diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md b/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md
index d91bbac6cf58..01c9f0df0f4d 100644
--- a/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md
+++ b/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md
@@ -1,5 +1,15 @@
# Release History
+## 2.0.0 (2025-02-27)
+### Breaking Changes
+
+- `ManagedServiceIdentityTypeSystemAndUserAssigned` from enum `ManagedServiceIdentityType` has been removed
+
+### Features Added
+
+- New value `ManagedServiceIdentityTypeSystemAssignedUserAssigned` added to enum type `ManagedServiceIdentityType`
+
+
## 1.0.0 (2024-10-22)
### Breaking Changes
diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/README.md b/sdk/resourcemanager/computefleet/armcomputefleet/README.md
index d92afe0f9bd2..4cc26831f84d 100644
--- a/sdk/resourcemanager/computefleet/armcomputefleet/README.md
+++ b/sdk/resourcemanager/computefleet/armcomputefleet/README.md
@@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve
Install the Azure Compute Fleet module:
```sh
-go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet
+go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/v2
```
## Authorization
diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/constants.go b/sdk/resourcemanager/computefleet/armcomputefleet/constants.go
index 9a5b1d23be3c..15db93573c51 100644
--- a/sdk/resourcemanager/computefleet/armcomputefleet/constants.go
+++ b/sdk/resourcemanager/computefleet/armcomputefleet/constants.go
@@ -6,7 +6,7 @@ package armcomputefleet
const (
moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet"
- moduleVersion = "v1.0.0"
+ moduleVersion = "v2.0.0"
)
// AcceleratorManufacturer - Accelerator manufacturers supported by Azure VMs.
@@ -188,9 +188,9 @@ func PossibleDiffDiskOptionsValues() []DiffDiskOptions {
// resource disk space for Ephemeral OS disk provisioning. For more information on
// Ephemeral OS disk size requirements, please refer Ephemeral OS disk size
// requirements for Windows VM at
-// https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements
+// https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements
// and Linux VM at
-// https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements
+// https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements
// Minimum api-version for NvmeDisk: 2024-03-01.
type DiffDiskPlacement string
@@ -215,10 +215,10 @@ func PossibleDiffDiskPlacementValues() []DiffDiskPlacement {
// DiskControllerTypes - Specifies the disk controller type configured for the VM and
// VirtualMachineScaleSet. This property is only supported for virtual machines
// whose operating system disk and VM sku supports Generation 2
-// (https://docs.microsoft.com/en-us/azure/virtual-machines/generation-2), please
+// (https://learn.microsoft.com/en-us/azure/virtual-machines/generation-2), please
// check the HyperVGenerations capability returned as part of VM sku capabilities
// in the response of Microsoft.Compute SKUs api for the region contains V2
-// (https://docs.microsoft.com/rest/api/compute/resourceskus/list). For more
+// (https://learn.microsoft.com/rest/api/compute/resourceskus/list). For more
// information about Disk Controller Types supported please refer to
// https://aka.ms/azure-diskcontrollertypes.
type DiskControllerTypes string
@@ -449,10 +449,10 @@ type ManagedServiceIdentityType string
const (
// ManagedServiceIdentityTypeNone - No managed identity.
ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None"
- // ManagedServiceIdentityTypeSystemAndUserAssigned - System and user assigned managed identity.
- ManagedServiceIdentityTypeSystemAndUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned"
// ManagedServiceIdentityTypeSystemAssigned - System assigned managed identity.
ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned"
+ // ManagedServiceIdentityTypeSystemAssignedUserAssigned - System and user assigned managed identity.
+ ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned"
// ManagedServiceIdentityTypeUserAssigned - User assigned managed identity.
ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned"
)
@@ -461,8 +461,8 @@ const (
func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType {
return []ManagedServiceIdentityType{
ManagedServiceIdentityTypeNone,
- ManagedServiceIdentityTypeSystemAndUserAssigned,
ManagedServiceIdentityTypeSystemAssigned,
+ ManagedServiceIdentityTypeSystemAssignedUserAssigned,
ManagedServiceIdentityTypeUserAssigned,
}
}
@@ -799,9 +799,9 @@ func PossibleSpotAllocationStrategyValues() []SpotAllocationStrategy {
// zone redundant storage. StandardSSD_ZRS uses Standard SSD zone redundant
// storage. For more information regarding disks supported for Windows Virtual
// Machines, refer to
-// https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for
+// https://learn.microsoft.com/azure/virtual-machines/windows/disks-types and, for
// Linux Virtual Machines, refer to
-// https://docs.microsoft.com/azure/virtual-machines/linux/disks-types
+// https://learn.microsoft.com/azure/virtual-machines/linux/disks-types
type StorageAccountTypes string
const (
diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/fake/fleets_server.go b/sdk/resourcemanager/computefleet/armcomputefleet/fake/fleets_server.go
index 50095603add1..efd507989a10 100644
--- a/sdk/resourcemanager/computefleet/armcomputefleet/fake/fleets_server.go
+++ b/sdk/resourcemanager/computefleet/armcomputefleet/fake/fleets_server.go
@@ -12,7 +12,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
- "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/v2"
"net/http"
"net/url"
"regexp"
@@ -25,7 +25,7 @@ type FleetsServer struct {
BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, fleetName string, resource armcomputefleet.Fleet, options *armcomputefleet.FleetsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armcomputefleet.FleetsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)
// BeginDelete is the fake for method FleetsClient.BeginDelete
- // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
BeginDelete func(ctx context.Context, resourceGroupName string, fleetName string, options *armcomputefleet.FleetsClientBeginDeleteOptions) (resp azfake.PollerResponder[armcomputefleet.FleetsClientDeleteResponse], errResp azfake.ErrorResponder)
// Get is the fake for method FleetsClient.Get
@@ -88,29 +88,48 @@ func (f *FleetsServerTransport) Do(req *http.Request) (*http.Response, error) {
}
func (f *FleetsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
- var resp *http.Response
- var err error
-
- switch method {
- case "FleetsClient.BeginCreateOrUpdate":
- resp, err = f.dispatchBeginCreateOrUpdate(req)
- case "FleetsClient.BeginDelete":
- resp, err = f.dispatchBeginDelete(req)
- case "FleetsClient.Get":
- resp, err = f.dispatchGet(req)
- case "FleetsClient.NewListByResourceGroupPager":
- resp, err = f.dispatchNewListByResourceGroupPager(req)
- case "FleetsClient.NewListBySubscriptionPager":
- resp, err = f.dispatchNewListBySubscriptionPager(req)
- case "FleetsClient.NewListVirtualMachineScaleSetsPager":
- resp, err = f.dispatchNewListVirtualMachineScaleSetsPager(req)
- case "FleetsClient.BeginUpdate":
- resp, err = f.dispatchBeginUpdate(req)
- default:
- err = fmt.Errorf("unhandled API %s", method)
- }
-
- return resp, err
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if fleetsServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = fleetsServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "FleetsClient.BeginCreateOrUpdate":
+ res.resp, res.err = f.dispatchBeginCreateOrUpdate(req)
+ case "FleetsClient.BeginDelete":
+ res.resp, res.err = f.dispatchBeginDelete(req)
+ case "FleetsClient.Get":
+ res.resp, res.err = f.dispatchGet(req)
+ case "FleetsClient.NewListByResourceGroupPager":
+ res.resp, res.err = f.dispatchNewListByResourceGroupPager(req)
+ case "FleetsClient.NewListBySubscriptionPager":
+ res.resp, res.err = f.dispatchNewListBySubscriptionPager(req)
+ case "FleetsClient.NewListVirtualMachineScaleSetsPager":
+ res.resp, res.err = f.dispatchNewListVirtualMachineScaleSetsPager(req)
+ case "FleetsClient.BeginUpdate":
+ res.resp, res.err = f.dispatchBeginUpdate(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
}
func (f *FleetsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) {
@@ -194,9 +213,9 @@ func (f *FleetsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Re
return nil, err
}
- if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
f.beginDelete.remove(req)
- return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
}
if !server.PollerResponderMore(beginDelete) {
f.beginDelete.remove(req)
@@ -396,3 +415,9 @@ func (f *FleetsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Re
return resp, nil
}
+
+// set this to conditionally intercept incoming requests to FleetsServerTransport
+var fleetsServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/fake/internal.go b/sdk/resourcemanager/computefleet/armcomputefleet/fake/internal.go
index 56a8f624f5f3..7425b6a669e2 100644
--- a/sdk/resourcemanager/computefleet/armcomputefleet/fake/internal.go
+++ b/sdk/resourcemanager/computefleet/armcomputefleet/fake/internal.go
@@ -10,6 +10,11 @@ import (
"sync"
)
+type result struct {
+ resp *http.Response
+ err error
+}
+
type nonRetriableError struct {
error
}
diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/fake/operations_server.go b/sdk/resourcemanager/computefleet/armcomputefleet/fake/operations_server.go
index a86d89fb4a63..1ca70f29e52a 100644
--- a/sdk/resourcemanager/computefleet/armcomputefleet/fake/operations_server.go
+++ b/sdk/resourcemanager/computefleet/armcomputefleet/fake/operations_server.go
@@ -11,7 +11,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
- "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/v2"
"net/http"
)
@@ -51,17 +51,36 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error
}
func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
- var resp *http.Response
- var err error
+ resultChan := make(chan result)
+ defer close(resultChan)
- switch method {
- case "OperationsClient.NewListPager":
- resp, err = o.dispatchNewListPager(req)
- default:
- err = fmt.Errorf("unhandled API %s", method)
- }
+ go func() {
+ var intercepted bool
+ var res result
+ if operationsServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "OperationsClient.NewListPager":
+ res.resp, res.err = o.dispatchNewListPager(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
- return resp, err
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
}
func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) {
@@ -90,3 +109,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht
}
return resp, nil
}
+
+// set this to conditionally intercept incoming requests to OperationsServerTransport
+var operationsServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client_example_test.go b/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client_example_test.go
index 1499fe058820..ed0a132c4065 100644
--- a/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client_example_test.go
+++ b/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client_example_test.go
@@ -8,7 +8,7 @@ import (
"context"
"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/computefleet/armcomputefleet"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/v2"
"log"
)
@@ -2313,7 +2313,6 @@ func ExampleFleetsClient_NewListVirtualMachineScaleSetsPager() {
// VirtualMachineScaleSetListResult: armcomputefleet.VirtualMachineScaleSetListResult{
// Value: []*armcomputefleet.VirtualMachineScaleSet{
// {
- // Name: to.Ptr("myVmss"),
// ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/myFleet/virtualMachineScaleSets/myVmss"),
// Type: to.Ptr("Microsoft.AzureFleet/fleets/virtualMachineScaleSets"),
// OperationStatus: to.Ptr(armcomputefleet.ProvisioningStateCreating),
diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/go.mod b/sdk/resourcemanager/computefleet/armcomputefleet/go.mod
index d9e01a0863d1..02d187579f37 100644
--- a/sdk/resourcemanager/computefleet/armcomputefleet/go.mod
+++ b/sdk/resourcemanager/computefleet/armcomputefleet/go.mod
@@ -1,4 +1,4 @@
-module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet
+module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/v2
go 1.18
diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/models.go b/sdk/resourcemanager/computefleet/armcomputefleet/models.go
index caf2d6bf4392..4b7af780c514 100644
--- a/sdk/resourcemanager/computefleet/armcomputefleet/models.go
+++ b/sdk/resourcemanager/computefleet/armcomputefleet/models.go
@@ -117,9 +117,9 @@ type BaseVirtualMachineProfile struct {
// Server operating system are:
RHEL_BYOS (for RHEL)
SLES_BYOS
// (for SUSE)
For more information, see [Azure Hybrid Use Benefit for
// Windows
- // Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)
+ // Server](https://learn.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)
//
[Azure Hybrid Use Benefit for Linux
- // Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)
+ // Server](https://learn.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)
//
Minimum api-version: 2015-06-15
LicenseType *string
@@ -229,8 +229,8 @@ type DiffDiskSettings struct {
// values are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is:
// **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk**
// is used. Refer to the VM size documentation for Windows VM at
- // https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at
- // https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM
+ // https://learn.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at
+ // https://learn.microsoft.com/azure/virtual-machines/linux/sizes to check which VM
// sizes exposes a cache disk.
Placement *DiffDiskPlacement
}
@@ -403,7 +403,7 @@ type KeyVaultSecretReference struct {
// LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine. For a
// list of supported Linux distributions, see [Linux on Azure-Endorsed
-// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros).
+// Distributions](https://learn.microsoft.com/azure/virtual-machines/linux/endorsed-distros).
type LinuxConfiguration struct {
// Specifies whether password authentication should be disabled.
DisablePasswordAuthentication *bool
@@ -509,12 +509,12 @@ type OSImageNotificationProfile struct {
// Operation - Details of a REST API operation, returned from the Resource Provider Operations API
type Operation struct {
- // Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
- ActionType *ActionType
-
- // READ-ONLY; Localized display information for this particular operation.
+ // Localized display information for this particular operation.
Display *OperationDisplay
+ // READ-ONLY; Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ ActionType *ActionType
+
// READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure
// Resource Manager/control-plane operations.
IsDataAction *bool
@@ -679,7 +679,7 @@ type SSHPublicKey struct {
// SSH public key certificate used to authenticate with the VM through ssh. The
// key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys,
// see [Create SSH keys on Linux and Mac for Linux VMs in
- // Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed).
+ // Azure]https://learn.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed).
KeyData *string
// Specifies the full path on the created VM where ssh public key is stored. If
@@ -908,6 +908,7 @@ type VMAttributes struct {
LocalStorageInGiB *VMAttributeMinMaxDouble
// Specifies whether the VMSize supporting local storage should be used to build Fleet or not.
+ // Included - Default if not specified as most Azure VMs support local storage.
LocalStorageSupport *VMAttributeSupport
// The range of memory in GiB per vCPU specified from min to max. Optional parameter. Either Min or Max is required if specified.
@@ -991,14 +992,14 @@ type VMSizeProperties struct {
// specified in the request body the default behavior is to set it to the value of
// vCPUs available for that VM size exposed in api response of [List all available
// virtual machine sizes in a
- // region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list).
+ // region](https://learn.microsoft.com/en-us/rest/api/compute/resource-skus/list).
VCPUsAvailable *int32
// Specifies the vCPU to physical core ratio. When this property is not specified
// in the request body the default behavior is set to the value of vCPUsPerCore
// for the VM Size exposed in api response of [List all available virtual machine
// sizes in a
- // region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list).
+ // region](https://learn.microsoft.com/en-us/rest/api/compute/resource-skus/list).
// **Setting this property to 1 also means that hyper-threading is disabled.**
VCPUsPerCore *int32
}
@@ -1018,16 +1019,16 @@ type VaultCertificate struct {
// This is the URL of a certificate that has been uploaded to Key Vault as a
// secret. For adding a secret to the Key Vault, see [Add a key or secret to the
// key
- // vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add).
+ // vault](https://learn.microsoft.com/azure/key-vault/key-vault-get-started/#add).
// In this case, your certificate needs to be It is the Base64 encoding of the
// following JSON Object which is encoded in UTF-8:
{
// "data":"",
"dataType":"pfx",
// "password":""
}
To install certificates on a virtual
// machine it is recommended to use the [Azure Key Vault virtual machine extension
// for
- // Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux)
+ // Linux](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-linux)
// or the [Azure Key Vault virtual machine extension for
- // Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows).
+ // Windows](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-windows).
CertificateURL *string
}
@@ -1419,10 +1420,10 @@ type VirtualMachineScaleSetOSProfile struct {
// "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1",
// "Password22", "iloveyou!"
For resetting the password, see [How to
// reset the Remote Desktop service or its login password in a Windows
- // VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp)
+ // VM](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp)
//
For resetting root password, see [Manage users, SSH, and check or
// repair disks on Azure Linux VMs using the VMAccess
- // Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection)
+ // Extension](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection)
AdminPassword *string
// Specifies the name of the administrator account.
**Windows-only
@@ -1448,12 +1449,12 @@ type VirtualMachineScaleSetOSProfile struct {
// is decoded to a binary array that is saved as a file on the Virtual Machine.
// The maximum length of the binary array is 65535 bytes. For using cloud-init for
// your VM, see [Using cloud-init to customize a Linux VM during
- // creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init)
+ // creation](https://learn.microsoft.com/azure/virtual-machines/linux/using-cloud-init)
CustomData *string
// Specifies the Linux operating system settings on the virtual machine. For a
// list of supported Linux distributions, see [Linux on Azure-Endorsed
- // Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros).
+ // Distributions](https://learn.microsoft.com/azure/virtual-machines/linux/endorsed-distros).
LinuxConfiguration *LinuxConfiguration
// Optional property which must either be set to True or omitted.
@@ -1462,9 +1463,9 @@ type VirtualMachineScaleSetOSProfile struct {
// Specifies set of certificates that should be installed onto the virtual
// machines in the scale set. To install certificates on a virtual machine it is
// recommended to use the [Azure Key Vault virtual machine extension for
- // Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux)
+ // Linux](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-linux)
// or the [Azure Key Vault virtual machine extension for
- // Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows).
+ // Windows](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-windows).
Secrets []*VaultSecretGroup
// Specifies Windows operating system settings on the virtual machine.
@@ -1531,7 +1532,7 @@ type VirtualMachineScaleSetStorageProfile struct {
// Specifies the parameters that are used to add data disks to the virtual
// machines in the scale set. For more information about disks, see [About disks
// and VHDs for Azure virtual
- // machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview).
+ // machines](https://learn.microsoft.com/azure/virtual-machines/managed-disks-overview).
DataDisks []*VirtualMachineScaleSetDataDisk
// Specifies the disk controller type configured for the virtual machines in the scale set. Minimum api-version: 2022-08-01
@@ -1546,7 +1547,7 @@ type VirtualMachineScaleSetStorageProfile struct {
// Specifies information about the operating system disk used by the virtual
// machines in the scale set. For more information about disks, see [About disks
// and VHDs for Azure virtual
- // machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview).
+ // machines](https://learn.microsoft.com/azure/virtual-machines/managed-disks-overview).
OSDisk *VirtualMachineScaleSetOSDisk
}
@@ -1561,16 +1562,16 @@ type WinRMListener struct {
// This is the URL of a certificate that has been uploaded to Key Vault as a
// secret. For adding a secret to the Key Vault, see [Add a key or secret to the
// key
- // vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add).
+ // vault](https://learn.microsoft.com/azure/key-vault/key-vault-get-started/#add).
// In this case, your certificate needs to be the Base64 encoding of the following
// JSON Object which is encoded in UTF-8:
{
// "data":"",
"dataType":"pfx",
// "password":""
}
To install certificates on a virtual
// machine it is recommended to use the [Azure Key Vault virtual machine extension
// for
- // Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux)
+ // Linux](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-linux)
// or the [Azure Key Vault virtual machine extension for
- // Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows).
+ // Windows](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-windows).
CertificateURL *string
// Specifies the protocol of WinRM listener. Possible values are: **http,**
@@ -1604,9 +1605,9 @@ type WindowsConfiguration struct {
// Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time".
// Possible values can be
- // [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id)
+ // [TimeZoneInfo.Id](https://learn.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id)
// value from time zones returned by
- // [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones).
+ // [TimeZoneInfo.GetSystemTimeZones](https://learn.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones).
TimeZone *string
// Specifies the Windows Remote Management listeners. This enables remote Windows
diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/operations_client_example_test.go b/sdk/resourcemanager/computefleet/armcomputefleet/operations_client_example_test.go
index 9ba1df570e27..306f65f68a20 100644
--- a/sdk/resourcemanager/computefleet/armcomputefleet/operations_client_example_test.go
+++ b/sdk/resourcemanager/computefleet/armcomputefleet/operations_client_example_test.go
@@ -7,7 +7,7 @@ package armcomputefleet_test
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
- "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/v2"
"log"
)
diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml b/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml
index c8d950e137b2..f2943d446861 100644
--- a/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml
+++ b/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml
@@ -1,4 +1,4 @@
directory: specification/azurefleet/AzureFleet.Management
-commit: c120171b3684d88562fa26ae7db5d22b7bfa95d8
+commit: 676334a284e5136f0a0721d6ae844bb04332f579
repo: Azure/azure-rest-api-specs
-additionalDirectories:
+additionalDirectories:
\ No newline at end of file
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/CHANGELOG.md b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/CHANGELOG.md
new file mode 100644
index 000000000000..7f4919082336
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/CHANGELOG.md
@@ -0,0 +1,8 @@
+# Release History
+
+## 0.1.0 (2025-02-27)
+### Other Changes
+
+The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html).
+
+To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt).
\ No newline at end of file
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/LICENSE.txt b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/LICENSE.txt
new file mode 100644
index 000000000000..dc0c2ffb3dc1
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/README.md b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/README.md
new file mode 100644
index 000000000000..5284a75848db
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/README.md
@@ -0,0 +1,90 @@
+# Azure Databasefleetmanager Module for Go
+
+The `armdatabasefleetmanager` module provides operations for working with Azure Databasefleetmanager.
+
+[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager)
+
+# Getting started
+
+## Prerequisites
+
+- an [Azure subscription](https://azure.microsoft.com/free/)
+- Go 1.18 or above (You could download and install the latest version of Go from [here](https://go.dev/doc/install). 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](https://go.dev/doc/manage-install).)
+
+## Install the package
+
+This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management.
+
+Install the Azure Databasefleetmanager module:
+
+```sh
+go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager
+```
+
+## Authorization
+
+When creating a client, you will need to provide a credential for authenticating with Azure Databasefleetmanager. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.
+
+```go
+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](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity).
+
+## Client Factory
+
+Azure Databasefleetmanager module consists of one or more clients. We provide a client factory which could be used to create any client in this module.
+
+```go
+clientFactory, err := armdatabasefleetmanager.NewClientFactory(, 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](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore).
+
+```go
+options := arm.ClientOptions {
+ ClientOptions: azcore.ClientOptions {
+ Cloud: cloud.AzureChina,
+ },
+}
+clientFactory, err := armdatabasefleetmanager.NewClientFactory(, 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.
+
+```go
+client := clientFactory.NewFirewallRulesClient()
+```
+
+## 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](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Databasefleetmanager` 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](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](https://opensource.microsoft.com/codeofconduct/).
+For more information, see the
+[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
+or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
+additional questions or comments.
\ No newline at end of file
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/ci.yml b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/ci.yml
new file mode 100644
index 000000000000..956c4cf594c7
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/ci.yml
@@ -0,0 +1,28 @@
+# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
+trigger:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/
+
+pr:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/
+
+extends:
+ template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
+ parameters:
+ IncludeRelease: true
+ ServiceDirectory: 'resourcemanager/databasefleetmanager/armdatabasefleetmanager'
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/client_factory.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/client_factory.go
new file mode 100644
index 000000000000..2afecb91e05c
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/client_factory.go
@@ -0,0 +1,80 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager
+
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+)
+
+// ClientFactory is a client factory used to create any client in this module.
+// Don't use this type directly, use NewClientFactory instead.
+type ClientFactory struct {
+ subscriptionID string
+ internal *arm.Client
+}
+
+// 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 ID of the target subscription. The value must be an UUID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) {
+ internal, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ return &ClientFactory{
+ subscriptionID: subscriptionID,
+ internal: internal,
+ }, nil
+}
+
+// NewFirewallRulesClient creates a new instance of FirewallRulesClient.
+func (c *ClientFactory) NewFirewallRulesClient() *FirewallRulesClient {
+ return &FirewallRulesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewFleetDatabasesClient creates a new instance of FleetDatabasesClient.
+func (c *ClientFactory) NewFleetDatabasesClient() *FleetDatabasesClient {
+ return &FleetDatabasesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewFleetTiersClient creates a new instance of FleetTiersClient.
+func (c *ClientFactory) NewFleetTiersClient() *FleetTiersClient {
+ return &FleetTiersClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewFleetsClient creates a new instance of FleetsClient.
+func (c *ClientFactory) NewFleetsClient() *FleetsClient {
+ return &FleetsClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewFleetspacesClient creates a new instance of FleetspacesClient.
+func (c *ClientFactory) NewFleetspacesClient() *FleetspacesClient {
+ return &FleetspacesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewOperationsClient creates a new instance of OperationsClient.
+func (c *ClientFactory) NewOperationsClient() *OperationsClient {
+ return &OperationsClient{
+ internal: c.internal,
+ }
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/constants.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/constants.go
new file mode 100644
index 000000000000..6447efae7876
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/constants.go
@@ -0,0 +1,194 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager
+
+const (
+ moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager"
+ moduleVersion = "v0.1.0"
+)
+
+// ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+type ActionType string
+
+const (
+ // ActionTypeInternal - Actions are for internal-only APIs.
+ ActionTypeInternal ActionType = "Internal"
+)
+
+// PossibleActionTypeValues returns the possible values for the ActionType const type.
+func PossibleActionTypeValues() []ActionType {
+ return []ActionType{
+ ActionTypeInternal,
+ }
+}
+
+// AzureProvisioningState - The provisioning state of the resource.
+type AzureProvisioningState string
+
+const (
+ // AzureProvisioningStateAccepted - Request on the resource has been accepted.
+ AzureProvisioningStateAccepted AzureProvisioningState = "Accepted"
+ // AzureProvisioningStateCanceled - Resource creation was canceled.
+ AzureProvisioningStateCanceled AzureProvisioningState = "Canceled"
+ // AzureProvisioningStateFailed - Resource creation failed.
+ AzureProvisioningStateFailed AzureProvisioningState = "Failed"
+ // AzureProvisioningStateProvisioning - Resource is provisioning.
+ AzureProvisioningStateProvisioning AzureProvisioningState = "Provisioning"
+ // AzureProvisioningStateSucceeded - Resource has been created.
+ AzureProvisioningStateSucceeded AzureProvisioningState = "Succeeded"
+)
+
+// PossibleAzureProvisioningStateValues returns the possible values for the AzureProvisioningState const type.
+func PossibleAzureProvisioningStateValues() []AzureProvisioningState {
+ return []AzureProvisioningState{
+ AzureProvisioningStateAccepted,
+ AzureProvisioningStateCanceled,
+ AzureProvisioningStateFailed,
+ AzureProvisioningStateProvisioning,
+ AzureProvisioningStateSucceeded,
+ }
+}
+
+// CreatedByType - The kind of entity that created the resource.
+type CreatedByType string
+
+const (
+ // CreatedByTypeApplication - The entity was created by an application.
+ CreatedByTypeApplication CreatedByType = "Application"
+ // CreatedByTypeKey - The entity was created by a key.
+ CreatedByTypeKey CreatedByType = "Key"
+ // CreatedByTypeManagedIdentity - The entity was created by a managed identity.
+ CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
+ // CreatedByTypeUser - The entity was created by a user.
+ CreatedByTypeUser CreatedByType = "User"
+)
+
+// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.
+func PossibleCreatedByTypeValues() []CreatedByType {
+ return []CreatedByType{
+ CreatedByTypeApplication,
+ CreatedByTypeKey,
+ CreatedByTypeManagedIdentity,
+ CreatedByTypeUser,
+ }
+}
+
+// DatabaseCreateMode - Create mode. Available options: Default - Create a database. Copy - Copy the source database (source
+// database name must be specified) PointInTimeRestore - Create a database by restoring source database from a point in time
+// (source database name and restore from time must be specified)
+type DatabaseCreateMode string
+
+const (
+ // DatabaseCreateModeCopy - Copy the source database (source database name must be specified).
+ DatabaseCreateModeCopy DatabaseCreateMode = "Copy"
+ // DatabaseCreateModeDefault - Create a database.
+ DatabaseCreateModeDefault DatabaseCreateMode = "Default"
+ // DatabaseCreateModePointInTimeRestore - Create a database by restoring source database from a point in time (source database
+ // name and restore from time must be specified).
+ DatabaseCreateModePointInTimeRestore DatabaseCreateMode = "PointInTimeRestore"
+)
+
+// PossibleDatabaseCreateModeValues returns the possible values for the DatabaseCreateMode const type.
+func PossibleDatabaseCreateModeValues() []DatabaseCreateMode {
+ return []DatabaseCreateMode{
+ DatabaseCreateModeCopy,
+ DatabaseCreateModeDefault,
+ DatabaseCreateModePointInTimeRestore,
+ }
+}
+
+// IdentityType - Identity type of the main principal.
+type IdentityType string
+
+const (
+ // IdentityTypeNone - No identity.
+ IdentityTypeNone IdentityType = "None"
+ // IdentityTypeUserAssigned - User assigned identity.
+ IdentityTypeUserAssigned IdentityType = "UserAssigned"
+)
+
+// PossibleIdentityTypeValues returns the possible values for the IdentityType const type.
+func PossibleIdentityTypeValues() []IdentityType {
+ return []IdentityType{
+ IdentityTypeNone,
+ IdentityTypeUserAssigned,
+ }
+}
+
+// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
+// value is "user,system"
+type Origin string
+
+const (
+ // OriginSystem - Indicates the operation is initiated by a system.
+ OriginSystem Origin = "system"
+ // OriginUser - Indicates the operation is initiated by a user.
+ OriginUser Origin = "user"
+ // OriginUserSystem - Indicates the operation is initiated by a user or system.
+ OriginUserSystem Origin = "user,system"
+)
+
+// PossibleOriginValues returns the possible values for the Origin const type.
+func PossibleOriginValues() []Origin {
+ return []Origin{
+ OriginSystem,
+ OriginUser,
+ OriginUserSystem,
+ }
+}
+
+// PrincipalType - Principal type of the authorized principal.
+type PrincipalType string
+
+const (
+ // PrincipalTypeApplication - Application principal type.
+ PrincipalTypeApplication PrincipalType = "Application"
+ // PrincipalTypeUser - User principal type.
+ PrincipalTypeUser PrincipalType = "User"
+)
+
+// PossiblePrincipalTypeValues returns the possible values for the PrincipalType const type.
+func PossiblePrincipalTypeValues() []PrincipalType {
+ return []PrincipalType{
+ PrincipalTypeApplication,
+ PrincipalTypeUser,
+ }
+}
+
+// ResourceType - Resource type of the destination tier override.
+type ResourceType string
+
+const (
+ // ResourceTypeDatabase - Database resource type.
+ ResourceTypeDatabase ResourceType = "Database"
+ // ResourceTypePool - Elastic pool resource type.
+ ResourceTypePool ResourceType = "Pool"
+)
+
+// PossibleResourceTypeValues returns the possible values for the ResourceType const type.
+func PossibleResourceTypeValues() []ResourceType {
+ return []ResourceType{
+ ResourceTypeDatabase,
+ ResourceTypePool,
+ }
+}
+
+// ZoneRedundancy - Status of zone redundancy in a tier.
+type ZoneRedundancy string
+
+const (
+ // ZoneRedundancyDisabled - Zone redundancy disabled.
+ ZoneRedundancyDisabled ZoneRedundancy = "Disabled"
+ // ZoneRedundancyEnabled - Zone redundancy enabled.
+ ZoneRedundancyEnabled ZoneRedundancy = "Enabled"
+)
+
+// PossibleZoneRedundancyValues returns the possible values for the ZoneRedundancy const type.
+func PossibleZoneRedundancyValues() []ZoneRedundancy {
+ return []ZoneRedundancy{
+ ZoneRedundancyDisabled,
+ ZoneRedundancyEnabled,
+ }
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/firewallrules_server.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/firewallrules_server.go
new file mode 100644
index 000000000000..8647c11c820a
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/firewallrules_server.go
@@ -0,0 +1,352 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager"
+ "net/http"
+ "net/url"
+ "regexp"
+ "strconv"
+)
+
+// FirewallRulesServer is a fake server for instances of the armdatabasefleetmanager.FirewallRulesClient type.
+type FirewallRulesServer struct {
+ // BeginCreateOrUpdate is the fake for method FirewallRulesClient.BeginCreateOrUpdate
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
+ BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, firewallRuleName string, resource armdatabasefleetmanager.FirewallRule, options *armdatabasefleetmanager.FirewallRulesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FirewallRulesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)
+
+ // BeginDelete is the fake for method FirewallRulesClient.BeginDelete
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
+ BeginDelete func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, firewallRuleName string, options *armdatabasefleetmanager.FirewallRulesClientBeginDeleteOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FirewallRulesClientDeleteResponse], errResp azfake.ErrorResponder)
+
+ // Get is the fake for method FirewallRulesClient.Get
+ // HTTP status codes to indicate success: http.StatusOK
+ Get func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, firewallRuleName string, options *armdatabasefleetmanager.FirewallRulesClientGetOptions) (resp azfake.Responder[armdatabasefleetmanager.FirewallRulesClientGetResponse], errResp azfake.ErrorResponder)
+
+ // NewListByFleetspacePager is the fake for method FirewallRulesClient.NewListByFleetspacePager
+ // HTTP status codes to indicate success: http.StatusOK
+ NewListByFleetspacePager func(resourceGroupName string, fleetName string, fleetspaceName string, options *armdatabasefleetmanager.FirewallRulesClientListByFleetspaceOptions) (resp azfake.PagerResponder[armdatabasefleetmanager.FirewallRulesClientListByFleetspaceResponse])
+}
+
+// NewFirewallRulesServerTransport creates a new instance of FirewallRulesServerTransport with the provided implementation.
+// The returned FirewallRulesServerTransport instance is connected to an instance of armdatabasefleetmanager.FirewallRulesClient via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewFirewallRulesServerTransport(srv *FirewallRulesServer) *FirewallRulesServerTransport {
+ return &FirewallRulesServerTransport{
+ srv: srv,
+ beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FirewallRulesClientCreateOrUpdateResponse]](),
+ beginDelete: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FirewallRulesClientDeleteResponse]](),
+ newListByFleetspacePager: newTracker[azfake.PagerResponder[armdatabasefleetmanager.FirewallRulesClientListByFleetspaceResponse]](),
+ }
+}
+
+// FirewallRulesServerTransport connects instances of armdatabasefleetmanager.FirewallRulesClient to instances of FirewallRulesServer.
+// Don't use this type directly, use NewFirewallRulesServerTransport instead.
+type FirewallRulesServerTransport struct {
+ srv *FirewallRulesServer
+ beginCreateOrUpdate *tracker[azfake.PollerResponder[armdatabasefleetmanager.FirewallRulesClientCreateOrUpdateResponse]]
+ beginDelete *tracker[azfake.PollerResponder[armdatabasefleetmanager.FirewallRulesClientDeleteResponse]]
+ newListByFleetspacePager *tracker[azfake.PagerResponder[armdatabasefleetmanager.FirewallRulesClientListByFleetspaceResponse]]
+}
+
+// Do implements the policy.Transporter interface for FirewallRulesServerTransport.
+func (f *FirewallRulesServerTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ return f.dispatchToMethodFake(req, method)
+}
+
+func (f *FirewallRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if firewallRulesServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = firewallRulesServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "FirewallRulesClient.BeginCreateOrUpdate":
+ res.resp, res.err = f.dispatchBeginCreateOrUpdate(req)
+ case "FirewallRulesClient.BeginDelete":
+ res.resp, res.err = f.dispatchBeginDelete(req)
+ case "FirewallRulesClient.Get":
+ res.resp, res.err = f.dispatchGet(req)
+ case "FirewallRulesClient.NewListByFleetspacePager":
+ res.resp, res.err = f.dispatchNewListByFleetspacePager(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
+}
+
+func (f *FirewallRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginCreateOrUpdate == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")}
+ }
+ beginCreateOrUpdate := f.beginCreateOrUpdate.get(req)
+ if beginCreateOrUpdate == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 5 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasefleetmanager.FirewallRule](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ firewallRuleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("firewallRuleName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, firewallRuleNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginCreateOrUpdate = &respr
+ f.beginCreateOrUpdate.add(req, beginCreateOrUpdate)
+ }
+
+ resp, err := server.PollerResponderNext(beginCreateOrUpdate, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) {
+ f.beginCreateOrUpdate.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginCreateOrUpdate) {
+ f.beginCreateOrUpdate.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (f *FirewallRulesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginDelete == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")}
+ }
+ beginDelete := f.beginDelete.get(req)
+ if beginDelete == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 5 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ firewallRuleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("firewallRuleName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginDelete(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, firewallRuleNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginDelete = &respr
+ f.beginDelete.add(req, beginDelete)
+ }
+
+ resp, err := server.PollerResponderNext(beginDelete, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ f.beginDelete.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginDelete) {
+ f.beginDelete.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (f *FirewallRulesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
+ if f.srv.Get == nil {
+ return nil, &nonRetriableError{errors.New("fake for method Get not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 5 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ firewallRuleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("firewallRuleName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.Get(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, firewallRuleNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FirewallRule, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (f *FirewallRulesServerTransport) dispatchNewListByFleetspacePager(req *http.Request) (*http.Response, error) {
+ if f.srv.NewListByFleetspacePager == nil {
+ return nil, &nonRetriableError{errors.New("fake for method NewListByFleetspacePager not implemented")}
+ }
+ newListByFleetspacePager := f.newListByFleetspacePager.get(req)
+ if newListByFleetspacePager == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ qp := req.URL.Query()
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ skipUnescaped, err := url.QueryUnescape(qp.Get("$skip"))
+ if err != nil {
+ return nil, err
+ }
+ skipParam, err := parseOptional(skipUnescaped, func(v string) (int64, error) {
+ p, parseErr := strconv.ParseInt(v, 10, 64)
+ if parseErr != nil {
+ return 0, parseErr
+ }
+ return p, nil
+ })
+ if err != nil {
+ return nil, err
+ }
+ topUnescaped, err := url.QueryUnescape(qp.Get("$top"))
+ if err != nil {
+ return nil, err
+ }
+ topParam, err := parseOptional(topUnescaped, func(v string) (int64, error) {
+ p, parseErr := strconv.ParseInt(v, 10, 64)
+ if parseErr != nil {
+ return 0, parseErr
+ }
+ return p, nil
+ })
+ if err != nil {
+ return nil, err
+ }
+ skiptokenUnescaped, err := url.QueryUnescape(qp.Get("$skiptoken"))
+ if err != nil {
+ return nil, err
+ }
+ skiptokenParam := getOptional(skiptokenUnescaped)
+ var options *armdatabasefleetmanager.FirewallRulesClientListByFleetspaceOptions
+ if skipParam != nil || topParam != nil || skiptokenParam != nil {
+ options = &armdatabasefleetmanager.FirewallRulesClientListByFleetspaceOptions{
+ Skip: skipParam,
+ Top: topParam,
+ Skiptoken: skiptokenParam,
+ }
+ }
+ resp := f.srv.NewListByFleetspacePager(resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, options)
+ newListByFleetspacePager = &resp
+ f.newListByFleetspacePager.add(req, newListByFleetspacePager)
+ server.PagerResponderInjectNextLinks(newListByFleetspacePager, req, func(page *armdatabasefleetmanager.FirewallRulesClientListByFleetspaceResponse, createLink func() string) {
+ page.NextLink = to.Ptr(createLink())
+ })
+ }
+ resp, err := server.PagerResponderNext(newListByFleetspacePager, req)
+ if err != nil {
+ return nil, err
+ }
+ if !contains([]int{http.StatusOK}, resp.StatusCode) {
+ f.newListByFleetspacePager.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
+ }
+ if !server.PagerResponderMore(newListByFleetspacePager) {
+ f.newListByFleetspacePager.remove(req)
+ }
+ return resp, nil
+}
+
+// set this to conditionally intercept incoming requests to FirewallRulesServerTransport
+var firewallRulesServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/fleetdatabases_server.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/fleetdatabases_server.go
new file mode 100644
index 000000000000..4685274ef9ce
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/fleetdatabases_server.go
@@ -0,0 +1,610 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager"
+ "net/http"
+ "net/url"
+ "regexp"
+ "strconv"
+)
+
+// FleetDatabasesServer is a fake server for instances of the armdatabasefleetmanager.FleetDatabasesClient type.
+type FleetDatabasesServer struct {
+ // BeginChangeTier is the fake for method FleetDatabasesClient.BeginChangeTier
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
+ BeginChangeTier func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, body armdatabasefleetmanager.DatabaseChangeTierProperties, options *armdatabasefleetmanager.FleetDatabasesClientBeginChangeTierOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientChangeTierResponse], errResp azfake.ErrorResponder)
+
+ // BeginCreateOrUpdate is the fake for method FleetDatabasesClient.BeginCreateOrUpdate
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
+ BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, resource armdatabasefleetmanager.FleetDatabase, options *armdatabasefleetmanager.FleetDatabasesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)
+
+ // BeginDelete is the fake for method FleetDatabasesClient.BeginDelete
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
+ BeginDelete func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, options *armdatabasefleetmanager.FleetDatabasesClientBeginDeleteOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientDeleteResponse], errResp azfake.ErrorResponder)
+
+ // Get is the fake for method FleetDatabasesClient.Get
+ // HTTP status codes to indicate success: http.StatusOK
+ Get func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, options *armdatabasefleetmanager.FleetDatabasesClientGetOptions) (resp azfake.Responder[armdatabasefleetmanager.FleetDatabasesClientGetResponse], errResp azfake.ErrorResponder)
+
+ // NewListByFleetspacePager is the fake for method FleetDatabasesClient.NewListByFleetspacePager
+ // HTTP status codes to indicate success: http.StatusOK
+ NewListByFleetspacePager func(resourceGroupName string, fleetName string, fleetspaceName string, options *armdatabasefleetmanager.FleetDatabasesClientListByFleetspaceOptions) (resp azfake.PagerResponder[armdatabasefleetmanager.FleetDatabasesClientListByFleetspaceResponse])
+
+ // BeginRename is the fake for method FleetDatabasesClient.BeginRename
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
+ BeginRename func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, body armdatabasefleetmanager.DatabaseRenameProperties, options *armdatabasefleetmanager.FleetDatabasesClientBeginRenameOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientRenameResponse], errResp azfake.ErrorResponder)
+
+ // BeginRevert is the fake for method FleetDatabasesClient.BeginRevert
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
+ BeginRevert func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, options *armdatabasefleetmanager.FleetDatabasesClientBeginRevertOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientRevertResponse], errResp azfake.ErrorResponder)
+
+ // BeginUpdate is the fake for method FleetDatabasesClient.BeginUpdate
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
+ BeginUpdate func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, properties armdatabasefleetmanager.FleetDatabase, options *armdatabasefleetmanager.FleetDatabasesClientBeginUpdateOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientUpdateResponse], errResp azfake.ErrorResponder)
+}
+
+// NewFleetDatabasesServerTransport creates a new instance of FleetDatabasesServerTransport with the provided implementation.
+// The returned FleetDatabasesServerTransport instance is connected to an instance of armdatabasefleetmanager.FleetDatabasesClient via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewFleetDatabasesServerTransport(srv *FleetDatabasesServer) *FleetDatabasesServerTransport {
+ return &FleetDatabasesServerTransport{
+ srv: srv,
+ beginChangeTier: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientChangeTierResponse]](),
+ beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientCreateOrUpdateResponse]](),
+ beginDelete: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientDeleteResponse]](),
+ newListByFleetspacePager: newTracker[azfake.PagerResponder[armdatabasefleetmanager.FleetDatabasesClientListByFleetspaceResponse]](),
+ beginRename: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientRenameResponse]](),
+ beginRevert: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientRevertResponse]](),
+ beginUpdate: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientUpdateResponse]](),
+ }
+}
+
+// FleetDatabasesServerTransport connects instances of armdatabasefleetmanager.FleetDatabasesClient to instances of FleetDatabasesServer.
+// Don't use this type directly, use NewFleetDatabasesServerTransport instead.
+type FleetDatabasesServerTransport struct {
+ srv *FleetDatabasesServer
+ beginChangeTier *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientChangeTierResponse]]
+ beginCreateOrUpdate *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientCreateOrUpdateResponse]]
+ beginDelete *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientDeleteResponse]]
+ newListByFleetspacePager *tracker[azfake.PagerResponder[armdatabasefleetmanager.FleetDatabasesClientListByFleetspaceResponse]]
+ beginRename *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientRenameResponse]]
+ beginRevert *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientRevertResponse]]
+ beginUpdate *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetDatabasesClientUpdateResponse]]
+}
+
+// Do implements the policy.Transporter interface for FleetDatabasesServerTransport.
+func (f *FleetDatabasesServerTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ return f.dispatchToMethodFake(req, method)
+}
+
+func (f *FleetDatabasesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if fleetDatabasesServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = fleetDatabasesServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "FleetDatabasesClient.BeginChangeTier":
+ res.resp, res.err = f.dispatchBeginChangeTier(req)
+ case "FleetDatabasesClient.BeginCreateOrUpdate":
+ res.resp, res.err = f.dispatchBeginCreateOrUpdate(req)
+ case "FleetDatabasesClient.BeginDelete":
+ res.resp, res.err = f.dispatchBeginDelete(req)
+ case "FleetDatabasesClient.Get":
+ res.resp, res.err = f.dispatchGet(req)
+ case "FleetDatabasesClient.NewListByFleetspacePager":
+ res.resp, res.err = f.dispatchNewListByFleetspacePager(req)
+ case "FleetDatabasesClient.BeginRename":
+ res.resp, res.err = f.dispatchBeginRename(req)
+ case "FleetDatabasesClient.BeginRevert":
+ res.resp, res.err = f.dispatchBeginRevert(req)
+ case "FleetDatabasesClient.BeginUpdate":
+ res.resp, res.err = f.dispatchBeginUpdate(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
+}
+
+func (f *FleetDatabasesServerTransport) dispatchBeginChangeTier(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginChangeTier == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginChangeTier not implemented")}
+ }
+ beginChangeTier := f.beginChangeTier.get(req)
+ if beginChangeTier == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/changeTier`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 5 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasefleetmanager.DatabaseChangeTierProperties](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginChangeTier(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, databaseNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginChangeTier = &respr
+ f.beginChangeTier.add(req, beginChangeTier)
+ }
+
+ resp, err := server.PollerResponderNext(beginChangeTier, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ f.beginChangeTier.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginChangeTier) {
+ f.beginChangeTier.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (f *FleetDatabasesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginCreateOrUpdate == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")}
+ }
+ beginCreateOrUpdate := f.beginCreateOrUpdate.get(req)
+ if beginCreateOrUpdate == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 5 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasefleetmanager.FleetDatabase](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, databaseNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginCreateOrUpdate = &respr
+ f.beginCreateOrUpdate.add(req, beginCreateOrUpdate)
+ }
+
+ resp, err := server.PollerResponderNext(beginCreateOrUpdate, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) {
+ f.beginCreateOrUpdate.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginCreateOrUpdate) {
+ f.beginCreateOrUpdate.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (f *FleetDatabasesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginDelete == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")}
+ }
+ beginDelete := f.beginDelete.get(req)
+ if beginDelete == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 5 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginDelete(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, databaseNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginDelete = &respr
+ f.beginDelete.add(req, beginDelete)
+ }
+
+ resp, err := server.PollerResponderNext(beginDelete, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ f.beginDelete.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginDelete) {
+ f.beginDelete.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (f *FleetDatabasesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
+ if f.srv.Get == nil {
+ return nil, &nonRetriableError{errors.New("fake for method Get not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 5 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.Get(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, databaseNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FleetDatabase, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (f *FleetDatabasesServerTransport) dispatchNewListByFleetspacePager(req *http.Request) (*http.Response, error) {
+ if f.srv.NewListByFleetspacePager == nil {
+ return nil, &nonRetriableError{errors.New("fake for method NewListByFleetspacePager not implemented")}
+ }
+ newListByFleetspacePager := f.newListByFleetspacePager.get(req)
+ if newListByFleetspacePager == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ qp := req.URL.Query()
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ skipUnescaped, err := url.QueryUnescape(qp.Get("$skip"))
+ if err != nil {
+ return nil, err
+ }
+ skipParam, err := parseOptional(skipUnescaped, func(v string) (int64, error) {
+ p, parseErr := strconv.ParseInt(v, 10, 64)
+ if parseErr != nil {
+ return 0, parseErr
+ }
+ return p, nil
+ })
+ if err != nil {
+ return nil, err
+ }
+ topUnescaped, err := url.QueryUnescape(qp.Get("$top"))
+ if err != nil {
+ return nil, err
+ }
+ topParam, err := parseOptional(topUnescaped, func(v string) (int64, error) {
+ p, parseErr := strconv.ParseInt(v, 10, 64)
+ if parseErr != nil {
+ return 0, parseErr
+ }
+ return p, nil
+ })
+ if err != nil {
+ return nil, err
+ }
+ filterUnescaped, err := url.QueryUnescape(qp.Get("$filter"))
+ if err != nil {
+ return nil, err
+ }
+ filterParam := getOptional(filterUnescaped)
+ skiptokenUnescaped, err := url.QueryUnescape(qp.Get("$skiptoken"))
+ if err != nil {
+ return nil, err
+ }
+ skiptokenParam := getOptional(skiptokenUnescaped)
+ var options *armdatabasefleetmanager.FleetDatabasesClientListByFleetspaceOptions
+ if skipParam != nil || topParam != nil || filterParam != nil || skiptokenParam != nil {
+ options = &armdatabasefleetmanager.FleetDatabasesClientListByFleetspaceOptions{
+ Skip: skipParam,
+ Top: topParam,
+ Filter: filterParam,
+ Skiptoken: skiptokenParam,
+ }
+ }
+ resp := f.srv.NewListByFleetspacePager(resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, options)
+ newListByFleetspacePager = &resp
+ f.newListByFleetspacePager.add(req, newListByFleetspacePager)
+ server.PagerResponderInjectNextLinks(newListByFleetspacePager, req, func(page *armdatabasefleetmanager.FleetDatabasesClientListByFleetspaceResponse, createLink func() string) {
+ page.NextLink = to.Ptr(createLink())
+ })
+ }
+ resp, err := server.PagerResponderNext(newListByFleetspacePager, req)
+ if err != nil {
+ return nil, err
+ }
+ if !contains([]int{http.StatusOK}, resp.StatusCode) {
+ f.newListByFleetspacePager.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
+ }
+ if !server.PagerResponderMore(newListByFleetspacePager) {
+ f.newListByFleetspacePager.remove(req)
+ }
+ return resp, nil
+}
+
+func (f *FleetDatabasesServerTransport) dispatchBeginRename(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginRename == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginRename not implemented")}
+ }
+ beginRename := f.beginRename.get(req)
+ if beginRename == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/rename`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 5 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasefleetmanager.DatabaseRenameProperties](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginRename(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, databaseNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginRename = &respr
+ f.beginRename.add(req, beginRename)
+ }
+
+ resp, err := server.PollerResponderNext(beginRename, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ f.beginRename.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginRename) {
+ f.beginRename.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (f *FleetDatabasesServerTransport) dispatchBeginRevert(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginRevert == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginRevert not implemented")}
+ }
+ beginRevert := f.beginRevert.get(req)
+ if beginRevert == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/revert`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 5 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginRevert(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, databaseNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginRevert = &respr
+ f.beginRevert.add(req, beginRevert)
+ }
+
+ resp, err := server.PollerResponderNext(beginRevert, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ f.beginRevert.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginRevert) {
+ f.beginRevert.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (f *FleetDatabasesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginUpdate == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")}
+ }
+ beginUpdate := f.beginUpdate.get(req)
+ if beginUpdate == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 5 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasefleetmanager.FleetDatabase](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginUpdate(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, databaseNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginUpdate = &respr
+ f.beginUpdate.add(req, beginUpdate)
+ }
+
+ resp, err := server.PollerResponderNext(beginUpdate, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
+ f.beginUpdate.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginUpdate) {
+ f.beginUpdate.remove(req)
+ }
+
+ return resp, nil
+}
+
+// set this to conditionally intercept incoming requests to FleetDatabasesServerTransport
+var fleetDatabasesServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/fleets_server.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/fleets_server.go
new file mode 100644
index 000000000000..e5d68393ad38
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/fleets_server.go
@@ -0,0 +1,417 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager"
+ "net/http"
+ "net/url"
+ "regexp"
+ "strconv"
+)
+
+// FleetsServer is a fake server for instances of the armdatabasefleetmanager.FleetsClient type.
+type FleetsServer struct {
+ // BeginCreateOrUpdate is the fake for method FleetsClient.BeginCreateOrUpdate
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
+ BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, fleetName string, resource armdatabasefleetmanager.Fleet, options *armdatabasefleetmanager.FleetsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)
+
+ // BeginDelete is the fake for method FleetsClient.BeginDelete
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
+ BeginDelete func(ctx context.Context, resourceGroupName string, fleetName string, options *armdatabasefleetmanager.FleetsClientBeginDeleteOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetsClientDeleteResponse], errResp azfake.ErrorResponder)
+
+ // Get is the fake for method FleetsClient.Get
+ // HTTP status codes to indicate success: http.StatusOK
+ Get func(ctx context.Context, resourceGroupName string, fleetName string, options *armdatabasefleetmanager.FleetsClientGetOptions) (resp azfake.Responder[armdatabasefleetmanager.FleetsClientGetResponse], errResp azfake.ErrorResponder)
+
+ // NewListPager is the fake for method FleetsClient.NewListPager
+ // HTTP status codes to indicate success: http.StatusOK
+ NewListPager func(options *armdatabasefleetmanager.FleetsClientListOptions) (resp azfake.PagerResponder[armdatabasefleetmanager.FleetsClientListResponse])
+
+ // NewListByResourceGroupPager is the fake for method FleetsClient.NewListByResourceGroupPager
+ // HTTP status codes to indicate success: http.StatusOK
+ NewListByResourceGroupPager func(resourceGroupName string, options *armdatabasefleetmanager.FleetsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armdatabasefleetmanager.FleetsClientListByResourceGroupResponse])
+
+ // BeginUpdate is the fake for method FleetsClient.BeginUpdate
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
+ BeginUpdate func(ctx context.Context, resourceGroupName string, fleetName string, properties armdatabasefleetmanager.FleetUpdate, options *armdatabasefleetmanager.FleetsClientBeginUpdateOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetsClientUpdateResponse], errResp azfake.ErrorResponder)
+}
+
+// NewFleetsServerTransport creates a new instance of FleetsServerTransport with the provided implementation.
+// The returned FleetsServerTransport instance is connected to an instance of armdatabasefleetmanager.FleetsClient via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewFleetsServerTransport(srv *FleetsServer) *FleetsServerTransport {
+ return &FleetsServerTransport{
+ srv: srv,
+ beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetsClientCreateOrUpdateResponse]](),
+ beginDelete: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetsClientDeleteResponse]](),
+ newListPager: newTracker[azfake.PagerResponder[armdatabasefleetmanager.FleetsClientListResponse]](),
+ newListByResourceGroupPager: newTracker[azfake.PagerResponder[armdatabasefleetmanager.FleetsClientListByResourceGroupResponse]](),
+ beginUpdate: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetsClientUpdateResponse]](),
+ }
+}
+
+// FleetsServerTransport connects instances of armdatabasefleetmanager.FleetsClient to instances of FleetsServer.
+// Don't use this type directly, use NewFleetsServerTransport instead.
+type FleetsServerTransport struct {
+ srv *FleetsServer
+ beginCreateOrUpdate *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetsClientCreateOrUpdateResponse]]
+ beginDelete *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetsClientDeleteResponse]]
+ newListPager *tracker[azfake.PagerResponder[armdatabasefleetmanager.FleetsClientListResponse]]
+ newListByResourceGroupPager *tracker[azfake.PagerResponder[armdatabasefleetmanager.FleetsClientListByResourceGroupResponse]]
+ beginUpdate *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetsClientUpdateResponse]]
+}
+
+// Do implements the policy.Transporter interface for FleetsServerTransport.
+func (f *FleetsServerTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ return f.dispatchToMethodFake(req, method)
+}
+
+func (f *FleetsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if fleetsServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = fleetsServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "FleetsClient.BeginCreateOrUpdate":
+ res.resp, res.err = f.dispatchBeginCreateOrUpdate(req)
+ case "FleetsClient.BeginDelete":
+ res.resp, res.err = f.dispatchBeginDelete(req)
+ case "FleetsClient.Get":
+ res.resp, res.err = f.dispatchGet(req)
+ case "FleetsClient.NewListPager":
+ res.resp, res.err = f.dispatchNewListPager(req)
+ case "FleetsClient.NewListByResourceGroupPager":
+ res.resp, res.err = f.dispatchNewListByResourceGroupPager(req)
+ case "FleetsClient.BeginUpdate":
+ res.resp, res.err = f.dispatchBeginUpdate(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
+}
+
+func (f *FleetsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginCreateOrUpdate == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")}
+ }
+ beginCreateOrUpdate := f.beginCreateOrUpdate.get(req)
+ if beginCreateOrUpdate == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasefleetmanager.Fleet](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, fleetNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginCreateOrUpdate = &respr
+ f.beginCreateOrUpdate.add(req, beginCreateOrUpdate)
+ }
+
+ resp, err := server.PollerResponderNext(beginCreateOrUpdate, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) {
+ f.beginCreateOrUpdate.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginCreateOrUpdate) {
+ f.beginCreateOrUpdate.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (f *FleetsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginDelete == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")}
+ }
+ beginDelete := f.beginDelete.get(req)
+ if beginDelete == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginDelete(req.Context(), resourceGroupNameParam, fleetNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginDelete = &respr
+ f.beginDelete.add(req, beginDelete)
+ }
+
+ resp, err := server.PollerResponderNext(beginDelete, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ f.beginDelete.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginDelete) {
+ f.beginDelete.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (f *FleetsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
+ if f.srv.Get == nil {
+ return nil, &nonRetriableError{errors.New("fake for method Get not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.Get(req.Context(), resourceGroupNameParam, fleetNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Fleet, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (f *FleetsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) {
+ if f.srv.NewListPager == nil {
+ return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")}
+ }
+ newListPager := f.newListPager.get(req)
+ if newListPager == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 1 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resp := f.srv.NewListPager(nil)
+ newListPager = &resp
+ f.newListPager.add(req, newListPager)
+ server.PagerResponderInjectNextLinks(newListPager, req, func(page *armdatabasefleetmanager.FleetsClientListResponse, createLink func() string) {
+ page.NextLink = to.Ptr(createLink())
+ })
+ }
+ resp, err := server.PagerResponderNext(newListPager, req)
+ if err != nil {
+ return nil, err
+ }
+ if !contains([]int{http.StatusOK}, resp.StatusCode) {
+ f.newListPager.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
+ }
+ if !server.PagerResponderMore(newListPager) {
+ f.newListPager.remove(req)
+ }
+ return resp, nil
+}
+
+func (f *FleetsServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) {
+ if f.srv.NewListByResourceGroupPager == nil {
+ return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")}
+ }
+ newListByResourceGroupPager := f.newListByResourceGroupPager.get(req)
+ if newListByResourceGroupPager == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 2 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ qp := req.URL.Query()
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ skipUnescaped, err := url.QueryUnescape(qp.Get("$skip"))
+ if err != nil {
+ return nil, err
+ }
+ skipParam, err := parseOptional(skipUnescaped, func(v string) (int64, error) {
+ p, parseErr := strconv.ParseInt(v, 10, 64)
+ if parseErr != nil {
+ return 0, parseErr
+ }
+ return p, nil
+ })
+ if err != nil {
+ return nil, err
+ }
+ topUnescaped, err := url.QueryUnescape(qp.Get("$top"))
+ if err != nil {
+ return nil, err
+ }
+ topParam, err := parseOptional(topUnescaped, func(v string) (int64, error) {
+ p, parseErr := strconv.ParseInt(v, 10, 64)
+ if parseErr != nil {
+ return 0, parseErr
+ }
+ return p, nil
+ })
+ if err != nil {
+ return nil, err
+ }
+ skiptokenUnescaped, err := url.QueryUnescape(qp.Get("$skiptoken"))
+ if err != nil {
+ return nil, err
+ }
+ skiptokenParam := getOptional(skiptokenUnescaped)
+ var options *armdatabasefleetmanager.FleetsClientListByResourceGroupOptions
+ if skipParam != nil || topParam != nil || skiptokenParam != nil {
+ options = &armdatabasefleetmanager.FleetsClientListByResourceGroupOptions{
+ Skip: skipParam,
+ Top: topParam,
+ Skiptoken: skiptokenParam,
+ }
+ }
+ resp := f.srv.NewListByResourceGroupPager(resourceGroupNameParam, options)
+ newListByResourceGroupPager = &resp
+ f.newListByResourceGroupPager.add(req, newListByResourceGroupPager)
+ server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armdatabasefleetmanager.FleetsClientListByResourceGroupResponse, createLink func() string) {
+ page.NextLink = to.Ptr(createLink())
+ })
+ }
+ resp, err := server.PagerResponderNext(newListByResourceGroupPager, req)
+ if err != nil {
+ return nil, err
+ }
+ if !contains([]int{http.StatusOK}, resp.StatusCode) {
+ f.newListByResourceGroupPager.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
+ }
+ if !server.PagerResponderMore(newListByResourceGroupPager) {
+ f.newListByResourceGroupPager.remove(req)
+ }
+ return resp, nil
+}
+
+func (f *FleetsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginUpdate == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")}
+ }
+ beginUpdate := f.beginUpdate.get(req)
+ if beginUpdate == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasefleetmanager.FleetUpdate](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginUpdate(req.Context(), resourceGroupNameParam, fleetNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginUpdate = &respr
+ f.beginUpdate.add(req, beginUpdate)
+ }
+
+ resp, err := server.PollerResponderNext(beginUpdate, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
+ f.beginUpdate.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginUpdate) {
+ f.beginUpdate.remove(req)
+ }
+
+ return resp, nil
+}
+
+// set this to conditionally intercept incoming requests to FleetsServerTransport
+var fleetsServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/fleetspaces_server.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/fleetspaces_server.go
new file mode 100644
index 000000000000..b1de42345aa8
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/fleetspaces_server.go
@@ -0,0 +1,512 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager"
+ "net/http"
+ "net/url"
+ "regexp"
+ "strconv"
+)
+
+// FleetspacesServer is a fake server for instances of the armdatabasefleetmanager.FleetspacesClient type.
+type FleetspacesServer struct {
+ // BeginCreateOrUpdate is the fake for method FleetspacesClient.BeginCreateOrUpdate
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
+ BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, resource armdatabasefleetmanager.Fleetspace, options *armdatabasefleetmanager.FleetspacesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetspacesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)
+
+ // BeginDelete is the fake for method FleetspacesClient.BeginDelete
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
+ BeginDelete func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, options *armdatabasefleetmanager.FleetspacesClientBeginDeleteOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetspacesClientDeleteResponse], errResp azfake.ErrorResponder)
+
+ // Get is the fake for method FleetspacesClient.Get
+ // HTTP status codes to indicate success: http.StatusOK
+ Get func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, options *armdatabasefleetmanager.FleetspacesClientGetOptions) (resp azfake.Responder[armdatabasefleetmanager.FleetspacesClientGetResponse], errResp azfake.ErrorResponder)
+
+ // NewListByFleetPager is the fake for method FleetspacesClient.NewListByFleetPager
+ // HTTP status codes to indicate success: http.StatusOK
+ NewListByFleetPager func(resourceGroupName string, fleetName string, options *armdatabasefleetmanager.FleetspacesClientListByFleetOptions) (resp azfake.PagerResponder[armdatabasefleetmanager.FleetspacesClientListByFleetResponse])
+
+ // BeginRegisterServer is the fake for method FleetspacesClient.BeginRegisterServer
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
+ BeginRegisterServer func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, body armdatabasefleetmanager.RegisterServerProperties, options *armdatabasefleetmanager.FleetspacesClientBeginRegisterServerOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetspacesClientRegisterServerResponse], errResp azfake.ErrorResponder)
+
+ // BeginUnregister is the fake for method FleetspacesClient.BeginUnregister
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
+ BeginUnregister func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, options *armdatabasefleetmanager.FleetspacesClientBeginUnregisterOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetspacesClientUnregisterResponse], errResp azfake.ErrorResponder)
+
+ // BeginUpdate is the fake for method FleetspacesClient.BeginUpdate
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
+ BeginUpdate func(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, properties armdatabasefleetmanager.Fleetspace, options *armdatabasefleetmanager.FleetspacesClientBeginUpdateOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetspacesClientUpdateResponse], errResp azfake.ErrorResponder)
+}
+
+// NewFleetspacesServerTransport creates a new instance of FleetspacesServerTransport with the provided implementation.
+// The returned FleetspacesServerTransport instance is connected to an instance of armdatabasefleetmanager.FleetspacesClient via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewFleetspacesServerTransport(srv *FleetspacesServer) *FleetspacesServerTransport {
+ return &FleetspacesServerTransport{
+ srv: srv,
+ beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetspacesClientCreateOrUpdateResponse]](),
+ beginDelete: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetspacesClientDeleteResponse]](),
+ newListByFleetPager: newTracker[azfake.PagerResponder[armdatabasefleetmanager.FleetspacesClientListByFleetResponse]](),
+ beginRegisterServer: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetspacesClientRegisterServerResponse]](),
+ beginUnregister: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetspacesClientUnregisterResponse]](),
+ beginUpdate: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetspacesClientUpdateResponse]](),
+ }
+}
+
+// FleetspacesServerTransport connects instances of armdatabasefleetmanager.FleetspacesClient to instances of FleetspacesServer.
+// Don't use this type directly, use NewFleetspacesServerTransport instead.
+type FleetspacesServerTransport struct {
+ srv *FleetspacesServer
+ beginCreateOrUpdate *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetspacesClientCreateOrUpdateResponse]]
+ beginDelete *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetspacesClientDeleteResponse]]
+ newListByFleetPager *tracker[azfake.PagerResponder[armdatabasefleetmanager.FleetspacesClientListByFleetResponse]]
+ beginRegisterServer *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetspacesClientRegisterServerResponse]]
+ beginUnregister *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetspacesClientUnregisterResponse]]
+ beginUpdate *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetspacesClientUpdateResponse]]
+}
+
+// Do implements the policy.Transporter interface for FleetspacesServerTransport.
+func (f *FleetspacesServerTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ return f.dispatchToMethodFake(req, method)
+}
+
+func (f *FleetspacesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if fleetspacesServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = fleetspacesServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "FleetspacesClient.BeginCreateOrUpdate":
+ res.resp, res.err = f.dispatchBeginCreateOrUpdate(req)
+ case "FleetspacesClient.BeginDelete":
+ res.resp, res.err = f.dispatchBeginDelete(req)
+ case "FleetspacesClient.Get":
+ res.resp, res.err = f.dispatchGet(req)
+ case "FleetspacesClient.NewListByFleetPager":
+ res.resp, res.err = f.dispatchNewListByFleetPager(req)
+ case "FleetspacesClient.BeginRegisterServer":
+ res.resp, res.err = f.dispatchBeginRegisterServer(req)
+ case "FleetspacesClient.BeginUnregister":
+ res.resp, res.err = f.dispatchBeginUnregister(req)
+ case "FleetspacesClient.BeginUpdate":
+ res.resp, res.err = f.dispatchBeginUpdate(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
+}
+
+func (f *FleetspacesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginCreateOrUpdate == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")}
+ }
+ beginCreateOrUpdate := f.beginCreateOrUpdate.get(req)
+ if beginCreateOrUpdate == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasefleetmanager.Fleetspace](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginCreateOrUpdate = &respr
+ f.beginCreateOrUpdate.add(req, beginCreateOrUpdate)
+ }
+
+ resp, err := server.PollerResponderNext(beginCreateOrUpdate, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) {
+ f.beginCreateOrUpdate.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginCreateOrUpdate) {
+ f.beginCreateOrUpdate.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (f *FleetspacesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginDelete == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")}
+ }
+ beginDelete := f.beginDelete.get(req)
+ if beginDelete == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginDelete(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginDelete = &respr
+ f.beginDelete.add(req, beginDelete)
+ }
+
+ resp, err := server.PollerResponderNext(beginDelete, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ f.beginDelete.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginDelete) {
+ f.beginDelete.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (f *FleetspacesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
+ if f.srv.Get == nil {
+ return nil, &nonRetriableError{errors.New("fake for method Get not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.Get(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Fleetspace, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (f *FleetspacesServerTransport) dispatchNewListByFleetPager(req *http.Request) (*http.Response, error) {
+ if f.srv.NewListByFleetPager == nil {
+ return nil, &nonRetriableError{errors.New("fake for method NewListByFleetPager not implemented")}
+ }
+ newListByFleetPager := f.newListByFleetPager.get(req)
+ if newListByFleetPager == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ qp := req.URL.Query()
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ skipUnescaped, err := url.QueryUnescape(qp.Get("$skip"))
+ if err != nil {
+ return nil, err
+ }
+ skipParam, err := parseOptional(skipUnescaped, func(v string) (int64, error) {
+ p, parseErr := strconv.ParseInt(v, 10, 64)
+ if parseErr != nil {
+ return 0, parseErr
+ }
+ return p, nil
+ })
+ if err != nil {
+ return nil, err
+ }
+ topUnescaped, err := url.QueryUnescape(qp.Get("$top"))
+ if err != nil {
+ return nil, err
+ }
+ topParam, err := parseOptional(topUnescaped, func(v string) (int64, error) {
+ p, parseErr := strconv.ParseInt(v, 10, 64)
+ if parseErr != nil {
+ return 0, parseErr
+ }
+ return p, nil
+ })
+ if err != nil {
+ return nil, err
+ }
+ skiptokenUnescaped, err := url.QueryUnescape(qp.Get("$skiptoken"))
+ if err != nil {
+ return nil, err
+ }
+ skiptokenParam := getOptional(skiptokenUnescaped)
+ var options *armdatabasefleetmanager.FleetspacesClientListByFleetOptions
+ if skipParam != nil || topParam != nil || skiptokenParam != nil {
+ options = &armdatabasefleetmanager.FleetspacesClientListByFleetOptions{
+ Skip: skipParam,
+ Top: topParam,
+ Skiptoken: skiptokenParam,
+ }
+ }
+ resp := f.srv.NewListByFleetPager(resourceGroupNameParam, fleetNameParam, options)
+ newListByFleetPager = &resp
+ f.newListByFleetPager.add(req, newListByFleetPager)
+ server.PagerResponderInjectNextLinks(newListByFleetPager, req, func(page *armdatabasefleetmanager.FleetspacesClientListByFleetResponse, createLink func() string) {
+ page.NextLink = to.Ptr(createLink())
+ })
+ }
+ resp, err := server.PagerResponderNext(newListByFleetPager, req)
+ if err != nil {
+ return nil, err
+ }
+ if !contains([]int{http.StatusOK}, resp.StatusCode) {
+ f.newListByFleetPager.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
+ }
+ if !server.PagerResponderMore(newListByFleetPager) {
+ f.newListByFleetPager.remove(req)
+ }
+ return resp, nil
+}
+
+func (f *FleetspacesServerTransport) dispatchBeginRegisterServer(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginRegisterServer == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginRegisterServer not implemented")}
+ }
+ beginRegisterServer := f.beginRegisterServer.get(req)
+ if beginRegisterServer == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/registerServer`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasefleetmanager.RegisterServerProperties](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginRegisterServer(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginRegisterServer = &respr
+ f.beginRegisterServer.add(req, beginRegisterServer)
+ }
+
+ resp, err := server.PollerResponderNext(beginRegisterServer, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ f.beginRegisterServer.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginRegisterServer) {
+ f.beginRegisterServer.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (f *FleetspacesServerTransport) dispatchBeginUnregister(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginUnregister == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginUnregister not implemented")}
+ }
+ beginUnregister := f.beginUnregister.get(req)
+ if beginUnregister == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/unregister`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginUnregister(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginUnregister = &respr
+ f.beginUnregister.add(req, beginUnregister)
+ }
+
+ resp, err := server.PollerResponderNext(beginUnregister, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ f.beginUnregister.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginUnregister) {
+ f.beginUnregister.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (f *FleetspacesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginUpdate == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")}
+ }
+ beginUpdate := f.beginUpdate.get(req)
+ if beginUpdate == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fleetspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasefleetmanager.Fleetspace](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetspaceName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginUpdate(req.Context(), resourceGroupNameParam, fleetNameParam, fleetspaceNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginUpdate = &respr
+ f.beginUpdate.add(req, beginUpdate)
+ }
+
+ resp, err := server.PollerResponderNext(beginUpdate, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
+ f.beginUpdate.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginUpdate) {
+ f.beginUpdate.remove(req)
+ }
+
+ return resp, nil
+}
+
+// set this to conditionally intercept incoming requests to FleetspacesServerTransport
+var fleetspacesServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/fleettiers_server.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/fleettiers_server.go
new file mode 100644
index 000000000000..10f00ff891dd
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/fleettiers_server.go
@@ -0,0 +1,439 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager"
+ "net/http"
+ "net/url"
+ "regexp"
+ "strconv"
+)
+
+// FleetTiersServer is a fake server for instances of the armdatabasefleetmanager.FleetTiersClient type.
+type FleetTiersServer struct {
+ // BeginCreateOrUpdate is the fake for method FleetTiersClient.BeginCreateOrUpdate
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
+ BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, fleetName string, tierName string, resource armdatabasefleetmanager.FleetTier, options *armdatabasefleetmanager.FleetTiersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetTiersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)
+
+ // BeginDelete is the fake for method FleetTiersClient.BeginDelete
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
+ BeginDelete func(ctx context.Context, resourceGroupName string, fleetName string, tierName string, options *armdatabasefleetmanager.FleetTiersClientBeginDeleteOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetTiersClientDeleteResponse], errResp azfake.ErrorResponder)
+
+ // Disable is the fake for method FleetTiersClient.Disable
+ // HTTP status codes to indicate success: http.StatusOK
+ Disable func(ctx context.Context, resourceGroupName string, fleetName string, tierName string, options *armdatabasefleetmanager.FleetTiersClientDisableOptions) (resp azfake.Responder[armdatabasefleetmanager.FleetTiersClientDisableResponse], errResp azfake.ErrorResponder)
+
+ // Get is the fake for method FleetTiersClient.Get
+ // HTTP status codes to indicate success: http.StatusOK
+ Get func(ctx context.Context, resourceGroupName string, fleetName string, tierName string, options *armdatabasefleetmanager.FleetTiersClientGetOptions) (resp azfake.Responder[armdatabasefleetmanager.FleetTiersClientGetResponse], errResp azfake.ErrorResponder)
+
+ // NewListByFleetPager is the fake for method FleetTiersClient.NewListByFleetPager
+ // HTTP status codes to indicate success: http.StatusOK
+ NewListByFleetPager func(resourceGroupName string, fleetName string, options *armdatabasefleetmanager.FleetTiersClientListByFleetOptions) (resp azfake.PagerResponder[armdatabasefleetmanager.FleetTiersClientListByFleetResponse])
+
+ // BeginUpdate is the fake for method FleetTiersClient.BeginUpdate
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
+ BeginUpdate func(ctx context.Context, resourceGroupName string, fleetName string, tierName string, properties armdatabasefleetmanager.FleetTier, options *armdatabasefleetmanager.FleetTiersClientBeginUpdateOptions) (resp azfake.PollerResponder[armdatabasefleetmanager.FleetTiersClientUpdateResponse], errResp azfake.ErrorResponder)
+}
+
+// NewFleetTiersServerTransport creates a new instance of FleetTiersServerTransport with the provided implementation.
+// The returned FleetTiersServerTransport instance is connected to an instance of armdatabasefleetmanager.FleetTiersClient via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewFleetTiersServerTransport(srv *FleetTiersServer) *FleetTiersServerTransport {
+ return &FleetTiersServerTransport{
+ srv: srv,
+ beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetTiersClientCreateOrUpdateResponse]](),
+ beginDelete: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetTiersClientDeleteResponse]](),
+ newListByFleetPager: newTracker[azfake.PagerResponder[armdatabasefleetmanager.FleetTiersClientListByFleetResponse]](),
+ beginUpdate: newTracker[azfake.PollerResponder[armdatabasefleetmanager.FleetTiersClientUpdateResponse]](),
+ }
+}
+
+// FleetTiersServerTransport connects instances of armdatabasefleetmanager.FleetTiersClient to instances of FleetTiersServer.
+// Don't use this type directly, use NewFleetTiersServerTransport instead.
+type FleetTiersServerTransport struct {
+ srv *FleetTiersServer
+ beginCreateOrUpdate *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetTiersClientCreateOrUpdateResponse]]
+ beginDelete *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetTiersClientDeleteResponse]]
+ newListByFleetPager *tracker[azfake.PagerResponder[armdatabasefleetmanager.FleetTiersClientListByFleetResponse]]
+ beginUpdate *tracker[azfake.PollerResponder[armdatabasefleetmanager.FleetTiersClientUpdateResponse]]
+}
+
+// Do implements the policy.Transporter interface for FleetTiersServerTransport.
+func (f *FleetTiersServerTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ return f.dispatchToMethodFake(req, method)
+}
+
+func (f *FleetTiersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if fleetTiersServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = fleetTiersServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "FleetTiersClient.BeginCreateOrUpdate":
+ res.resp, res.err = f.dispatchBeginCreateOrUpdate(req)
+ case "FleetTiersClient.BeginDelete":
+ res.resp, res.err = f.dispatchBeginDelete(req)
+ case "FleetTiersClient.Disable":
+ res.resp, res.err = f.dispatchDisable(req)
+ case "FleetTiersClient.Get":
+ res.resp, res.err = f.dispatchGet(req)
+ case "FleetTiersClient.NewListByFleetPager":
+ res.resp, res.err = f.dispatchNewListByFleetPager(req)
+ case "FleetTiersClient.BeginUpdate":
+ res.resp, res.err = f.dispatchBeginUpdate(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
+}
+
+func (f *FleetTiersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginCreateOrUpdate == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")}
+ }
+ beginCreateOrUpdate := f.beginCreateOrUpdate.get(req)
+ if beginCreateOrUpdate == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tiers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasefleetmanager.FleetTier](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ tierNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("tierName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, fleetNameParam, tierNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginCreateOrUpdate = &respr
+ f.beginCreateOrUpdate.add(req, beginCreateOrUpdate)
+ }
+
+ resp, err := server.PollerResponderNext(beginCreateOrUpdate, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) {
+ f.beginCreateOrUpdate.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginCreateOrUpdate) {
+ f.beginCreateOrUpdate.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (f *FleetTiersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginDelete == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")}
+ }
+ beginDelete := f.beginDelete.get(req)
+ if beginDelete == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tiers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ tierNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("tierName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginDelete(req.Context(), resourceGroupNameParam, fleetNameParam, tierNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginDelete = &respr
+ f.beginDelete.add(req, beginDelete)
+ }
+
+ resp, err := server.PollerResponderNext(beginDelete, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ f.beginDelete.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginDelete) {
+ f.beginDelete.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (f *FleetTiersServerTransport) dispatchDisable(req *http.Request) (*http.Response, error) {
+ if f.srv.Disable == nil {
+ return nil, &nonRetriableError{errors.New("fake for method Disable not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tiers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disable`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ tierNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("tierName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.Disable(req.Context(), resourceGroupNameParam, fleetNameParam, tierNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FleetTier, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (f *FleetTiersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
+ if f.srv.Get == nil {
+ return nil, &nonRetriableError{errors.New("fake for method Get not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tiers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ tierNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("tierName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.Get(req.Context(), resourceGroupNameParam, fleetNameParam, tierNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FleetTier, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (f *FleetTiersServerTransport) dispatchNewListByFleetPager(req *http.Request) (*http.Response, error) {
+ if f.srv.NewListByFleetPager == nil {
+ return nil, &nonRetriableError{errors.New("fake for method NewListByFleetPager not implemented")}
+ }
+ newListByFleetPager := f.newListByFleetPager.get(req)
+ if newListByFleetPager == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tiers`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ qp := req.URL.Query()
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ skipUnescaped, err := url.QueryUnescape(qp.Get("$skip"))
+ if err != nil {
+ return nil, err
+ }
+ skipParam, err := parseOptional(skipUnescaped, func(v string) (int64, error) {
+ p, parseErr := strconv.ParseInt(v, 10, 64)
+ if parseErr != nil {
+ return 0, parseErr
+ }
+ return p, nil
+ })
+ if err != nil {
+ return nil, err
+ }
+ topUnescaped, err := url.QueryUnescape(qp.Get("$top"))
+ if err != nil {
+ return nil, err
+ }
+ topParam, err := parseOptional(topUnescaped, func(v string) (int64, error) {
+ p, parseErr := strconv.ParseInt(v, 10, 64)
+ if parseErr != nil {
+ return 0, parseErr
+ }
+ return p, nil
+ })
+ if err != nil {
+ return nil, err
+ }
+ skiptokenUnescaped, err := url.QueryUnescape(qp.Get("$skiptoken"))
+ if err != nil {
+ return nil, err
+ }
+ skiptokenParam := getOptional(skiptokenUnescaped)
+ var options *armdatabasefleetmanager.FleetTiersClientListByFleetOptions
+ if skipParam != nil || topParam != nil || skiptokenParam != nil {
+ options = &armdatabasefleetmanager.FleetTiersClientListByFleetOptions{
+ Skip: skipParam,
+ Top: topParam,
+ Skiptoken: skiptokenParam,
+ }
+ }
+ resp := f.srv.NewListByFleetPager(resourceGroupNameParam, fleetNameParam, options)
+ newListByFleetPager = &resp
+ f.newListByFleetPager.add(req, newListByFleetPager)
+ server.PagerResponderInjectNextLinks(newListByFleetPager, req, func(page *armdatabasefleetmanager.FleetTiersClientListByFleetResponse, createLink func() string) {
+ page.NextLink = to.Ptr(createLink())
+ })
+ }
+ resp, err := server.PagerResponderNext(newListByFleetPager, req)
+ if err != nil {
+ return nil, err
+ }
+ if !contains([]int{http.StatusOK}, resp.StatusCode) {
+ f.newListByFleetPager.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
+ }
+ if !server.PagerResponderMore(newListByFleetPager) {
+ f.newListByFleetPager.remove(req)
+ }
+ return resp, nil
+}
+
+func (f *FleetTiersServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginUpdate == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")}
+ }
+ beginUpdate := f.beginUpdate.get(req)
+ if beginUpdate == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseFleetManager/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tiers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasefleetmanager.FleetTier](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")])
+ if err != nil {
+ return nil, err
+ }
+ tierNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("tierName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := f.srv.BeginUpdate(req.Context(), resourceGroupNameParam, fleetNameParam, tierNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginUpdate = &respr
+ f.beginUpdate.add(req, beginUpdate)
+ }
+
+ resp, err := server.PollerResponderNext(beginUpdate, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
+ f.beginUpdate.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginUpdate) {
+ f.beginUpdate.remove(req)
+ }
+
+ return resp, nil
+}
+
+// set this to conditionally intercept incoming requests to FleetTiersServerTransport
+var fleetTiersServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/internal.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/internal.go
new file mode 100644
index 000000000000..41e62ec29233
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/internal.go
@@ -0,0 +1,84 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "net/http"
+ "reflect"
+ "sync"
+)
+
+type result struct {
+ resp *http.Response
+ err error
+}
+
+type nonRetriableError struct {
+ error
+}
+
+func (nonRetriableError) NonRetriable() {
+ // marker method
+}
+
+func contains[T comparable](s []T, v T) bool {
+ for _, vv := range s {
+ if vv == v {
+ return true
+ }
+ }
+ return false
+}
+
+func getOptional[T any](v T) *T {
+ if reflect.ValueOf(v).IsZero() {
+ return nil
+ }
+ return &v
+}
+
+func parseOptional[T any](v string, parse func(v string) (T, error)) (*T, error) {
+ if v == "" {
+ return nil, nil
+ }
+ t, err := parse(v)
+ if err != nil {
+ return nil, err
+ }
+ return &t, err
+}
+
+func newTracker[T any]() *tracker[T] {
+ return &tracker[T]{
+ items: map[string]*T{},
+ }
+}
+
+type tracker[T any] struct {
+ items map[string]*T
+ mu sync.Mutex
+}
+
+func (p *tracker[T]) get(req *http.Request) *T {
+ p.mu.Lock()
+ defer p.mu.Unlock()
+ if item, ok := p.items[server.SanitizePagerPollerPath(req.URL.Path)]; ok {
+ return item
+ }
+ return nil
+}
+
+func (p *tracker[T]) add(req *http.Request, item *T) {
+ p.mu.Lock()
+ defer p.mu.Unlock()
+ p.items[server.SanitizePagerPollerPath(req.URL.Path)] = item
+}
+
+func (p *tracker[T]) remove(req *http.Request) {
+ p.mu.Lock()
+ defer p.mu.Unlock()
+ delete(p.items, server.SanitizePagerPollerPath(req.URL.Path))
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/operations_server.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/operations_server.go
new file mode 100644
index 000000000000..d65ceda6770b
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/operations_server.go
@@ -0,0 +1,117 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "errors"
+ "fmt"
+ azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager"
+ "net/http"
+)
+
+// OperationsServer is a fake server for instances of the armdatabasefleetmanager.OperationsClient type.
+type OperationsServer struct {
+ // NewListPager is the fake for method OperationsClient.NewListPager
+ // HTTP status codes to indicate success: http.StatusOK
+ NewListPager func(options *armdatabasefleetmanager.OperationsClientListOptions) (resp azfake.PagerResponder[armdatabasefleetmanager.OperationsClientListResponse])
+}
+
+// NewOperationsServerTransport creates a new instance of OperationsServerTransport with the provided implementation.
+// The returned OperationsServerTransport instance is connected to an instance of armdatabasefleetmanager.OperationsClient via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewOperationsServerTransport(srv *OperationsServer) *OperationsServerTransport {
+ return &OperationsServerTransport{
+ srv: srv,
+ newListPager: newTracker[azfake.PagerResponder[armdatabasefleetmanager.OperationsClientListResponse]](),
+ }
+}
+
+// OperationsServerTransport connects instances of armdatabasefleetmanager.OperationsClient to instances of OperationsServer.
+// Don't use this type directly, use NewOperationsServerTransport instead.
+type OperationsServerTransport struct {
+ srv *OperationsServer
+ newListPager *tracker[azfake.PagerResponder[armdatabasefleetmanager.OperationsClientListResponse]]
+}
+
+// Do implements the policy.Transporter interface for OperationsServerTransport.
+func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ return o.dispatchToMethodFake(req, method)
+}
+
+func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if operationsServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "OperationsClient.NewListPager":
+ res.resp, res.err = o.dispatchNewListPager(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
+}
+
+func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) {
+ if o.srv.NewListPager == nil {
+ return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")}
+ }
+ newListPager := o.newListPager.get(req)
+ if newListPager == nil {
+ resp := o.srv.NewListPager(nil)
+ newListPager = &resp
+ o.newListPager.add(req, newListPager)
+ server.PagerResponderInjectNextLinks(newListPager, req, func(page *armdatabasefleetmanager.OperationsClientListResponse, createLink func() string) {
+ page.NextLink = to.Ptr(createLink())
+ })
+ }
+ resp, err := server.PagerResponderNext(newListPager, req)
+ if err != nil {
+ return nil, err
+ }
+ if !contains([]int{http.StatusOK}, resp.StatusCode) {
+ o.newListPager.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
+ }
+ if !server.PagerResponderMore(newListPager) {
+ o.newListPager.remove(req)
+ }
+ return resp, nil
+}
+
+// set this to conditionally intercept incoming requests to OperationsServerTransport
+var operationsServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/server_factory.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/server_factory.go
new file mode 100644
index 000000000000..ba9a95b5f73f
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/server_factory.go
@@ -0,0 +1,111 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "errors"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "strings"
+ "sync"
+)
+
+// ServerFactory is a fake server for instances of the armdatabasefleetmanager.ClientFactory type.
+type ServerFactory struct {
+ // FirewallRulesServer contains the fakes for client FirewallRulesClient
+ FirewallRulesServer FirewallRulesServer
+
+ // FleetDatabasesServer contains the fakes for client FleetDatabasesClient
+ FleetDatabasesServer FleetDatabasesServer
+
+ // FleetTiersServer contains the fakes for client FleetTiersClient
+ FleetTiersServer FleetTiersServer
+
+ // FleetsServer contains the fakes for client FleetsClient
+ FleetsServer FleetsServer
+
+ // FleetspacesServer contains the fakes for client FleetspacesClient
+ FleetspacesServer FleetspacesServer
+
+ // OperationsServer contains the fakes for client OperationsClient
+ OperationsServer OperationsServer
+}
+
+// NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation.
+// The returned ServerFactoryTransport instance is connected to an instance of armdatabasefleetmanager.ClientFactory via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport {
+ return &ServerFactoryTransport{
+ srv: srv,
+ }
+}
+
+// ServerFactoryTransport connects instances of armdatabasefleetmanager.ClientFactory to instances of ServerFactory.
+// Don't use this type directly, use NewServerFactoryTransport instead.
+type ServerFactoryTransport struct {
+ srv *ServerFactory
+ trMu sync.Mutex
+ trFirewallRulesServer *FirewallRulesServerTransport
+ trFleetDatabasesServer *FleetDatabasesServerTransport
+ trFleetTiersServer *FleetTiersServerTransport
+ trFleetsServer *FleetsServerTransport
+ trFleetspacesServer *FleetspacesServerTransport
+ trOperationsServer *OperationsServerTransport
+}
+
+// Do implements the policy.Transporter interface for ServerFactoryTransport.
+func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ client := method[:strings.Index(method, ".")]
+ var resp *http.Response
+ var err error
+
+ switch client {
+ case "FirewallRulesClient":
+ initServer(s, &s.trFirewallRulesServer, func() *FirewallRulesServerTransport {
+ return NewFirewallRulesServerTransport(&s.srv.FirewallRulesServer)
+ })
+ resp, err = s.trFirewallRulesServer.Do(req)
+ case "FleetDatabasesClient":
+ initServer(s, &s.trFleetDatabasesServer, func() *FleetDatabasesServerTransport {
+ return NewFleetDatabasesServerTransport(&s.srv.FleetDatabasesServer)
+ })
+ resp, err = s.trFleetDatabasesServer.Do(req)
+ case "FleetTiersClient":
+ initServer(s, &s.trFleetTiersServer, func() *FleetTiersServerTransport { return NewFleetTiersServerTransport(&s.srv.FleetTiersServer) })
+ resp, err = s.trFleetTiersServer.Do(req)
+ case "FleetsClient":
+ initServer(s, &s.trFleetsServer, func() *FleetsServerTransport { return NewFleetsServerTransport(&s.srv.FleetsServer) })
+ resp, err = s.trFleetsServer.Do(req)
+ case "FleetspacesClient":
+ initServer(s, &s.trFleetspacesServer, func() *FleetspacesServerTransport { return NewFleetspacesServerTransport(&s.srv.FleetspacesServer) })
+ resp, err = s.trFleetspacesServer.Do(req)
+ case "OperationsClient":
+ initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) })
+ resp, err = s.trOperationsServer.Do(req)
+ default:
+ err = fmt.Errorf("unhandled client %s", client)
+ }
+
+ if err != nil {
+ return nil, err
+ }
+
+ return resp, nil
+}
+
+func initServer[T any](s *ServerFactoryTransport, dst **T, src func() *T) {
+ s.trMu.Lock()
+ if *dst == nil {
+ *dst = src()
+ }
+ s.trMu.Unlock()
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/time_rfc3339.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/time_rfc3339.go
new file mode 100644
index 000000000000..87ee11e83b32
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fake/time_rfc3339.go
@@ -0,0 +1,109 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "reflect"
+ "regexp"
+ "strings"
+ "time"
+)
+
+// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases.
+var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`)
+
+const (
+ utcDateTime = "2006-01-02T15:04:05.999999999"
+ utcDateTimeJSON = `"` + utcDateTime + `"`
+ utcDateTimeNoT = "2006-01-02 15:04:05.999999999"
+ utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"`
+ dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00`
+ dateTimeJSON = `"` + time.RFC3339Nano + `"`
+ dateTimeJSONNoT = `"` + dateTimeNoT + `"`
+)
+
+type dateTimeRFC3339 time.Time
+
+func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalJSON()
+}
+
+func (t dateTimeRFC3339) MarshalText() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalText()
+}
+
+func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error {
+ tzOffset := tzOffsetRegex.Match(data)
+ hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t")
+ var layout string
+ if tzOffset && hasT {
+ layout = dateTimeJSON
+ } else if tzOffset {
+ layout = dateTimeJSONNoT
+ } else if hasT {
+ layout = utcDateTimeJSON
+ } else {
+ layout = utcDateTimeJSONNoT
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) UnmarshalText(data []byte) error {
+ if len(data) == 0 {
+ return nil
+ }
+ tzOffset := tzOffsetRegex.Match(data)
+ hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t")
+ var layout string
+ if tzOffset && hasT {
+ layout = time.RFC3339Nano
+ } else if tzOffset {
+ layout = dateTimeNoT
+ } else if hasT {
+ layout = utcDateTime
+ } else {
+ layout = utcDateTimeNoT
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) Parse(layout, value string) error {
+ p, err := time.Parse(layout, strings.ToUpper(value))
+ *t = dateTimeRFC3339(p)
+ return err
+}
+
+func (t dateTimeRFC3339) String() string {
+ return time.Time(t).Format(time.RFC3339Nano)
+}
+
+func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) {
+ if t == nil {
+ return
+ } else if azcore.IsNullValue(t) {
+ m[k] = nil
+ return
+ } else if reflect.ValueOf(t).IsNil() {
+ return
+ }
+ m[k] = (*dateTimeRFC3339)(t)
+}
+
+func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error {
+ if data == nil || string(data) == "null" {
+ return nil
+ }
+ var aux dateTimeRFC3339
+ if err := json.Unmarshal(data, &aux); err != nil {
+ return fmt.Errorf("struct field %s: %v", fn, err)
+ }
+ *t = (*time.Time)(&aux)
+ return nil
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/firewallrules_client.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/firewallrules_client.go
new file mode 100644
index 000000000000..503cc3a93ac9
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/firewallrules_client.go
@@ -0,0 +1,371 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// FirewallRulesClient contains the methods for the FirewallRules group.
+// Don't use this type directly, use NewFirewallRulesClient() instead.
+type FirewallRulesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewFirewallRulesClient creates a new instance of FirewallRulesClient with the specified values.
+// - subscriptionID - The ID of the target subscription. The value must be an UUID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallRulesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &FirewallRulesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Creates or updates a firewall rule.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - firewallRuleName - Name of the firewall rule.
+// - resource - The firewall rule object to create or update.
+// - options - FirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.BeginCreateOrUpdate
+// method.
+func (client *FirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, firewallRuleName string, resource FirewallRule, options *FirewallRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[FirewallRulesClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, fleetName, fleetspaceName, firewallRuleName, resource, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallRulesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FirewallRulesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Creates or updates a firewall rule.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FirewallRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, firewallRuleName string, resource FirewallRule, options *FirewallRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FirewallRulesClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, firewallRuleName, resource, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, firewallRuleName string, resource FirewallRule, _ *FirewallRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ if firewallRuleName == "" {
+ return nil, errors.New("parameter firewallRuleName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{firewallRuleName}", url.PathEscape(firewallRuleName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, resource); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Deletes a firewall rule.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - firewallRuleName - Name of the firewall rule.
+// - options - FirewallRulesClientBeginDeleteOptions contains the optional parameters for the FirewallRulesClient.BeginDelete
+// method.
+func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, firewallRuleName string, options *FirewallRulesClientBeginDeleteOptions) (*runtime.Poller[FirewallRulesClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, fleetName, fleetspaceName, firewallRuleName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallRulesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FirewallRulesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Deletes a firewall rule.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FirewallRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, firewallRuleName string, options *FirewallRulesClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FirewallRulesClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, firewallRuleName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, firewallRuleName string, _ *FirewallRulesClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ if firewallRuleName == "" {
+ return nil, errors.New("parameter firewallRuleName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{firewallRuleName}", url.PathEscape(firewallRuleName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets a firewall rule.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - firewallRuleName - Name of the firewall rule.
+// - options - FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method.
+func (client *FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, firewallRuleName string, options *FirewallRulesClientGetOptions) (FirewallRulesClientGetResponse, error) {
+ var err error
+ const operationName = "FirewallRulesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, firewallRuleName, options)
+ if err != nil {
+ return FirewallRulesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FirewallRulesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FirewallRulesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, firewallRuleName string, _ *FirewallRulesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ if firewallRuleName == "" {
+ return nil, errors.New("parameter firewallRuleName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{firewallRuleName}", url.PathEscape(firewallRuleName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *FirewallRulesClient) getHandleResponse(resp *http.Response) (FirewallRulesClientGetResponse, error) {
+ result := FirewallRulesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FirewallRule); err != nil {
+ return FirewallRulesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByFleetspacePager - Gets all firewall rules in a fleetspace.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - options - FirewallRulesClientListByFleetspaceOptions contains the optional parameters for the FirewallRulesClient.NewListByFleetspacePager
+// method.
+func (client *FirewallRulesClient) NewListByFleetspacePager(resourceGroupName string, fleetName string, fleetspaceName string, options *FirewallRulesClientListByFleetspaceOptions) *runtime.Pager[FirewallRulesClientListByFleetspaceResponse] {
+ return runtime.NewPager(runtime.PagingHandler[FirewallRulesClientListByFleetspaceResponse]{
+ More: func(page FirewallRulesClientListByFleetspaceResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *FirewallRulesClientListByFleetspaceResponse) (FirewallRulesClientListByFleetspaceResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FirewallRulesClient.NewListByFleetspacePager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByFleetspaceCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, options)
+ }, nil)
+ if err != nil {
+ return FirewallRulesClientListByFleetspaceResponse{}, err
+ }
+ return client.listByFleetspaceHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByFleetspaceCreateRequest creates the ListByFleetspace request.
+func (client *FirewallRulesClient) listByFleetspaceCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, options *FirewallRulesClientListByFleetspaceOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Skip != nil {
+ reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10))
+ }
+ if options != nil && options.Skiptoken != nil {
+ reqQP.Set("$skiptoken", *options.Skiptoken)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(*options.Top, 10))
+ }
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByFleetspaceHandleResponse handles the ListByFleetspace response.
+func (client *FirewallRulesClient) listByFleetspaceHandleResponse(resp *http.Response) (FirewallRulesClientListByFleetspaceResponse, error) {
+ result := FirewallRulesClientListByFleetspaceResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FirewallRuleListResult); err != nil {
+ return FirewallRulesClientListByFleetspaceResponse{}, err
+ }
+ return result, nil
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/firewallrules_client_example_test.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/firewallrules_client_example_test.go
new file mode 100644
index 000000000000..9389a0452127
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/firewallrules_client_example_test.go
@@ -0,0 +1,176 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager_test
+
+import (
+ "context"
+ "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/databasefleetmanager/armdatabasefleetmanager"
+ "log"
+)
+
+// Generated from example definition: 2025-02-01-preview/FirewallRules_CreateOrUpdate_MaximumSet_Gen.json
+func ExampleFirewallRulesClient_BeginCreateOrUpdate() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("a2b3c4d5-6789-0123-4567-89abcdef1234", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "rg-networking-operations", "data-fleet-01", "prod-environment", "allow-10-0-0-0-24-to-10-1-0-0-24", armdatabasefleetmanager.FirewallRule{
+ Properties: &armdatabasefleetmanager.FirewallRuleProperties{
+ StartIPAddress: to.Ptr("10.0.0.0"),
+ EndIPAddress: to.Ptr("10.0.0.255"),
+ },
+ }, 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 = armdatabasefleetmanager.FirewallRulesClientCreateOrUpdateResponse{
+ // FirewallRule: &armdatabasefleetmanager.FirewallRule{
+ // Properties: &armdatabasefleetmanager.FirewallRuleProperties{
+ // StartIPAddress: to.Ptr("10.0.0.0"),
+ // EndIPAddress: to.Ptr("10.0.0.255"),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // },
+ // ID: to.Ptr("/subscriptions/a2b3c4d5-6789-0123-4567-89abcdef1234/resourceGroups/rg-networking-operations/providers/Microsoft.DatabaseFleetManager/fleets/data-fleet-01/fleetspaces/prod-environment/firewallRules/allow-10-0-0-0-24-to-10-1-0-0-24"),
+ // Name: to.Ptr("allow-10-0-0-0-24-to-10-1-0-0-24"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/firewallRules"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("admin.jdoe"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-01T14:30:45.123Z"); return t}()),
+ // LastModifiedBy: to.Ptr("admin.jdoe"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-01T14:30:45.124Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-02-01-preview/FirewallRules_Delete_MaximumSet_Gen.json
+func ExampleFirewallRulesClient_BeginDelete() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("a2b3c4d5-6789-0123-4567-89abcdef1234", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFirewallRulesClient().BeginDelete(ctx, "rg-networking-operations", "data-fleet-01", "prod-environment", "allow-10-0-0-0-24-to-10-1-0-0-24", nil)
+ if err != nil {
+ log.Fatalf("failed to finish the request: %v", err)
+ }
+ _, err = poller.PollUntilDone(ctx, nil)
+ if err != nil {
+ log.Fatalf("failed to pull the result: %v", err)
+ }
+}
+
+// Generated from example definition: 2025-02-01-preview/FirewallRules_Get_MaximumSet_Gen.json
+func ExampleFirewallRulesClient_Get() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("a2b3c4d5-6789-0123-4567-89abcdef1234", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewFirewallRulesClient().Get(ctx, "rg-networking-operations", "data-fleet-01", "prod-environment", "allow-10-0-0-0-24-to-10-1-0-0-24", 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 = armdatabasefleetmanager.FirewallRulesClientGetResponse{
+ // FirewallRule: &armdatabasefleetmanager.FirewallRule{
+ // Properties: &armdatabasefleetmanager.FirewallRuleProperties{
+ // StartIPAddress: to.Ptr("10.0.0.0"),
+ // EndIPAddress: to.Ptr("10.0.0.255"),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // },
+ // ID: to.Ptr("/subscriptions/a2b3c4d5-6789-0123-4567-89abcdef1234/resourceGroups/rg-networking-operations/providers/Microsoft.DatabaseFleetManager/fleets/data-fleet-01/fleetspaces/prod-environment/firewallRules/allow-10-0-0-0-24-to-10-1-0-0-24"),
+ // Name: to.Ptr("allow-10-0-0-0-24-to-10-1-0-0-24"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets/fleetspaces/firewallRules"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("admin.jdoe"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-01T14:30:45.123Z"); return t}()),
+ // LastModifiedBy: to.Ptr("admin.jdoe"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-01T14:30:45.124Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-02-01-preview/FirewallRules_ListByFleetspace_MaximumSet_Gen.json
+func ExampleFirewallRulesClient_NewListByFleetspacePager() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("a2b3c4d5-6789-0123-4567-89abcdef1234", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ pager := clientFactory.NewFirewallRulesClient().NewListByFleetspacePager("rg-networking-operations", "data-fleet-01", "prod-environment", &FirewallRulesClientListByFleetspaceOptions{
+ Skip: to.Ptr[int64](8),
+ Top: to.Ptr[int64](18),
+ Skiptoken: to.Ptr("thjchalxuwykrawwdgaie")})
+ 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 = armdatabasefleetmanager.FirewallRulesClientListByFleetspaceResponse{
+ // FirewallRuleListResult: armdatabasefleetmanager.FirewallRuleListResult{
+ // Value: []*armdatabasefleetmanager.FirewallRule{
+ // {
+ // Properties: &armdatabasefleetmanager.FirewallRuleProperties{
+ // StartIPAddress: to.Ptr("10.0.0.0"),
+ // EndIPAddress: to.Ptr("10.0.0.255"),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // },
+ // ID: to.Ptr("/subscriptions/a2b3c4d5-6789-0123-4567-89abcdef1234/resourceGroups/rg-networking-operations/providers/Microsoft.DatabaseFleetManager/fleets/data-fleet-01/fleetspaces/prod-environment/firewallRules/allow-10-0-0-0-24-to-10-1-0-0-24"),
+ // Name: to.Ptr("allow-10-0-0-0-24-to-10-1-0-0-24"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets/fleetspaces/firewallRules"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("admin.jdoe"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-01T14:30:45.123Z"); return t}()),
+ // LastModifiedBy: to.Ptr("admin.jdoe"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-01T14:30:45.124Z"); return t}()),
+ // },
+ // },
+ // },
+ // NextLink: to.Ptr("https://microsoft.com/a"),
+ // },
+ // }
+ }
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleetdatabases_client.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleetdatabases_client.go
new file mode 100644
index 000000000000..d62796a17149
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleetdatabases_client.go
@@ -0,0 +1,733 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// FleetDatabasesClient contains the methods for the FleetDatabases group.
+// Don't use this type directly, use NewFleetDatabasesClient() instead.
+type FleetDatabasesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewFleetDatabasesClient creates a new instance of FleetDatabasesClient with the specified values.
+// - subscriptionID - The ID of the target subscription. The value must be an UUID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewFleetDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FleetDatabasesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &FleetDatabasesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginChangeTier - Moves database to a different tier.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - databaseName - Name of the database.
+// - body - The details of the change tier operation.
+// - options - FleetDatabasesClientBeginChangeTierOptions contains the optional parameters for the FleetDatabasesClient.BeginChangeTier
+// method.
+func (client *FleetDatabasesClient) BeginChangeTier(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, body DatabaseChangeTierProperties, options *FleetDatabasesClientBeginChangeTierOptions) (*runtime.Poller[FleetDatabasesClientChangeTierResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.changeTier(ctx, resourceGroupName, fleetName, fleetspaceName, databaseName, body, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetDatabasesClientChangeTierResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetDatabasesClientChangeTierResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// ChangeTier - Moves database to a different tier.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetDatabasesClient) changeTier(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, body DatabaseChangeTierProperties, options *FleetDatabasesClientBeginChangeTierOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetDatabasesClient.BeginChangeTier"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.changeTierCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, databaseName, body, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// changeTierCreateRequest creates the ChangeTier request.
+func (client *FleetDatabasesClient) changeTierCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, body DatabaseChangeTierProperties, _ *FleetDatabasesClientBeginChangeTierOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/changeTier"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ if databaseName == "" {
+ return nil, errors.New("parameter databaseName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, body); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginCreateOrUpdate - Creates or updates a fleet database.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - databaseName - Name of the database.
+// - resource - The database object to create or update.
+// - options - FleetDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the FleetDatabasesClient.BeginCreateOrUpdate
+// method.
+func (client *FleetDatabasesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, resource FleetDatabase, options *FleetDatabasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[FleetDatabasesClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, fleetName, fleetspaceName, databaseName, resource, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetDatabasesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetDatabasesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Creates or updates a fleet database.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetDatabasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, resource FleetDatabase, options *FleetDatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetDatabasesClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, databaseName, resource, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *FleetDatabasesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, resource FleetDatabase, _ *FleetDatabasesClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ if databaseName == "" {
+ return nil, errors.New("parameter databaseName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, resource); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Deletes a fleet database.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - databaseName - Name of the database.
+// - options - FleetDatabasesClientBeginDeleteOptions contains the optional parameters for the FleetDatabasesClient.BeginDelete
+// method.
+func (client *FleetDatabasesClient) BeginDelete(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, options *FleetDatabasesClientBeginDeleteOptions) (*runtime.Poller[FleetDatabasesClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, fleetName, fleetspaceName, databaseName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetDatabasesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetDatabasesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Deletes a fleet database.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetDatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, options *FleetDatabasesClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetDatabasesClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, databaseName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *FleetDatabasesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, _ *FleetDatabasesClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ if databaseName == "" {
+ return nil, errors.New("parameter databaseName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets a fleet database.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - databaseName - Name of the database.
+// - options - FleetDatabasesClientGetOptions contains the optional parameters for the FleetDatabasesClient.Get method.
+func (client *FleetDatabasesClient) Get(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, options *FleetDatabasesClientGetOptions) (FleetDatabasesClientGetResponse, error) {
+ var err error
+ const operationName = "FleetDatabasesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, databaseName, options)
+ if err != nil {
+ return FleetDatabasesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FleetDatabasesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FleetDatabasesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *FleetDatabasesClient) getCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, _ *FleetDatabasesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ if databaseName == "" {
+ return nil, errors.New("parameter databaseName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *FleetDatabasesClient) getHandleResponse(resp *http.Response) (FleetDatabasesClientGetResponse, error) {
+ result := FleetDatabasesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FleetDatabase); err != nil {
+ return FleetDatabasesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByFleetspacePager - Gets all fleet databases in a fleetspace.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - options - FleetDatabasesClientListByFleetspaceOptions contains the optional parameters for the FleetDatabasesClient.NewListByFleetspacePager
+// method.
+func (client *FleetDatabasesClient) NewListByFleetspacePager(resourceGroupName string, fleetName string, fleetspaceName string, options *FleetDatabasesClientListByFleetspaceOptions) *runtime.Pager[FleetDatabasesClientListByFleetspaceResponse] {
+ return runtime.NewPager(runtime.PagingHandler[FleetDatabasesClientListByFleetspaceResponse]{
+ More: func(page FleetDatabasesClientListByFleetspaceResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *FleetDatabasesClientListByFleetspaceResponse) (FleetDatabasesClientListByFleetspaceResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FleetDatabasesClient.NewListByFleetspacePager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByFleetspaceCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, options)
+ }, nil)
+ if err != nil {
+ return FleetDatabasesClientListByFleetspaceResponse{}, err
+ }
+ return client.listByFleetspaceHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByFleetspaceCreateRequest creates the ListByFleetspace request.
+func (client *FleetDatabasesClient) listByFleetspaceCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, options *FleetDatabasesClientListByFleetspaceOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Skip != nil {
+ reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10))
+ }
+ if options != nil && options.Skiptoken != nil {
+ reqQP.Set("$skiptoken", *options.Skiptoken)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(*options.Top, 10))
+ }
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByFleetspaceHandleResponse handles the ListByFleetspace response.
+func (client *FleetDatabasesClient) listByFleetspaceHandleResponse(resp *http.Response) (FleetDatabasesClientListByFleetspaceResponse, error) {
+ result := FleetDatabasesClientListByFleetspaceResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FleetDatabaseListResult); err != nil {
+ return FleetDatabasesClientListByFleetspaceResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginRename - Renames a database.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - databaseName - Name of the database.
+// - body - The details of the rename operation.
+// - options - FleetDatabasesClientBeginRenameOptions contains the optional parameters for the FleetDatabasesClient.BeginRename
+// method.
+func (client *FleetDatabasesClient) BeginRename(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, body DatabaseRenameProperties, options *FleetDatabasesClientBeginRenameOptions) (*runtime.Poller[FleetDatabasesClientRenameResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.rename(ctx, resourceGroupName, fleetName, fleetspaceName, databaseName, body, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetDatabasesClientRenameResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetDatabasesClientRenameResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Rename - Renames a database.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetDatabasesClient) rename(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, body DatabaseRenameProperties, options *FleetDatabasesClientBeginRenameOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetDatabasesClient.BeginRename"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.renameCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, databaseName, body, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// renameCreateRequest creates the Rename request.
+func (client *FleetDatabasesClient) renameCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, body DatabaseRenameProperties, _ *FleetDatabasesClientBeginRenameOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/rename"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ if databaseName == "" {
+ return nil, errors.New("parameter databaseName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, body); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginRevert - Revert a database transparent data encryption (TDE).
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - databaseName - Name of the database.
+// - options - FleetDatabasesClientBeginRevertOptions contains the optional parameters for the FleetDatabasesClient.BeginRevert
+// method.
+func (client *FleetDatabasesClient) BeginRevert(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, options *FleetDatabasesClientBeginRevertOptions) (*runtime.Poller[FleetDatabasesClientRevertResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.revert(ctx, resourceGroupName, fleetName, fleetspaceName, databaseName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetDatabasesClientRevertResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetDatabasesClientRevertResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Revert - Revert a database transparent data encryption (TDE).
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetDatabasesClient) revert(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, options *FleetDatabasesClientBeginRevertOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetDatabasesClient.BeginRevert"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.revertCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, databaseName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// revertCreateRequest creates the Revert request.
+func (client *FleetDatabasesClient) revertCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, _ *FleetDatabasesClientBeginRevertOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/revert"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ if databaseName == "" {
+ return nil, errors.New("parameter databaseName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginUpdate - Updates a fleet database.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - databaseName - Name of the database.
+// - properties - The database object to patch.
+// - options - FleetDatabasesClientBeginUpdateOptions contains the optional parameters for the FleetDatabasesClient.BeginUpdate
+// method.
+func (client *FleetDatabasesClient) BeginUpdate(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, properties FleetDatabase, options *FleetDatabasesClientBeginUpdateOptions) (*runtime.Poller[FleetDatabasesClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, fleetName, fleetspaceName, databaseName, properties, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetDatabasesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetDatabasesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Updates a fleet database.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetDatabasesClient) update(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, properties FleetDatabase, options *FleetDatabasesClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetDatabasesClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, databaseName, properties, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *FleetDatabasesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, databaseName string, properties FleetDatabase, _ *FleetDatabasesClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ if databaseName == "" {
+ return nil, errors.New("parameter databaseName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleetdatabases_client_example_test.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleetdatabases_client_example_test.go
new file mode 100644
index 000000000000..0c4bee52a57f
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleetdatabases_client_example_test.go
@@ -0,0 +1,464 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager_test
+
+import (
+ "context"
+ "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/databasefleetmanager/armdatabasefleetmanager"
+ "log"
+ "time"
+)
+
+// Generated from example definition: 2025-02-01-preview/FleetDatabases_ChangeTier_MaximumSet_Gen.json
+func ExampleFleetDatabasesClient_BeginChangeTier() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetDatabasesClient().BeginChangeTier(ctx, "rg-database-operations", "data-fleet-01", "prod-environment", "customer-db-prod", armdatabasefleetmanager.DatabaseChangeTierProperties{
+ TargetTierName: to.Ptr("Standard"),
+ }, nil)
+ if err != nil {
+ log.Fatalf("failed to finish the request: %v", err)
+ }
+ _, err = poller.PollUntilDone(ctx, nil)
+ if err != nil {
+ log.Fatalf("failed to pull the result: %v", err)
+ }
+}
+
+// Generated from example definition: 2025-02-01-preview/FleetDatabases_CreateOrUpdate_MaximumSet_Gen.json
+func ExampleFleetDatabasesClient_BeginCreateOrUpdate() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetDatabasesClient().BeginCreateOrUpdate(ctx, "rg-database-operations", "data-fleet-01", "prod-environment", "customer-db-prod", armdatabasefleetmanager.FleetDatabase{
+ Properties: &armdatabasefleetmanager.FleetDatabaseProperties{
+ CreateMode: to.Ptr(armdatabasefleetmanager.DatabaseCreateModeDefault),
+ TierName: to.Ptr("Premium"),
+ RestoreFromTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:05.048Z"); return t }()),
+ SourceDatabaseName: to.Ptr("existing-db-prod"),
+ ResourceTags: map[string]*string{
+ "project": to.Ptr("Customer Data"),
+ },
+ Identity: &armdatabasefleetmanager.Identity{
+ IdentityType: to.Ptr(armdatabasefleetmanager.IdentityTypeNone),
+ UserAssignedIdentities: []*armdatabasefleetmanager.DatabaseIdentity{
+ {
+ ResourceID: to.Ptr("/subscriptions/12345678-90ab-cdef-1234-567890abcdef/resourceGroups/rg-database-operations/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-01"),
+ PrincipalID: to.Ptr("a2b3c4d5-6789-0123-4567-89abcdef1234"),
+ ClientID: to.Ptr("a2b3c4d5-6789-0123-4567-89abcdef1234"),
+ },
+ },
+ FederatedClientID: to.Ptr("a2b3c4d5-6789-0123-4567-89abcdef1234"),
+ },
+ TransparentDataEncryption: &armdatabasefleetmanager.TransparentDataEncryption{
+ KeyURI: to.Ptr("https://keyvaultname.vault.azure.net/keys/myKey/12345"),
+ Keys: []*string{
+ to.Ptr("key1"),
+ },
+ EnableAutoRotation: to.Ptr(true),
+ },
+ },
+ }, 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 = armdatabasefleetmanager.FleetDatabasesClientCreateOrUpdateResponse{
+ // FleetDatabase: &armdatabasefleetmanager.FleetDatabase{
+ // Properties: &armdatabasefleetmanager.FleetDatabaseProperties{
+ // OriginalDatabaseID: to.Ptr("uwzvasvknrwbnqgu"),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // CreateMode: to.Ptr(armdatabasefleetmanager.DatabaseCreateModeDefault),
+ // TierName: to.Ptr("Premium"),
+ // ConnectionString: to.Ptr("Server=myserver.database.windows.net;Database=customer-db-prod;User Id=user;"),
+ // Recoverable: to.Ptr(true),
+ // RestoreFromTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:05.048Z"); return t}()),
+ // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:05.048Z"); return t}()),
+ // LatestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:05.048Z"); return t}()),
+ // BackupRetentionDays: to.Ptr[int32](22),
+ // DatabaseSizeGbMax: to.Ptr[int32](100),
+ // SourceDatabaseName: to.Ptr("existing-db-prod"),
+ // ResourceTags: map[string]*string{
+ // "project": to.Ptr("Customer Data"),
+ // },
+ // Identity: &armdatabasefleetmanager.Identity{
+ // IdentityType: to.Ptr(armdatabasefleetmanager.IdentityTypeNone),
+ // UserAssignedIdentities: []*armdatabasefleetmanager.DatabaseIdentity{
+ // {
+ // ResourceID: to.Ptr("/subscriptions/12345678-90ab-cdef-1234-567890abcdef/resourceGroups/rg-database-operations/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-01"),
+ // PrincipalID: to.Ptr("a2b3c4d5-6789-0123-4567-89abcdef1234"),
+ // ClientID: to.Ptr("a2b3c4d5-6789-0123-4567-89abcdef1234"),
+ // },
+ // },
+ // FederatedClientID: to.Ptr("a2b3c4d5-6789-0123-4567-89abcdef1234"),
+ // },
+ // TransparentDataEncryption: &armdatabasefleetmanager.TransparentDataEncryption{
+ // KeyURI: to.Ptr("https://keyvaultname.vault.azure.net/keys/myKey/12345"),
+ // Keys: []*string{
+ // to.Ptr("key1"),
+ // },
+ // EnableAutoRotation: to.Ptr(true),
+ // },
+ // },
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-operations/providers/Microsoft.DatabaseFleetManager/fleet/fleetspace/database/customer-db-prod"),
+ // Name: to.Ptr("customer-db-prod"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleet/fleetspace/database"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("admin-user"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("admin-user"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-02-01-preview/FleetDatabases_Delete_MaximumSet_Gen.json
+func ExampleFleetDatabasesClient_BeginDelete() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetDatabasesClient().BeginDelete(ctx, "rg-database-operations", "data-fleet-01", "prod-environment", "customer-db-prod", nil)
+ if err != nil {
+ log.Fatalf("failed to finish the request: %v", err)
+ }
+ _, err = poller.PollUntilDone(ctx, nil)
+ if err != nil {
+ log.Fatalf("failed to pull the result: %v", err)
+ }
+}
+
+// Generated from example definition: 2025-02-01-preview/FleetDatabases_Get_MaximumSet_Gen.json
+func ExampleFleetDatabasesClient_Get() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewFleetDatabasesClient().Get(ctx, "rg-database-operations", "data-fleet-01", "prod-environment", "customer-db-prod", 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 = armdatabasefleetmanager.FleetDatabasesClientGetResponse{
+ // FleetDatabase: &armdatabasefleetmanager.FleetDatabase{
+ // Properties: &armdatabasefleetmanager.FleetDatabaseProperties{
+ // OriginalDatabaseID: to.Ptr("uwzvasvknrwbnqgu"),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // CreateMode: to.Ptr(armdatabasefleetmanager.DatabaseCreateModeDefault),
+ // TierName: to.Ptr("Premium"),
+ // ConnectionString: to.Ptr("Server=myserver.database.windows.net;Database=customer-db-prod;User Id=user;"),
+ // Recoverable: to.Ptr(true),
+ // RestoreFromTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:05.048Z"); return t}()),
+ // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:05.048Z"); return t}()),
+ // LatestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:05.048Z"); return t}()),
+ // BackupRetentionDays: to.Ptr[int32](22),
+ // DatabaseSizeGbMax: to.Ptr[int32](100),
+ // SourceDatabaseName: to.Ptr("existing-db-prod"),
+ // ResourceTags: map[string]*string{
+ // "project": to.Ptr("Customer Data"),
+ // },
+ // Identity: &armdatabasefleetmanager.Identity{
+ // IdentityType: to.Ptr(armdatabasefleetmanager.IdentityTypeNone),
+ // UserAssignedIdentities: []*armdatabasefleetmanager.DatabaseIdentity{
+ // {
+ // ResourceID: to.Ptr("/subscriptions/12345678-90ab-cdef-1234-567890abcdef/resourceGroups/rg-database-operations/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-01"),
+ // PrincipalID: to.Ptr("a2b3c4d5-6789-0123-4567-89abcdef1234"),
+ // ClientID: to.Ptr("a2b3c4d5-6789-0123-4567-89abcdef1234"),
+ // },
+ // },
+ // FederatedClientID: to.Ptr("a2b3c4d5-6789-0123-4567-89abcdef1234"),
+ // },
+ // TransparentDataEncryption: &armdatabasefleetmanager.TransparentDataEncryption{
+ // KeyURI: to.Ptr("https://keyvaultname.vault.azure.net/keys/myKey/12345"),
+ // Keys: []*string{
+ // to.Ptr("key1"),
+ // },
+ // EnableAutoRotation: to.Ptr(true),
+ // },
+ // },
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-operations/providers/Microsoft.DatabaseFleetManager/fleets/fleet-01/fleetspaces/prod-environment/databases/customer-db-prod"),
+ // Name: to.Ptr("customer-db-prod"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets/fleetspaces/databases"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("admin-user"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("admin-user"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-02-01-preview/FleetDatabases_ListByFleetspace_MaximumSet_Gen.json
+func ExampleFleetDatabasesClient_NewListByFleetspacePager() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ pager := clientFactory.NewFleetDatabasesClient().NewListByFleetspacePager("rg-database-operations", "data-fleet-01", "prod-environment", &FleetDatabasesClientListByFleetspaceOptions{
+ Skip: to.Ptr[int64](24),
+ Top: to.Ptr[int64](2),
+ Filter: to.Ptr("tier eq 'Premium'"),
+ Skiptoken: to.Ptr("sbrskcoueja")})
+ 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 = armdatabasefleetmanager.FleetDatabasesClientListByFleetspaceResponse{
+ // FleetDatabaseListResult: armdatabasefleetmanager.FleetDatabaseListResult{
+ // Value: []*armdatabasefleetmanager.FleetDatabase{
+ // {
+ // Properties: &armdatabasefleetmanager.FleetDatabaseProperties{
+ // OriginalDatabaseID: to.Ptr("uwzvasvknrwbnqgu"),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // CreateMode: to.Ptr(armdatabasefleetmanager.DatabaseCreateModeDefault),
+ // TierName: to.Ptr("Premium"),
+ // ConnectionString: to.Ptr("Server=myserver.database.windows.net;Database=customer-db-prod;User Id=user;"),
+ // Recoverable: to.Ptr(true),
+ // RestoreFromTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:05.048Z"); return t}()),
+ // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:05.048Z"); return t}()),
+ // LatestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:05.048Z"); return t}()),
+ // BackupRetentionDays: to.Ptr[int32](22),
+ // DatabaseSizeGbMax: to.Ptr[int32](100),
+ // SourceDatabaseName: to.Ptr("existing-db-prod"),
+ // ResourceTags: map[string]*string{
+ // "project": to.Ptr("Customer Data"),
+ // },
+ // Identity: &armdatabasefleetmanager.Identity{
+ // IdentityType: to.Ptr(armdatabasefleetmanager.IdentityTypeNone),
+ // UserAssignedIdentities: []*armdatabasefleetmanager.DatabaseIdentity{
+ // {
+ // ResourceID: to.Ptr("/subscriptions/12345678-90ab-cdef-1234-567890abcdef/resourceGroups/rg-database-operations/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-01"),
+ // PrincipalID: to.Ptr("a2b3c4d5-6789-0123-4567-89abcdef1234"),
+ // ClientID: to.Ptr("a2b3c4d5-6789-0123-4567-89abcdef1234"),
+ // },
+ // },
+ // FederatedClientID: to.Ptr("a2b3c4d5-6789-0123-4567-89abcdef1234"),
+ // },
+ // TransparentDataEncryption: &armdatabasefleetmanager.TransparentDataEncryption{
+ // KeyURI: to.Ptr("https://keyvaultname.vault.azure.net/keys/myKey/12345"),
+ // Keys: []*string{
+ // to.Ptr("key1"),
+ // },
+ // EnableAutoRotation: to.Ptr(true),
+ // },
+ // },
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-operations/providers/Microsoft.DatabaseFleetManager/fleets/fleet-01/fleetspaces/prod-environment/databases/customer-db-prod"),
+ // Name: to.Ptr("customer-db-prod"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets/fleetspaces/databases"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("admin-user"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("admin-user"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // },
+ // NextLink: to.Ptr("https://microsoft.com/ajgwcc"),
+ // },
+ // }
+ }
+}
+
+// Generated from example definition: 2025-02-01-preview/FleetDatabases_Rename_MaximumSet_Gen.json
+func ExampleFleetDatabasesClient_BeginRename() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetDatabasesClient().BeginRename(ctx, "rg-database-operations", "data-fleet-01", "prod-environment", "customer-db-prod", armdatabasefleetmanager.DatabaseRenameProperties{
+ NewName: to.Ptr("new-customer-db-prod"),
+ }, nil)
+ if err != nil {
+ log.Fatalf("failed to finish the request: %v", err)
+ }
+ _, err = poller.PollUntilDone(ctx, nil)
+ if err != nil {
+ log.Fatalf("failed to pull the result: %v", err)
+ }
+}
+
+// Generated from example definition: 2025-02-01-preview/FleetDatabases_Revert_MaximumSet_Gen.json
+func ExampleFleetDatabasesClient_BeginRevert() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetDatabasesClient().BeginRevert(ctx, "rg-database-operations", "data-fleet-01", "prod-environment", "customer-db-prod", nil)
+ if err != nil {
+ log.Fatalf("failed to finish the request: %v", err)
+ }
+ _, err = poller.PollUntilDone(ctx, nil)
+ if err != nil {
+ log.Fatalf("failed to pull the result: %v", err)
+ }
+}
+
+// Generated from example definition: 2025-02-01-preview/FleetDatabases_Update_MaximumSet_Gen.json
+func ExampleFleetDatabasesClient_BeginUpdate() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetDatabasesClient().BeginUpdate(ctx, "rgdatabasefleetmanager", "production-fleet", "primary-space", "customer-database-prod", armdatabasefleetmanager.FleetDatabase{
+ Properties: &armdatabasefleetmanager.FleetDatabaseProperties{
+ CreateMode: to.Ptr(armdatabasefleetmanager.DatabaseCreateModeDefault),
+ TierName: to.Ptr("Standard"),
+ RestoreFromTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:05.048Z"); return t }()),
+ SourceDatabaseName: to.Ptr("customer-database-staging"),
+ ResourceTags: map[string]*string{
+ "environment": to.Ptr("production"),
+ "owner": to.Ptr("database-team"),
+ },
+ Identity: &armdatabasefleetmanager.Identity{
+ IdentityType: to.Ptr(armdatabasefleetmanager.IdentityTypeUserAssigned),
+ UserAssignedIdentities: []*armdatabasefleetmanager.DatabaseIdentity{
+ {
+ ResourceID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourcegroups/rgdatabasefleetmanager/providers/Microsoft.ManagedIdentity/userAssignedIdentities/db-identity"),
+ PrincipalID: to.Ptr("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"),
+ ClientID: to.Ptr("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"),
+ },
+ },
+ FederatedClientID: to.Ptr("a2b3c4d5-6789-0123-4567-89abcdef1234"),
+ },
+ TransparentDataEncryption: &armdatabasefleetmanager.TransparentDataEncryption{
+ KeyURI: to.Ptr("https://keyvault-contoso.vault.azure.net/keys/db-encryption-key/abc123"),
+ Keys: []*string{
+ to.Ptr("abc123"),
+ to.Ptr("xyz789"),
+ },
+ EnableAutoRotation: to.Ptr(true),
+ },
+ },
+ }, 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 = armdatabasefleetmanager.FleetDatabasesClientUpdateResponse{
+ // FleetDatabase: &armdatabasefleetmanager.FleetDatabase{
+ // Properties: &armdatabasefleetmanager.FleetDatabaseProperties{
+ // OriginalDatabaseID: to.Ptr("uwzvasvknrwbnqgu"),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // CreateMode: to.Ptr(armdatabasefleetmanager.DatabaseCreateModeDefault),
+ // TierName: to.Ptr("Standard"),
+ // ConnectionString: to.Ptr("Server=tcp:dbserver.contoso.com;Database=customer-database-prod;User ID=dbadmin;"),
+ // Recoverable: to.Ptr(true),
+ // RestoreFromTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:05.048Z"); return t}()),
+ // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:05.048Z"); return t}()),
+ // LatestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:05.048Z"); return t}()),
+ // BackupRetentionDays: to.Ptr[int32](30),
+ // DatabaseSizeGbMax: to.Ptr[int32](500),
+ // SourceDatabaseName: to.Ptr("customer-database-staging"),
+ // ResourceTags: map[string]*string{
+ // "environment": to.Ptr("production"),
+ // "owner": to.Ptr("database-team"),
+ // },
+ // Identity: &armdatabasefleetmanager.Identity{
+ // IdentityType: to.Ptr(armdatabasefleetmanager.IdentityTypeUserAssigned),
+ // UserAssignedIdentities: []*armdatabasefleetmanager.DatabaseIdentity{
+ // {
+ // ResourceID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourcegroups/rgdatabasefleetmanager/providers/Microsoft.ManagedIdentity/userAssignedIdentities/db-identity"),
+ // PrincipalID: to.Ptr("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"),
+ // ClientID: to.Ptr("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"),
+ // },
+ // },
+ // FederatedClientID: to.Ptr("a2b3c4d5-6789-0123-4567-89abcdef1234"),
+ // },
+ // TransparentDataEncryption: &armdatabasefleetmanager.TransparentDataEncryption{
+ // KeyURI: to.Ptr("https://keyvault-contoso.vault.azure.net/keys/db-encryption-key/abc123"),
+ // Keys: []*string{
+ // to.Ptr("abc123"),
+ // to.Ptr("xyz789"),
+ // },
+ // EnableAutoRotation: to.Ptr(true),
+ // },
+ // },
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-operations/providers/Microsoft.DatabaseFleetManager/fleets/fleet-01/fleetspaces/prod-environment/databases/customer-db-prod"),
+ // Name: to.Ptr("customer-db-prod"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets/fleetspaces/databases"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("adminUser"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("adminUser"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // }
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleets_client.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleets_client.go
new file mode 100644
index 000000000000..6804c316ea53
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleets_client.go
@@ -0,0 +1,464 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// FleetsClient contains the methods for the Fleets group.
+// Don't use this type directly, use NewFleetsClient() instead.
+type FleetsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewFleetsClient creates a new instance of FleetsClient with the specified values.
+// - subscriptionID - The ID of the target subscription. The value must be an UUID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewFleetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FleetsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &FleetsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Creates or updates a fleet resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - resource - The fleet object to create or update.
+// - options - FleetsClientBeginCreateOrUpdateOptions contains the optional parameters for the FleetsClient.BeginCreateOrUpdate
+// method.
+func (client *FleetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, resource Fleet, options *FleetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[FleetsClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, fleetName, resource, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Creates or updates a fleet resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, resource Fleet, options *FleetsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetsClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, fleetName, resource, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *FleetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, resource Fleet, _ *FleetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, resource); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Deletes a fleet.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - options - FleetsClientBeginDeleteOptions contains the optional parameters for the FleetsClient.BeginDelete method.
+func (client *FleetsClient) BeginDelete(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientBeginDeleteOptions) (*runtime.Poller[FleetsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, fleetName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Deletes a fleet.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetsClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, fleetName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *FleetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, _ *FleetsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets a fleet resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - options - FleetsClientGetOptions contains the optional parameters for the FleetsClient.Get method.
+func (client *FleetsClient) Get(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientGetOptions) (FleetsClientGetResponse, error) {
+ var err error
+ const operationName = "FleetsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, fleetName, options)
+ if err != nil {
+ return FleetsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FleetsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FleetsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *FleetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, _ *FleetsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *FleetsClient) getHandleResponse(resp *http.Response) (FleetsClientGetResponse, error) {
+ result := FleetsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Fleet); err != nil {
+ return FleetsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets all fleets in a subscription.
+//
+// Generated from API version 2025-02-01-preview
+// - options - FleetsClientListOptions contains the optional parameters for the FleetsClient.NewListPager method.
+func (client *FleetsClient) NewListPager(options *FleetsClientListOptions) *runtime.Pager[FleetsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[FleetsClientListResponse]{
+ More: func(page FleetsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *FleetsClientListResponse) (FleetsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FleetsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return FleetsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *FleetsClient) listCreateRequest(ctx context.Context, _ *FleetsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DatabaseFleetManager/fleets"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *FleetsClient) listHandleResponse(resp *http.Response) (FleetsClientListResponse, error) {
+ result := FleetsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FleetListResult); err != nil {
+ return FleetsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - Gets all fleets in a resource group.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - options - FleetsClientListByResourceGroupOptions contains the optional parameters for the FleetsClient.NewListByResourceGroupPager
+// method.
+func (client *FleetsClient) NewListByResourceGroupPager(resourceGroupName string, options *FleetsClientListByResourceGroupOptions) *runtime.Pager[FleetsClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[FleetsClientListByResourceGroupResponse]{
+ More: func(page FleetsClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *FleetsClientListByResourceGroupResponse) (FleetsClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FleetsClient.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return FleetsClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *FleetsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *FleetsClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Skip != nil {
+ reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10))
+ }
+ if options != nil && options.Skiptoken != nil {
+ reqQP.Set("$skiptoken", *options.Skiptoken)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(*options.Top, 10))
+ }
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *FleetsClient) listByResourceGroupHandleResponse(resp *http.Response) (FleetsClientListByResourceGroupResponse, error) {
+ result := FleetsClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FleetListResult); err != nil {
+ return FleetsClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - Modifies a fleet resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - properties - The fleet object to patch.
+// - options - FleetsClientBeginUpdateOptions contains the optional parameters for the FleetsClient.BeginUpdate method.
+func (client *FleetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, fleetName string, properties FleetUpdate, options *FleetsClientBeginUpdateOptions) (*runtime.Poller[FleetsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, fleetName, properties, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Modifies a fleet resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetsClient) update(ctx context.Context, resourceGroupName string, fleetName string, properties FleetUpdate, options *FleetsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, fleetName, properties, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *FleetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, properties FleetUpdate, _ *FleetsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleets_client_example_test.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleets_client_example_test.go
new file mode 100644
index 000000000000..23ed412afd59
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleets_client_example_test.go
@@ -0,0 +1,302 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager_test
+
+import (
+ "context"
+ "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/databasefleetmanager/armdatabasefleetmanager"
+ "log"
+)
+
+// Generated from example definition: 2025-02-01-preview/Fleets_CreateOrUpdate_MaximumSet_Gen.json
+func ExampleFleetsClient_BeginCreateOrUpdate() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetsClient().BeginCreateOrUpdate(ctx, "rg-database-fleet-manager", "production-fleet-01", armdatabasefleetmanager.Fleet{
+ Properties: &armdatabasefleetmanager.FleetProperties{
+ Description: to.Ptr("Production fleet for high availability and scalability."),
+ },
+ Tags: map[string]*string{
+ "environment": to.Ptr("production"),
+ "owner": to.Ptr("team-database"),
+ },
+ Location: to.Ptr("East US"),
+ }, 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 = armdatabasefleetmanager.FleetsClientCreateOrUpdateResponse{
+ // Fleet: &armdatabasefleetmanager.Fleet{
+ // Properties: &armdatabasefleetmanager.FleetProperties{
+ // Description: to.Ptr("Production fleet for high availability and scalability."),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // },
+ // Tags: map[string]*string{
+ // "environment": to.Ptr("production"),
+ // "owner": to.Ptr("team-database"),
+ // },
+ // Location: to.Ptr("East US"),
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-fleet-manager/providers/Microsoft.DatabaseFleetManager/fleet/production-fleet-01"),
+ // Name: to.Ptr("production-fleet-01"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("adminuser"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("adminuser"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-02-01-preview/Fleets_Delete_MaximumSet_Gen.json
+func ExampleFleetsClient_BeginDelete() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetsClient().BeginDelete(ctx, "rg-database-fleet-manager", "production-fleet-01", nil)
+ if err != nil {
+ log.Fatalf("failed to finish the request: %v", err)
+ }
+ _, err = poller.PollUntilDone(ctx, nil)
+ if err != nil {
+ log.Fatalf("failed to pull the result: %v", err)
+ }
+}
+
+// Generated from example definition: 2025-02-01-preview/Fleets_Get_MaximumSet_Gen.json
+func ExampleFleetsClient_Get() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewFleetsClient().Get(ctx, "rg-database-fleet-manager", "production-fleet-01", 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 = armdatabasefleetmanager.FleetsClientGetResponse{
+ // Fleet: &armdatabasefleetmanager.Fleet{
+ // Properties: &armdatabasefleetmanager.FleetProperties{
+ // Description: to.Ptr("Production fleet for high availability and scalability."),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // },
+ // Tags: map[string]*string{
+ // "environment": to.Ptr("production"),
+ // "owner": to.Ptr("team-database"),
+ // },
+ // Location: to.Ptr("East US"),
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-fleet-manager/providers/Microsoft.DatabaseFleetManager/fleet/production-fleet-01"),
+ // Name: to.Ptr("production-fleet-01"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("adminuser"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("adminuser"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-02-01-preview/Fleets_List_MaximumSet_Gen.json
+func ExampleFleetsClient_NewListPager() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ pager := clientFactory.NewFleetsClient().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 = armdatabasefleetmanager.FleetsClientListResponse{
+ // FleetListResult: armdatabasefleetmanager.FleetListResult{
+ // Value: []*armdatabasefleetmanager.Fleet{
+ // {
+ // Properties: &armdatabasefleetmanager.FleetProperties{
+ // Description: to.Ptr("Fleet containing critical production databases."),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // },
+ // Tags: map[string]*string{
+ // "environment": to.Ptr("production"),
+ // "owner": to.Ptr("team-database"),
+ // },
+ // Location: to.Ptr("East US"),
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-fleet-manager/providers/Microsoft.DatabaseFleetManager/fleet/critical-production-fleet"),
+ // Name: to.Ptr("critical-production-fleet"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("adminuser"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("adminuser"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // },
+ // NextLink: to.Ptr("https://microsoft.com/a"),
+ // },
+ // }
+ }
+}
+
+// Generated from example definition: 2025-02-01-preview/Fleets_ListByResourceGroup_MaximumSet_Gen.json
+func ExampleFleetsClient_NewListByResourceGroupPager() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ pager := clientFactory.NewFleetsClient().NewListByResourceGroupPager("rg-database-fleet-manager", &FleetsClientListByResourceGroupOptions{
+ Skip: to.Ptr[int64](6),
+ Top: to.Ptr[int64](30),
+ Skiptoken: to.Ptr("ovlavzakdncfvvbdhqkal")})
+ 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 = armdatabasefleetmanager.FleetsClientListByResourceGroupResponse{
+ // FleetListResult: armdatabasefleetmanager.FleetListResult{
+ // Value: []*armdatabasefleetmanager.Fleet{
+ // {
+ // Properties: &armdatabasefleetmanager.FleetProperties{
+ // Description: to.Ptr("Production fleet for critical workloads."),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // },
+ // Tags: map[string]*string{
+ // "environment": to.Ptr("production"),
+ // "owner": to.Ptr("team-database"),
+ // },
+ // Location: to.Ptr("East US"),
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-fleet-manager/providers/Microsoft.DatabaseFleetManager/fleet/production-fleet-01"),
+ // Name: to.Ptr("production-fleet-01"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("adminuser"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("adminuser"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // },
+ // NextLink: to.Ptr("https://microsoft.com/a"),
+ // },
+ // }
+ }
+}
+
+// Generated from example definition: 2025-02-01-preview/Fleets_Update_MaximumSet_Gen.json
+func ExampleFleetsClient_BeginUpdate() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetsClient().BeginUpdate(ctx, "rg-database-fleet-manager", "critical-production-fleet", armdatabasefleetmanager.FleetUpdate{
+ Properties: &armdatabasefleetmanager.FleetProperties{
+ Description: to.Ptr("Fleet containing critical production databases and high availability configurations."),
+ },
+ Tags: map[string]*string{
+ "environment": to.Ptr("production"),
+ "owner": to.Ptr("team-database"),
+ },
+ }, 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 = armdatabasefleetmanager.FleetsClientUpdateResponse{
+ // Fleet: &armdatabasefleetmanager.Fleet{
+ // Properties: &armdatabasefleetmanager.FleetProperties{
+ // Description: to.Ptr("Fleet containing critical production databases and high availability configurations."),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // },
+ // Tags: map[string]*string{
+ // "environment": to.Ptr("production"),
+ // "owner": to.Ptr("team-database"),
+ // },
+ // Location: to.Ptr("East US"),
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-fleet-manager/providers/Microsoft.DatabaseFleetManager/fleet/critical-production-fleet"),
+ // Name: to.Ptr("critical-production-fleet"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("adminuser"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("adminuser"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // }
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleetspaces_client.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleetspaces_client.go
new file mode 100644
index 000000000000..deac337442c9
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleetspaces_client.go
@@ -0,0 +1,602 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// FleetspacesClient contains the methods for the Fleetspaces group.
+// Don't use this type directly, use NewFleetspacesClient() instead.
+type FleetspacesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewFleetspacesClient creates a new instance of FleetspacesClient with the specified values.
+// - subscriptionID - The ID of the target subscription. The value must be an UUID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewFleetspacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FleetspacesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &FleetspacesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Creates or updates a fleetspace resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - resource - The fleet object to create or update.
+// - options - FleetspacesClientBeginCreateOrUpdateOptions contains the optional parameters for the FleetspacesClient.BeginCreateOrUpdate
+// method.
+func (client *FleetspacesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, resource Fleetspace, options *FleetspacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[FleetspacesClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, fleetName, fleetspaceName, resource, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetspacesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetspacesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Creates or updates a fleetspace resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetspacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, resource Fleetspace, options *FleetspacesClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetspacesClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, resource, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *FleetspacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, resource Fleetspace, _ *FleetspacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, resource); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Deletes a fleetspace.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - options - FleetspacesClientBeginDeleteOptions contains the optional parameters for the FleetspacesClient.BeginDelete method.
+func (client *FleetspacesClient) BeginDelete(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, options *FleetspacesClientBeginDeleteOptions) (*runtime.Poller[FleetspacesClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, fleetName, fleetspaceName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetspacesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetspacesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Deletes a fleetspace.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetspacesClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, options *FleetspacesClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetspacesClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *FleetspacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, _ *FleetspacesClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets fleetspace resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - options - FleetspacesClientGetOptions contains the optional parameters for the FleetspacesClient.Get method.
+func (client *FleetspacesClient) Get(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, options *FleetspacesClientGetOptions) (FleetspacesClientGetResponse, error) {
+ var err error
+ const operationName = "FleetspacesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, options)
+ if err != nil {
+ return FleetspacesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FleetspacesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FleetspacesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *FleetspacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, _ *FleetspacesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *FleetspacesClient) getHandleResponse(resp *http.Response) (FleetspacesClientGetResponse, error) {
+ result := FleetspacesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Fleetspace); err != nil {
+ return FleetspacesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByFleetPager - Lists fleetspaces in a fleet.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - options - FleetspacesClientListByFleetOptions contains the optional parameters for the FleetspacesClient.NewListByFleetPager
+// method.
+func (client *FleetspacesClient) NewListByFleetPager(resourceGroupName string, fleetName string, options *FleetspacesClientListByFleetOptions) *runtime.Pager[FleetspacesClientListByFleetResponse] {
+ return runtime.NewPager(runtime.PagingHandler[FleetspacesClientListByFleetResponse]{
+ More: func(page FleetspacesClientListByFleetResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *FleetspacesClientListByFleetResponse) (FleetspacesClientListByFleetResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FleetspacesClient.NewListByFleetPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByFleetCreateRequest(ctx, resourceGroupName, fleetName, options)
+ }, nil)
+ if err != nil {
+ return FleetspacesClientListByFleetResponse{}, err
+ }
+ return client.listByFleetHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByFleetCreateRequest creates the ListByFleet request.
+func (client *FleetspacesClient) listByFleetCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, options *FleetspacesClientListByFleetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Skip != nil {
+ reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10))
+ }
+ if options != nil && options.Skiptoken != nil {
+ reqQP.Set("$skiptoken", *options.Skiptoken)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(*options.Top, 10))
+ }
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByFleetHandleResponse handles the ListByFleet response.
+func (client *FleetspacesClient) listByFleetHandleResponse(resp *http.Response) (FleetspacesClientListByFleetResponse, error) {
+ result := FleetspacesClientListByFleetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FleetspaceListResult); err != nil {
+ return FleetspacesClientListByFleetResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginRegisterServer - Migrates an existing logical server into fleet.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - body - The details of the register server operation.
+// - options - FleetspacesClientBeginRegisterServerOptions contains the optional parameters for the FleetspacesClient.BeginRegisterServer
+// method.
+func (client *FleetspacesClient) BeginRegisterServer(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, body RegisterServerProperties, options *FleetspacesClientBeginRegisterServerOptions) (*runtime.Poller[FleetspacesClientRegisterServerResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.registerServer(ctx, resourceGroupName, fleetName, fleetspaceName, body, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetspacesClientRegisterServerResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetspacesClientRegisterServerResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// RegisterServer - Migrates an existing logical server into fleet.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetspacesClient) registerServer(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, body RegisterServerProperties, options *FleetspacesClientBeginRegisterServerOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetspacesClient.BeginRegisterServer"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.registerServerCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, body, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// registerServerCreateRequest creates the RegisterServer request.
+func (client *FleetspacesClient) registerServerCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, body RegisterServerProperties, _ *FleetspacesClientBeginRegisterServerOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/registerServer"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, body); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginUnregister - Unregisters all databases from a fleetspace
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - options - FleetspacesClientBeginUnregisterOptions contains the optional parameters for the FleetspacesClient.BeginUnregister
+// method.
+func (client *FleetspacesClient) BeginUnregister(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, options *FleetspacesClientBeginUnregisterOptions) (*runtime.Poller[FleetspacesClientUnregisterResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.unregister(ctx, resourceGroupName, fleetName, fleetspaceName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetspacesClientUnregisterResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetspacesClientUnregisterResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Unregister - Unregisters all databases from a fleetspace
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetspacesClient) unregister(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, options *FleetspacesClientBeginUnregisterOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetspacesClient.BeginUnregister"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.unregisterCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// unregisterCreateRequest creates the Unregister request.
+func (client *FleetspacesClient) unregisterCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, _ *FleetspacesClientBeginUnregisterOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/unregister"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginUpdate - Modifies a fleetspace resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - fleetspaceName - Name of the fleetspace.
+// - properties - The resource properties to be updated.
+// - options - FleetspacesClientBeginUpdateOptions contains the optional parameters for the FleetspacesClient.BeginUpdate method.
+func (client *FleetspacesClient) BeginUpdate(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, properties Fleetspace, options *FleetspacesClientBeginUpdateOptions) (*runtime.Poller[FleetspacesClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, fleetName, fleetspaceName, properties, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetspacesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetspacesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Modifies a fleetspace resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetspacesClient) update(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, properties Fleetspace, options *FleetspacesClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetspacesClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, fleetName, fleetspaceName, properties, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *FleetspacesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, fleetspaceName string, properties Fleetspace, _ *FleetspacesClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if fleetspaceName == "" {
+ return nil, errors.New("parameter fleetspaceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetspaceName}", url.PathEscape(fleetspaceName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleetspaces_client_example_test.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleetspaces_client_example_test.go
new file mode 100644
index 000000000000..6193cffa4759
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleetspaces_client_example_test.go
@@ -0,0 +1,315 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager_test
+
+import (
+ "context"
+ "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/databasefleetmanager/armdatabasefleetmanager"
+ "log"
+)
+
+// Generated from example definition: 2025-02-01-preview/Fleetspaces_CreateOrUpdate_MaximumSet_Gen.json
+func ExampleFleetspacesClient_BeginCreateOrUpdate() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetspacesClient().BeginCreateOrUpdate(ctx, "rgdatabasefleetmanager", "production-fleet", "primary-space", armdatabasefleetmanager.Fleetspace{
+ Properties: &armdatabasefleetmanager.FleetspaceProperties{
+ CapacityMax: to.Ptr[int32](150000),
+ MainPrincipal: &armdatabasefleetmanager.MainPrincipal{
+ Login: to.Ptr("adminUser"),
+ ApplicationID: to.Ptr("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"),
+ ObjectID: to.Ptr("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"),
+ TenantID: to.Ptr("bde45d44-ec42-45b8-a5a2-c5b998c65ef6"),
+ PrincipalType: to.Ptr(armdatabasefleetmanager.PrincipalTypeApplication),
+ },
+ },
+ }, 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 = armdatabasefleetmanager.FleetspacesClientCreateOrUpdateResponse{
+ // Fleetspace: &armdatabasefleetmanager.Fleetspace{
+ // Properties: &armdatabasefleetmanager.FleetspaceProperties{
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // CapacityMax: to.Ptr[int32](150000),
+ // MainPrincipal: &armdatabasefleetmanager.MainPrincipal{
+ // Login: to.Ptr("adminUser"),
+ // ApplicationID: to.Ptr("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"),
+ // ObjectID: to.Ptr("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"),
+ // TenantID: to.Ptr("bde45d44-ec42-45b8-a5a2-c5b998c65ef6"),
+ // PrincipalType: to.Ptr(armdatabasefleetmanager.PrincipalTypeApplication),
+ // },
+ // },
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-operations/providers/Microsoft.DatabaseFleetManager/fleet/fleet-01/fleetspace/primary-space"),
+ // Name: to.Ptr("customer-db-prod"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets/fleetspaces"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("adminUser"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("adminUser"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-02-01-preview/Fleetspaces_Delete_MaximumSet_Gen.json
+func ExampleFleetspacesClient_BeginDelete() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetspacesClient().BeginDelete(ctx, "rgdatabasefleetmanager", "production-fleet", "primary-space", nil)
+ if err != nil {
+ log.Fatalf("failed to finish the request: %v", err)
+ }
+ _, err = poller.PollUntilDone(ctx, nil)
+ if err != nil {
+ log.Fatalf("failed to pull the result: %v", err)
+ }
+}
+
+// Generated from example definition: 2025-02-01-preview/Fleetspaces_Get_MaximumSet_Gen.json
+func ExampleFleetspacesClient_Get() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewFleetspacesClient().Get(ctx, "rgdatabasefleetmanager", "production-fleet", "primary-space", 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 = armdatabasefleetmanager.FleetspacesClientGetResponse{
+ // Fleetspace: &armdatabasefleetmanager.Fleetspace{
+ // Properties: &armdatabasefleetmanager.FleetspaceProperties{
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // CapacityMax: to.Ptr[int32](13),
+ // MainPrincipal: &armdatabasefleetmanager.MainPrincipal{
+ // Login: to.Ptr("xijrmaod"),
+ // ApplicationID: to.Ptr("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"),
+ // ObjectID: to.Ptr("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"),
+ // TenantID: to.Ptr("bde45d44-ec42-45b8-a5a2-c5b998c65ef6"),
+ // PrincipalType: to.Ptr(armdatabasefleetmanager.PrincipalTypeApplication),
+ // },
+ // },
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-operations/providers/Microsoft.DatabaseFleetManager/fleet/fleet-01/fleetspace/primary-space"),
+ // Name: to.Ptr("customer-db-prod"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets/fleetspaces"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("ckmcfjpuwvncpuluhk"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("o"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-02-01-preview/Fleetspaces_ListByFleet_MaximumSet_Gen.json
+func ExampleFleetspacesClient_NewListByFleetPager() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ pager := clientFactory.NewFleetspacesClient().NewListByFleetPager("rg-database-fleet-manager", "production-fleet", &FleetspacesClientListByFleetOptions{
+ Skip: to.Ptr[int64](27),
+ Top: to.Ptr[int64](7),
+ Skiptoken: to.Ptr("qaorjlbhvuntmn")})
+ 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 = armdatabasefleetmanager.FleetspacesClientListByFleetResponse{
+ // FleetspaceListResult: armdatabasefleetmanager.FleetspaceListResult{
+ // Value: []*armdatabasefleetmanager.Fleetspace{
+ // {
+ // Properties: &armdatabasefleetmanager.FleetspaceProperties{
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // CapacityMax: to.Ptr[int32](1000),
+ // MainPrincipal: &armdatabasefleetmanager.MainPrincipal{
+ // Login: to.Ptr("admin-prod"),
+ // ApplicationID: to.Ptr("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"),
+ // ObjectID: to.Ptr("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"),
+ // TenantID: to.Ptr("bde45d44-ec42-45b8-a5a2-c5b998c65ef6"),
+ // PrincipalType: to.Ptr(armdatabasefleetmanager.PrincipalTypeApplication),
+ // },
+ // },
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-operations/providers/Microsoft.DatabaseFleetManager/fleet/fleet-01/fleetspace/primary-space"),
+ // Name: to.Ptr("customer-db-prod"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets/fleetspaces"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("john.doe@company.com"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("jane.smith@company.com"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // },
+ // NextLink: to.Ptr("https://microsoft.com/a"),
+ // },
+ // }
+ }
+}
+
+// Generated from example definition: 2025-02-01-preview/Fleetspaces_RegisterServer_MaximumSet_Gen.json
+func ExampleFleetspacesClient_BeginRegisterServer() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetspacesClient().BeginRegisterServer(ctx, "rg-database-fleet-manager", "production-fleet", "primary-space", armdatabasefleetmanager.RegisterServerProperties{
+ TierName: to.Ptr("Standard"),
+ SourceSubscriptionID: to.Ptr("c76e2b32-46c7-4325-8f4f-476828a5b207"),
+ SourceResourceGroupName: to.Ptr("rg-source-database"),
+ SourceServerName: to.Ptr("source-db-server-prod"),
+ DestinationTierOverrides: []*armdatabasefleetmanager.DestinationTierOverride{
+ {
+ ResourceType: to.Ptr(armdatabasefleetmanager.ResourceTypeDatabase),
+ TierName: to.Ptr("bronze"),
+ ResourceName: to.Ptr("source-db-prod"),
+ },
+ },
+ }, nil)
+ if err != nil {
+ log.Fatalf("failed to finish the request: %v", err)
+ }
+ _, err = poller.PollUntilDone(ctx, nil)
+ if err != nil {
+ log.Fatalf("failed to pull the result: %v", err)
+ }
+}
+
+// Generated from example definition: 2025-02-01-preview/Fleetspaces_Unregister_MaximumSet_Gen.json
+func ExampleFleetspacesClient_BeginUnregister() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetspacesClient().BeginUnregister(ctx, "rg-database-fleet-manager", "production-fleet", "primary-space", nil)
+ if err != nil {
+ log.Fatalf("failed to finish the request: %v", err)
+ }
+ _, err = poller.PollUntilDone(ctx, nil)
+ if err != nil {
+ log.Fatalf("failed to pull the result: %v", err)
+ }
+}
+
+// Generated from example definition: 2025-02-01-preview/Fleetspaces_Update_MaximumSet_Gen.json
+func ExampleFleetspacesClient_BeginUpdate() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetspacesClient().BeginUpdate(ctx, "rg-database-fleet-manager", "production-fleet", "primary-space", armdatabasefleetmanager.Fleetspace{
+ Properties: &armdatabasefleetmanager.FleetspaceProperties{
+ CapacityMax: to.Ptr[int32](150000),
+ MainPrincipal: &armdatabasefleetmanager.MainPrincipal{
+ Login: to.Ptr("adminUser"),
+ ApplicationID: to.Ptr("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"),
+ ObjectID: to.Ptr("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"),
+ TenantID: to.Ptr("bde45d44-ec42-45b8-a5a2-c5b998c65ef6"),
+ PrincipalType: to.Ptr(armdatabasefleetmanager.PrincipalTypeApplication),
+ },
+ },
+ }, 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 = armdatabasefleetmanager.FleetspacesClientUpdateResponse{
+ // Fleetspace: &armdatabasefleetmanager.Fleetspace{
+ // Properties: &armdatabasefleetmanager.FleetspaceProperties{
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // CapacityMax: to.Ptr[int32](150000),
+ // MainPrincipal: &armdatabasefleetmanager.MainPrincipal{
+ // Login: to.Ptr("adminUser"),
+ // ApplicationID: to.Ptr("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"),
+ // ObjectID: to.Ptr("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"),
+ // TenantID: to.Ptr("bde45d44-ec42-45b8-a5a2-c5b998c65ef6"),
+ // PrincipalType: to.Ptr(armdatabasefleetmanager.PrincipalTypeApplication),
+ // },
+ // },
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-operations/providers/Microsoft.DatabaseFleetManager/fleet/fleet-01/fleetspace/primary-space"),
+ // Name: to.Ptr("customer-db-prod"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets/fleetspaces"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("adminUser"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("adminUser"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // }
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleettiers_client.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleettiers_client.go
new file mode 100644
index 000000000000..14386cb5005a
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleettiers_client.go
@@ -0,0 +1,504 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// FleetTiersClient contains the methods for the FleetTiers group.
+// Don't use this type directly, use NewFleetTiersClient() instead.
+type FleetTiersClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewFleetTiersClient creates a new instance of FleetTiersClient with the specified values.
+// - subscriptionID - The ID of the target subscription. The value must be an UUID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewFleetTiersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FleetTiersClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &FleetTiersClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Creates or updates a tier.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - tierName - Name of the tier.
+// - resource - The tier object to create or update.
+// - options - FleetTiersClientBeginCreateOrUpdateOptions contains the optional parameters for the FleetTiersClient.BeginCreateOrUpdate
+// method.
+func (client *FleetTiersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, tierName string, resource FleetTier, options *FleetTiersClientBeginCreateOrUpdateOptions) (*runtime.Poller[FleetTiersClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, fleetName, tierName, resource, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetTiersClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetTiersClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Creates or updates a tier.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetTiersClient) createOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, tierName string, resource FleetTier, options *FleetTiersClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetTiersClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, fleetName, tierName, resource, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *FleetTiersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, tierName string, resource FleetTier, _ *FleetTiersClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if tierName == "" {
+ return nil, errors.New("parameter tierName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tierName}", url.PathEscape(tierName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, resource); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Deletes a tier.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - tierName - Name of the tier.
+// - options - FleetTiersClientBeginDeleteOptions contains the optional parameters for the FleetTiersClient.BeginDelete method.
+func (client *FleetTiersClient) BeginDelete(ctx context.Context, resourceGroupName string, fleetName string, tierName string, options *FleetTiersClientBeginDeleteOptions) (*runtime.Poller[FleetTiersClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, fleetName, tierName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetTiersClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetTiersClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Deletes a tier.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetTiersClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, tierName string, options *FleetTiersClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetTiersClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, fleetName, tierName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *FleetTiersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, tierName string, _ *FleetTiersClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if tierName == "" {
+ return nil, errors.New("parameter tierName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tierName}", url.PathEscape(tierName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Disable - Disables a tier.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - tierName - Name of the tier.
+// - options - FleetTiersClientDisableOptions contains the optional parameters for the FleetTiersClient.Disable method.
+func (client *FleetTiersClient) Disable(ctx context.Context, resourceGroupName string, fleetName string, tierName string, options *FleetTiersClientDisableOptions) (FleetTiersClientDisableResponse, error) {
+ var err error
+ const operationName = "FleetTiersClient.Disable"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.disableCreateRequest(ctx, resourceGroupName, fleetName, tierName, options)
+ if err != nil {
+ return FleetTiersClientDisableResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FleetTiersClientDisableResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FleetTiersClientDisableResponse{}, err
+ }
+ resp, err := client.disableHandleResponse(httpResp)
+ return resp, err
+}
+
+// disableCreateRequest creates the Disable request.
+func (client *FleetTiersClient) disableCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, tierName string, _ *FleetTiersClientDisableOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName}/disable"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if tierName == "" {
+ return nil, errors.New("parameter tierName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tierName}", url.PathEscape(tierName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// disableHandleResponse handles the Disable response.
+func (client *FleetTiersClient) disableHandleResponse(resp *http.Response) (FleetTiersClientDisableResponse, error) {
+ result := FleetTiersClientDisableResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FleetTier); err != nil {
+ return FleetTiersClientDisableResponse{}, err
+ }
+ return result, nil
+}
+
+// Get - Gets a tier resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - tierName - Name of the tier.
+// - options - FleetTiersClientGetOptions contains the optional parameters for the FleetTiersClient.Get method.
+func (client *FleetTiersClient) Get(ctx context.Context, resourceGroupName string, fleetName string, tierName string, options *FleetTiersClientGetOptions) (FleetTiersClientGetResponse, error) {
+ var err error
+ const operationName = "FleetTiersClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, fleetName, tierName, options)
+ if err != nil {
+ return FleetTiersClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FleetTiersClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FleetTiersClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *FleetTiersClient) getCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, tierName string, _ *FleetTiersClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if tierName == "" {
+ return nil, errors.New("parameter tierName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tierName}", url.PathEscape(tierName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *FleetTiersClient) getHandleResponse(resp *http.Response) (FleetTiersClientGetResponse, error) {
+ result := FleetTiersClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FleetTier); err != nil {
+ return FleetTiersClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByFleetPager - List tiers in a fleet.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - options - FleetTiersClientListByFleetOptions contains the optional parameters for the FleetTiersClient.NewListByFleetPager
+// method.
+func (client *FleetTiersClient) NewListByFleetPager(resourceGroupName string, fleetName string, options *FleetTiersClientListByFleetOptions) *runtime.Pager[FleetTiersClientListByFleetResponse] {
+ return runtime.NewPager(runtime.PagingHandler[FleetTiersClientListByFleetResponse]{
+ More: func(page FleetTiersClientListByFleetResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *FleetTiersClientListByFleetResponse) (FleetTiersClientListByFleetResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FleetTiersClient.NewListByFleetPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByFleetCreateRequest(ctx, resourceGroupName, fleetName, options)
+ }, nil)
+ if err != nil {
+ return FleetTiersClientListByFleetResponse{}, err
+ }
+ return client.listByFleetHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByFleetCreateRequest creates the ListByFleet request.
+func (client *FleetTiersClient) listByFleetCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, options *FleetTiersClientListByFleetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Skip != nil {
+ reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10))
+ }
+ if options != nil && options.Skiptoken != nil {
+ reqQP.Set("$skiptoken", *options.Skiptoken)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(*options.Top, 10))
+ }
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByFleetHandleResponse handles the ListByFleet response.
+func (client *FleetTiersClient) listByFleetHandleResponse(resp *http.Response) (FleetTiersClientListByFleetResponse, error) {
+ result := FleetTiersClientListByFleetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FleetTierListResult); err != nil {
+ return FleetTiersClientListByFleetResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - Updates a tier.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - fleetName - Name of the database fleet.
+// - tierName - Name of the tier.
+// - properties - The resource properties to be updated.
+// - options - FleetTiersClientBeginUpdateOptions contains the optional parameters for the FleetTiersClient.BeginUpdate method.
+func (client *FleetTiersClient) BeginUpdate(ctx context.Context, resourceGroupName string, fleetName string, tierName string, properties FleetTier, options *FleetTiersClientBeginUpdateOptions) (*runtime.Poller[FleetTiersClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, fleetName, tierName, properties, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetTiersClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetTiersClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Updates a tier.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-02-01-preview
+func (client *FleetTiersClient) update(ctx context.Context, resourceGroupName string, fleetName string, tierName string, properties FleetTier, options *FleetTiersClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "FleetTiersClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, fleetName, tierName, properties, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *FleetTiersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, tierName string, properties FleetTier, _ *FleetTiersClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if fleetName == "" {
+ return nil, errors.New("parameter fleetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName))
+ if tierName == "" {
+ return nil, errors.New("parameter tierName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tierName}", url.PathEscape(tierName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleettiers_client_example_test.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleettiers_client_example_test.go
new file mode 100644
index 000000000000..ec17931946dc
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/fleettiers_client_example_test.go
@@ -0,0 +1,333 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager_test
+
+import (
+ "context"
+ "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/databasefleetmanager/armdatabasefleetmanager"
+ "log"
+)
+
+// Generated from example definition: 2025-02-01-preview/FleetTiers_CreateOrUpdate_MaximumSet_Gen.json
+func ExampleFleetTiersClient_BeginCreateOrUpdate() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetTiersClient().BeginCreateOrUpdate(ctx, "rg-database-fleet-manager", "critical-production-fleet", "general-purpose-tier", armdatabasefleetmanager.FleetTier{
+ Properties: &armdatabasefleetmanager.FleetTierProperties{
+ Serverless: to.Ptr(false),
+ Pooled: to.Ptr(true),
+ ServiceTier: to.Ptr("GeneralPurpose"),
+ Family: to.Ptr("Gen5"),
+ Capacity: to.Ptr[int32](4),
+ PoolNumOfDatabasesMax: to.Ptr[int32](10),
+ HighAvailabilityReplicaCount: to.Ptr[int32](5),
+ ZoneRedundancy: to.Ptr(armdatabasefleetmanager.ZoneRedundancyDisabled),
+ DatabaseCapacityMin: to.Ptr[float64](0),
+ DatabaseCapacityMax: to.Ptr[float64](4),
+ DatabaseSizeGbMax: to.Ptr[int32](50),
+ },
+ }, 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 = armdatabasefleetmanager.FleetTiersClientCreateOrUpdateResponse{
+ // FleetTier: &armdatabasefleetmanager.FleetTier{
+ // Properties: &armdatabasefleetmanager.FleetTierProperties{
+ // Disabled: to.Ptr(false),
+ // Serverless: to.Ptr(false),
+ // Pooled: to.Ptr(true),
+ // ServiceTier: to.Ptr("GeneralPurpose"),
+ // Family: to.Ptr("Gen5"),
+ // Capacity: to.Ptr[int32](4),
+ // PoolNumOfDatabasesMax: to.Ptr[int32](10),
+ // HighAvailabilityReplicaCount: to.Ptr[int32](5),
+ // ZoneRedundancy: to.Ptr(armdatabasefleetmanager.ZoneRedundancyDisabled),
+ // DatabaseCapacityMin: to.Ptr[float64](0),
+ // DatabaseCapacityMax: to.Ptr[float64](4),
+ // DatabaseSizeGbMax: to.Ptr[int32](50),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // },
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-fleet-manager/providers/Microsoft.DatabaseFleetManager/fleets/critical-production-fleet/tiers/general-purpose-tier"),
+ // Name: to.Ptr("general-purpose-tier"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets/tiers"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("adminuser"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("adminuser"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-02-01-preview/FleetTiers_Delete_MaximumSet_Gen.json
+func ExampleFleetTiersClient_BeginDelete() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetTiersClient().BeginDelete(ctx, "rg-database-fleet-manager", "critical-production-fleet", "general-purpose-tier", nil)
+ if err != nil {
+ log.Fatalf("failed to finish the request: %v", err)
+ }
+ _, err = poller.PollUntilDone(ctx, nil)
+ if err != nil {
+ log.Fatalf("failed to pull the result: %v", err)
+ }
+}
+
+// Generated from example definition: 2025-02-01-preview/FleetTiers_Disable_MaximumSet_Gen.json
+func ExampleFleetTiersClient_Disable() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewFleetTiersClient().Disable(ctx, "rg-database-fleet-manager", "critical-production-fleet", "general-purpose-tier", 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 = armdatabasefleetmanager.FleetTiersClientDisableResponse{
+ // FleetTier: &armdatabasefleetmanager.FleetTier{
+ // Properties: &armdatabasefleetmanager.FleetTierProperties{
+ // Disabled: to.Ptr(false),
+ // Serverless: to.Ptr(false),
+ // Pooled: to.Ptr(true),
+ // ServiceTier: to.Ptr("GeneralPurpose"),
+ // Family: to.Ptr("Gen5"),
+ // Capacity: to.Ptr[int32](4),
+ // PoolNumOfDatabasesMax: to.Ptr[int32](10),
+ // HighAvailabilityReplicaCount: to.Ptr[int32](5),
+ // ZoneRedundancy: to.Ptr(armdatabasefleetmanager.ZoneRedundancyDisabled),
+ // DatabaseCapacityMin: to.Ptr[float64](0),
+ // DatabaseCapacityMax: to.Ptr[float64](4),
+ // DatabaseSizeGbMax: to.Ptr[int32](50),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // },
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-fleet-manager/providers/Microsoft.DatabaseFleetManager/fleets/critical-production-fleet/tiers/general-purpose-tier"),
+ // Name: to.Ptr("general-purpose-tier"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets/tiers"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("adminuser"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("adminuser"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-02-01-preview/FleetTiers_Get_MaximumSet_Gen.json
+func ExampleFleetTiersClient_Get() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewFleetTiersClient().Get(ctx, "rg-database-fleet-manager", "critical-production-fleet", "general-purpose-tier", 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 = armdatabasefleetmanager.FleetTiersClientGetResponse{
+ // FleetTier: &armdatabasefleetmanager.FleetTier{
+ // Properties: &armdatabasefleetmanager.FleetTierProperties{
+ // Disabled: to.Ptr(false),
+ // Serverless: to.Ptr(false),
+ // Pooled: to.Ptr(true),
+ // ServiceTier: to.Ptr("GeneralPurpose"),
+ // Family: to.Ptr("Gen5"),
+ // Capacity: to.Ptr[int32](4),
+ // PoolNumOfDatabasesMax: to.Ptr[int32](10),
+ // HighAvailabilityReplicaCount: to.Ptr[int32](5),
+ // ZoneRedundancy: to.Ptr(armdatabasefleetmanager.ZoneRedundancyDisabled),
+ // DatabaseCapacityMin: to.Ptr[float64](0),
+ // DatabaseCapacityMax: to.Ptr[float64](4),
+ // DatabaseSizeGbMax: to.Ptr[int32](50),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // },
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-fleet-manager/providers/Microsoft.DatabaseFleetManager/fleets/critical-production-fleet/tiers/general-purpose-tier"),
+ // Name: to.Ptr("general-purpose-tier"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets/tiers"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("ckmcfjpuwvncpuluhk"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("o"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-02-01-preview/FleetTiers_ListByFleet_MaximumSet_Gen.json
+func ExampleFleetTiersClient_NewListByFleetPager() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ pager := clientFactory.NewFleetTiersClient().NewListByFleetPager("rg-database-fleet-manager", "critical-production-fleet", &FleetTiersClientListByFleetOptions{
+ Skip: to.Ptr[int64](10),
+ Top: to.Ptr[int64](1),
+ Skiptoken: to.Ptr("hfrg")})
+ 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 = armdatabasefleetmanager.FleetTiersClientListByFleetResponse{
+ // FleetTierListResult: armdatabasefleetmanager.FleetTierListResult{
+ // Value: []*armdatabasefleetmanager.FleetTier{
+ // {
+ // Properties: &armdatabasefleetmanager.FleetTierProperties{
+ // Disabled: to.Ptr(false),
+ // Serverless: to.Ptr(false),
+ // Pooled: to.Ptr(true),
+ // ServiceTier: to.Ptr("GeneralPurpose"),
+ // Family: to.Ptr("Gen5"),
+ // Capacity: to.Ptr[int32](4),
+ // PoolNumOfDatabasesMax: to.Ptr[int32](10),
+ // HighAvailabilityReplicaCount: to.Ptr[int32](5),
+ // ZoneRedundancy: to.Ptr(armdatabasefleetmanager.ZoneRedundancyDisabled),
+ // DatabaseCapacityMin: to.Ptr[float64](0),
+ // DatabaseCapacityMax: to.Ptr[float64](4),
+ // DatabaseSizeGbMax: to.Ptr[int32](50),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // },
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-fleet-manager/providers/Microsoft.DatabaseFleetManager/fleets/critical-production-fleet/tiers/general-purpose-tier"),
+ // Name: to.Ptr("general-purpose-tier"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets/tiers"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("ckmcfjpuwvncpuluhk"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("o"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // },
+ // NextLink: to.Ptr("https://microsoft.com/afucor"),
+ // },
+ // }
+ }
+}
+
+// Generated from example definition: 2025-02-01-preview/FleetTiers_Update_MaximumSet_Gen.json
+func ExampleFleetTiersClient_BeginUpdate() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("C3897315-3847-4D8A-B2FC-7307B066AD63", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFleetTiersClient().BeginUpdate(ctx, "rg-database-fleet-manager", "critical-production-fleet", "general-purpose-tier", armdatabasefleetmanager.FleetTier{
+ Properties: &armdatabasefleetmanager.FleetTierProperties{
+ Serverless: to.Ptr(false),
+ Pooled: to.Ptr(true),
+ ServiceTier: to.Ptr("GeneralPurpose"),
+ Family: to.Ptr("Gen5"),
+ Capacity: to.Ptr[int32](4),
+ PoolNumOfDatabasesMax: to.Ptr[int32](10),
+ HighAvailabilityReplicaCount: to.Ptr[int32](5),
+ ZoneRedundancy: to.Ptr(armdatabasefleetmanager.ZoneRedundancyDisabled),
+ DatabaseCapacityMin: to.Ptr[float64](0),
+ DatabaseCapacityMax: to.Ptr[float64](4),
+ DatabaseSizeGbMax: to.Ptr[int32](50),
+ },
+ }, 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 = armdatabasefleetmanager.FleetTiersClientUpdateResponse{
+ // FleetTier: &armdatabasefleetmanager.FleetTier{
+ // Properties: &armdatabasefleetmanager.FleetTierProperties{
+ // Disabled: to.Ptr(false),
+ // Serverless: to.Ptr(false),
+ // Pooled: to.Ptr(true),
+ // ServiceTier: to.Ptr("GeneralPurpose"),
+ // Family: to.Ptr("Gen5"),
+ // Capacity: to.Ptr[int32](4),
+ // PoolNumOfDatabasesMax: to.Ptr[int32](10),
+ // HighAvailabilityReplicaCount: to.Ptr[int32](5),
+ // ZoneRedundancy: to.Ptr(armdatabasefleetmanager.ZoneRedundancyDisabled),
+ // DatabaseCapacityMin: to.Ptr[float64](0),
+ // DatabaseCapacityMax: to.Ptr[float64](4),
+ // DatabaseSizeGbMax: to.Ptr[int32](50),
+ // ProvisioningState: to.Ptr(armdatabasefleetmanager.AzureProvisioningStateSucceeded),
+ // },
+ // ID: to.Ptr("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourceGroups/rg-database-fleet-manager/providers/Microsoft.DatabaseFleetManager/fleets/critical-production-fleet/tiers/general-purpose-tier"),
+ // Name: to.Ptr("general-purpose-tier"),
+ // Type: to.Ptr("Microsoft.DatabaseFleetManager/fleets/tiers"),
+ // SystemData: &armdatabasefleetmanager.SystemData{
+ // CreatedBy: to.Ptr("ckmcfjpuwvncpuluhk"),
+ // CreatedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.802Z"); return t}()),
+ // LastModifiedBy: to.Ptr("o"),
+ // LastModifiedByType: to.Ptr(armdatabasefleetmanager.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-06T09:16:01.803Z"); return t}()),
+ // },
+ // },
+ // }
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/go.mod b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/go.mod
new file mode 100644
index 000000000000..ad3156dc1f20
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/go.mod
@@ -0,0 +1,21 @@
+module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager
+
+go 1.18
+
+require (
+ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0
+ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0
+)
+
+require (
+ github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
+ github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
+ github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
+ github.com/google/uuid v1.6.0 // indirect
+ github.com/kylelemons/godebug v1.1.0 // indirect
+ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
+ golang.org/x/crypto v0.32.0 // indirect
+ golang.org/x/net v0.34.0 // indirect
+ golang.org/x/sys v0.29.0 // indirect
+ golang.org/x/text v0.21.0 // indirect
+)
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/go.sum b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/go.sum
new file mode 100644
index 000000000000..065ccc364f39
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/go.sum
@@ -0,0 +1,29 @@
+github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 h1:g0EZJwz7xkXQiZAI5xi9f3WWFYBlX1CPTrR+NDToRkQ=
+github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0/go.mod h1:XCW7KnZet0Opnr7HccfUw1PLc4CjHqpcaxW8DHklNkQ=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg=
+github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY=
+github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY=
+github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU=
+github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
+github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
+github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
+github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
+github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
+golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
+golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
+golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
+golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
+golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
+golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
+golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/models.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/models.go
new file mode 100644
index 000000000000..acd63345999c
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/models.go
@@ -0,0 +1,451 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager
+
+import "time"
+
+// DatabaseChangeTierProperties - A database change tier definition.
+type DatabaseChangeTierProperties struct {
+ // A target tier name.
+ TargetTierName *string
+}
+
+// DatabaseIdentity - Database Identity properties.
+type DatabaseIdentity struct {
+ // Client Id of the database identity.
+ ClientID *string
+
+ // Principal Id of the database identity.
+ PrincipalID *string
+
+ // Resource Id of the database identity.
+ ResourceID *string
+}
+
+// DatabaseRenameProperties - A database rename definition.
+type DatabaseRenameProperties struct {
+ // New database name.
+ NewName *string
+}
+
+// DestinationTierOverride - A destination tier override.
+type DestinationTierOverride struct {
+ // REQUIRED; Resource name.
+ ResourceName *string
+
+ // REQUIRED; Resource type.
+ ResourceType *ResourceType
+
+ // REQUIRED; Destination tier name.
+ TierName *string
+}
+
+// FirewallRule - A firewall rule.
+type FirewallRule struct {
+ // A Firewall rule properties.
+ Properties *FirewallRuleProperties
+
+ // READ-ONLY; Name of the firewall rule.
+ Name *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// FirewallRuleListResult - The response of a FirewallRule list operation.
+type FirewallRuleListResult struct {
+ // REQUIRED; The FirewallRule items on this page
+ Value []*FirewallRule
+
+ // The link to the next page of items
+ NextLink *string
+}
+
+// FirewallRuleProperties - A Firewall rule properties.
+type FirewallRuleProperties struct {
+ // End IP address.
+ EndIPAddress *string
+
+ // Start IP address.
+ StartIPAddress *string
+
+ // READ-ONLY; Provisioning state.
+ ProvisioningState *AzureProvisioningState
+}
+
+// Fleet - A Database Fleet.
+type Fleet struct {
+ // REQUIRED; The geo-location where the resource lives
+ Location *string
+
+ // The fleet properties.
+ Properties *FleetProperties
+
+ // Resource tags.
+ Tags map[string]*string
+
+ // READ-ONLY; Name of the database fleet.
+ Name *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// FleetDatabase - A fleet database.
+type FleetDatabase struct {
+ // Fleet database properties.
+ Properties *FleetDatabaseProperties
+
+ // READ-ONLY; Name of the database.
+ Name *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// FleetDatabaseListResult - The response of a FleetDatabase list operation.
+type FleetDatabaseListResult struct {
+ // REQUIRED; The FleetDatabase items on this page
+ Value []*FleetDatabase
+
+ // The link to the next page of items
+ NextLink *string
+}
+
+// FleetDatabaseProperties - Fleet database properties.
+type FleetDatabaseProperties struct {
+ // Database collation.
+ Collation *string
+
+ // Create mode. Available options: Default - Create a database. Copy - Copy the source database (source database name must
+ // be specified) PointInTimeRestore - Create a database by restoring source database from a point in time (source database
+ // name and restore from time must be specified)
+ CreateMode *DatabaseCreateMode
+
+ // Identity property.
+ Identity *Identity
+
+ // Additional database properties to be applied as the underlying database resource tags.
+ ResourceTags map[string]*string
+
+ // Restore from time when CreateMode is PointInTimeRestore.
+ RestoreFromTime *time.Time
+
+ // Source database name used when CreateMode is Copy or PointInTimeRestore.
+ SourceDatabaseName *string
+
+ // Name of the tier this database belongs to.
+ TierName *string
+
+ // Transparent Data Encryption properties
+ TransparentDataEncryption *TransparentDataEncryption
+
+ // READ-ONLY; Backup retention in days.
+ BackupRetentionDays *int32
+
+ // READ-ONLY; Connection string to connect to the database with.
+ ConnectionString *string
+
+ // READ-ONLY; Maximum database size in Gb.
+ DatabaseSizeGbMax *int32
+
+ // READ-ONLY; Earliest restore time.
+ EarliestRestoreTime *time.Time
+
+ // READ-ONLY; Latest restore time.
+ LatestRestoreTime *time.Time
+
+ // READ-ONLY; Resource identifier for the underlying database resource.
+ OriginalDatabaseID *string
+
+ // READ-ONLY; Database state.
+ ProvisioningState *AzureProvisioningState
+
+ // READ-ONLY; If true, database is recoverable.
+ Recoverable *bool
+}
+
+// FleetListResult - The response of a Fleet list operation.
+type FleetListResult struct {
+ // REQUIRED; The Fleet items on this page
+ Value []*Fleet
+
+ // The link to the next page of items
+ NextLink *string
+}
+
+// FleetProperties - The Database Fleet properties.
+type FleetProperties struct {
+ // Fleet description.
+ Description *string
+
+ // READ-ONLY; Provisioning state.
+ ProvisioningState *AzureProvisioningState
+}
+
+// FleetTier - A SQL Database Fleet tier.
+type FleetTier struct {
+ // A Fleet tier properties.
+ Properties *FleetTierProperties
+
+ // READ-ONLY; Name of the tier.
+ Name *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// FleetTierListResult - The response of a FleetTier list operation.
+type FleetTierListResult struct {
+ // REQUIRED; The FleetTier items on this page
+ Value []*FleetTier
+
+ // The link to the next page of items
+ NextLink *string
+}
+
+// FleetTierProperties - A Fleet tier properties.
+type FleetTierProperties struct {
+ // Capacity of provisioned resources in the tier, in units matching the specified service tier, for example vCore for GeneralPurpose.
+ Capacity *int32
+
+ // Maximum allocated capacity per database, in units matching the specified service tier.
+ DatabaseCapacityMax *float64
+
+ // Minimum allocated capacity per database, in units matching the specified service tier.
+ DatabaseCapacityMin *float64
+
+ // Maximum database size in Gb.
+ DatabaseSizeGbMax *int32
+
+ // Family of provisioned resources, for example Gen5.
+ Family *string
+
+ // Number of high availability replicas for databases in this tier.
+ HighAvailabilityReplicaCount *int32
+
+ // Maximum number of databases per pool.
+ PoolNumOfDatabasesMax *int32
+
+ // If true, databases are pooled.
+ Pooled *bool
+
+ // If true, serverless resources are provisioned in the tier.
+ Serverless *bool
+
+ // Service tier of provisioned resources. Supported values: GeneralPurpose, Hyperscale.
+ ServiceTier *string
+
+ // Enable zone redundancy for all databases in this tier.
+ ZoneRedundancy *ZoneRedundancy
+
+ // READ-ONLY; If true, tier is disabled.
+ Disabled *bool
+
+ // READ-ONLY; Provisioning state.
+ ProvisioningState *AzureProvisioningState
+}
+
+// FleetUpdate - An update to a Database Fleet.
+type FleetUpdate struct {
+ // The Database Fleet properties.
+ Properties *FleetProperties
+
+ // Resource tags.
+ Tags map[string]*string
+}
+
+// Fleetspace - A fleetspace.
+type Fleetspace struct {
+ // A Fleetspace properties.
+ Properties *FleetspaceProperties
+
+ // READ-ONLY; Name of the fleetspace.
+ Name *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// FleetspaceListResult - The response of a Fleetspace list operation.
+type FleetspaceListResult struct {
+ // REQUIRED; The Fleetspace items on this page
+ Value []*Fleetspace
+
+ // The link to the next page of items
+ NextLink *string
+}
+
+// FleetspaceProperties - A Fleetspace properties.
+type FleetspaceProperties struct {
+ // Maximum number of vCores database fleet manager is allowed to provision in the fleetspace.
+ CapacityMax *int32
+
+ // Main Microsoft Entra ID principal that has admin access to all databases in the fleetspace.
+ MainPrincipal *MainPrincipal
+
+ // READ-ONLY; Fleetspace state.
+ ProvisioningState *AzureProvisioningState
+}
+
+// Identity - Database Identity.
+type Identity struct {
+ // The federated client id for the SQL Database. It is used for cross tenant CMK scenario.
+ FederatedClientID *string
+
+ // Identity type of the main principal.
+ IdentityType *IdentityType
+
+ // User identity ids
+ UserAssignedIdentities []*DatabaseIdentity
+}
+
+// MainPrincipal - A main principal.
+type MainPrincipal struct {
+ // Application Id of the main principal.
+ ApplicationID *string
+
+ // Login name of the main principal.
+ Login *string
+
+ // Object Id of the main principal.
+ ObjectID *string
+
+ // Principal type of the main principal.
+ PrincipalType *PrincipalType
+
+ // Tenant Id of the main principal.
+ TenantID *string
+}
+
+// Operation - Details of a REST API operation, returned from the Resource Provider Operations API
+type Operation struct {
+ // Localized display information for this particular operation.
+ Display *OperationDisplay
+
+ // READ-ONLY; Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ ActionType *ActionType
+
+ // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure
+ // Resource Manager/control-plane operations.
+ IsDataAction *bool
+
+ // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write",
+ // "Microsoft.Compute/virtualMachines/capture/action"
+ Name *string
+
+ // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
+ // value is "user,system"
+ Origin *Origin
+}
+
+// OperationDisplay - Localized display information for and operation.
+type OperationDisplay struct {
+ // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views.
+ Description *string
+
+ // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual
+ // Machine", "Restart Virtual Machine".
+ Operation *string
+
+ // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft
+ // Compute".
+ Provider *string
+
+ // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job
+ // Schedule Collections".
+ Resource *string
+}
+
+// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to
+// get the next set of results.
+type OperationListResult struct {
+ // REQUIRED; The Operation items on this page
+ Value []*Operation
+
+ // The link to the next page of items
+ NextLink *string
+}
+
+// RegisterServerProperties - Server registration definition.
+type RegisterServerProperties struct {
+ // Destination tier overrides.
+ DestinationTierOverrides []*DestinationTierOverride
+
+ // Source resource group name.
+ SourceResourceGroupName *string
+
+ // Source SQL Server name.
+ SourceServerName *string
+
+ // Source subscription id.
+ SourceSubscriptionID *string
+
+ // Destination tier name.
+ TierName *string
+}
+
+// SystemData - Metadata pertaining to creation and last modification of the resource.
+type SystemData struct {
+ // The timestamp of resource creation (UTC).
+ CreatedAt *time.Time
+
+ // The identity that created the resource.
+ CreatedBy *string
+
+ // The type of identity that created the resource.
+ CreatedByType *CreatedByType
+
+ // The timestamp of resource last modification (UTC)
+ LastModifiedAt *time.Time
+
+ // The identity that last modified the resource.
+ LastModifiedBy *string
+
+ // The type of identity that last modified the resource.
+ LastModifiedByType *CreatedByType
+}
+
+// TransparentDataEncryption - Transparent Data Encryption properties.
+type TransparentDataEncryption struct {
+ // Enable key auto rotation
+ EnableAutoRotation *bool
+
+ // Customer Managed Key (CMK) Uri.
+ KeyURI *string
+
+ // Additional Keys
+ Keys []*string
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/models_serde.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/models_serde.go
new file mode 100644
index 000000000000..e2e93feb5a2b
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/models_serde.go
@@ -0,0 +1,1144 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "reflect"
+)
+
+// MarshalJSON implements the json.Marshaller interface for type DatabaseChangeTierProperties.
+func (d DatabaseChangeTierProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "targetTierName", d.TargetTierName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseChangeTierProperties.
+func (d *DatabaseChangeTierProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "targetTierName":
+ err = unpopulate(val, "TargetTierName", &d.TargetTierName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DatabaseIdentity.
+func (d DatabaseIdentity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "clientId", d.ClientID)
+ populate(objectMap, "principalId", d.PrincipalID)
+ populate(objectMap, "resourceId", d.ResourceID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseIdentity.
+func (d *DatabaseIdentity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "clientId":
+ err = unpopulate(val, "ClientID", &d.ClientID)
+ delete(rawMsg, key)
+ case "principalId":
+ err = unpopulate(val, "PrincipalID", &d.PrincipalID)
+ delete(rawMsg, key)
+ case "resourceId":
+ err = unpopulate(val, "ResourceID", &d.ResourceID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DatabaseRenameProperties.
+func (d DatabaseRenameProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "newName", d.NewName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseRenameProperties.
+func (d *DatabaseRenameProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "newName":
+ err = unpopulate(val, "NewName", &d.NewName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DestinationTierOverride.
+func (d DestinationTierOverride) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "resourceName", d.ResourceName)
+ populate(objectMap, "resourceType", d.ResourceType)
+ populate(objectMap, "tierName", d.TierName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DestinationTierOverride.
+func (d *DestinationTierOverride) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "resourceName":
+ err = unpopulate(val, "ResourceName", &d.ResourceName)
+ delete(rawMsg, key)
+ case "resourceType":
+ err = unpopulate(val, "ResourceType", &d.ResourceType)
+ delete(rawMsg, key)
+ case "tierName":
+ err = unpopulate(val, "TierName", &d.TierName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FirewallRule.
+func (f FirewallRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", f.ID)
+ populate(objectMap, "name", f.Name)
+ populate(objectMap, "properties", f.Properties)
+ populate(objectMap, "systemData", f.SystemData)
+ populate(objectMap, "type", f.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRule.
+func (f *FirewallRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &f.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &f.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &f.Properties)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &f.SystemData)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &f.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FirewallRuleListResult.
+func (f FirewallRuleListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", f.NextLink)
+ populate(objectMap, "value", f.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleListResult.
+func (f *FirewallRuleListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &f.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &f.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FirewallRuleProperties.
+func (f FirewallRuleProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "endIpAddress", f.EndIPAddress)
+ populate(objectMap, "provisioningState", f.ProvisioningState)
+ populate(objectMap, "startIpAddress", f.StartIPAddress)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleProperties.
+func (f *FirewallRuleProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "endIpAddress":
+ err = unpopulate(val, "EndIPAddress", &f.EndIPAddress)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &f.ProvisioningState)
+ delete(rawMsg, key)
+ case "startIpAddress":
+ err = unpopulate(val, "StartIPAddress", &f.StartIPAddress)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Fleet.
+func (f Fleet) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", f.ID)
+ populate(objectMap, "location", f.Location)
+ populate(objectMap, "name", f.Name)
+ populate(objectMap, "properties", f.Properties)
+ populate(objectMap, "systemData", f.SystemData)
+ populate(objectMap, "tags", f.Tags)
+ populate(objectMap, "type", f.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Fleet.
+func (f *Fleet) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &f.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &f.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &f.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &f.Properties)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &f.SystemData)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &f.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &f.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FleetDatabase.
+func (f FleetDatabase) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", f.ID)
+ populate(objectMap, "name", f.Name)
+ populate(objectMap, "properties", f.Properties)
+ populate(objectMap, "systemData", f.SystemData)
+ populate(objectMap, "type", f.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FleetDatabase.
+func (f *FleetDatabase) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &f.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &f.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &f.Properties)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &f.SystemData)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &f.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FleetDatabaseListResult.
+func (f FleetDatabaseListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", f.NextLink)
+ populate(objectMap, "value", f.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FleetDatabaseListResult.
+func (f *FleetDatabaseListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &f.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &f.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FleetDatabaseProperties.
+func (f FleetDatabaseProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "backupRetentionDays", f.BackupRetentionDays)
+ populate(objectMap, "collation", f.Collation)
+ populate(objectMap, "connectionString", f.ConnectionString)
+ populate(objectMap, "createMode", f.CreateMode)
+ populate(objectMap, "databaseSizeGbMax", f.DatabaseSizeGbMax)
+ populateDateTimeRFC3339(objectMap, "earliestRestoreTime", f.EarliestRestoreTime)
+ populate(objectMap, "identity", f.Identity)
+ populateDateTimeRFC3339(objectMap, "latestRestoreTime", f.LatestRestoreTime)
+ populate(objectMap, "originalDatabaseId", f.OriginalDatabaseID)
+ populate(objectMap, "provisioningState", f.ProvisioningState)
+ populate(objectMap, "recoverable", f.Recoverable)
+ populate(objectMap, "resourceTags", f.ResourceTags)
+ populateDateTimeRFC3339(objectMap, "restoreFromTime", f.RestoreFromTime)
+ populate(objectMap, "sourceDatabaseName", f.SourceDatabaseName)
+ populate(objectMap, "tierName", f.TierName)
+ populate(objectMap, "transparentDataEncryption", f.TransparentDataEncryption)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FleetDatabaseProperties.
+func (f *FleetDatabaseProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "backupRetentionDays":
+ err = unpopulate(val, "BackupRetentionDays", &f.BackupRetentionDays)
+ delete(rawMsg, key)
+ case "collation":
+ err = unpopulate(val, "Collation", &f.Collation)
+ delete(rawMsg, key)
+ case "connectionString":
+ err = unpopulate(val, "ConnectionString", &f.ConnectionString)
+ delete(rawMsg, key)
+ case "createMode":
+ err = unpopulate(val, "CreateMode", &f.CreateMode)
+ delete(rawMsg, key)
+ case "databaseSizeGbMax":
+ err = unpopulate(val, "DatabaseSizeGbMax", &f.DatabaseSizeGbMax)
+ delete(rawMsg, key)
+ case "earliestRestoreTime":
+ err = unpopulateDateTimeRFC3339(val, "EarliestRestoreTime", &f.EarliestRestoreTime)
+ delete(rawMsg, key)
+ case "identity":
+ err = unpopulate(val, "Identity", &f.Identity)
+ delete(rawMsg, key)
+ case "latestRestoreTime":
+ err = unpopulateDateTimeRFC3339(val, "LatestRestoreTime", &f.LatestRestoreTime)
+ delete(rawMsg, key)
+ case "originalDatabaseId":
+ err = unpopulate(val, "OriginalDatabaseID", &f.OriginalDatabaseID)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &f.ProvisioningState)
+ delete(rawMsg, key)
+ case "recoverable":
+ err = unpopulate(val, "Recoverable", &f.Recoverable)
+ delete(rawMsg, key)
+ case "resourceTags":
+ err = unpopulate(val, "ResourceTags", &f.ResourceTags)
+ delete(rawMsg, key)
+ case "restoreFromTime":
+ err = unpopulateDateTimeRFC3339(val, "RestoreFromTime", &f.RestoreFromTime)
+ delete(rawMsg, key)
+ case "sourceDatabaseName":
+ err = unpopulate(val, "SourceDatabaseName", &f.SourceDatabaseName)
+ delete(rawMsg, key)
+ case "tierName":
+ err = unpopulate(val, "TierName", &f.TierName)
+ delete(rawMsg, key)
+ case "transparentDataEncryption":
+ err = unpopulate(val, "TransparentDataEncryption", &f.TransparentDataEncryption)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FleetListResult.
+func (f FleetListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", f.NextLink)
+ populate(objectMap, "value", f.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FleetListResult.
+func (f *FleetListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &f.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &f.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FleetProperties.
+func (f FleetProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", f.Description)
+ populate(objectMap, "provisioningState", f.ProvisioningState)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FleetProperties.
+func (f *FleetProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &f.Description)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &f.ProvisioningState)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FleetTier.
+func (f FleetTier) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", f.ID)
+ populate(objectMap, "name", f.Name)
+ populate(objectMap, "properties", f.Properties)
+ populate(objectMap, "systemData", f.SystemData)
+ populate(objectMap, "type", f.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FleetTier.
+func (f *FleetTier) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &f.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &f.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &f.Properties)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &f.SystemData)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &f.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FleetTierListResult.
+func (f FleetTierListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", f.NextLink)
+ populate(objectMap, "value", f.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FleetTierListResult.
+func (f *FleetTierListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &f.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &f.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FleetTierProperties.
+func (f FleetTierProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "capacity", f.Capacity)
+ populate(objectMap, "databaseCapacityMax", f.DatabaseCapacityMax)
+ populate(objectMap, "databaseCapacityMin", f.DatabaseCapacityMin)
+ populate(objectMap, "databaseSizeGbMax", f.DatabaseSizeGbMax)
+ populate(objectMap, "disabled", f.Disabled)
+ populate(objectMap, "family", f.Family)
+ populate(objectMap, "highAvailabilityReplicaCount", f.HighAvailabilityReplicaCount)
+ populate(objectMap, "poolNumOfDatabasesMax", f.PoolNumOfDatabasesMax)
+ populate(objectMap, "pooled", f.Pooled)
+ populate(objectMap, "provisioningState", f.ProvisioningState)
+ populate(objectMap, "serverless", f.Serverless)
+ populate(objectMap, "serviceTier", f.ServiceTier)
+ populate(objectMap, "zoneRedundancy", f.ZoneRedundancy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FleetTierProperties.
+func (f *FleetTierProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "capacity":
+ err = unpopulate(val, "Capacity", &f.Capacity)
+ delete(rawMsg, key)
+ case "databaseCapacityMax":
+ err = unpopulate(val, "DatabaseCapacityMax", &f.DatabaseCapacityMax)
+ delete(rawMsg, key)
+ case "databaseCapacityMin":
+ err = unpopulate(val, "DatabaseCapacityMin", &f.DatabaseCapacityMin)
+ delete(rawMsg, key)
+ case "databaseSizeGbMax":
+ err = unpopulate(val, "DatabaseSizeGbMax", &f.DatabaseSizeGbMax)
+ delete(rawMsg, key)
+ case "disabled":
+ err = unpopulate(val, "Disabled", &f.Disabled)
+ delete(rawMsg, key)
+ case "family":
+ err = unpopulate(val, "Family", &f.Family)
+ delete(rawMsg, key)
+ case "highAvailabilityReplicaCount":
+ err = unpopulate(val, "HighAvailabilityReplicaCount", &f.HighAvailabilityReplicaCount)
+ delete(rawMsg, key)
+ case "poolNumOfDatabasesMax":
+ err = unpopulate(val, "PoolNumOfDatabasesMax", &f.PoolNumOfDatabasesMax)
+ delete(rawMsg, key)
+ case "pooled":
+ err = unpopulate(val, "Pooled", &f.Pooled)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &f.ProvisioningState)
+ delete(rawMsg, key)
+ case "serverless":
+ err = unpopulate(val, "Serverless", &f.Serverless)
+ delete(rawMsg, key)
+ case "serviceTier":
+ err = unpopulate(val, "ServiceTier", &f.ServiceTier)
+ delete(rawMsg, key)
+ case "zoneRedundancy":
+ err = unpopulate(val, "ZoneRedundancy", &f.ZoneRedundancy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FleetUpdate.
+func (f FleetUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", f.Properties)
+ populate(objectMap, "tags", f.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FleetUpdate.
+func (f *FleetUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "Properties", &f.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &f.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Fleetspace.
+func (f Fleetspace) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", f.ID)
+ populate(objectMap, "name", f.Name)
+ populate(objectMap, "properties", f.Properties)
+ populate(objectMap, "systemData", f.SystemData)
+ populate(objectMap, "type", f.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Fleetspace.
+func (f *Fleetspace) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &f.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &f.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &f.Properties)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &f.SystemData)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &f.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FleetspaceListResult.
+func (f FleetspaceListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", f.NextLink)
+ populate(objectMap, "value", f.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FleetspaceListResult.
+func (f *FleetspaceListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &f.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &f.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FleetspaceProperties.
+func (f FleetspaceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "capacityMax", f.CapacityMax)
+ populate(objectMap, "mainPrincipal", f.MainPrincipal)
+ populate(objectMap, "provisioningState", f.ProvisioningState)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FleetspaceProperties.
+func (f *FleetspaceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "capacityMax":
+ err = unpopulate(val, "CapacityMax", &f.CapacityMax)
+ delete(rawMsg, key)
+ case "mainPrincipal":
+ err = unpopulate(val, "MainPrincipal", &f.MainPrincipal)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &f.ProvisioningState)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Identity.
+func (i Identity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "federatedClientId", i.FederatedClientID)
+ populate(objectMap, "identityType", i.IdentityType)
+ populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Identity.
+func (i *Identity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "federatedClientId":
+ err = unpopulate(val, "FederatedClientID", &i.FederatedClientID)
+ delete(rawMsg, key)
+ case "identityType":
+ err = unpopulate(val, "IdentityType", &i.IdentityType)
+ delete(rawMsg, key)
+ case "userAssignedIdentities":
+ err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type MainPrincipal.
+func (m MainPrincipal) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "applicationId", m.ApplicationID)
+ populate(objectMap, "login", m.Login)
+ populate(objectMap, "objectId", m.ObjectID)
+ populate(objectMap, "principalType", m.PrincipalType)
+ populate(objectMap, "tenantId", m.TenantID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type MainPrincipal.
+func (m *MainPrincipal) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "applicationId":
+ err = unpopulate(val, "ApplicationID", &m.ApplicationID)
+ delete(rawMsg, key)
+ case "login":
+ err = unpopulate(val, "Login", &m.Login)
+ delete(rawMsg, key)
+ case "objectId":
+ err = unpopulate(val, "ObjectID", &m.ObjectID)
+ delete(rawMsg, key)
+ case "principalType":
+ err = unpopulate(val, "PrincipalType", &m.PrincipalType)
+ delete(rawMsg, key)
+ case "tenantId":
+ err = unpopulate(val, "TenantID", &m.TenantID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Operation.
+func (o Operation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "actionType", o.ActionType)
+ populate(objectMap, "display", o.Display)
+ populate(objectMap, "isDataAction", o.IsDataAction)
+ populate(objectMap, "name", o.Name)
+ populate(objectMap, "origin", o.Origin)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
+func (o *Operation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "actionType":
+ err = unpopulate(val, "ActionType", &o.ActionType)
+ delete(rawMsg, key)
+ case "display":
+ err = unpopulate(val, "Display", &o.Display)
+ delete(rawMsg, key)
+ case "isDataAction":
+ err = unpopulate(val, "IsDataAction", &o.IsDataAction)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &o.Name)
+ delete(rawMsg, key)
+ case "origin":
+ err = unpopulate(val, "Origin", &o.Origin)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
+func (o OperationDisplay) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", o.Description)
+ populate(objectMap, "operation", o.Operation)
+ populate(objectMap, "provider", o.Provider)
+ populate(objectMap, "resource", o.Resource)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
+func (o *OperationDisplay) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &o.Description)
+ delete(rawMsg, key)
+ case "operation":
+ err = unpopulate(val, "Operation", &o.Operation)
+ delete(rawMsg, key)
+ case "provider":
+ err = unpopulate(val, "Provider", &o.Provider)
+ delete(rawMsg, key)
+ case "resource":
+ err = unpopulate(val, "Resource", &o.Resource)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OperationListResult.
+func (o OperationListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", o.NextLink)
+ populate(objectMap, "value", o.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
+func (o *OperationListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &o.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &o.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RegisterServerProperties.
+func (r RegisterServerProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "destinationTierOverrides", r.DestinationTierOverrides)
+ populate(objectMap, "sourceResourceGroupName", r.SourceResourceGroupName)
+ populate(objectMap, "sourceServerName", r.SourceServerName)
+ populate(objectMap, "sourceSubscriptionId", r.SourceSubscriptionID)
+ populate(objectMap, "tierName", r.TierName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RegisterServerProperties.
+func (r *RegisterServerProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "destinationTierOverrides":
+ err = unpopulate(val, "DestinationTierOverrides", &r.DestinationTierOverrides)
+ delete(rawMsg, key)
+ case "sourceResourceGroupName":
+ err = unpopulate(val, "SourceResourceGroupName", &r.SourceResourceGroupName)
+ delete(rawMsg, key)
+ case "sourceServerName":
+ err = unpopulate(val, "SourceServerName", &r.SourceServerName)
+ delete(rawMsg, key)
+ case "sourceSubscriptionId":
+ err = unpopulate(val, "SourceSubscriptionID", &r.SourceSubscriptionID)
+ delete(rawMsg, key)
+ case "tierName":
+ err = unpopulate(val, "TierName", &r.TierName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SystemData.
+func (s SystemData) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt)
+ populate(objectMap, "createdBy", s.CreatedBy)
+ populate(objectMap, "createdByType", s.CreatedByType)
+ populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt)
+ populate(objectMap, "lastModifiedBy", s.LastModifiedBy)
+ populate(objectMap, "lastModifiedByType", s.LastModifiedByType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.
+func (s *SystemData) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "createdAt":
+ err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt)
+ delete(rawMsg, key)
+ case "createdBy":
+ err = unpopulate(val, "CreatedBy", &s.CreatedBy)
+ delete(rawMsg, key)
+ case "createdByType":
+ err = unpopulate(val, "CreatedByType", &s.CreatedByType)
+ delete(rawMsg, key)
+ case "lastModifiedAt":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt)
+ delete(rawMsg, key)
+ case "lastModifiedBy":
+ err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy)
+ delete(rawMsg, key)
+ case "lastModifiedByType":
+ err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TransparentDataEncryption.
+func (t TransparentDataEncryption) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enableAutoRotation", t.EnableAutoRotation)
+ populate(objectMap, "keyUri", t.KeyURI)
+ populate(objectMap, "keys", t.Keys)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TransparentDataEncryption.
+func (t *TransparentDataEncryption) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enableAutoRotation":
+ err = unpopulate(val, "EnableAutoRotation", &t.EnableAutoRotation)
+ delete(rawMsg, key)
+ case "keyUri":
+ err = unpopulate(val, "KeyURI", &t.KeyURI)
+ delete(rawMsg, key)
+ case "keys":
+ err = unpopulate(val, "Keys", &t.Keys)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+func populate(m map[string]any, k string, v any) {
+ if v == nil {
+ return
+ } else if azcore.IsNullValue(v) {
+ m[k] = nil
+ } else if !reflect.ValueOf(v).IsNil() {
+ m[k] = v
+ }
+}
+
+func unpopulate(data json.RawMessage, fn string, v any) error {
+ if data == nil || string(data) == "null" {
+ return nil
+ }
+ if err := json.Unmarshal(data, v); err != nil {
+ return fmt.Errorf("struct field %s: %v", fn, err)
+ }
+ return nil
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/operations_client.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/operations_client.go
new file mode 100644
index 000000000000..3b90e40923ab
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/operations_client.go
@@ -0,0 +1,84 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager
+
+import (
+ "context"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+)
+
+// OperationsClient contains the methods for the Operations group.
+// Don't use this type directly, use NewOperationsClient() instead.
+type OperationsClient struct {
+ internal *arm.Client
+}
+
+// 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 NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &OperationsClient{
+ internal: cl,
+ }
+ return client, nil
+}
+
+// NewListPager - List the operations for the provider
+//
+// Generated from API version 2025-02-01-preview
+// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
+func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{
+ More: func(page OperationsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return OperationsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.DatabaseFleetManager/operations"
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-02-01-preview")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) {
+ result := OperationsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil {
+ return OperationsClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/operations_client_example_test.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/operations_client_example_test.go
new file mode 100644
index 000000000000..7d2991907687
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/operations_client_example_test.go
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager_test
+
+import (
+ "context"
+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager"
+ "log"
+)
+
+// Generated from example definition: 2025-02-01-preview/Operations_List_MaximumSet_Gen.json
+func ExampleOperationsClient_NewListPager() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasefleetmanager.NewClientFactory("", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ pager := clientFactory.NewOperationsClient().NewListPager(nil)
+ for pager.More() {
+ page, err := pager.NextPage(ctx)
+ if err != nil {
+ log.Fatalf("failed to advance page: %v", err)
+ }
+ for _, v := range page.Value {
+ // You could use page here. We use blank identifier for just demo purposes.
+ _ = v
+ }
+ // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
+ // page = armdatabasefleetmanager.OperationsClientListResponse{
+ // OperationListResult: armdatabasefleetmanager.OperationListResult{
+ // Value: []*armdatabasefleetmanager.Operation{
+ // {
+ // Name: to.Ptr("xalexazqlaltsvcoseubmutjbey"),
+ // IsDataAction: to.Ptr(true),
+ // Display: &armdatabasefleetmanager.OperationDisplay{
+ // Provider: to.Ptr("bnlenqwsjrsxcflztxtllrep"),
+ // Resource: to.Ptr("ncu"),
+ // Operation: to.Ptr("nnbudygrwx"),
+ // Description: to.Ptr("ulkoxbko"),
+ // },
+ // Origin: to.Ptr(armdatabasefleetmanager.OriginUser),
+ // ActionType: to.Ptr(armdatabasefleetmanager.ActionTypeInternal),
+ // },
+ // },
+ // NextLink: to.Ptr("https://microsoft.com/abgad"),
+ // },
+ // }
+ }
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/options.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/options.go
new file mode 100644
index 000000000000..d1bf9d740627
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/options.go
@@ -0,0 +1,231 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager
+
+// FirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.BeginCreateOrUpdate
+// method.
+type FirewallRulesClientBeginCreateOrUpdateOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FirewallRulesClientBeginDeleteOptions contains the optional parameters for the FirewallRulesClient.BeginDelete method.
+type FirewallRulesClientBeginDeleteOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method.
+type FirewallRulesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FirewallRulesClientListByFleetspaceOptions contains the optional parameters for the FirewallRulesClient.NewListByFleetspacePager
+// method.
+type FirewallRulesClientListByFleetspaceOptions struct {
+ // The number of elements in the collection to skip.
+ Skip *int64
+
+ // An opaque token that identifies a starting point in the collection.
+ Skiptoken *string
+
+ // The number of elements to return from the collection.
+ Top *int64
+}
+
+// FleetDatabasesClientBeginChangeTierOptions contains the optional parameters for the FleetDatabasesClient.BeginChangeTier
+// method.
+type FleetDatabasesClientBeginChangeTierOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the FleetDatabasesClient.BeginCreateOrUpdate
+// method.
+type FleetDatabasesClientBeginCreateOrUpdateOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetDatabasesClientBeginDeleteOptions contains the optional parameters for the FleetDatabasesClient.BeginDelete method.
+type FleetDatabasesClientBeginDeleteOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetDatabasesClientBeginRenameOptions contains the optional parameters for the FleetDatabasesClient.BeginRename method.
+type FleetDatabasesClientBeginRenameOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetDatabasesClientBeginRevertOptions contains the optional parameters for the FleetDatabasesClient.BeginRevert method.
+type FleetDatabasesClientBeginRevertOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetDatabasesClientBeginUpdateOptions contains the optional parameters for the FleetDatabasesClient.BeginUpdate method.
+type FleetDatabasesClientBeginUpdateOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetDatabasesClientGetOptions contains the optional parameters for the FleetDatabasesClient.Get method.
+type FleetDatabasesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FleetDatabasesClientListByFleetspaceOptions contains the optional parameters for the FleetDatabasesClient.NewListByFleetspacePager
+// method.
+type FleetDatabasesClientListByFleetspaceOptions struct {
+ // An OData filter expression that filters elements in the collection.
+ Filter *string
+
+ // The number of elements in the collection to skip.
+ Skip *int64
+
+ // An opaque token that identifies a starting point in the collection.
+ Skiptoken *string
+
+ // The number of elements to return from the collection.
+ Top *int64
+}
+
+// FleetTiersClientBeginCreateOrUpdateOptions contains the optional parameters for the FleetTiersClient.BeginCreateOrUpdate
+// method.
+type FleetTiersClientBeginCreateOrUpdateOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetTiersClientBeginDeleteOptions contains the optional parameters for the FleetTiersClient.BeginDelete method.
+type FleetTiersClientBeginDeleteOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetTiersClientBeginUpdateOptions contains the optional parameters for the FleetTiersClient.BeginUpdate method.
+type FleetTiersClientBeginUpdateOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetTiersClientDisableOptions contains the optional parameters for the FleetTiersClient.Disable method.
+type FleetTiersClientDisableOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FleetTiersClientGetOptions contains the optional parameters for the FleetTiersClient.Get method.
+type FleetTiersClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FleetTiersClientListByFleetOptions contains the optional parameters for the FleetTiersClient.NewListByFleetPager method.
+type FleetTiersClientListByFleetOptions struct {
+ // The number of elements in the collection to skip.
+ Skip *int64
+
+ // An opaque token that identifies a starting point in the collection.
+ Skiptoken *string
+
+ // The number of elements to return from the collection.
+ Top *int64
+}
+
+// FleetsClientBeginCreateOrUpdateOptions contains the optional parameters for the FleetsClient.BeginCreateOrUpdate method.
+type FleetsClientBeginCreateOrUpdateOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetsClientBeginDeleteOptions contains the optional parameters for the FleetsClient.BeginDelete method.
+type FleetsClientBeginDeleteOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetsClientBeginUpdateOptions contains the optional parameters for the FleetsClient.BeginUpdate method.
+type FleetsClientBeginUpdateOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetsClientGetOptions contains the optional parameters for the FleetsClient.Get method.
+type FleetsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FleetsClientListByResourceGroupOptions contains the optional parameters for the FleetsClient.NewListByResourceGroupPager
+// method.
+type FleetsClientListByResourceGroupOptions struct {
+ // The number of elements in the collection to skip.
+ Skip *int64
+
+ // An opaque token that identifies a starting point in the collection.
+ Skiptoken *string
+
+ // The number of elements to return from the collection.
+ Top *int64
+}
+
+// FleetsClientListOptions contains the optional parameters for the FleetsClient.NewListPager method.
+type FleetsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FleetspacesClientBeginCreateOrUpdateOptions contains the optional parameters for the FleetspacesClient.BeginCreateOrUpdate
+// method.
+type FleetspacesClientBeginCreateOrUpdateOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetspacesClientBeginDeleteOptions contains the optional parameters for the FleetspacesClient.BeginDelete method.
+type FleetspacesClientBeginDeleteOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetspacesClientBeginRegisterServerOptions contains the optional parameters for the FleetspacesClient.BeginRegisterServer
+// method.
+type FleetspacesClientBeginRegisterServerOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetspacesClientBeginUnregisterOptions contains the optional parameters for the FleetspacesClient.BeginUnregister method.
+type FleetspacesClientBeginUnregisterOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetspacesClientBeginUpdateOptions contains the optional parameters for the FleetspacesClient.BeginUpdate method.
+type FleetspacesClientBeginUpdateOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// FleetspacesClientGetOptions contains the optional parameters for the FleetspacesClient.Get method.
+type FleetspacesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FleetspacesClientListByFleetOptions contains the optional parameters for the FleetspacesClient.NewListByFleetPager method.
+type FleetspacesClientListByFleetOptions struct {
+ // The number of elements in the collection to skip.
+ Skip *int64
+
+ // An opaque token that identifies a starting point in the collection.
+ Skiptoken *string
+
+ // The number of elements to return from the collection.
+ Top *int64
+}
+
+// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
+type OperationsClientListOptions struct {
+ // placeholder for future optional parameters
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/responses.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/responses.go
new file mode 100644
index 000000000000..84fabeb067ae
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/responses.go
@@ -0,0 +1,187 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager
+
+// FirewallRulesClientCreateOrUpdateResponse contains the response from method FirewallRulesClient.BeginCreateOrUpdate.
+type FirewallRulesClientCreateOrUpdateResponse struct {
+ // A firewall rule.
+ FirewallRule
+}
+
+// FirewallRulesClientDeleteResponse contains the response from method FirewallRulesClient.BeginDelete.
+type FirewallRulesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// FirewallRulesClientGetResponse contains the response from method FirewallRulesClient.Get.
+type FirewallRulesClientGetResponse struct {
+ // A firewall rule.
+ FirewallRule
+}
+
+// FirewallRulesClientListByFleetspaceResponse contains the response from method FirewallRulesClient.NewListByFleetspacePager.
+type FirewallRulesClientListByFleetspaceResponse struct {
+ // The response of a FirewallRule list operation.
+ FirewallRuleListResult
+}
+
+// FleetDatabasesClientChangeTierResponse contains the response from method FleetDatabasesClient.BeginChangeTier.
+type FleetDatabasesClientChangeTierResponse struct {
+ // placeholder for future response values
+}
+
+// FleetDatabasesClientCreateOrUpdateResponse contains the response from method FleetDatabasesClient.BeginCreateOrUpdate.
+type FleetDatabasesClientCreateOrUpdateResponse struct {
+ // A fleet database.
+ FleetDatabase
+}
+
+// FleetDatabasesClientDeleteResponse contains the response from method FleetDatabasesClient.BeginDelete.
+type FleetDatabasesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// FleetDatabasesClientGetResponse contains the response from method FleetDatabasesClient.Get.
+type FleetDatabasesClientGetResponse struct {
+ // A fleet database.
+ FleetDatabase
+}
+
+// FleetDatabasesClientListByFleetspaceResponse contains the response from method FleetDatabasesClient.NewListByFleetspacePager.
+type FleetDatabasesClientListByFleetspaceResponse struct {
+ // The response of a FleetDatabase list operation.
+ FleetDatabaseListResult
+}
+
+// FleetDatabasesClientRenameResponse contains the response from method FleetDatabasesClient.BeginRename.
+type FleetDatabasesClientRenameResponse struct {
+ // placeholder for future response values
+}
+
+// FleetDatabasesClientRevertResponse contains the response from method FleetDatabasesClient.BeginRevert.
+type FleetDatabasesClientRevertResponse struct {
+ // placeholder for future response values
+}
+
+// FleetDatabasesClientUpdateResponse contains the response from method FleetDatabasesClient.BeginUpdate.
+type FleetDatabasesClientUpdateResponse struct {
+ // A fleet database.
+ FleetDatabase
+}
+
+// FleetTiersClientCreateOrUpdateResponse contains the response from method FleetTiersClient.BeginCreateOrUpdate.
+type FleetTiersClientCreateOrUpdateResponse struct {
+ // A SQL Database Fleet tier.
+ FleetTier
+}
+
+// FleetTiersClientDeleteResponse contains the response from method FleetTiersClient.BeginDelete.
+type FleetTiersClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// FleetTiersClientDisableResponse contains the response from method FleetTiersClient.Disable.
+type FleetTiersClientDisableResponse struct {
+ // A SQL Database Fleet tier.
+ FleetTier
+}
+
+// FleetTiersClientGetResponse contains the response from method FleetTiersClient.Get.
+type FleetTiersClientGetResponse struct {
+ // A SQL Database Fleet tier.
+ FleetTier
+}
+
+// FleetTiersClientListByFleetResponse contains the response from method FleetTiersClient.NewListByFleetPager.
+type FleetTiersClientListByFleetResponse struct {
+ // The response of a FleetTier list operation.
+ FleetTierListResult
+}
+
+// FleetTiersClientUpdateResponse contains the response from method FleetTiersClient.BeginUpdate.
+type FleetTiersClientUpdateResponse struct {
+ // A SQL Database Fleet tier.
+ FleetTier
+}
+
+// FleetsClientCreateOrUpdateResponse contains the response from method FleetsClient.BeginCreateOrUpdate.
+type FleetsClientCreateOrUpdateResponse struct {
+ // A Database Fleet.
+ Fleet
+}
+
+// FleetsClientDeleteResponse contains the response from method FleetsClient.BeginDelete.
+type FleetsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// FleetsClientGetResponse contains the response from method FleetsClient.Get.
+type FleetsClientGetResponse struct {
+ // A Database Fleet.
+ Fleet
+}
+
+// FleetsClientListByResourceGroupResponse contains the response from method FleetsClient.NewListByResourceGroupPager.
+type FleetsClientListByResourceGroupResponse struct {
+ // The response of a Fleet list operation.
+ FleetListResult
+}
+
+// FleetsClientListResponse contains the response from method FleetsClient.NewListPager.
+type FleetsClientListResponse struct {
+ // The response of a Fleet list operation.
+ FleetListResult
+}
+
+// FleetsClientUpdateResponse contains the response from method FleetsClient.BeginUpdate.
+type FleetsClientUpdateResponse struct {
+ // A Database Fleet.
+ Fleet
+}
+
+// FleetspacesClientCreateOrUpdateResponse contains the response from method FleetspacesClient.BeginCreateOrUpdate.
+type FleetspacesClientCreateOrUpdateResponse struct {
+ // A fleetspace.
+ Fleetspace
+}
+
+// FleetspacesClientDeleteResponse contains the response from method FleetspacesClient.BeginDelete.
+type FleetspacesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// FleetspacesClientGetResponse contains the response from method FleetspacesClient.Get.
+type FleetspacesClientGetResponse struct {
+ // A fleetspace.
+ Fleetspace
+}
+
+// FleetspacesClientListByFleetResponse contains the response from method FleetspacesClient.NewListByFleetPager.
+type FleetspacesClientListByFleetResponse struct {
+ // The response of a Fleetspace list operation.
+ FleetspaceListResult
+}
+
+// FleetspacesClientRegisterServerResponse contains the response from method FleetspacesClient.BeginRegisterServer.
+type FleetspacesClientRegisterServerResponse struct {
+ // placeholder for future response values
+}
+
+// FleetspacesClientUnregisterResponse contains the response from method FleetspacesClient.BeginUnregister.
+type FleetspacesClientUnregisterResponse struct {
+ // placeholder for future response values
+}
+
+// FleetspacesClientUpdateResponse contains the response from method FleetspacesClient.BeginUpdate.
+type FleetspacesClientUpdateResponse struct {
+ // A fleetspace.
+ Fleetspace
+}
+
+// OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
+type OperationsClientListResponse struct {
+ // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
+ OperationListResult
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/time_rfc3339.go b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/time_rfc3339.go
new file mode 100644
index 000000000000..6a6d0db9efb0
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/time_rfc3339.go
@@ -0,0 +1,109 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasefleetmanager
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "reflect"
+ "regexp"
+ "strings"
+ "time"
+)
+
+// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases.
+var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`)
+
+const (
+ utcDateTime = "2006-01-02T15:04:05.999999999"
+ utcDateTimeJSON = `"` + utcDateTime + `"`
+ utcDateTimeNoT = "2006-01-02 15:04:05.999999999"
+ utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"`
+ dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00`
+ dateTimeJSON = `"` + time.RFC3339Nano + `"`
+ dateTimeJSONNoT = `"` + dateTimeNoT + `"`
+)
+
+type dateTimeRFC3339 time.Time
+
+func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalJSON()
+}
+
+func (t dateTimeRFC3339) MarshalText() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalText()
+}
+
+func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error {
+ tzOffset := tzOffsetRegex.Match(data)
+ hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t")
+ var layout string
+ if tzOffset && hasT {
+ layout = dateTimeJSON
+ } else if tzOffset {
+ layout = dateTimeJSONNoT
+ } else if hasT {
+ layout = utcDateTimeJSON
+ } else {
+ layout = utcDateTimeJSONNoT
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) UnmarshalText(data []byte) error {
+ if len(data) == 0 {
+ return nil
+ }
+ tzOffset := tzOffsetRegex.Match(data)
+ hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t")
+ var layout string
+ if tzOffset && hasT {
+ layout = time.RFC3339Nano
+ } else if tzOffset {
+ layout = dateTimeNoT
+ } else if hasT {
+ layout = utcDateTime
+ } else {
+ layout = utcDateTimeNoT
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) Parse(layout, value string) error {
+ p, err := time.Parse(layout, strings.ToUpper(value))
+ *t = dateTimeRFC3339(p)
+ return err
+}
+
+func (t dateTimeRFC3339) String() string {
+ return time.Time(t).Format(time.RFC3339Nano)
+}
+
+func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) {
+ if t == nil {
+ return
+ } else if azcore.IsNullValue(t) {
+ m[k] = nil
+ return
+ } else if reflect.ValueOf(t).IsNil() {
+ return
+ }
+ m[k] = (*dateTimeRFC3339)(t)
+}
+
+func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error {
+ if data == nil || string(data) == "null" {
+ return nil
+ }
+ var aux dateTimeRFC3339
+ if err := json.Unmarshal(data, &aux); err != nil {
+ return fmt.Errorf("struct field %s: %v", fn, err)
+ }
+ *t = (*time.Time)(&aux)
+ return nil
+}
diff --git a/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/tsp-location.yaml b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/tsp-location.yaml
new file mode 100644
index 000000000000..4ddfdb458c44
--- /dev/null
+++ b/sdk/resourcemanager/databasefleetmanager/armdatabasefleetmanager/tsp-location.yaml
@@ -0,0 +1,4 @@
+directory: specification/databasefleetmanager/DatabaseFleetManager.Management
+commit: 676334a284e5136f0a0721d6ae844bb04332f579
+repo: Azure/azure-rest-api-specs
+additionalDirectories:
\ No newline at end of file
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/CHANGELOG.md b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/CHANGELOG.md
new file mode 100644
index 000000000000..01f10e170866
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/CHANGELOG.md
@@ -0,0 +1,8 @@
+# Release History
+
+## 0.1.0 (2025-02-27)
+### Other Changes
+
+The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasewatcher/armdatabasewatcher` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html).
+
+To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt).
\ No newline at end of file
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/LICENSE.txt b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/LICENSE.txt
new file mode 100644
index 000000000000..dc0c2ffb3dc1
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/README.md b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/README.md
new file mode 100644
index 000000000000..eb65fb5abd50
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/README.md
@@ -0,0 +1,90 @@
+# Azure Databasewatcher Module for Go
+
+The `armdatabasewatcher` module provides operations for working with Azure Databasewatcher.
+
+[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/databasewatcher/armdatabasewatcher)
+
+# Getting started
+
+## Prerequisites
+
+- an [Azure subscription](https://azure.microsoft.com/free/)
+- Go 1.18 or above (You could download and install the latest version of Go from [here](https://go.dev/doc/install). 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](https://go.dev/doc/manage-install).)
+
+## Install the package
+
+This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management.
+
+Install the Azure Databasewatcher module:
+
+```sh
+go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasewatcher/armdatabasewatcher
+```
+
+## Authorization
+
+When creating a client, you will need to provide a credential for authenticating with Azure Databasewatcher. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.
+
+```go
+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](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity).
+
+## Client Factory
+
+Azure Databasewatcher module consists of one or more clients. We provide a client factory which could be used to create any client in this module.
+
+```go
+clientFactory, err := armdatabasewatcher.NewClientFactory(, 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](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore).
+
+```go
+options := arm.ClientOptions {
+ ClientOptions: azcore.ClientOptions {
+ Cloud: cloud.AzureChina,
+ },
+}
+clientFactory, err := armdatabasewatcher.NewClientFactory(, 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.
+
+```go
+client := clientFactory.NewAlertRuleResourcesClient()
+```
+
+## 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](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Databasewatcher` 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](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](https://opensource.microsoft.com/codeofconduct/).
+For more information, see the
+[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
+or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
+additional questions or comments.
\ No newline at end of file
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/alertruleresources_client.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/alertruleresources_client.go
new file mode 100644
index 000000000000..295553c4e513
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/alertruleresources_client.go
@@ -0,0 +1,309 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// AlertRuleResourcesClient contains the methods for the AlertRuleResources group.
+// Don't use this type directly, use NewAlertRuleResourcesClient() instead.
+type AlertRuleResourcesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewAlertRuleResourcesClient creates a new instance of AlertRuleResourcesClient with the specified values.
+// - subscriptionID - The ID of the target subscription. The value must be an UUID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewAlertRuleResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AlertRuleResourcesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &AlertRuleResourcesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - Create a AlertRuleResource
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - alertRuleResourceName - The alert rule proxy resource name.
+// - resource - Resource create parameters.
+// - options - AlertRuleResourcesClientCreateOrUpdateOptions contains the optional parameters for the AlertRuleResourcesClient.CreateOrUpdate
+// method.
+func (client *AlertRuleResourcesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, watcherName string, alertRuleResourceName string, resource AlertRuleResource, options *AlertRuleResourcesClientCreateOrUpdateOptions) (AlertRuleResourcesClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "AlertRuleResourcesClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, watcherName, alertRuleResourceName, resource, options)
+ if err != nil {
+ return AlertRuleResourcesClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AlertRuleResourcesClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return AlertRuleResourcesClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *AlertRuleResourcesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, alertRuleResourceName string, resource AlertRuleResource, _ *AlertRuleResourcesClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ if alertRuleResourceName == "" {
+ return nil, errors.New("parameter alertRuleResourceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{alertRuleResourceName}", url.PathEscape(alertRuleResourceName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, resource); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *AlertRuleResourcesClient) createOrUpdateHandleResponse(resp *http.Response) (AlertRuleResourcesClientCreateOrUpdateResponse, error) {
+ result := AlertRuleResourcesClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AlertRuleResource); err != nil {
+ return AlertRuleResourcesClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Delete a AlertRuleResource
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - alertRuleResourceName - The alert rule proxy resource name.
+// - options - AlertRuleResourcesClientDeleteOptions contains the optional parameters for the AlertRuleResourcesClient.Delete
+// method.
+func (client *AlertRuleResourcesClient) Delete(ctx context.Context, resourceGroupName string, watcherName string, alertRuleResourceName string, options *AlertRuleResourcesClientDeleteOptions) (AlertRuleResourcesClientDeleteResponse, error) {
+ var err error
+ const operationName = "AlertRuleResourcesClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, watcherName, alertRuleResourceName, options)
+ if err != nil {
+ return AlertRuleResourcesClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AlertRuleResourcesClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return AlertRuleResourcesClientDeleteResponse{}, err
+ }
+ return AlertRuleResourcesClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *AlertRuleResourcesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, alertRuleResourceName string, _ *AlertRuleResourcesClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ if alertRuleResourceName == "" {
+ return nil, errors.New("parameter alertRuleResourceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{alertRuleResourceName}", url.PathEscape(alertRuleResourceName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Get a AlertRuleResource
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - alertRuleResourceName - The alert rule proxy resource name.
+// - options - AlertRuleResourcesClientGetOptions contains the optional parameters for the AlertRuleResourcesClient.Get method.
+func (client *AlertRuleResourcesClient) Get(ctx context.Context, resourceGroupName string, watcherName string, alertRuleResourceName string, options *AlertRuleResourcesClientGetOptions) (AlertRuleResourcesClientGetResponse, error) {
+ var err error
+ const operationName = "AlertRuleResourcesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, watcherName, alertRuleResourceName, options)
+ if err != nil {
+ return AlertRuleResourcesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AlertRuleResourcesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AlertRuleResourcesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *AlertRuleResourcesClient) getCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, alertRuleResourceName string, _ *AlertRuleResourcesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ if alertRuleResourceName == "" {
+ return nil, errors.New("parameter alertRuleResourceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{alertRuleResourceName}", url.PathEscape(alertRuleResourceName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *AlertRuleResourcesClient) getHandleResponse(resp *http.Response) (AlertRuleResourcesClientGetResponse, error) {
+ result := AlertRuleResourcesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AlertRuleResource); err != nil {
+ return AlertRuleResourcesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByParentPager - List AlertRuleResource resources by Watcher
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - options - AlertRuleResourcesClientListByParentOptions contains the optional parameters for the AlertRuleResourcesClient.NewListByParentPager
+// method.
+func (client *AlertRuleResourcesClient) NewListByParentPager(resourceGroupName string, watcherName string, options *AlertRuleResourcesClientListByParentOptions) *runtime.Pager[AlertRuleResourcesClientListByParentResponse] {
+ return runtime.NewPager(runtime.PagingHandler[AlertRuleResourcesClientListByParentResponse]{
+ More: func(page AlertRuleResourcesClientListByParentResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *AlertRuleResourcesClientListByParentResponse) (AlertRuleResourcesClientListByParentResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AlertRuleResourcesClient.NewListByParentPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByParentCreateRequest(ctx, resourceGroupName, watcherName, options)
+ }, nil)
+ if err != nil {
+ return AlertRuleResourcesClientListByParentResponse{}, err
+ }
+ return client.listByParentHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByParentCreateRequest creates the ListByParent request.
+func (client *AlertRuleResourcesClient) listByParentCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, _ *AlertRuleResourcesClientListByParentOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByParentHandleResponse handles the ListByParent response.
+func (client *AlertRuleResourcesClient) listByParentHandleResponse(resp *http.Response) (AlertRuleResourcesClientListByParentResponse, error) {
+ result := AlertRuleResourcesClientListByParentResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AlertRuleResourceListResult); err != nil {
+ return AlertRuleResourcesClientListByParentResponse{}, err
+ }
+ return result, nil
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/alertruleresources_client_example_test.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/alertruleresources_client_example_test.go
new file mode 100644
index 000000000000..61c9f599aab7
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/alertruleresources_client_example_test.go
@@ -0,0 +1,183 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher_test
+
+import (
+ "context"
+ "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/databasewatcher/armdatabasewatcher"
+ "log"
+ "time"
+)
+
+// Generated from example definition: 2025-01-02/AlertRuleResources_CreateOrUpdate_MaximumSet_Gen.json
+func ExampleAlertRuleResourcesClient_CreateOrUpdate() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("A76F9850-996B-40B3-94D4-C98110A0EEC9", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewAlertRuleResourcesClient().CreateOrUpdate(ctx, "rgWatcher", "testWatcher", "testAlert", armdatabasewatcher.AlertRuleResource{
+ Properties: &armdatabasewatcher.AlertRuleResourceProperties{
+ AlertRuleResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.insights/scheduledqueryrules/alerts-demo"),
+ CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.798Z"); return t }()),
+ AlertRuleTemplateVersion: to.Ptr("1.0"),
+ AlertRuleTemplateID: to.Ptr("someTemplateId"),
+ CreatedWithProperties: to.Ptr(armdatabasewatcher.AlertRuleCreationPropertiesCreatedWithActionGroup),
+ },
+ }, 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 = armdatabasewatcher.AlertRuleResourcesClientCreateOrUpdateResponse{
+ // AlertRuleResource: &armdatabasewatcher.AlertRuleResource{
+ // Properties: &armdatabasewatcher.AlertRuleResourceProperties{
+ // AlertRuleResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.insights/scheduledqueryrules/alerts-demo"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.798Z"); return t}()),
+ // AlertRuleTemplateVersion: to.Ptr("1.0"),
+ // AlertRuleTemplateID: to.Ptr("someTemplateId"),
+ // CreatedWithProperties: to.Ptr(armdatabasewatcher.AlertRuleCreationPropertiesCreatedWithActionGroup),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ResourceProvisioningStateSucceeded),
+ // },
+ // ID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.databasewatcher/watchers/testWatcher/alertRuleResources/testAlert"),
+ // Name: to.Ptr("testAlert"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers/alertRuleResources"),
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-01-02/AlertRuleResources_Delete_MaximumSet_Gen.json
+func ExampleAlertRuleResourcesClient_Delete() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("A76F9850-996B-40B3-94D4-C98110A0EEC9", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewAlertRuleResourcesClient().Delete(ctx, "rgWatcher", "testWatcher", "testAlert", 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 = armdatabasewatcher.AlertRuleResourcesClientDeleteResponse{
+ // }
+}
+
+// Generated from example definition: 2025-01-02/AlertRuleResources_Get_MaximumSet_Gen.json
+func ExampleAlertRuleResourcesClient_Get() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("A76F9850-996B-40B3-94D4-C98110A0EEC9", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewAlertRuleResourcesClient().Get(ctx, "rgWatcher", "testWatcher", "testAlert", 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 = armdatabasewatcher.AlertRuleResourcesClientGetResponse{
+ // AlertRuleResource: &armdatabasewatcher.AlertRuleResource{
+ // Properties: &armdatabasewatcher.AlertRuleResourceProperties{
+ // AlertRuleResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.insights/scheduledqueryrules/alerts-demo"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.798Z"); return t}()),
+ // AlertRuleTemplateVersion: to.Ptr("1.0"),
+ // AlertRuleTemplateID: to.Ptr("someTemplateId"),
+ // CreatedWithProperties: to.Ptr(armdatabasewatcher.AlertRuleCreationPropertiesCreatedWithActionGroup),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ResourceProvisioningStateSucceeded),
+ // },
+ // ID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.databasewatcher/watchers/testWatcher/alertRuleResources/testAlert"),
+ // Name: to.Ptr("testAlert"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers/alertRuleResources"),
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-01-02/AlertRuleResources_ListByParent_MaximumSet_Gen.json
+func ExampleAlertRuleResourcesClient_NewListByParentPager() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("A76F9850-996B-40B3-94D4-C98110A0EEC9", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ pager := clientFactory.NewAlertRuleResourcesClient().NewListByParentPager("rgWatcher", "testWatcher", 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 = armdatabasewatcher.AlertRuleResourcesClientListByParentResponse{
+ // AlertRuleResourceListResult: armdatabasewatcher.AlertRuleResourceListResult{
+ // Value: []*armdatabasewatcher.AlertRuleResource{
+ // {
+ // Properties: &armdatabasewatcher.AlertRuleResourceProperties{
+ // AlertRuleResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.insights/scheduledqueryrules/alerts-demo"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.798Z"); return t}()),
+ // AlertRuleTemplateVersion: to.Ptr("1.0"),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ResourceProvisioningStateSucceeded),
+ // AlertRuleTemplateID: to.Ptr("someTemplateId"),
+ // CreatedWithProperties: to.Ptr(armdatabasewatcher.AlertRuleCreationPropertiesCreatedWithActionGroup),
+ // },
+ // ID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.databasewatcher/watchers/testWatcher/alertRuleResources/testAlert"),
+ // Name: to.Ptr("testAlert"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers/alertRuleResources"),
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // },
+ // NextLink: to.Ptr("https://microsoft.com/a"),
+ // },
+ // }
+ }
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/ci.yml b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/ci.yml
new file mode 100644
index 000000000000..3a06f60c597b
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/ci.yml
@@ -0,0 +1,28 @@
+# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
+trigger:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/resourcemanager/databasewatcher/armdatabasewatcher/
+
+pr:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/resourcemanager/databasewatcher/armdatabasewatcher/
+
+extends:
+ template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
+ parameters:
+ IncludeRelease: true
+ ServiceDirectory: 'resourcemanager/databasewatcher/armdatabasewatcher'
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/client_factory.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/client_factory.go
new file mode 100644
index 000000000000..db28bbe342ae
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/client_factory.go
@@ -0,0 +1,80 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher
+
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+)
+
+// ClientFactory is a client factory used to create any client in this module.
+// Don't use this type directly, use NewClientFactory instead.
+type ClientFactory struct {
+ subscriptionID string
+ internal *arm.Client
+}
+
+// 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 ID of the target subscription. The value must be an UUID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) {
+ internal, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ return &ClientFactory{
+ subscriptionID: subscriptionID,
+ internal: internal,
+ }, nil
+}
+
+// NewAlertRuleResourcesClient creates a new instance of AlertRuleResourcesClient.
+func (c *ClientFactory) NewAlertRuleResourcesClient() *AlertRuleResourcesClient {
+ return &AlertRuleResourcesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewHealthValidationsClient creates a new instance of HealthValidationsClient.
+func (c *ClientFactory) NewHealthValidationsClient() *HealthValidationsClient {
+ return &HealthValidationsClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewOperationsClient creates a new instance of OperationsClient.
+func (c *ClientFactory) NewOperationsClient() *OperationsClient {
+ return &OperationsClient{
+ internal: c.internal,
+ }
+}
+
+// NewSharedPrivateLinkResourcesClient creates a new instance of SharedPrivateLinkResourcesClient.
+func (c *ClientFactory) NewSharedPrivateLinkResourcesClient() *SharedPrivateLinkResourcesClient {
+ return &SharedPrivateLinkResourcesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewTargetsClient creates a new instance of TargetsClient.
+func (c *ClientFactory) NewTargetsClient() *TargetsClient {
+ return &TargetsClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewWatchersClient creates a new instance of WatchersClient.
+func (c *ClientFactory) NewWatchersClient() *WatchersClient {
+ return &WatchersClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/constants.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/constants.go
new file mode 100644
index 000000000000..fb14d4b4600b
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/constants.go
@@ -0,0 +1,277 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher
+
+const (
+ moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasewatcher/armdatabasewatcher"
+ moduleVersion = "v0.1.0"
+)
+
+// ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+type ActionType string
+
+const (
+ // ActionTypeInternal - Actions are for internal-only APIs.
+ ActionTypeInternal ActionType = "Internal"
+)
+
+// PossibleActionTypeValues returns the possible values for the ActionType const type.
+func PossibleActionTypeValues() []ActionType {
+ return []ActionType{
+ ActionTypeInternal,
+ }
+}
+
+// AlertRuleCreationProperties - The properties with which the alert rule resource was created.
+type AlertRuleCreationProperties string
+
+const (
+ // AlertRuleCreationPropertiesCreatedWithActionGroup - The alert rule was created with an action group.
+ AlertRuleCreationPropertiesCreatedWithActionGroup AlertRuleCreationProperties = "CreatedWithActionGroup"
+ // AlertRuleCreationPropertiesNone - The alert rule was created with no properties.
+ AlertRuleCreationPropertiesNone AlertRuleCreationProperties = "None"
+)
+
+// PossibleAlertRuleCreationPropertiesValues returns the possible values for the AlertRuleCreationProperties const type.
+func PossibleAlertRuleCreationPropertiesValues() []AlertRuleCreationProperties {
+ return []AlertRuleCreationProperties{
+ AlertRuleCreationPropertiesCreatedWithActionGroup,
+ AlertRuleCreationPropertiesNone,
+ }
+}
+
+// CreatedByType - The kind of entity that created the resource.
+type CreatedByType string
+
+const (
+ // CreatedByTypeApplication - The entity was created by an application.
+ CreatedByTypeApplication CreatedByType = "Application"
+ // CreatedByTypeKey - The entity was created by a key.
+ CreatedByTypeKey CreatedByType = "Key"
+ // CreatedByTypeManagedIdentity - The entity was created by a managed identity.
+ CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
+ // CreatedByTypeUser - The entity was created by a user.
+ CreatedByTypeUser CreatedByType = "User"
+)
+
+// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.
+func PossibleCreatedByTypeValues() []CreatedByType {
+ return []CreatedByType{
+ CreatedByTypeApplication,
+ CreatedByTypeKey,
+ CreatedByTypeManagedIdentity,
+ CreatedByTypeUser,
+ }
+}
+
+// KustoOfferingType - The type of Kusto offering.
+type KustoOfferingType string
+
+const (
+ // KustoOfferingTypeAdx - The Azure Data Explorer cluster Kusto offering.
+ KustoOfferingTypeAdx KustoOfferingType = "adx"
+ // KustoOfferingTypeFabric - The Fabric Real-Time Analytics Kusto offering.
+ KustoOfferingTypeFabric KustoOfferingType = "fabric"
+ // KustoOfferingTypeFree - The free Azure Data Explorer cluster Kusto offering.
+ KustoOfferingTypeFree KustoOfferingType = "free"
+)
+
+// PossibleKustoOfferingTypeValues returns the possible values for the KustoOfferingType const type.
+func PossibleKustoOfferingTypeValues() []KustoOfferingType {
+ return []KustoOfferingType{
+ KustoOfferingTypeAdx,
+ KustoOfferingTypeFabric,
+ KustoOfferingTypeFree,
+ }
+}
+
+// ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
+type ManagedServiceIdentityType string
+
+const (
+ // ManagedServiceIdentityTypeNone - No managed identity.
+ ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None"
+ // ManagedServiceIdentityTypeSystemAndUserAssigned - System and user assigned managed identity.
+ ManagedServiceIdentityTypeSystemAndUserAssigned ManagedServiceIdentityType = "SystemAssigned, UserAssigned"
+ // ManagedServiceIdentityTypeSystemAssigned - System assigned managed identity.
+ ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned"
+ // ManagedServiceIdentityTypeUserAssigned - User assigned managed identity.
+ ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned"
+)
+
+// PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type.
+func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType {
+ return []ManagedServiceIdentityType{
+ ManagedServiceIdentityTypeNone,
+ ManagedServiceIdentityTypeSystemAndUserAssigned,
+ ManagedServiceIdentityTypeSystemAssigned,
+ ManagedServiceIdentityTypeUserAssigned,
+ }
+}
+
+// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
+// value is "user,system"
+type Origin string
+
+const (
+ // OriginSystem - Indicates the operation is initiated by a system.
+ OriginSystem Origin = "system"
+ // OriginUser - Indicates the operation is initiated by a user.
+ OriginUser Origin = "user"
+ // OriginUserSystem - Indicates the operation is initiated by a user or system.
+ OriginUserSystem Origin = "user,system"
+)
+
+// PossibleOriginValues returns the possible values for the Origin const type.
+func PossibleOriginValues() []Origin {
+ return []Origin{
+ OriginSystem,
+ OriginUser,
+ OriginUserSystem,
+ }
+}
+
+// ProvisioningState - The status of the last provisioning operation performed on the resource.
+type ProvisioningState string
+
+const (
+ // ProvisioningStateCanceled - Resource creation was canceled.
+ ProvisioningStateCanceled ProvisioningState = "Canceled"
+ // ProvisioningStateFailed - Resource creation failed.
+ ProvisioningStateFailed ProvisioningState = "Failed"
+ // ProvisioningStateSucceeded - Resource has been created.
+ ProvisioningStateSucceeded ProvisioningState = "Succeeded"
+)
+
+// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.
+func PossibleProvisioningStateValues() []ProvisioningState {
+ return []ProvisioningState{
+ ProvisioningStateCanceled,
+ ProvisioningStateFailed,
+ ProvisioningStateSucceeded,
+ }
+}
+
+// ResourceProvisioningState - The provisioning state of a resource type.
+type ResourceProvisioningState string
+
+const (
+ // ResourceProvisioningStateCanceled - Resource creation was canceled.
+ ResourceProvisioningStateCanceled ResourceProvisioningState = "Canceled"
+ // ResourceProvisioningStateFailed - Resource creation failed.
+ ResourceProvisioningStateFailed ResourceProvisioningState = "Failed"
+ // ResourceProvisioningStateSucceeded - Resource has been created.
+ ResourceProvisioningStateSucceeded ResourceProvisioningState = "Succeeded"
+)
+
+// PossibleResourceProvisioningStateValues returns the possible values for the ResourceProvisioningState const type.
+func PossibleResourceProvisioningStateValues() []ResourceProvisioningState {
+ return []ResourceProvisioningState{
+ ResourceProvisioningStateCanceled,
+ ResourceProvisioningStateFailed,
+ ResourceProvisioningStateSucceeded,
+ }
+}
+
+// SharedPrivateLinkResourceStatus - Status of the shared private link resource. Can be Pending, Approved, Rejected or Disconnected.
+type SharedPrivateLinkResourceStatus string
+
+const (
+ // SharedPrivateLinkResourceStatusApproved - The shared private link connection request was approved by the resource owner.
+ SharedPrivateLinkResourceStatusApproved SharedPrivateLinkResourceStatus = "Approved"
+ // SharedPrivateLinkResourceStatusDisconnected - The shared private link connection request was disconnected by the resource
+ // owner.
+ SharedPrivateLinkResourceStatusDisconnected SharedPrivateLinkResourceStatus = "Disconnected"
+ // SharedPrivateLinkResourceStatusPending - The shared private link connection request was not yet authorized by the resource
+ // owner.
+ SharedPrivateLinkResourceStatusPending SharedPrivateLinkResourceStatus = "Pending"
+ // SharedPrivateLinkResourceStatusRejected - The shared private link connection request was rejected by the resource owner.
+ SharedPrivateLinkResourceStatusRejected SharedPrivateLinkResourceStatus = "Rejected"
+)
+
+// PossibleSharedPrivateLinkResourceStatusValues returns the possible values for the SharedPrivateLinkResourceStatus const type.
+func PossibleSharedPrivateLinkResourceStatusValues() []SharedPrivateLinkResourceStatus {
+ return []SharedPrivateLinkResourceStatus{
+ SharedPrivateLinkResourceStatusApproved,
+ SharedPrivateLinkResourceStatusDisconnected,
+ SharedPrivateLinkResourceStatusPending,
+ SharedPrivateLinkResourceStatusRejected,
+ }
+}
+
+// TargetAuthenticationType - The type of authentication to use when connecting to a target.
+type TargetAuthenticationType string
+
+const (
+ // TargetAuthenticationTypeAAD - The Azure Active Directory authentication.
+ TargetAuthenticationTypeAAD TargetAuthenticationType = "Aad"
+ // TargetAuthenticationTypeSQL - The SQL password authentication.
+ TargetAuthenticationTypeSQL TargetAuthenticationType = "Sql"
+)
+
+// PossibleTargetAuthenticationTypeValues returns the possible values for the TargetAuthenticationType const type.
+func PossibleTargetAuthenticationTypeValues() []TargetAuthenticationType {
+ return []TargetAuthenticationType{
+ TargetAuthenticationTypeAAD,
+ TargetAuthenticationTypeSQL,
+ }
+}
+
+// ValidationStatus - Health validation status.
+type ValidationStatus string
+
+const (
+ // ValidationStatusCanceled - Health validation was canceled.
+ ValidationStatusCanceled ValidationStatus = "Canceled"
+ // ValidationStatusFailed - Health validation failed.
+ ValidationStatusFailed ValidationStatus = "Failed"
+ // ValidationStatusNotStarted - Health validation has not started.
+ ValidationStatusNotStarted ValidationStatus = "NotStarted"
+ // ValidationStatusRunning - Health validation is running.
+ ValidationStatusRunning ValidationStatus = "Running"
+ // ValidationStatusSucceeded - Health validation completed successfully.
+ ValidationStatusSucceeded ValidationStatus = "Succeeded"
+ // ValidationStatusTimedOut - Health validation timed out.
+ ValidationStatusTimedOut ValidationStatus = "TimedOut"
+)
+
+// PossibleValidationStatusValues returns the possible values for the ValidationStatus const type.
+func PossibleValidationStatusValues() []ValidationStatus {
+ return []ValidationStatus{
+ ValidationStatusCanceled,
+ ValidationStatusFailed,
+ ValidationStatusNotStarted,
+ ValidationStatusRunning,
+ ValidationStatusSucceeded,
+ ValidationStatusTimedOut,
+ }
+}
+
+// WatcherStatus - The monitoring collection status of a watcher.
+type WatcherStatus string
+
+const (
+ // WatcherStatusDeleting - Denotes the watcher is in a deleting state.
+ WatcherStatusDeleting WatcherStatus = "Deleting"
+ // WatcherStatusRunning - Denotes the watcher is in a running state.
+ WatcherStatusRunning WatcherStatus = "Running"
+ // WatcherStatusStarting - Denotes the watcher is in a starting state.
+ WatcherStatusStarting WatcherStatus = "Starting"
+ // WatcherStatusStopped - Denotes the watcher is in a stopped state.
+ WatcherStatusStopped WatcherStatus = "Stopped"
+ // WatcherStatusStopping - Denotes the watcher is in a stopping state.
+ WatcherStatusStopping WatcherStatus = "Stopping"
+)
+
+// PossibleWatcherStatusValues returns the possible values for the WatcherStatus const type.
+func PossibleWatcherStatusValues() []WatcherStatus {
+ return []WatcherStatus{
+ WatcherStatusDeleting,
+ WatcherStatusRunning,
+ WatcherStatusStarting,
+ WatcherStatusStopped,
+ WatcherStatusStopping,
+ }
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/alertruleresources_server.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/alertruleresources_server.go
new file mode 100644
index 000000000000..c95341c938b2
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/alertruleresources_server.go
@@ -0,0 +1,267 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasewatcher/armdatabasewatcher"
+ "net/http"
+ "net/url"
+ "regexp"
+)
+
+// AlertRuleResourcesServer is a fake server for instances of the armdatabasewatcher.AlertRuleResourcesClient type.
+type AlertRuleResourcesServer struct {
+ // CreateOrUpdate is the fake for method AlertRuleResourcesClient.CreateOrUpdate
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
+ CreateOrUpdate func(ctx context.Context, resourceGroupName string, watcherName string, alertRuleResourceName string, resource armdatabasewatcher.AlertRuleResource, options *armdatabasewatcher.AlertRuleResourcesClientCreateOrUpdateOptions) (resp azfake.Responder[armdatabasewatcher.AlertRuleResourcesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)
+
+ // Delete is the fake for method AlertRuleResourcesClient.Delete
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent
+ Delete func(ctx context.Context, resourceGroupName string, watcherName string, alertRuleResourceName string, options *armdatabasewatcher.AlertRuleResourcesClientDeleteOptions) (resp azfake.Responder[armdatabasewatcher.AlertRuleResourcesClientDeleteResponse], errResp azfake.ErrorResponder)
+
+ // Get is the fake for method AlertRuleResourcesClient.Get
+ // HTTP status codes to indicate success: http.StatusOK
+ Get func(ctx context.Context, resourceGroupName string, watcherName string, alertRuleResourceName string, options *armdatabasewatcher.AlertRuleResourcesClientGetOptions) (resp azfake.Responder[armdatabasewatcher.AlertRuleResourcesClientGetResponse], errResp azfake.ErrorResponder)
+
+ // NewListByParentPager is the fake for method AlertRuleResourcesClient.NewListByParentPager
+ // HTTP status codes to indicate success: http.StatusOK
+ NewListByParentPager func(resourceGroupName string, watcherName string, options *armdatabasewatcher.AlertRuleResourcesClientListByParentOptions) (resp azfake.PagerResponder[armdatabasewatcher.AlertRuleResourcesClientListByParentResponse])
+}
+
+// NewAlertRuleResourcesServerTransport creates a new instance of AlertRuleResourcesServerTransport with the provided implementation.
+// The returned AlertRuleResourcesServerTransport instance is connected to an instance of armdatabasewatcher.AlertRuleResourcesClient via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewAlertRuleResourcesServerTransport(srv *AlertRuleResourcesServer) *AlertRuleResourcesServerTransport {
+ return &AlertRuleResourcesServerTransport{
+ srv: srv,
+ newListByParentPager: newTracker[azfake.PagerResponder[armdatabasewatcher.AlertRuleResourcesClientListByParentResponse]](),
+ }
+}
+
+// AlertRuleResourcesServerTransport connects instances of armdatabasewatcher.AlertRuleResourcesClient to instances of AlertRuleResourcesServer.
+// Don't use this type directly, use NewAlertRuleResourcesServerTransport instead.
+type AlertRuleResourcesServerTransport struct {
+ srv *AlertRuleResourcesServer
+ newListByParentPager *tracker[azfake.PagerResponder[armdatabasewatcher.AlertRuleResourcesClientListByParentResponse]]
+}
+
+// Do implements the policy.Transporter interface for AlertRuleResourcesServerTransport.
+func (a *AlertRuleResourcesServerTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ return a.dispatchToMethodFake(req, method)
+}
+
+func (a *AlertRuleResourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if alertRuleResourcesServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = alertRuleResourcesServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "AlertRuleResourcesClient.CreateOrUpdate":
+ res.resp, res.err = a.dispatchCreateOrUpdate(req)
+ case "AlertRuleResourcesClient.Delete":
+ res.resp, res.err = a.dispatchDelete(req)
+ case "AlertRuleResourcesClient.Get":
+ res.resp, res.err = a.dispatchGet(req)
+ case "AlertRuleResourcesClient.NewListByParentPager":
+ res.resp, res.err = a.dispatchNewListByParentPager(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
+}
+
+func (a *AlertRuleResourcesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) {
+ if a.srv.CreateOrUpdate == nil {
+ return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/alertRuleResources/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasewatcher.AlertRuleResource](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ alertRuleResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("alertRuleResourceName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := a.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, watcherNameParam, alertRuleResourceNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AlertRuleResource, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (a *AlertRuleResourcesServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) {
+ if a.srv.Delete == nil {
+ return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/alertRuleResources/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ alertRuleResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("alertRuleResourceName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := a.srv.Delete(req.Context(), resourceGroupNameParam, watcherNameParam, alertRuleResourceNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)}
+ }
+ resp, err := server.NewResponse(respContent, req, nil)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (a *AlertRuleResourcesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
+ if a.srv.Get == nil {
+ return nil, &nonRetriableError{errors.New("fake for method Get not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/alertRuleResources/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ alertRuleResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("alertRuleResourceName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, watcherNameParam, alertRuleResourceNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AlertRuleResource, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (a *AlertRuleResourcesServerTransport) dispatchNewListByParentPager(req *http.Request) (*http.Response, error) {
+ if a.srv.NewListByParentPager == nil {
+ return nil, &nonRetriableError{errors.New("fake for method NewListByParentPager not implemented")}
+ }
+ newListByParentPager := a.newListByParentPager.get(req)
+ if newListByParentPager == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/alertRuleResources`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ resp := a.srv.NewListByParentPager(resourceGroupNameParam, watcherNameParam, nil)
+ newListByParentPager = &resp
+ a.newListByParentPager.add(req, newListByParentPager)
+ server.PagerResponderInjectNextLinks(newListByParentPager, req, func(page *armdatabasewatcher.AlertRuleResourcesClientListByParentResponse, createLink func() string) {
+ page.NextLink = to.Ptr(createLink())
+ })
+ }
+ resp, err := server.PagerResponderNext(newListByParentPager, req)
+ if err != nil {
+ return nil, err
+ }
+ if !contains([]int{http.StatusOK}, resp.StatusCode) {
+ a.newListByParentPager.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
+ }
+ if !server.PagerResponderMore(newListByParentPager) {
+ a.newListByParentPager.remove(req)
+ }
+ return resp, nil
+}
+
+// set this to conditionally intercept incoming requests to AlertRuleResourcesServerTransport
+var alertRuleResourcesServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/healthvalidations_server.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/healthvalidations_server.go
new file mode 100644
index 000000000000..95b7ca6aa035
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/healthvalidations_server.go
@@ -0,0 +1,233 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasewatcher/armdatabasewatcher"
+ "net/http"
+ "net/url"
+ "regexp"
+)
+
+// HealthValidationsServer is a fake server for instances of the armdatabasewatcher.HealthValidationsClient type.
+type HealthValidationsServer struct {
+ // Get is the fake for method HealthValidationsClient.Get
+ // HTTP status codes to indicate success: http.StatusOK
+ Get func(ctx context.Context, resourceGroupName string, watcherName string, healthValidationName string, options *armdatabasewatcher.HealthValidationsClientGetOptions) (resp azfake.Responder[armdatabasewatcher.HealthValidationsClientGetResponse], errResp azfake.ErrorResponder)
+
+ // NewListByParentPager is the fake for method HealthValidationsClient.NewListByParentPager
+ // HTTP status codes to indicate success: http.StatusOK
+ NewListByParentPager func(resourceGroupName string, watcherName string, options *armdatabasewatcher.HealthValidationsClientListByParentOptions) (resp azfake.PagerResponder[armdatabasewatcher.HealthValidationsClientListByParentResponse])
+
+ // BeginStartValidation is the fake for method HealthValidationsClient.BeginStartValidation
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
+ BeginStartValidation func(ctx context.Context, resourceGroupName string, watcherName string, healthValidationName string, options *armdatabasewatcher.HealthValidationsClientBeginStartValidationOptions) (resp azfake.PollerResponder[armdatabasewatcher.HealthValidationsClientStartValidationResponse], errResp azfake.ErrorResponder)
+}
+
+// NewHealthValidationsServerTransport creates a new instance of HealthValidationsServerTransport with the provided implementation.
+// The returned HealthValidationsServerTransport instance is connected to an instance of armdatabasewatcher.HealthValidationsClient via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewHealthValidationsServerTransport(srv *HealthValidationsServer) *HealthValidationsServerTransport {
+ return &HealthValidationsServerTransport{
+ srv: srv,
+ newListByParentPager: newTracker[azfake.PagerResponder[armdatabasewatcher.HealthValidationsClientListByParentResponse]](),
+ beginStartValidation: newTracker[azfake.PollerResponder[armdatabasewatcher.HealthValidationsClientStartValidationResponse]](),
+ }
+}
+
+// HealthValidationsServerTransport connects instances of armdatabasewatcher.HealthValidationsClient to instances of HealthValidationsServer.
+// Don't use this type directly, use NewHealthValidationsServerTransport instead.
+type HealthValidationsServerTransport struct {
+ srv *HealthValidationsServer
+ newListByParentPager *tracker[azfake.PagerResponder[armdatabasewatcher.HealthValidationsClientListByParentResponse]]
+ beginStartValidation *tracker[azfake.PollerResponder[armdatabasewatcher.HealthValidationsClientStartValidationResponse]]
+}
+
+// Do implements the policy.Transporter interface for HealthValidationsServerTransport.
+func (h *HealthValidationsServerTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ return h.dispatchToMethodFake(req, method)
+}
+
+func (h *HealthValidationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if healthValidationsServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = healthValidationsServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "HealthValidationsClient.Get":
+ res.resp, res.err = h.dispatchGet(req)
+ case "HealthValidationsClient.NewListByParentPager":
+ res.resp, res.err = h.dispatchNewListByParentPager(req)
+ case "HealthValidationsClient.BeginStartValidation":
+ res.resp, res.err = h.dispatchBeginStartValidation(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
+}
+
+func (h *HealthValidationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
+ if h.srv.Get == nil {
+ return nil, &nonRetriableError{errors.New("fake for method Get not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/healthValidations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ healthValidationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("healthValidationName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := h.srv.Get(req.Context(), resourceGroupNameParam, watcherNameParam, healthValidationNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).HealthValidation, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (h *HealthValidationsServerTransport) dispatchNewListByParentPager(req *http.Request) (*http.Response, error) {
+ if h.srv.NewListByParentPager == nil {
+ return nil, &nonRetriableError{errors.New("fake for method NewListByParentPager not implemented")}
+ }
+ newListByParentPager := h.newListByParentPager.get(req)
+ if newListByParentPager == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/healthValidations`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ resp := h.srv.NewListByParentPager(resourceGroupNameParam, watcherNameParam, nil)
+ newListByParentPager = &resp
+ h.newListByParentPager.add(req, newListByParentPager)
+ server.PagerResponderInjectNextLinks(newListByParentPager, req, func(page *armdatabasewatcher.HealthValidationsClientListByParentResponse, createLink func() string) {
+ page.NextLink = to.Ptr(createLink())
+ })
+ }
+ resp, err := server.PagerResponderNext(newListByParentPager, req)
+ if err != nil {
+ return nil, err
+ }
+ if !contains([]int{http.StatusOK}, resp.StatusCode) {
+ h.newListByParentPager.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
+ }
+ if !server.PagerResponderMore(newListByParentPager) {
+ h.newListByParentPager.remove(req)
+ }
+ return resp, nil
+}
+
+func (h *HealthValidationsServerTransport) dispatchBeginStartValidation(req *http.Request) (*http.Response, error) {
+ if h.srv.BeginStartValidation == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginStartValidation not implemented")}
+ }
+ beginStartValidation := h.beginStartValidation.get(req)
+ if beginStartValidation == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/healthValidations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startValidation`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ healthValidationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("healthValidationName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := h.srv.BeginStartValidation(req.Context(), resourceGroupNameParam, watcherNameParam, healthValidationNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginStartValidation = &respr
+ h.beginStartValidation.add(req, beginStartValidation)
+ }
+
+ resp, err := server.PollerResponderNext(beginStartValidation, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
+ h.beginStartValidation.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginStartValidation) {
+ h.beginStartValidation.remove(req)
+ }
+
+ return resp, nil
+}
+
+// set this to conditionally intercept incoming requests to HealthValidationsServerTransport
+var healthValidationsServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/internal.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/internal.go
new file mode 100644
index 000000000000..7425b6a669e2
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/internal.go
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "net/http"
+ "sync"
+)
+
+type result struct {
+ resp *http.Response
+ err error
+}
+
+type nonRetriableError struct {
+ error
+}
+
+func (nonRetriableError) NonRetriable() {
+ // marker method
+}
+
+func contains[T comparable](s []T, v T) bool {
+ for _, vv := range s {
+ if vv == v {
+ return true
+ }
+ }
+ return false
+}
+
+func newTracker[T any]() *tracker[T] {
+ return &tracker[T]{
+ items: map[string]*T{},
+ }
+}
+
+type tracker[T any] struct {
+ items map[string]*T
+ mu sync.Mutex
+}
+
+func (p *tracker[T]) get(req *http.Request) *T {
+ p.mu.Lock()
+ defer p.mu.Unlock()
+ if item, ok := p.items[server.SanitizePagerPollerPath(req.URL.Path)]; ok {
+ return item
+ }
+ return nil
+}
+
+func (p *tracker[T]) add(req *http.Request, item *T) {
+ p.mu.Lock()
+ defer p.mu.Unlock()
+ p.items[server.SanitizePagerPollerPath(req.URL.Path)] = item
+}
+
+func (p *tracker[T]) remove(req *http.Request) {
+ p.mu.Lock()
+ defer p.mu.Unlock()
+ delete(p.items, server.SanitizePagerPollerPath(req.URL.Path))
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/operations_server.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/operations_server.go
new file mode 100644
index 000000000000..a0cc87fd81d7
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/operations_server.go
@@ -0,0 +1,117 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "errors"
+ "fmt"
+ azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasewatcher/armdatabasewatcher"
+ "net/http"
+)
+
+// OperationsServer is a fake server for instances of the armdatabasewatcher.OperationsClient type.
+type OperationsServer struct {
+ // NewListPager is the fake for method OperationsClient.NewListPager
+ // HTTP status codes to indicate success: http.StatusOK
+ NewListPager func(options *armdatabasewatcher.OperationsClientListOptions) (resp azfake.PagerResponder[armdatabasewatcher.OperationsClientListResponse])
+}
+
+// NewOperationsServerTransport creates a new instance of OperationsServerTransport with the provided implementation.
+// The returned OperationsServerTransport instance is connected to an instance of armdatabasewatcher.OperationsClient via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewOperationsServerTransport(srv *OperationsServer) *OperationsServerTransport {
+ return &OperationsServerTransport{
+ srv: srv,
+ newListPager: newTracker[azfake.PagerResponder[armdatabasewatcher.OperationsClientListResponse]](),
+ }
+}
+
+// OperationsServerTransport connects instances of armdatabasewatcher.OperationsClient to instances of OperationsServer.
+// Don't use this type directly, use NewOperationsServerTransport instead.
+type OperationsServerTransport struct {
+ srv *OperationsServer
+ newListPager *tracker[azfake.PagerResponder[armdatabasewatcher.OperationsClientListResponse]]
+}
+
+// Do implements the policy.Transporter interface for OperationsServerTransport.
+func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ return o.dispatchToMethodFake(req, method)
+}
+
+func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if operationsServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "OperationsClient.NewListPager":
+ res.resp, res.err = o.dispatchNewListPager(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
+}
+
+func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) {
+ if o.srv.NewListPager == nil {
+ return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")}
+ }
+ newListPager := o.newListPager.get(req)
+ if newListPager == nil {
+ resp := o.srv.NewListPager(nil)
+ newListPager = &resp
+ o.newListPager.add(req, newListPager)
+ server.PagerResponderInjectNextLinks(newListPager, req, func(page *armdatabasewatcher.OperationsClientListResponse, createLink func() string) {
+ page.NextLink = to.Ptr(createLink())
+ })
+ }
+ resp, err := server.PagerResponderNext(newListPager, req)
+ if err != nil {
+ return nil, err
+ }
+ if !contains([]int{http.StatusOK}, resp.StatusCode) {
+ o.newListPager.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
+ }
+ if !server.PagerResponderMore(newListPager) {
+ o.newListPager.remove(req)
+ }
+ return resp, nil
+}
+
+// set this to conditionally intercept incoming requests to OperationsServerTransport
+var operationsServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/server_factory.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/server_factory.go
new file mode 100644
index 000000000000..1e703d61daa4
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/server_factory.go
@@ -0,0 +1,113 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "errors"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "strings"
+ "sync"
+)
+
+// ServerFactory is a fake server for instances of the armdatabasewatcher.ClientFactory type.
+type ServerFactory struct {
+ // AlertRuleResourcesServer contains the fakes for client AlertRuleResourcesClient
+ AlertRuleResourcesServer AlertRuleResourcesServer
+
+ // HealthValidationsServer contains the fakes for client HealthValidationsClient
+ HealthValidationsServer HealthValidationsServer
+
+ // OperationsServer contains the fakes for client OperationsClient
+ OperationsServer OperationsServer
+
+ // SharedPrivateLinkResourcesServer contains the fakes for client SharedPrivateLinkResourcesClient
+ SharedPrivateLinkResourcesServer SharedPrivateLinkResourcesServer
+
+ // TargetsServer contains the fakes for client TargetsClient
+ TargetsServer TargetsServer
+
+ // WatchersServer contains the fakes for client WatchersClient
+ WatchersServer WatchersServer
+}
+
+// NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation.
+// The returned ServerFactoryTransport instance is connected to an instance of armdatabasewatcher.ClientFactory via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport {
+ return &ServerFactoryTransport{
+ srv: srv,
+ }
+}
+
+// ServerFactoryTransport connects instances of armdatabasewatcher.ClientFactory to instances of ServerFactory.
+// Don't use this type directly, use NewServerFactoryTransport instead.
+type ServerFactoryTransport struct {
+ srv *ServerFactory
+ trMu sync.Mutex
+ trAlertRuleResourcesServer *AlertRuleResourcesServerTransport
+ trHealthValidationsServer *HealthValidationsServerTransport
+ trOperationsServer *OperationsServerTransport
+ trSharedPrivateLinkResourcesServer *SharedPrivateLinkResourcesServerTransport
+ trTargetsServer *TargetsServerTransport
+ trWatchersServer *WatchersServerTransport
+}
+
+// Do implements the policy.Transporter interface for ServerFactoryTransport.
+func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ client := method[:strings.Index(method, ".")]
+ var resp *http.Response
+ var err error
+
+ switch client {
+ case "AlertRuleResourcesClient":
+ initServer(s, &s.trAlertRuleResourcesServer, func() *AlertRuleResourcesServerTransport {
+ return NewAlertRuleResourcesServerTransport(&s.srv.AlertRuleResourcesServer)
+ })
+ resp, err = s.trAlertRuleResourcesServer.Do(req)
+ case "HealthValidationsClient":
+ initServer(s, &s.trHealthValidationsServer, func() *HealthValidationsServerTransport {
+ return NewHealthValidationsServerTransport(&s.srv.HealthValidationsServer)
+ })
+ resp, err = s.trHealthValidationsServer.Do(req)
+ case "OperationsClient":
+ initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) })
+ resp, err = s.trOperationsServer.Do(req)
+ case "SharedPrivateLinkResourcesClient":
+ initServer(s, &s.trSharedPrivateLinkResourcesServer, func() *SharedPrivateLinkResourcesServerTransport {
+ return NewSharedPrivateLinkResourcesServerTransport(&s.srv.SharedPrivateLinkResourcesServer)
+ })
+ resp, err = s.trSharedPrivateLinkResourcesServer.Do(req)
+ case "TargetsClient":
+ initServer(s, &s.trTargetsServer, func() *TargetsServerTransport { return NewTargetsServerTransport(&s.srv.TargetsServer) })
+ resp, err = s.trTargetsServer.Do(req)
+ case "WatchersClient":
+ initServer(s, &s.trWatchersServer, func() *WatchersServerTransport { return NewWatchersServerTransport(&s.srv.WatchersServer) })
+ resp, err = s.trWatchersServer.Do(req)
+ default:
+ err = fmt.Errorf("unhandled client %s", client)
+ }
+
+ if err != nil {
+ return nil, err
+ }
+
+ return resp, nil
+}
+
+func initServer[T any](s *ServerFactoryTransport, dst **T, src func() *T) {
+ s.trMu.Lock()
+ if *dst == nil {
+ *dst = src()
+ }
+ s.trMu.Unlock()
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/sharedprivatelinkresources_server.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/sharedprivatelinkresources_server.go
new file mode 100644
index 000000000000..0efdaae954e7
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/sharedprivatelinkresources_server.go
@@ -0,0 +1,293 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasewatcher/armdatabasewatcher"
+ "net/http"
+ "net/url"
+ "regexp"
+)
+
+// SharedPrivateLinkResourcesServer is a fake server for instances of the armdatabasewatcher.SharedPrivateLinkResourcesClient type.
+type SharedPrivateLinkResourcesServer struct {
+ // BeginCreate is the fake for method SharedPrivateLinkResourcesClient.BeginCreate
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
+ BeginCreate func(ctx context.Context, resourceGroupName string, watcherName string, sharedPrivateLinkResourceName string, resource armdatabasewatcher.SharedPrivateLinkResource, options *armdatabasewatcher.SharedPrivateLinkResourcesClientBeginCreateOptions) (resp azfake.PollerResponder[armdatabasewatcher.SharedPrivateLinkResourcesClientCreateResponse], errResp azfake.ErrorResponder)
+
+ // BeginDelete is the fake for method SharedPrivateLinkResourcesClient.BeginDelete
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
+ BeginDelete func(ctx context.Context, resourceGroupName string, watcherName string, sharedPrivateLinkResourceName string, options *armdatabasewatcher.SharedPrivateLinkResourcesClientBeginDeleteOptions) (resp azfake.PollerResponder[armdatabasewatcher.SharedPrivateLinkResourcesClientDeleteResponse], errResp azfake.ErrorResponder)
+
+ // Get is the fake for method SharedPrivateLinkResourcesClient.Get
+ // HTTP status codes to indicate success: http.StatusOK
+ Get func(ctx context.Context, resourceGroupName string, watcherName string, sharedPrivateLinkResourceName string, options *armdatabasewatcher.SharedPrivateLinkResourcesClientGetOptions) (resp azfake.Responder[armdatabasewatcher.SharedPrivateLinkResourcesClientGetResponse], errResp azfake.ErrorResponder)
+
+ // NewListByWatcherPager is the fake for method SharedPrivateLinkResourcesClient.NewListByWatcherPager
+ // HTTP status codes to indicate success: http.StatusOK
+ NewListByWatcherPager func(resourceGroupName string, watcherName string, options *armdatabasewatcher.SharedPrivateLinkResourcesClientListByWatcherOptions) (resp azfake.PagerResponder[armdatabasewatcher.SharedPrivateLinkResourcesClientListByWatcherResponse])
+}
+
+// NewSharedPrivateLinkResourcesServerTransport creates a new instance of SharedPrivateLinkResourcesServerTransport with the provided implementation.
+// The returned SharedPrivateLinkResourcesServerTransport instance is connected to an instance of armdatabasewatcher.SharedPrivateLinkResourcesClient via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewSharedPrivateLinkResourcesServerTransport(srv *SharedPrivateLinkResourcesServer) *SharedPrivateLinkResourcesServerTransport {
+ return &SharedPrivateLinkResourcesServerTransport{
+ srv: srv,
+ beginCreate: newTracker[azfake.PollerResponder[armdatabasewatcher.SharedPrivateLinkResourcesClientCreateResponse]](),
+ beginDelete: newTracker[azfake.PollerResponder[armdatabasewatcher.SharedPrivateLinkResourcesClientDeleteResponse]](),
+ newListByWatcherPager: newTracker[azfake.PagerResponder[armdatabasewatcher.SharedPrivateLinkResourcesClientListByWatcherResponse]](),
+ }
+}
+
+// SharedPrivateLinkResourcesServerTransport connects instances of armdatabasewatcher.SharedPrivateLinkResourcesClient to instances of SharedPrivateLinkResourcesServer.
+// Don't use this type directly, use NewSharedPrivateLinkResourcesServerTransport instead.
+type SharedPrivateLinkResourcesServerTransport struct {
+ srv *SharedPrivateLinkResourcesServer
+ beginCreate *tracker[azfake.PollerResponder[armdatabasewatcher.SharedPrivateLinkResourcesClientCreateResponse]]
+ beginDelete *tracker[azfake.PollerResponder[armdatabasewatcher.SharedPrivateLinkResourcesClientDeleteResponse]]
+ newListByWatcherPager *tracker[azfake.PagerResponder[armdatabasewatcher.SharedPrivateLinkResourcesClientListByWatcherResponse]]
+}
+
+// Do implements the policy.Transporter interface for SharedPrivateLinkResourcesServerTransport.
+func (s *SharedPrivateLinkResourcesServerTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ return s.dispatchToMethodFake(req, method)
+}
+
+func (s *SharedPrivateLinkResourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if sharedPrivateLinkResourcesServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = sharedPrivateLinkResourcesServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "SharedPrivateLinkResourcesClient.BeginCreate":
+ res.resp, res.err = s.dispatchBeginCreate(req)
+ case "SharedPrivateLinkResourcesClient.BeginDelete":
+ res.resp, res.err = s.dispatchBeginDelete(req)
+ case "SharedPrivateLinkResourcesClient.Get":
+ res.resp, res.err = s.dispatchGet(req)
+ case "SharedPrivateLinkResourcesClient.NewListByWatcherPager":
+ res.resp, res.err = s.dispatchNewListByWatcherPager(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
+}
+
+func (s *SharedPrivateLinkResourcesServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) {
+ if s.srv.BeginCreate == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")}
+ }
+ beginCreate := s.beginCreate.get(req)
+ if beginCreate == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sharedPrivateLinkResources/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasewatcher.SharedPrivateLinkResource](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ sharedPrivateLinkResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sharedPrivateLinkResourceName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := s.srv.BeginCreate(req.Context(), resourceGroupNameParam, watcherNameParam, sharedPrivateLinkResourceNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginCreate = &respr
+ s.beginCreate.add(req, beginCreate)
+ }
+
+ resp, err := server.PollerResponderNext(beginCreate, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) {
+ s.beginCreate.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginCreate) {
+ s.beginCreate.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (s *SharedPrivateLinkResourcesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) {
+ if s.srv.BeginDelete == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")}
+ }
+ beginDelete := s.beginDelete.get(req)
+ if beginDelete == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sharedPrivateLinkResources/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ sharedPrivateLinkResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sharedPrivateLinkResourceName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := s.srv.BeginDelete(req.Context(), resourceGroupNameParam, watcherNameParam, sharedPrivateLinkResourceNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginDelete = &respr
+ s.beginDelete.add(req, beginDelete)
+ }
+
+ resp, err := server.PollerResponderNext(beginDelete, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ s.beginDelete.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginDelete) {
+ s.beginDelete.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (s *SharedPrivateLinkResourcesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
+ if s.srv.Get == nil {
+ return nil, &nonRetriableError{errors.New("fake for method Get not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sharedPrivateLinkResources/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ sharedPrivateLinkResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sharedPrivateLinkResourceName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, watcherNameParam, sharedPrivateLinkResourceNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SharedPrivateLinkResource, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (s *SharedPrivateLinkResourcesServerTransport) dispatchNewListByWatcherPager(req *http.Request) (*http.Response, error) {
+ if s.srv.NewListByWatcherPager == nil {
+ return nil, &nonRetriableError{errors.New("fake for method NewListByWatcherPager not implemented")}
+ }
+ newListByWatcherPager := s.newListByWatcherPager.get(req)
+ if newListByWatcherPager == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sharedPrivateLinkResources`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ resp := s.srv.NewListByWatcherPager(resourceGroupNameParam, watcherNameParam, nil)
+ newListByWatcherPager = &resp
+ s.newListByWatcherPager.add(req, newListByWatcherPager)
+ server.PagerResponderInjectNextLinks(newListByWatcherPager, req, func(page *armdatabasewatcher.SharedPrivateLinkResourcesClientListByWatcherResponse, createLink func() string) {
+ page.NextLink = to.Ptr(createLink())
+ })
+ }
+ resp, err := server.PagerResponderNext(newListByWatcherPager, req)
+ if err != nil {
+ return nil, err
+ }
+ if !contains([]int{http.StatusOK}, resp.StatusCode) {
+ s.newListByWatcherPager.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
+ }
+ if !server.PagerResponderMore(newListByWatcherPager) {
+ s.newListByWatcherPager.remove(req)
+ }
+ return resp, nil
+}
+
+// set this to conditionally intercept incoming requests to SharedPrivateLinkResourcesServerTransport
+var sharedPrivateLinkResourcesServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/targets_server.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/targets_server.go
new file mode 100644
index 000000000000..cacee3f65b09
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/targets_server.go
@@ -0,0 +1,267 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasewatcher/armdatabasewatcher"
+ "net/http"
+ "net/url"
+ "regexp"
+)
+
+// TargetsServer is a fake server for instances of the armdatabasewatcher.TargetsClient type.
+type TargetsServer struct {
+ // CreateOrUpdate is the fake for method TargetsClient.CreateOrUpdate
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
+ CreateOrUpdate func(ctx context.Context, resourceGroupName string, watcherName string, targetName string, resource armdatabasewatcher.Target, options *armdatabasewatcher.TargetsClientCreateOrUpdateOptions) (resp azfake.Responder[armdatabasewatcher.TargetsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)
+
+ // Delete is the fake for method TargetsClient.Delete
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent
+ Delete func(ctx context.Context, resourceGroupName string, watcherName string, targetName string, options *armdatabasewatcher.TargetsClientDeleteOptions) (resp azfake.Responder[armdatabasewatcher.TargetsClientDeleteResponse], errResp azfake.ErrorResponder)
+
+ // Get is the fake for method TargetsClient.Get
+ // HTTP status codes to indicate success: http.StatusOK
+ Get func(ctx context.Context, resourceGroupName string, watcherName string, targetName string, options *armdatabasewatcher.TargetsClientGetOptions) (resp azfake.Responder[armdatabasewatcher.TargetsClientGetResponse], errResp azfake.ErrorResponder)
+
+ // NewListByWatcherPager is the fake for method TargetsClient.NewListByWatcherPager
+ // HTTP status codes to indicate success: http.StatusOK
+ NewListByWatcherPager func(resourceGroupName string, watcherName string, options *armdatabasewatcher.TargetsClientListByWatcherOptions) (resp azfake.PagerResponder[armdatabasewatcher.TargetsClientListByWatcherResponse])
+}
+
+// NewTargetsServerTransport creates a new instance of TargetsServerTransport with the provided implementation.
+// The returned TargetsServerTransport instance is connected to an instance of armdatabasewatcher.TargetsClient via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewTargetsServerTransport(srv *TargetsServer) *TargetsServerTransport {
+ return &TargetsServerTransport{
+ srv: srv,
+ newListByWatcherPager: newTracker[azfake.PagerResponder[armdatabasewatcher.TargetsClientListByWatcherResponse]](),
+ }
+}
+
+// TargetsServerTransport connects instances of armdatabasewatcher.TargetsClient to instances of TargetsServer.
+// Don't use this type directly, use NewTargetsServerTransport instead.
+type TargetsServerTransport struct {
+ srv *TargetsServer
+ newListByWatcherPager *tracker[azfake.PagerResponder[armdatabasewatcher.TargetsClientListByWatcherResponse]]
+}
+
+// Do implements the policy.Transporter interface for TargetsServerTransport.
+func (t *TargetsServerTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ return t.dispatchToMethodFake(req, method)
+}
+
+func (t *TargetsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if targetsServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = targetsServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "TargetsClient.CreateOrUpdate":
+ res.resp, res.err = t.dispatchCreateOrUpdate(req)
+ case "TargetsClient.Delete":
+ res.resp, res.err = t.dispatchDelete(req)
+ case "TargetsClient.Get":
+ res.resp, res.err = t.dispatchGet(req)
+ case "TargetsClient.NewListByWatcherPager":
+ res.resp, res.err = t.dispatchNewListByWatcherPager(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
+}
+
+func (t *TargetsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) {
+ if t.srv.CreateOrUpdate == nil {
+ return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/targets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasewatcher.Target](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ targetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := t.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, watcherNameParam, targetNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Target, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (t *TargetsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) {
+ if t.srv.Delete == nil {
+ return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/targets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ targetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := t.srv.Delete(req.Context(), resourceGroupNameParam, watcherNameParam, targetNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)}
+ }
+ resp, err := server.NewResponse(respContent, req, nil)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (t *TargetsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
+ if t.srv.Get == nil {
+ return nil, &nonRetriableError{errors.New("fake for method Get not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/targets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 4 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ targetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := t.srv.Get(req.Context(), resourceGroupNameParam, watcherNameParam, targetNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Target, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (t *TargetsServerTransport) dispatchNewListByWatcherPager(req *http.Request) (*http.Response, error) {
+ if t.srv.NewListByWatcherPager == nil {
+ return nil, &nonRetriableError{errors.New("fake for method NewListByWatcherPager not implemented")}
+ }
+ newListByWatcherPager := t.newListByWatcherPager.get(req)
+ if newListByWatcherPager == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/targets`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ resp := t.srv.NewListByWatcherPager(resourceGroupNameParam, watcherNameParam, nil)
+ newListByWatcherPager = &resp
+ t.newListByWatcherPager.add(req, newListByWatcherPager)
+ server.PagerResponderInjectNextLinks(newListByWatcherPager, req, func(page *armdatabasewatcher.TargetsClientListByWatcherResponse, createLink func() string) {
+ page.NextLink = to.Ptr(createLink())
+ })
+ }
+ resp, err := server.PagerResponderNext(newListByWatcherPager, req)
+ if err != nil {
+ return nil, err
+ }
+ if !contains([]int{http.StatusOK}, resp.StatusCode) {
+ t.newListByWatcherPager.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
+ }
+ if !server.PagerResponderMore(newListByWatcherPager) {
+ t.newListByWatcherPager.remove(req)
+ }
+ return resp, nil
+}
+
+// set this to conditionally intercept incoming requests to TargetsServerTransport
+var targetsServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/time_rfc3339.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/time_rfc3339.go
new file mode 100644
index 000000000000..87ee11e83b32
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/time_rfc3339.go
@@ -0,0 +1,109 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "reflect"
+ "regexp"
+ "strings"
+ "time"
+)
+
+// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases.
+var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`)
+
+const (
+ utcDateTime = "2006-01-02T15:04:05.999999999"
+ utcDateTimeJSON = `"` + utcDateTime + `"`
+ utcDateTimeNoT = "2006-01-02 15:04:05.999999999"
+ utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"`
+ dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00`
+ dateTimeJSON = `"` + time.RFC3339Nano + `"`
+ dateTimeJSONNoT = `"` + dateTimeNoT + `"`
+)
+
+type dateTimeRFC3339 time.Time
+
+func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalJSON()
+}
+
+func (t dateTimeRFC3339) MarshalText() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalText()
+}
+
+func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error {
+ tzOffset := tzOffsetRegex.Match(data)
+ hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t")
+ var layout string
+ if tzOffset && hasT {
+ layout = dateTimeJSON
+ } else if tzOffset {
+ layout = dateTimeJSONNoT
+ } else if hasT {
+ layout = utcDateTimeJSON
+ } else {
+ layout = utcDateTimeJSONNoT
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) UnmarshalText(data []byte) error {
+ if len(data) == 0 {
+ return nil
+ }
+ tzOffset := tzOffsetRegex.Match(data)
+ hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t")
+ var layout string
+ if tzOffset && hasT {
+ layout = time.RFC3339Nano
+ } else if tzOffset {
+ layout = dateTimeNoT
+ } else if hasT {
+ layout = utcDateTime
+ } else {
+ layout = utcDateTimeNoT
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) Parse(layout, value string) error {
+ p, err := time.Parse(layout, strings.ToUpper(value))
+ *t = dateTimeRFC3339(p)
+ return err
+}
+
+func (t dateTimeRFC3339) String() string {
+ return time.Time(t).Format(time.RFC3339Nano)
+}
+
+func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) {
+ if t == nil {
+ return
+ } else if azcore.IsNullValue(t) {
+ m[k] = nil
+ return
+ } else if reflect.ValueOf(t).IsNil() {
+ return
+ }
+ m[k] = (*dateTimeRFC3339)(t)
+}
+
+func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error {
+ if data == nil || string(data) == "null" {
+ return nil
+ }
+ var aux dateTimeRFC3339
+ if err := json.Unmarshal(data, &aux); err != nil {
+ return fmt.Errorf("struct field %s: %v", fn, err)
+ }
+ *t = (*time.Time)(&aux)
+ return nil
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/watchers_server.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/watchers_server.go
new file mode 100644
index 000000000000..62d4c81a7133
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/fake/watchers_server.go
@@ -0,0 +1,478 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasewatcher/armdatabasewatcher"
+ "net/http"
+ "net/url"
+ "regexp"
+)
+
+// WatchersServer is a fake server for instances of the armdatabasewatcher.WatchersClient type.
+type WatchersServer struct {
+ // BeginCreateOrUpdate is the fake for method WatchersClient.BeginCreateOrUpdate
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
+ BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, watcherName string, resource armdatabasewatcher.Watcher, options *armdatabasewatcher.WatchersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdatabasewatcher.WatchersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)
+
+ // BeginDelete is the fake for method WatchersClient.BeginDelete
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
+ BeginDelete func(ctx context.Context, resourceGroupName string, watcherName string, options *armdatabasewatcher.WatchersClientBeginDeleteOptions) (resp azfake.PollerResponder[armdatabasewatcher.WatchersClientDeleteResponse], errResp azfake.ErrorResponder)
+
+ // Get is the fake for method WatchersClient.Get
+ // HTTP status codes to indicate success: http.StatusOK
+ Get func(ctx context.Context, resourceGroupName string, watcherName string, options *armdatabasewatcher.WatchersClientGetOptions) (resp azfake.Responder[armdatabasewatcher.WatchersClientGetResponse], errResp azfake.ErrorResponder)
+
+ // NewListByResourceGroupPager is the fake for method WatchersClient.NewListByResourceGroupPager
+ // HTTP status codes to indicate success: http.StatusOK
+ NewListByResourceGroupPager func(resourceGroupName string, options *armdatabasewatcher.WatchersClientListByResourceGroupOptions) (resp azfake.PagerResponder[armdatabasewatcher.WatchersClientListByResourceGroupResponse])
+
+ // NewListBySubscriptionPager is the fake for method WatchersClient.NewListBySubscriptionPager
+ // HTTP status codes to indicate success: http.StatusOK
+ NewListBySubscriptionPager func(options *armdatabasewatcher.WatchersClientListBySubscriptionOptions) (resp azfake.PagerResponder[armdatabasewatcher.WatchersClientListBySubscriptionResponse])
+
+ // BeginStart is the fake for method WatchersClient.BeginStart
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
+ BeginStart func(ctx context.Context, resourceGroupName string, watcherName string, options *armdatabasewatcher.WatchersClientBeginStartOptions) (resp azfake.PollerResponder[armdatabasewatcher.WatchersClientStartResponse], errResp azfake.ErrorResponder)
+
+ // BeginStop is the fake for method WatchersClient.BeginStop
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
+ BeginStop func(ctx context.Context, resourceGroupName string, watcherName string, options *armdatabasewatcher.WatchersClientBeginStopOptions) (resp azfake.PollerResponder[armdatabasewatcher.WatchersClientStopResponse], errResp azfake.ErrorResponder)
+
+ // BeginUpdate is the fake for method WatchersClient.BeginUpdate
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
+ BeginUpdate func(ctx context.Context, resourceGroupName string, watcherName string, properties armdatabasewatcher.WatcherUpdate, options *armdatabasewatcher.WatchersClientBeginUpdateOptions) (resp azfake.PollerResponder[armdatabasewatcher.WatchersClientUpdateResponse], errResp azfake.ErrorResponder)
+}
+
+// NewWatchersServerTransport creates a new instance of WatchersServerTransport with the provided implementation.
+// The returned WatchersServerTransport instance is connected to an instance of armdatabasewatcher.WatchersClient via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewWatchersServerTransport(srv *WatchersServer) *WatchersServerTransport {
+ return &WatchersServerTransport{
+ srv: srv,
+ beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdatabasewatcher.WatchersClientCreateOrUpdateResponse]](),
+ beginDelete: newTracker[azfake.PollerResponder[armdatabasewatcher.WatchersClientDeleteResponse]](),
+ newListByResourceGroupPager: newTracker[azfake.PagerResponder[armdatabasewatcher.WatchersClientListByResourceGroupResponse]](),
+ newListBySubscriptionPager: newTracker[azfake.PagerResponder[armdatabasewatcher.WatchersClientListBySubscriptionResponse]](),
+ beginStart: newTracker[azfake.PollerResponder[armdatabasewatcher.WatchersClientStartResponse]](),
+ beginStop: newTracker[azfake.PollerResponder[armdatabasewatcher.WatchersClientStopResponse]](),
+ beginUpdate: newTracker[azfake.PollerResponder[armdatabasewatcher.WatchersClientUpdateResponse]](),
+ }
+}
+
+// WatchersServerTransport connects instances of armdatabasewatcher.WatchersClient to instances of WatchersServer.
+// Don't use this type directly, use NewWatchersServerTransport instead.
+type WatchersServerTransport struct {
+ srv *WatchersServer
+ beginCreateOrUpdate *tracker[azfake.PollerResponder[armdatabasewatcher.WatchersClientCreateOrUpdateResponse]]
+ beginDelete *tracker[azfake.PollerResponder[armdatabasewatcher.WatchersClientDeleteResponse]]
+ newListByResourceGroupPager *tracker[azfake.PagerResponder[armdatabasewatcher.WatchersClientListByResourceGroupResponse]]
+ newListBySubscriptionPager *tracker[azfake.PagerResponder[armdatabasewatcher.WatchersClientListBySubscriptionResponse]]
+ beginStart *tracker[azfake.PollerResponder[armdatabasewatcher.WatchersClientStartResponse]]
+ beginStop *tracker[azfake.PollerResponder[armdatabasewatcher.WatchersClientStopResponse]]
+ beginUpdate *tracker[azfake.PollerResponder[armdatabasewatcher.WatchersClientUpdateResponse]]
+}
+
+// Do implements the policy.Transporter interface for WatchersServerTransport.
+func (w *WatchersServerTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ return w.dispatchToMethodFake(req, method)
+}
+
+func (w *WatchersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if watchersServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = watchersServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "WatchersClient.BeginCreateOrUpdate":
+ res.resp, res.err = w.dispatchBeginCreateOrUpdate(req)
+ case "WatchersClient.BeginDelete":
+ res.resp, res.err = w.dispatchBeginDelete(req)
+ case "WatchersClient.Get":
+ res.resp, res.err = w.dispatchGet(req)
+ case "WatchersClient.NewListByResourceGroupPager":
+ res.resp, res.err = w.dispatchNewListByResourceGroupPager(req)
+ case "WatchersClient.NewListBySubscriptionPager":
+ res.resp, res.err = w.dispatchNewListBySubscriptionPager(req)
+ case "WatchersClient.BeginStart":
+ res.resp, res.err = w.dispatchBeginStart(req)
+ case "WatchersClient.BeginStop":
+ res.resp, res.err = w.dispatchBeginStop(req)
+ case "WatchersClient.BeginUpdate":
+ res.resp, res.err = w.dispatchBeginUpdate(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
+}
+
+func (w *WatchersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) {
+ if w.srv.BeginCreateOrUpdate == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")}
+ }
+ beginCreateOrUpdate := w.beginCreateOrUpdate.get(req)
+ if beginCreateOrUpdate == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasewatcher.Watcher](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := w.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, watcherNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginCreateOrUpdate = &respr
+ w.beginCreateOrUpdate.add(req, beginCreateOrUpdate)
+ }
+
+ resp, err := server.PollerResponderNext(beginCreateOrUpdate, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) {
+ w.beginCreateOrUpdate.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginCreateOrUpdate) {
+ w.beginCreateOrUpdate.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (w *WatchersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) {
+ if w.srv.BeginDelete == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")}
+ }
+ beginDelete := w.beginDelete.get(req)
+ if beginDelete == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := w.srv.BeginDelete(req.Context(), resourceGroupNameParam, watcherNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginDelete = &respr
+ w.beginDelete.add(req, beginDelete)
+ }
+
+ resp, err := server.PollerResponderNext(beginDelete, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ w.beginDelete.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginDelete) {
+ w.beginDelete.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (w *WatchersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
+ if w.srv.Get == nil {
+ return nil, &nonRetriableError{errors.New("fake for method Get not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := w.srv.Get(req.Context(), resourceGroupNameParam, watcherNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Watcher, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (w *WatchersServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) {
+ if w.srv.NewListByResourceGroupPager == nil {
+ return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")}
+ }
+ newListByResourceGroupPager := w.newListByResourceGroupPager.get(req)
+ if newListByResourceGroupPager == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 2 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ resp := w.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil)
+ newListByResourceGroupPager = &resp
+ w.newListByResourceGroupPager.add(req, newListByResourceGroupPager)
+ server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armdatabasewatcher.WatchersClientListByResourceGroupResponse, createLink func() string) {
+ page.NextLink = to.Ptr(createLink())
+ })
+ }
+ resp, err := server.PagerResponderNext(newListByResourceGroupPager, req)
+ if err != nil {
+ return nil, err
+ }
+ if !contains([]int{http.StatusOK}, resp.StatusCode) {
+ w.newListByResourceGroupPager.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
+ }
+ if !server.PagerResponderMore(newListByResourceGroupPager) {
+ w.newListByResourceGroupPager.remove(req)
+ }
+ return resp, nil
+}
+
+func (w *WatchersServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) {
+ if w.srv.NewListBySubscriptionPager == nil {
+ return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")}
+ }
+ newListBySubscriptionPager := w.newListBySubscriptionPager.get(req)
+ if newListBySubscriptionPager == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 1 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resp := w.srv.NewListBySubscriptionPager(nil)
+ newListBySubscriptionPager = &resp
+ w.newListBySubscriptionPager.add(req, newListBySubscriptionPager)
+ server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armdatabasewatcher.WatchersClientListBySubscriptionResponse, createLink func() string) {
+ page.NextLink = to.Ptr(createLink())
+ })
+ }
+ resp, err := server.PagerResponderNext(newListBySubscriptionPager, req)
+ if err != nil {
+ return nil, err
+ }
+ if !contains([]int{http.StatusOK}, resp.StatusCode) {
+ w.newListBySubscriptionPager.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
+ }
+ if !server.PagerResponderMore(newListBySubscriptionPager) {
+ w.newListBySubscriptionPager.remove(req)
+ }
+ return resp, nil
+}
+
+func (w *WatchersServerTransport) dispatchBeginStart(req *http.Request) (*http.Response, error) {
+ if w.srv.BeginStart == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")}
+ }
+ beginStart := w.beginStart.get(req)
+ if beginStart == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/start`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := w.srv.BeginStart(req.Context(), resourceGroupNameParam, watcherNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginStart = &respr
+ w.beginStart.add(req, beginStart)
+ }
+
+ resp, err := server.PollerResponderNext(beginStart, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ w.beginStart.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginStart) {
+ w.beginStart.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (w *WatchersServerTransport) dispatchBeginStop(req *http.Request) (*http.Response, error) {
+ if w.srv.BeginStop == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginStop not implemented")}
+ }
+ beginStop := w.beginStop.get(req)
+ if beginStop == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stop`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := w.srv.BeginStop(req.Context(), resourceGroupNameParam, watcherNameParam, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginStop = &respr
+ w.beginStop.add(req, beginStop)
+ }
+
+ resp, err := server.PollerResponderNext(beginStop, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ w.beginStop.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginStop) {
+ w.beginStop.remove(req)
+ }
+
+ return resp, nil
+}
+
+func (w *WatchersServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) {
+ if w.srv.BeginUpdate == nil {
+ return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")}
+ }
+ beginUpdate := w.beginUpdate.get(req)
+ if beginUpdate == nil {
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DatabaseWatcher/watchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdatabasewatcher.WatcherUpdate](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ watcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("watcherName")])
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := w.srv.BeginUpdate(req.Context(), resourceGroupNameParam, watcherNameParam, body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ beginUpdate = &respr
+ w.beginUpdate.add(req, beginUpdate)
+ }
+
+ resp, err := server.PollerResponderNext(beginUpdate, req)
+ if err != nil {
+ return nil, err
+ }
+
+ if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
+ w.beginUpdate.remove(req)
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
+ }
+ if !server.PollerResponderMore(beginUpdate) {
+ w.beginUpdate.remove(req)
+ }
+
+ return resp, nil
+}
+
+// set this to conditionally intercept incoming requests to WatchersServerTransport
+var watchersServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/go.mod b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/go.mod
new file mode 100644
index 000000000000..c76fad75df0e
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/go.mod
@@ -0,0 +1,21 @@
+module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasewatcher/armdatabasewatcher
+
+go 1.18
+
+require (
+ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0
+ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0
+)
+
+require (
+ github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
+ github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
+ github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
+ github.com/google/uuid v1.6.0 // indirect
+ github.com/kylelemons/godebug v1.1.0 // indirect
+ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
+ golang.org/x/crypto v0.32.0 // indirect
+ golang.org/x/net v0.34.0 // indirect
+ golang.org/x/sys v0.29.0 // indirect
+ golang.org/x/text v0.21.0 // indirect
+)
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/go.sum b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/go.sum
new file mode 100644
index 000000000000..065ccc364f39
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/go.sum
@@ -0,0 +1,29 @@
+github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 h1:g0EZJwz7xkXQiZAI5xi9f3WWFYBlX1CPTrR+NDToRkQ=
+github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0/go.mod h1:XCW7KnZet0Opnr7HccfUw1PLc4CjHqpcaxW8DHklNkQ=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg=
+github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY=
+github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY=
+github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU=
+github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
+github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
+github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
+github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
+github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
+golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
+golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
+golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
+golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
+golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
+golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
+golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/healthvalidations_client.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/healthvalidations_client.go
new file mode 100644
index 000000000000..ed29bb62d291
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/healthvalidations_client.go
@@ -0,0 +1,255 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// HealthValidationsClient contains the methods for the HealthValidations group.
+// Don't use this type directly, use NewHealthValidationsClient() instead.
+type HealthValidationsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewHealthValidationsClient creates a new instance of HealthValidationsClient with the specified values.
+// - subscriptionID - The ID of the target subscription. The value must be an UUID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewHealthValidationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HealthValidationsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &HealthValidationsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Get a HealthValidation
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - healthValidationName - The health validation resource name.
+// - options - HealthValidationsClientGetOptions contains the optional parameters for the HealthValidationsClient.Get method.
+func (client *HealthValidationsClient) Get(ctx context.Context, resourceGroupName string, watcherName string, healthValidationName string, options *HealthValidationsClientGetOptions) (HealthValidationsClientGetResponse, error) {
+ var err error
+ const operationName = "HealthValidationsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, watcherName, healthValidationName, options)
+ if err != nil {
+ return HealthValidationsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return HealthValidationsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return HealthValidationsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *HealthValidationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, healthValidationName string, _ *HealthValidationsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/healthValidations/{healthValidationName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ if healthValidationName == "" {
+ return nil, errors.New("parameter healthValidationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{healthValidationName}", url.PathEscape(healthValidationName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *HealthValidationsClient) getHandleResponse(resp *http.Response) (HealthValidationsClientGetResponse, error) {
+ result := HealthValidationsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.HealthValidation); err != nil {
+ return HealthValidationsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByParentPager - List HealthValidation resources by Watcher
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - options - HealthValidationsClientListByParentOptions contains the optional parameters for the HealthValidationsClient.NewListByParentPager
+// method.
+func (client *HealthValidationsClient) NewListByParentPager(resourceGroupName string, watcherName string, options *HealthValidationsClientListByParentOptions) *runtime.Pager[HealthValidationsClientListByParentResponse] {
+ return runtime.NewPager(runtime.PagingHandler[HealthValidationsClientListByParentResponse]{
+ More: func(page HealthValidationsClientListByParentResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *HealthValidationsClientListByParentResponse) (HealthValidationsClientListByParentResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "HealthValidationsClient.NewListByParentPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByParentCreateRequest(ctx, resourceGroupName, watcherName, options)
+ }, nil)
+ if err != nil {
+ return HealthValidationsClientListByParentResponse{}, err
+ }
+ return client.listByParentHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByParentCreateRequest creates the ListByParent request.
+func (client *HealthValidationsClient) listByParentCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, _ *HealthValidationsClientListByParentOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/healthValidations"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByParentHandleResponse handles the ListByParent response.
+func (client *HealthValidationsClient) listByParentHandleResponse(resp *http.Response) (HealthValidationsClientListByParentResponse, error) {
+ result := HealthValidationsClientListByParentResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.HealthValidationListResult); err != nil {
+ return HealthValidationsClientListByParentResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginStartValidation - Starts health validation for a watcher.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - healthValidationName - The health validation resource name.
+// - options - HealthValidationsClientBeginStartValidationOptions contains the optional parameters for the HealthValidationsClient.BeginStartValidation
+// method.
+func (client *HealthValidationsClient) BeginStartValidation(ctx context.Context, resourceGroupName string, watcherName string, healthValidationName string, options *HealthValidationsClientBeginStartValidationOptions) (*runtime.Poller[HealthValidationsClientStartValidationResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.startValidation(ctx, resourceGroupName, watcherName, healthValidationName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HealthValidationsClientStartValidationResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[HealthValidationsClientStartValidationResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// StartValidation - Starts health validation for a watcher.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+func (client *HealthValidationsClient) startValidation(ctx context.Context, resourceGroupName string, watcherName string, healthValidationName string, options *HealthValidationsClientBeginStartValidationOptions) (*http.Response, error) {
+ var err error
+ const operationName = "HealthValidationsClient.BeginStartValidation"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.startValidationCreateRequest(ctx, resourceGroupName, watcherName, healthValidationName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// startValidationCreateRequest creates the StartValidation request.
+func (client *HealthValidationsClient) startValidationCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, healthValidationName string, _ *HealthValidationsClientBeginStartValidationOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/healthValidations/{healthValidationName}/startValidation"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ if healthValidationName == "" {
+ return nil, errors.New("parameter healthValidationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{healthValidationName}", url.PathEscape(healthValidationName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/healthvalidations_client_example_test.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/healthvalidations_client_example_test.go
new file mode 100644
index 000000000000..f721a6d8e59f
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/healthvalidations_client_example_test.go
@@ -0,0 +1,172 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher_test
+
+import (
+ "context"
+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasewatcher/armdatabasewatcher"
+ "log"
+)
+
+// Generated from example definition: 2025-01-02/HealthValidations_Get_MaximumSet_Gen.json
+func ExampleHealthValidationsClient_Get() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("A76F9850-996B-40B3-94D4-C98110A0EEC9", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewHealthValidationsClient().Get(ctx, "rgWatcher", "testWatcher", "testHealthValidation", 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 = armdatabasewatcher.HealthValidationsClientGetResponse{
+ // HealthValidation: &armdatabasewatcher.HealthValidation{
+ // Properties: &armdatabasewatcher.HealthValidationProperties{
+ // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-07T19:42:55.594Z"); return t}()),
+ // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-07T19:42:55.594Z"); return t}()),
+ // Status: to.Ptr(armdatabasewatcher.ValidationStatusSucceeded),
+ // Issues: []*armdatabasewatcher.ValidationIssue{
+ // {
+ // ErrorCode: to.Ptr("ReadDatasetError"),
+ // ErrorMessage: to.Ptr("Invalid operation. The connection is closed."),
+ // AdditionalDetails: to.Ptr("There seems to be a connection issue."),
+ // RecommendationMessage: to.Ptr("Please check the connection."),
+ // RecommendationURL: to.Ptr("https://aka.ms/issuerecommendation"),
+ // RelatedResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/test-setup/providers/Microsoft.Sql/servers/test-setup/databases/test-1"),
+ // RelatedResourceType: to.Ptr("Microsoft.Sql/servers"),
+ // },
+ // },
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ResourceProvisioningStateSucceeded),
+ // },
+ // ID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.databasewatcher/watchers/testWatcher/healthValidations/testHealthValidation"),
+ // Name: to.Ptr("testHealthValidation"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers/healthValidations"),
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-01-02/HealthValidations_ListByParent_MaximumSet_Gen.json
+func ExampleHealthValidationsClient_NewListByParentPager() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("A76F9850-996B-40B3-94D4-C98110A0EEC9", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ pager := clientFactory.NewHealthValidationsClient().NewListByParentPager("rgWatcher", "testWatcher", 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 = armdatabasewatcher.HealthValidationsClientListByParentResponse{
+ // HealthValidationListResult: armdatabasewatcher.HealthValidationListResult{
+ // Value: []*armdatabasewatcher.HealthValidation{
+ // {
+ // Properties: &armdatabasewatcher.HealthValidationProperties{
+ // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-07T19:42:55.594Z"); return t}()),
+ // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-07T19:42:55.594Z"); return t}()),
+ // Status: to.Ptr(armdatabasewatcher.ValidationStatusSucceeded),
+ // Issues: []*armdatabasewatcher.ValidationIssue{
+ // {
+ // ErrorCode: to.Ptr("ReadDatasetError"),
+ // ErrorMessage: to.Ptr("Invalid operation. The connection is closed."),
+ // AdditionalDetails: to.Ptr("There seems to be a connection issue."),
+ // RecommendationMessage: to.Ptr("Please check the connection."),
+ // RecommendationURL: to.Ptr("https://aka.ms/issuerecommendation"),
+ // RelatedResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/test-setup/providers/Microsoft.Sql/servers/test-setup/databases/test-1"),
+ // RelatedResourceType: to.Ptr("Microsoft.Sql/servers"),
+ // },
+ // },
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ResourceProvisioningStateSucceeded),
+ // },
+ // ID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.databasewatcher/watchers/testWatcher/healthValidations/testHealthValidation"),
+ // Name: to.Ptr("testHealthValidation"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers/healthValidations"),
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // },
+ // NextLink: to.Ptr("https://microsoft.com/a"),
+ // },
+ // }
+ }
+}
+
+// Generated from example definition: 2025-01-02/HealthValidations_StartValidation_MaximumSet_Gen.json
+func ExampleHealthValidationsClient_BeginStartValidation() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("A76F9850-996B-40B3-94D4-C98110A0EEC9", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewHealthValidationsClient().BeginStartValidation(ctx, "rgWatcher", "testWatcher", "testHealthValidation", 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 = armdatabasewatcher.HealthValidationsClientStartValidationResponse{
+ // HealthValidation: &armdatabasewatcher.HealthValidation{
+ // Properties: &armdatabasewatcher.HealthValidationProperties{
+ // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-07T19:42:55.594Z"); return t}()),
+ // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-07T19:42:55.594Z"); return t}()),
+ // Status: to.Ptr(armdatabasewatcher.ValidationStatusRunning),
+ // Issues: []*armdatabasewatcher.ValidationIssue{
+ // },
+ // },
+ // ID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.databasewatcher/watchers/testWatcher/healthValidations/testHealthValidation"),
+ // Name: to.Ptr("testHealthValidation"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers/healthValidations"),
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // }
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/interfaces.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/interfaces.go
new file mode 100644
index 000000000000..19fec6f8296b
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/interfaces.go
@@ -0,0 +1,14 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher
+
+// TargetPropertiesClassification provides polymorphic access to related types.
+// Call the interface's GetTargetProperties() method to access the common type.
+// Use a type switch to determine the concrete type. The possible types are:
+// - *SQLDbElasticPoolTargetProperties, *SQLDbSingleDatabaseTargetProperties, *SQLMiTargetProperties, *TargetProperties
+type TargetPropertiesClassification interface {
+ // GetTargetProperties returns the TargetProperties content of the underlying type.
+ GetTargetProperties() *TargetProperties
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/models.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/models.go
new file mode 100644
index 000000000000..000a4d2e0879
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/models.go
@@ -0,0 +1,554 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher
+
+import "time"
+
+// AlertRuleResource - Concrete proxy resource types can be created by aliasing this type using a specific property type.
+type AlertRuleResource struct {
+ // The resource-specific properties for this resource.
+ Properties *AlertRuleResourceProperties
+
+ // READ-ONLY; The alert rule proxy resource name.
+ Name *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// AlertRuleResourceListResult - The response of a AlertRuleResource list operation.
+type AlertRuleResourceListResult struct {
+ // REQUIRED; The AlertRuleResource items on this page
+ Value []*AlertRuleResource
+
+ // The link to the next page of items
+ NextLink *string
+}
+
+// AlertRuleResourceProperties - The generic properties of the alert rule proxy resource.
+type AlertRuleResourceProperties struct {
+ // REQUIRED; The resource ID of the alert rule resource.
+ AlertRuleResourceID *string
+
+ // REQUIRED; The template ID associated with alert rule resource.
+ AlertRuleTemplateID *string
+
+ // REQUIRED; The alert rule template version.
+ AlertRuleTemplateVersion *string
+
+ // REQUIRED; The properties with which the alert rule resource was created.
+ CreatedWithProperties *AlertRuleCreationProperties
+
+ // REQUIRED; The creation time of the alert rule resource.
+ CreationTime *time.Time
+
+ // READ-ONLY; The provisioning state of the alert rule resource.
+ ProvisioningState *ResourceProvisioningState
+}
+
+// Datastore - The properties of a data store.
+type Datastore struct {
+ // REQUIRED; The Kusto cluster URI.
+ KustoClusterURI *string
+
+ // REQUIRED; The Kusto data ingestion URI.
+ KustoDataIngestionURI *string
+
+ // REQUIRED; The name of a Kusto database.
+ KustoDatabaseName *string
+
+ // REQUIRED; The Kusto management URL.
+ KustoManagementURL *string
+
+ // REQUIRED; The type of a Kusto offering.
+ KustoOfferingType *KustoOfferingType
+
+ // The Azure resource ID of an Azure Data Explorer cluster.
+ AdxClusterResourceID *string
+
+ // The Kusto cluster display name.
+ KustoClusterDisplayName *string
+}
+
+// HealthValidation - Concrete proxy resource types can be created by aliasing this type using a specific property type.
+type HealthValidation struct {
+ // The resource-specific properties for this resource.
+ Properties *HealthValidationProperties
+
+ // READ-ONLY; The health validation resource name.
+ Name *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// HealthValidationListResult - The response of a HealthValidation list operation.
+type HealthValidationListResult struct {
+ // REQUIRED; The HealthValidation items on this page
+ Value []*HealthValidation
+
+ // The link to the next page of items
+ NextLink *string
+}
+
+// HealthValidationProperties - The generic properties of the health validation resource.
+type HealthValidationProperties struct {
+ // READ-ONLY; The end time of health validation, in UTC.
+ EndTime *time.Time
+
+ // READ-ONLY; The list of issues found by health validation.
+ Issues []*ValidationIssue
+
+ // READ-ONLY; The start time of health validation, in UTC.
+ StartTime *time.Time
+
+ // READ-ONLY; The current health validation status.
+ Status *ValidationStatus
+
+ // READ-ONLY; The provisioning state of the health validation resource.
+ ProvisioningState *ResourceProvisioningState
+}
+
+// ManagedServiceIdentityV4 - Managed service identity (system assigned and/or user assigned identities)
+type ManagedServiceIdentityV4 struct {
+ // REQUIRED; The type of managed identity assigned to this resource.
+ Type *ManagedServiceIdentityType
+
+ // The identities assigned to this resource by the user.
+ UserAssignedIdentities map[string]*UserAssignedIdentity
+
+ // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned
+ // identity.
+ PrincipalID *string
+
+ // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.
+ TenantID *string
+}
+
+// Operation - Details of a REST API operation, returned from the Resource Provider Operations API
+type Operation struct {
+ // Localized display information for this particular operation.
+ Display *OperationDisplay
+
+ // READ-ONLY; Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ ActionType *ActionType
+
+ // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure
+ // Resource Manager/control-plane operations.
+ IsDataAction *bool
+
+ // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write",
+ // "Microsoft.Compute/virtualMachines/capture/action"
+ Name *string
+
+ // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
+ // value is "user,system"
+ Origin *Origin
+}
+
+// OperationDisplay - Localized display information for and operation.
+type OperationDisplay struct {
+ // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views.
+ Description *string
+
+ // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual
+ // Machine", "Restart Virtual Machine".
+ Operation *string
+
+ // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft
+ // Compute".
+ Provider *string
+
+ // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job
+ // Schedule Collections".
+ Resource *string
+}
+
+// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to
+// get the next set of results.
+type OperationListResult struct {
+ // REQUIRED; The Operation items on this page
+ Value []*Operation
+
+ // The link to the next page of items
+ NextLink *string
+}
+
+// SQLDbElasticPoolTargetProperties - The properties specific to an elastic pool in Azure SQL Database.
+type SQLDbElasticPoolTargetProperties struct {
+ // REQUIRED; The Azure resource ID of the anchor database used to connect to an elastic pool.
+ AnchorDatabaseResourceID *string
+
+ // REQUIRED; The FQDN host name of the server to use in the connection string when connecting to a target. For example, for
+ // an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net';
+ // for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'.
+ // Port number and instance name must be specified separately.
+ ConnectionServerName *string
+
+ // REQUIRED; The Azure resource ID of an Azure SQL DB elastic pool target.
+ SQLEpResourceID *string
+
+ // REQUIRED; The type of authentication to use when connecting to a target.
+ TargetAuthenticationType *TargetAuthenticationType
+
+ // CONSTANT; The Azure SQL DB elastic pool target.
+ // Field has constant value "SqlEp", any specified value is ignored.
+ TargetType *string
+
+ // Set to true to monitor a high availability replica of specified target, if any.
+ ReadIntent *bool
+
+ // To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored.
+ TargetVault *VaultSecret
+
+ // READ-ONLY; The provisioning state of the resource.
+ ProvisioningState *ResourceProvisioningState
+}
+
+// GetTargetProperties implements the TargetPropertiesClassification interface for type SQLDbElasticPoolTargetProperties.
+func (s *SQLDbElasticPoolTargetProperties) GetTargetProperties() *TargetProperties {
+ return &TargetProperties{
+ ConnectionServerName: s.ConnectionServerName,
+ ProvisioningState: s.ProvisioningState,
+ TargetAuthenticationType: s.TargetAuthenticationType,
+ TargetType: s.TargetType,
+ TargetVault: s.TargetVault,
+ }
+}
+
+// SQLDbSingleDatabaseTargetProperties - The properties specific to a database in Azure SQL Database.
+type SQLDbSingleDatabaseTargetProperties struct {
+ // REQUIRED; The FQDN host name of the server to use in the connection string when connecting to a target. For example, for
+ // an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net';
+ // for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'.
+ // Port number and instance name must be specified separately.
+ ConnectionServerName *string
+
+ // REQUIRED; The Azure resource ID of an Azure SQL DB database target.
+ SQLDbResourceID *string
+
+ // REQUIRED; The type of authentication to use when connecting to a target.
+ TargetAuthenticationType *TargetAuthenticationType
+
+ // CONSTANT; The Azure SQL DB single database target.
+ // Field has constant value "SqlDb", any specified value is ignored.
+ TargetType *string
+
+ // Set to true to monitor a high availability replica of specified target, if any.
+ ReadIntent *bool
+
+ // To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored.
+ TargetVault *VaultSecret
+
+ // READ-ONLY; The provisioning state of the resource.
+ ProvisioningState *ResourceProvisioningState
+}
+
+// GetTargetProperties implements the TargetPropertiesClassification interface for type SQLDbSingleDatabaseTargetProperties.
+func (s *SQLDbSingleDatabaseTargetProperties) GetTargetProperties() *TargetProperties {
+ return &TargetProperties{
+ ConnectionServerName: s.ConnectionServerName,
+ ProvisioningState: s.ProvisioningState,
+ TargetAuthenticationType: s.TargetAuthenticationType,
+ TargetType: s.TargetType,
+ TargetVault: s.TargetVault,
+ }
+}
+
+// SQLMiTargetProperties - The properties specific to Azure SQL Managed Instance targets.
+type SQLMiTargetProperties struct {
+ // REQUIRED; The FQDN host name of the server to use in the connection string when connecting to a target. For example, for
+ // an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net';
+ // for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'.
+ // Port number and instance name must be specified separately.
+ ConnectionServerName *string
+
+ // REQUIRED; The Azure resource ID of an Azure SQL Managed Instance target.
+ SQLMiResourceID *string
+
+ // REQUIRED; The type of authentication to use when connecting to a target.
+ TargetAuthenticationType *TargetAuthenticationType
+
+ // CONSTANT; The Azure SQL Managed Instance target.
+ // Field has constant value "SqlMi", any specified value is ignored.
+ TargetType *string
+
+ // The TCP port number to optionally use in the connection string when connecting to an Azure SQL Managed Instance target.
+ ConnectionTCPPort *int32
+
+ // Set to true to monitor a high availability replica of specified target, if any.
+ ReadIntent *bool
+
+ // To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored.
+ TargetVault *VaultSecret
+
+ // READ-ONLY; The provisioning state of the resource.
+ ProvisioningState *ResourceProvisioningState
+}
+
+// GetTargetProperties implements the TargetPropertiesClassification interface for type SQLMiTargetProperties.
+func (s *SQLMiTargetProperties) GetTargetProperties() *TargetProperties {
+ return &TargetProperties{
+ ConnectionServerName: s.ConnectionServerName,
+ ProvisioningState: s.ProvisioningState,
+ TargetAuthenticationType: s.TargetAuthenticationType,
+ TargetType: s.TargetType,
+ TargetVault: s.TargetVault,
+ }
+}
+
+// SharedPrivateLinkResource - Concrete proxy resource types can be created by aliasing this type using a specific property
+// type.
+type SharedPrivateLinkResource struct {
+ // The resource-specific properties for this resource.
+ Properties *SharedPrivateLinkResourceProperties
+
+ // READ-ONLY; The Shared Private Link resource name.
+ Name *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// SharedPrivateLinkResourceListResult - The response of a SharedPrivateLinkResource list operation.
+type SharedPrivateLinkResourceListResult struct {
+ // REQUIRED; The SharedPrivateLinkResource items on this page
+ Value []*SharedPrivateLinkResource
+
+ // The link to the next page of items
+ NextLink *string
+}
+
+// SharedPrivateLinkResourceProperties - The generic properties of a Shared Private Link resource.
+type SharedPrivateLinkResourceProperties struct {
+ // REQUIRED; The group id from the provider of resource the shared private link resource is for.
+ GroupID *string
+
+ // REQUIRED; The resource ID of the resource the shared private link resource is for.
+ PrivateLinkResourceID *string
+
+ // REQUIRED; The request message for requesting approval of the shared private link resource.
+ RequestMessage *string
+
+ // The DNS zone segment to be included in the DNS name of the shared private link. Value is required for Azure Data Explorer
+ // clusters and SQL managed instances, and must be omitted for SQL logical servers and key vaults. The value is the second
+ // segment of the host FQDN name of the resource that the shared private link resource is for. For example: if the host name
+ // is 'adx-cluster-21187695.eastus.kusto.windows.net', then the value is 'eastus'; if the host name is 'sql-mi-23961134.767d5869f605.database.windows.net',
+ // then the value is '767d5869f605'.
+ DNSZone *string
+
+ // READ-ONLY; The provisioning state of the resource.
+ ProvisioningState *ResourceProvisioningState
+
+ // READ-ONLY; Status of the shared private link resource. Can be Pending, Approved, Rejected or Disconnected.
+ Status *SharedPrivateLinkResourceStatus
+}
+
+// SystemData - Metadata pertaining to creation and last modification of the resource.
+type SystemData struct {
+ // The timestamp of resource creation (UTC).
+ CreatedAt *time.Time
+
+ // The identity that created the resource.
+ CreatedBy *string
+
+ // The type of identity that created the resource.
+ CreatedByType *CreatedByType
+
+ // The timestamp of resource last modification (UTC)
+ LastModifiedAt *time.Time
+
+ // The identity that last modified the resource.
+ LastModifiedBy *string
+
+ // The type of identity that last modified the resource.
+ LastModifiedByType *CreatedByType
+}
+
+// Target - Concrete proxy resource types can be created by aliasing this type using a specific property type.
+type Target struct {
+ // The resource-specific properties for this resource.
+ Properties TargetPropertiesClassification
+
+ // READ-ONLY; The target resource name.
+ Name *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// TargetListResult - The response of a Target list operation.
+type TargetListResult struct {
+ // REQUIRED; The Target items on this page
+ Value []*Target
+
+ // The link to the next page of items
+ NextLink *string
+}
+
+// TargetProperties - The generic properties of a target.
+type TargetProperties struct {
+ // REQUIRED; The FQDN host name of the server to use in the connection string when connecting to a target. For example, for
+ // an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net';
+ // for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'.
+ // Port number and instance name must be specified separately.
+ ConnectionServerName *string
+
+ // REQUIRED; The type of authentication to use when connecting to a target.
+ TargetAuthenticationType *TargetAuthenticationType
+
+ // REQUIRED; Discriminator property for TargetProperties.
+ TargetType *string
+
+ // To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored.
+ TargetVault *VaultSecret
+
+ // READ-ONLY; The provisioning state of the resource.
+ ProvisioningState *ResourceProvisioningState
+}
+
+// GetTargetProperties implements the TargetPropertiesClassification interface for type TargetProperties.
+func (t *TargetProperties) GetTargetProperties() *TargetProperties { return t }
+
+// UserAssignedIdentity - User assigned identity properties
+type UserAssignedIdentity struct {
+ // READ-ONLY; The client ID of the assigned identity.
+ ClientID *string
+
+ // READ-ONLY; The principal ID of the assigned identity.
+ PrincipalID *string
+}
+
+// ValidationIssue - The model of a health validation issue.
+type ValidationIssue struct {
+ // READ-ONLY; The error code of the issue.
+ ErrorCode *string
+
+ // READ-ONLY; The error message of the issue.
+ ErrorMessage *string
+
+ // READ-ONLY; The recommendation for resolving the issue.
+ RecommendationMessage *string
+
+ // READ-ONLY; The additional details for the issue.
+ AdditionalDetails *string
+
+ // READ-ONLY; The URL related to resolving the issue.
+ RecommendationURL *string
+
+ // READ-ONLY; The resource ID of the Azure resource related to the issue.
+ RelatedResourceID *string
+
+ // READ-ONLY; The type of the Azure resource related to the issue.
+ RelatedResourceType *string
+}
+
+// VaultSecret - The vault specific details required if using SQL authentication to connect to a target.
+type VaultSecret struct {
+ // The Azure resource ID of the Key Vault instance storing database authentication secrets.
+ AkvResourceID *string
+
+ // The path to the Key Vault secret storing the password for authentication to a target.
+ AkvTargetPassword *string
+
+ // The path to the Key Vault secret storing the login name (aka user name, aka account name) for authentication to a target.
+ AkvTargetUser *string
+}
+
+// Watcher - The DatabaseWatcherProviderHub resource.
+type Watcher struct {
+ // REQUIRED; The geo-location where the resource lives
+ Location *string
+
+ // READ-ONLY; The database watcher name.
+ Name *string
+
+ // The managed service identities assigned to this resource.
+ Identity *ManagedServiceIdentityV4
+
+ // The resource-specific properties for this resource.
+ Properties *WatcherProperties
+
+ // 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; Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// WatcherListResult - The response of a Watcher list operation.
+type WatcherListResult struct {
+ // REQUIRED; The Watcher items on this page
+ Value []*Watcher
+
+ // The link to the next page of items
+ NextLink *string
+}
+
+// WatcherProperties - The RP specific properties of the resource.
+type WatcherProperties struct {
+ // The data store for collected monitoring data.
+ Datastore *Datastore
+
+ // The resource ID of a user-assigned managed identity that will be assigned to a new alert rule.
+ DefaultAlertRuleIdentityResourceID *string
+
+ // READ-ONLY; The provisioning state of the resource watcher.
+ ProvisioningState *ProvisioningState
+
+ // READ-ONLY; The monitoring collection status of the watcher.
+ Status *WatcherStatus
+}
+
+// WatcherUpdate - The type used for update operations of the Watcher.
+type WatcherUpdate struct {
+ // The managed service identities assigned to this resource.
+ Identity *ManagedServiceIdentityV4
+
+ // The resource-specific properties for this resource.
+ Properties *WatcherUpdateProperties
+
+ // Resource tags.
+ Tags map[string]*string
+}
+
+// WatcherUpdateProperties - The updatable properties of the Watcher.
+type WatcherUpdateProperties struct {
+ // The data store for collected monitoring data.
+ Datastore *Datastore
+
+ // The resource ID of a user-assigned managed identity that will be assigned to a new alert rule.
+ DefaultAlertRuleIdentityResourceID *string
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/models_serde.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/models_serde.go
new file mode 100644
index 000000000000..e456d6003a7a
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/models_serde.go
@@ -0,0 +1,1227 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "reflect"
+)
+
+// MarshalJSON implements the json.Marshaller interface for type AlertRuleResource.
+func (a AlertRuleResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", a.ID)
+ populate(objectMap, "name", a.Name)
+ populate(objectMap, "properties", a.Properties)
+ populate(objectMap, "systemData", a.SystemData)
+ populate(objectMap, "type", a.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleResource.
+func (a *AlertRuleResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &a.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &a.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &a.Properties)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &a.SystemData)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &a.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AlertRuleResourceListResult.
+func (a AlertRuleResourceListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", a.NextLink)
+ populate(objectMap, "value", a.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleResourceListResult.
+func (a *AlertRuleResourceListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &a.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &a.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AlertRuleResourceProperties.
+func (a AlertRuleResourceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "alertRuleResourceId", a.AlertRuleResourceID)
+ populate(objectMap, "alertRuleTemplateId", a.AlertRuleTemplateID)
+ populate(objectMap, "alertRuleTemplateVersion", a.AlertRuleTemplateVersion)
+ populate(objectMap, "createdWithProperties", a.CreatedWithProperties)
+ populateDateTimeRFC3339(objectMap, "creationTime", a.CreationTime)
+ populate(objectMap, "provisioningState", a.ProvisioningState)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleResourceProperties.
+func (a *AlertRuleResourceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "alertRuleResourceId":
+ err = unpopulate(val, "AlertRuleResourceID", &a.AlertRuleResourceID)
+ delete(rawMsg, key)
+ case "alertRuleTemplateId":
+ err = unpopulate(val, "AlertRuleTemplateID", &a.AlertRuleTemplateID)
+ delete(rawMsg, key)
+ case "alertRuleTemplateVersion":
+ err = unpopulate(val, "AlertRuleTemplateVersion", &a.AlertRuleTemplateVersion)
+ delete(rawMsg, key)
+ case "createdWithProperties":
+ err = unpopulate(val, "CreatedWithProperties", &a.CreatedWithProperties)
+ delete(rawMsg, key)
+ case "creationTime":
+ err = unpopulateDateTimeRFC3339(val, "CreationTime", &a.CreationTime)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &a.ProvisioningState)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Datastore.
+func (d Datastore) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "adxClusterResourceId", d.AdxClusterResourceID)
+ populate(objectMap, "kustoClusterDisplayName", d.KustoClusterDisplayName)
+ populate(objectMap, "kustoClusterUri", d.KustoClusterURI)
+ populate(objectMap, "kustoDataIngestionUri", d.KustoDataIngestionURI)
+ populate(objectMap, "kustoDatabaseName", d.KustoDatabaseName)
+ populate(objectMap, "kustoManagementUrl", d.KustoManagementURL)
+ populate(objectMap, "kustoOfferingType", d.KustoOfferingType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Datastore.
+func (d *Datastore) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "adxClusterResourceId":
+ err = unpopulate(val, "AdxClusterResourceID", &d.AdxClusterResourceID)
+ delete(rawMsg, key)
+ case "kustoClusterDisplayName":
+ err = unpopulate(val, "KustoClusterDisplayName", &d.KustoClusterDisplayName)
+ delete(rawMsg, key)
+ case "kustoClusterUri":
+ err = unpopulate(val, "KustoClusterURI", &d.KustoClusterURI)
+ delete(rawMsg, key)
+ case "kustoDataIngestionUri":
+ err = unpopulate(val, "KustoDataIngestionURI", &d.KustoDataIngestionURI)
+ delete(rawMsg, key)
+ case "kustoDatabaseName":
+ err = unpopulate(val, "KustoDatabaseName", &d.KustoDatabaseName)
+ delete(rawMsg, key)
+ case "kustoManagementUrl":
+ err = unpopulate(val, "KustoManagementURL", &d.KustoManagementURL)
+ delete(rawMsg, key)
+ case "kustoOfferingType":
+ err = unpopulate(val, "KustoOfferingType", &d.KustoOfferingType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type HealthValidation.
+func (h HealthValidation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", h.ID)
+ populate(objectMap, "name", h.Name)
+ populate(objectMap, "properties", h.Properties)
+ populate(objectMap, "systemData", h.SystemData)
+ populate(objectMap, "type", h.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type HealthValidation.
+func (h *HealthValidation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", h, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &h.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &h.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &h.Properties)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &h.SystemData)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &h.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", h, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type HealthValidationListResult.
+func (h HealthValidationListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", h.NextLink)
+ populate(objectMap, "value", h.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type HealthValidationListResult.
+func (h *HealthValidationListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", h, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &h.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &h.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", h, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type HealthValidationProperties.
+func (h HealthValidationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "endTime", h.EndTime)
+ populate(objectMap, "issues", h.Issues)
+ populate(objectMap, "provisioningState", h.ProvisioningState)
+ populateDateTimeRFC3339(objectMap, "startTime", h.StartTime)
+ populate(objectMap, "status", h.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type HealthValidationProperties.
+func (h *HealthValidationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", h, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "endTime":
+ err = unpopulateDateTimeRFC3339(val, "EndTime", &h.EndTime)
+ delete(rawMsg, key)
+ case "issues":
+ err = unpopulate(val, "Issues", &h.Issues)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &h.ProvisioningState)
+ delete(rawMsg, key)
+ case "startTime":
+ err = unpopulateDateTimeRFC3339(val, "StartTime", &h.StartTime)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &h.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", h, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentityV4.
+func (m ManagedServiceIdentityV4) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "principalId", m.PrincipalID)
+ populate(objectMap, "tenantId", m.TenantID)
+ populate(objectMap, "type", m.Type)
+ populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentityV4.
+func (m *ManagedServiceIdentityV4) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "principalId":
+ err = unpopulate(val, "PrincipalID", &m.PrincipalID)
+ delete(rawMsg, key)
+ case "tenantId":
+ err = unpopulate(val, "TenantID", &m.TenantID)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &m.Type)
+ delete(rawMsg, key)
+ case "userAssignedIdentities":
+ err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Operation.
+func (o Operation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "actionType", o.ActionType)
+ populate(objectMap, "display", o.Display)
+ populate(objectMap, "isDataAction", o.IsDataAction)
+ populate(objectMap, "name", o.Name)
+ populate(objectMap, "origin", o.Origin)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
+func (o *Operation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "actionType":
+ err = unpopulate(val, "ActionType", &o.ActionType)
+ delete(rawMsg, key)
+ case "display":
+ err = unpopulate(val, "Display", &o.Display)
+ delete(rawMsg, key)
+ case "isDataAction":
+ err = unpopulate(val, "IsDataAction", &o.IsDataAction)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &o.Name)
+ delete(rawMsg, key)
+ case "origin":
+ err = unpopulate(val, "Origin", &o.Origin)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
+func (o OperationDisplay) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", o.Description)
+ populate(objectMap, "operation", o.Operation)
+ populate(objectMap, "provider", o.Provider)
+ populate(objectMap, "resource", o.Resource)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
+func (o *OperationDisplay) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &o.Description)
+ delete(rawMsg, key)
+ case "operation":
+ err = unpopulate(val, "Operation", &o.Operation)
+ delete(rawMsg, key)
+ case "provider":
+ err = unpopulate(val, "Provider", &o.Provider)
+ delete(rawMsg, key)
+ case "resource":
+ err = unpopulate(val, "Resource", &o.Resource)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OperationListResult.
+func (o OperationListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", o.NextLink)
+ populate(objectMap, "value", o.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
+func (o *OperationListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &o.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &o.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SQLDbElasticPoolTargetProperties.
+func (s SQLDbElasticPoolTargetProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "anchorDatabaseResourceId", s.AnchorDatabaseResourceID)
+ populate(objectMap, "connectionServerName", s.ConnectionServerName)
+ populate(objectMap, "provisioningState", s.ProvisioningState)
+ populate(objectMap, "readIntent", s.ReadIntent)
+ populate(objectMap, "sqlEpResourceId", s.SQLEpResourceID)
+ populate(objectMap, "targetAuthenticationType", s.TargetAuthenticationType)
+ objectMap["targetType"] = "SqlEp"
+ populate(objectMap, "targetVault", s.TargetVault)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDbElasticPoolTargetProperties.
+func (s *SQLDbElasticPoolTargetProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "anchorDatabaseResourceId":
+ err = unpopulate(val, "AnchorDatabaseResourceID", &s.AnchorDatabaseResourceID)
+ delete(rawMsg, key)
+ case "connectionServerName":
+ err = unpopulate(val, "ConnectionServerName", &s.ConnectionServerName)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &s.ProvisioningState)
+ delete(rawMsg, key)
+ case "readIntent":
+ err = unpopulate(val, "ReadIntent", &s.ReadIntent)
+ delete(rawMsg, key)
+ case "sqlEpResourceId":
+ err = unpopulate(val, "SQLEpResourceID", &s.SQLEpResourceID)
+ delete(rawMsg, key)
+ case "targetAuthenticationType":
+ err = unpopulate(val, "TargetAuthenticationType", &s.TargetAuthenticationType)
+ delete(rawMsg, key)
+ case "targetType":
+ err = unpopulate(val, "TargetType", &s.TargetType)
+ delete(rawMsg, key)
+ case "targetVault":
+ err = unpopulate(val, "TargetVault", &s.TargetVault)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SQLDbSingleDatabaseTargetProperties.
+func (s SQLDbSingleDatabaseTargetProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "connectionServerName", s.ConnectionServerName)
+ populate(objectMap, "provisioningState", s.ProvisioningState)
+ populate(objectMap, "readIntent", s.ReadIntent)
+ populate(objectMap, "sqlDbResourceId", s.SQLDbResourceID)
+ populate(objectMap, "targetAuthenticationType", s.TargetAuthenticationType)
+ objectMap["targetType"] = "SqlDb"
+ populate(objectMap, "targetVault", s.TargetVault)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDbSingleDatabaseTargetProperties.
+func (s *SQLDbSingleDatabaseTargetProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "connectionServerName":
+ err = unpopulate(val, "ConnectionServerName", &s.ConnectionServerName)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &s.ProvisioningState)
+ delete(rawMsg, key)
+ case "readIntent":
+ err = unpopulate(val, "ReadIntent", &s.ReadIntent)
+ delete(rawMsg, key)
+ case "sqlDbResourceId":
+ err = unpopulate(val, "SQLDbResourceID", &s.SQLDbResourceID)
+ delete(rawMsg, key)
+ case "targetAuthenticationType":
+ err = unpopulate(val, "TargetAuthenticationType", &s.TargetAuthenticationType)
+ delete(rawMsg, key)
+ case "targetType":
+ err = unpopulate(val, "TargetType", &s.TargetType)
+ delete(rawMsg, key)
+ case "targetVault":
+ err = unpopulate(val, "TargetVault", &s.TargetVault)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SQLMiTargetProperties.
+func (s SQLMiTargetProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "connectionServerName", s.ConnectionServerName)
+ populate(objectMap, "connectionTcpPort", s.ConnectionTCPPort)
+ populate(objectMap, "provisioningState", s.ProvisioningState)
+ populate(objectMap, "readIntent", s.ReadIntent)
+ populate(objectMap, "sqlMiResourceId", s.SQLMiResourceID)
+ populate(objectMap, "targetAuthenticationType", s.TargetAuthenticationType)
+ objectMap["targetType"] = "SqlMi"
+ populate(objectMap, "targetVault", s.TargetVault)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SQLMiTargetProperties.
+func (s *SQLMiTargetProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "connectionServerName":
+ err = unpopulate(val, "ConnectionServerName", &s.ConnectionServerName)
+ delete(rawMsg, key)
+ case "connectionTcpPort":
+ err = unpopulate(val, "ConnectionTCPPort", &s.ConnectionTCPPort)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &s.ProvisioningState)
+ delete(rawMsg, key)
+ case "readIntent":
+ err = unpopulate(val, "ReadIntent", &s.ReadIntent)
+ delete(rawMsg, key)
+ case "sqlMiResourceId":
+ err = unpopulate(val, "SQLMiResourceID", &s.SQLMiResourceID)
+ delete(rawMsg, key)
+ case "targetAuthenticationType":
+ err = unpopulate(val, "TargetAuthenticationType", &s.TargetAuthenticationType)
+ delete(rawMsg, key)
+ case "targetType":
+ err = unpopulate(val, "TargetType", &s.TargetType)
+ delete(rawMsg, key)
+ case "targetVault":
+ err = unpopulate(val, "TargetVault", &s.TargetVault)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedPrivateLinkResource.
+func (s SharedPrivateLinkResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", s.ID)
+ populate(objectMap, "name", s.Name)
+ populate(objectMap, "properties", s.Properties)
+ populate(objectMap, "systemData", s.SystemData)
+ populate(objectMap, "type", s.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedPrivateLinkResource.
+func (s *SharedPrivateLinkResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &s.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &s.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &s.Properties)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &s.SystemData)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &s.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedPrivateLinkResourceListResult.
+func (s SharedPrivateLinkResourceListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", s.NextLink)
+ populate(objectMap, "value", s.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedPrivateLinkResourceListResult.
+func (s *SharedPrivateLinkResourceListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &s.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &s.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedPrivateLinkResourceProperties.
+func (s SharedPrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dnsZone", s.DNSZone)
+ populate(objectMap, "groupId", s.GroupID)
+ populate(objectMap, "privateLinkResourceId", s.PrivateLinkResourceID)
+ populate(objectMap, "provisioningState", s.ProvisioningState)
+ populate(objectMap, "requestMessage", s.RequestMessage)
+ populate(objectMap, "status", s.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedPrivateLinkResourceProperties.
+func (s *SharedPrivateLinkResourceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dnsZone":
+ err = unpopulate(val, "DNSZone", &s.DNSZone)
+ delete(rawMsg, key)
+ case "groupId":
+ err = unpopulate(val, "GroupID", &s.GroupID)
+ delete(rawMsg, key)
+ case "privateLinkResourceId":
+ err = unpopulate(val, "PrivateLinkResourceID", &s.PrivateLinkResourceID)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &s.ProvisioningState)
+ delete(rawMsg, key)
+ case "requestMessage":
+ err = unpopulate(val, "RequestMessage", &s.RequestMessage)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &s.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SystemData.
+func (s SystemData) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt)
+ populate(objectMap, "createdBy", s.CreatedBy)
+ populate(objectMap, "createdByType", s.CreatedByType)
+ populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt)
+ populate(objectMap, "lastModifiedBy", s.LastModifiedBy)
+ populate(objectMap, "lastModifiedByType", s.LastModifiedByType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.
+func (s *SystemData) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "createdAt":
+ err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt)
+ delete(rawMsg, key)
+ case "createdBy":
+ err = unpopulate(val, "CreatedBy", &s.CreatedBy)
+ delete(rawMsg, key)
+ case "createdByType":
+ err = unpopulate(val, "CreatedByType", &s.CreatedByType)
+ delete(rawMsg, key)
+ case "lastModifiedAt":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt)
+ delete(rawMsg, key)
+ case "lastModifiedBy":
+ err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy)
+ delete(rawMsg, key)
+ case "lastModifiedByType":
+ err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Target.
+func (t Target) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", t.ID)
+ populate(objectMap, "name", t.Name)
+ populate(objectMap, "properties", t.Properties)
+ populate(objectMap, "systemData", t.SystemData)
+ populate(objectMap, "type", t.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Target.
+func (t *Target) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &t.Name)
+ delete(rawMsg, key)
+ case "properties":
+ t.Properties, err = unmarshalTargetPropertiesClassification(val)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &t.SystemData)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &t.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TargetListResult.
+func (t TargetListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", t.NextLink)
+ populate(objectMap, "value", t.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TargetListResult.
+func (t *TargetListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &t.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &t.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TargetProperties.
+func (t TargetProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "connectionServerName", t.ConnectionServerName)
+ populate(objectMap, "provisioningState", t.ProvisioningState)
+ populate(objectMap, "targetAuthenticationType", t.TargetAuthenticationType)
+ populate(objectMap, "targetType", t.TargetType)
+ populate(objectMap, "targetVault", t.TargetVault)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TargetProperties.
+func (t *TargetProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "connectionServerName":
+ err = unpopulate(val, "ConnectionServerName", &t.ConnectionServerName)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &t.ProvisioningState)
+ delete(rawMsg, key)
+ case "targetAuthenticationType":
+ err = unpopulate(val, "TargetAuthenticationType", &t.TargetAuthenticationType)
+ delete(rawMsg, key)
+ case "targetType":
+ err = unpopulate(val, "TargetType", &t.TargetType)
+ delete(rawMsg, key)
+ case "targetVault":
+ err = unpopulate(val, "TargetVault", &t.TargetVault)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity.
+func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "clientId", u.ClientID)
+ populate(objectMap, "principalId", u.PrincipalID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity.
+func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "clientId":
+ err = unpopulate(val, "ClientID", &u.ClientID)
+ delete(rawMsg, key)
+ case "principalId":
+ err = unpopulate(val, "PrincipalID", &u.PrincipalID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ValidationIssue.
+func (v ValidationIssue) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "additionalDetails", v.AdditionalDetails)
+ populate(objectMap, "errorCode", v.ErrorCode)
+ populate(objectMap, "errorMessage", v.ErrorMessage)
+ populate(objectMap, "recommendationMessage", v.RecommendationMessage)
+ populate(objectMap, "recommendationUrl", v.RecommendationURL)
+ populate(objectMap, "relatedResourceId", v.RelatedResourceID)
+ populate(objectMap, "relatedResourceType", v.RelatedResourceType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ValidationIssue.
+func (v *ValidationIssue) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "additionalDetails":
+ err = unpopulate(val, "AdditionalDetails", &v.AdditionalDetails)
+ delete(rawMsg, key)
+ case "errorCode":
+ err = unpopulate(val, "ErrorCode", &v.ErrorCode)
+ delete(rawMsg, key)
+ case "errorMessage":
+ err = unpopulate(val, "ErrorMessage", &v.ErrorMessage)
+ delete(rawMsg, key)
+ case "recommendationMessage":
+ err = unpopulate(val, "RecommendationMessage", &v.RecommendationMessage)
+ delete(rawMsg, key)
+ case "recommendationUrl":
+ err = unpopulate(val, "RecommendationURL", &v.RecommendationURL)
+ delete(rawMsg, key)
+ case "relatedResourceId":
+ err = unpopulate(val, "RelatedResourceID", &v.RelatedResourceID)
+ delete(rawMsg, key)
+ case "relatedResourceType":
+ err = unpopulate(val, "RelatedResourceType", &v.RelatedResourceType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VaultSecret.
+func (v VaultSecret) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "akvResourceId", v.AkvResourceID)
+ populate(objectMap, "akvTargetPassword", v.AkvTargetPassword)
+ populate(objectMap, "akvTargetUser", v.AkvTargetUser)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VaultSecret.
+func (v *VaultSecret) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "akvResourceId":
+ err = unpopulate(val, "AkvResourceID", &v.AkvResourceID)
+ delete(rawMsg, key)
+ case "akvTargetPassword":
+ err = unpopulate(val, "AkvTargetPassword", &v.AkvTargetPassword)
+ delete(rawMsg, key)
+ case "akvTargetUser":
+ err = unpopulate(val, "AkvTargetUser", &v.AkvTargetUser)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Watcher.
+func (w Watcher) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", w.ID)
+ populate(objectMap, "identity", w.Identity)
+ populate(objectMap, "location", w.Location)
+ populate(objectMap, "name", w.Name)
+ populate(objectMap, "properties", w.Properties)
+ populate(objectMap, "systemData", w.SystemData)
+ populate(objectMap, "tags", w.Tags)
+ populate(objectMap, "type", w.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Watcher.
+func (w *Watcher) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &w.ID)
+ delete(rawMsg, key)
+ case "identity":
+ err = unpopulate(val, "Identity", &w.Identity)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &w.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &w.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &w.Properties)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &w.SystemData)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &w.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &w.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type WatcherListResult.
+func (w WatcherListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", w.NextLink)
+ populate(objectMap, "value", w.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type WatcherListResult.
+func (w *WatcherListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &w.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &w.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type WatcherProperties.
+func (w WatcherProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "datastore", w.Datastore)
+ populate(objectMap, "defaultAlertRuleIdentityResourceId", w.DefaultAlertRuleIdentityResourceID)
+ populate(objectMap, "provisioningState", w.ProvisioningState)
+ populate(objectMap, "status", w.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type WatcherProperties.
+func (w *WatcherProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "datastore":
+ err = unpopulate(val, "Datastore", &w.Datastore)
+ delete(rawMsg, key)
+ case "defaultAlertRuleIdentityResourceId":
+ err = unpopulate(val, "DefaultAlertRuleIdentityResourceID", &w.DefaultAlertRuleIdentityResourceID)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &w.ProvisioningState)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &w.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type WatcherUpdate.
+func (w WatcherUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identity", w.Identity)
+ populate(objectMap, "properties", w.Properties)
+ populate(objectMap, "tags", w.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type WatcherUpdate.
+func (w *WatcherUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identity":
+ err = unpopulate(val, "Identity", &w.Identity)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &w.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &w.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type WatcherUpdateProperties.
+func (w WatcherUpdateProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "datastore", w.Datastore)
+ populate(objectMap, "defaultAlertRuleIdentityResourceId", w.DefaultAlertRuleIdentityResourceID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type WatcherUpdateProperties.
+func (w *WatcherUpdateProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "datastore":
+ err = unpopulate(val, "Datastore", &w.Datastore)
+ delete(rawMsg, key)
+ case "defaultAlertRuleIdentityResourceId":
+ err = unpopulate(val, "DefaultAlertRuleIdentityResourceID", &w.DefaultAlertRuleIdentityResourceID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ }
+ return nil
+}
+
+func populate(m map[string]any, k string, v any) {
+ if v == nil {
+ return
+ } else if azcore.IsNullValue(v) {
+ m[k] = nil
+ } else if !reflect.ValueOf(v).IsNil() {
+ m[k] = v
+ }
+}
+
+func unpopulate(data json.RawMessage, fn string, v any) error {
+ if data == nil || string(data) == "null" {
+ return nil
+ }
+ if err := json.Unmarshal(data, v); err != nil {
+ return fmt.Errorf("struct field %s: %v", fn, err)
+ }
+ return nil
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/operations_client.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/operations_client.go
new file mode 100644
index 000000000000..d259aa1e4f14
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/operations_client.go
@@ -0,0 +1,84 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher
+
+import (
+ "context"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+)
+
+// OperationsClient contains the methods for the Operations group.
+// Don't use this type directly, use NewOperationsClient() instead.
+type OperationsClient struct {
+ internal *arm.Client
+}
+
+// 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 NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &OperationsClient{
+ internal: cl,
+ }
+ return client, nil
+}
+
+// NewListPager - List the operations for the provider
+//
+// Generated from API version 2025-01-02
+// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
+func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{
+ More: func(page OperationsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return OperationsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.DatabaseWatcher/operations"
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) {
+ result := OperationsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil {
+ return OperationsClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/operations_client_example_test.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/operations_client_example_test.go
new file mode 100644
index 000000000000..622b7c3d1546
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/operations_client_example_test.go
@@ -0,0 +1,85 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher_test
+
+import (
+ "context"
+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databasewatcher/armdatabasewatcher"
+ "log"
+)
+
+// Generated from example definition: 2025-01-02/Operations_List_MaximumSet_Gen.json
+func ExampleOperationsClient_NewListPager_operationsListMaximumSet() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ pager := clientFactory.NewOperationsClient().NewListPager(nil)
+ for pager.More() {
+ page, err := pager.NextPage(ctx)
+ if err != nil {
+ log.Fatalf("failed to advance page: %v", err)
+ }
+ for _, v := range page.Value {
+ // You could use page here. We use blank identifier for just demo purposes.
+ _ = v
+ }
+ // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
+ // page = armdatabasewatcher.OperationsClientListResponse{
+ // OperationListResult: armdatabasewatcher.OperationListResult{
+ // Value: []*armdatabasewatcher.Operation{
+ // {
+ // Name: to.Ptr("snzrdvltunnrz"),
+ // IsDataAction: to.Ptr(true),
+ // Display: &armdatabasewatcher.OperationDisplay{
+ // Provider: to.Ptr("dtfrqzamclscchmghtxn"),
+ // Resource: to.Ptr("lvlhnsfnquorjuuutjxex"),
+ // Operation: to.Ptr("vbgvamoxqwthpbdghxzaw"),
+ // Description: to.Ptr("nvbtuwwjfehylzmoatd"),
+ // },
+ // Origin: to.Ptr(armdatabasewatcher.OriginUser),
+ // ActionType: to.Ptr(armdatabasewatcher.ActionTypeInternal),
+ // },
+ // },
+ // NextLink: to.Ptr("https://microsoft.com/awfba"),
+ // },
+ // }
+ }
+}
+
+// Generated from example definition: 2025-01-02/Operations_List_MinimumSet_Gen.json
+func ExampleOperationsClient_NewListPager_operationsListMinimumSet() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ pager := clientFactory.NewOperationsClient().NewListPager(nil)
+ for pager.More() {
+ page, err := pager.NextPage(ctx)
+ if err != nil {
+ log.Fatalf("failed to advance page: %v", err)
+ }
+ for _, v := range page.Value {
+ // You could use page here. We use blank identifier for just demo purposes.
+ _ = v
+ }
+ // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
+ // page = armdatabasewatcher.OperationsClientListResponse{
+ // OperationListResult: armdatabasewatcher.OperationListResult{
+ // },
+ // }
+ }
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/options.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/options.go
new file mode 100644
index 000000000000..62604d77b938
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/options.go
@@ -0,0 +1,143 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher
+
+// AlertRuleResourcesClientCreateOrUpdateOptions contains the optional parameters for the AlertRuleResourcesClient.CreateOrUpdate
+// method.
+type AlertRuleResourcesClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AlertRuleResourcesClientDeleteOptions contains the optional parameters for the AlertRuleResourcesClient.Delete method.
+type AlertRuleResourcesClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AlertRuleResourcesClientGetOptions contains the optional parameters for the AlertRuleResourcesClient.Get method.
+type AlertRuleResourcesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AlertRuleResourcesClientListByParentOptions contains the optional parameters for the AlertRuleResourcesClient.NewListByParentPager
+// method.
+type AlertRuleResourcesClientListByParentOptions struct {
+ // placeholder for future optional parameters
+}
+
+// HealthValidationsClientBeginStartValidationOptions contains the optional parameters for the HealthValidationsClient.BeginStartValidation
+// method.
+type HealthValidationsClientBeginStartValidationOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// HealthValidationsClientGetOptions contains the optional parameters for the HealthValidationsClient.Get method.
+type HealthValidationsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// HealthValidationsClientListByParentOptions contains the optional parameters for the HealthValidationsClient.NewListByParentPager
+// method.
+type HealthValidationsClientListByParentOptions struct {
+ // placeholder for future optional parameters
+}
+
+// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
+type OperationsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SharedPrivateLinkResourcesClientBeginCreateOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginCreate
+// method.
+type SharedPrivateLinkResourcesClientBeginCreateOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// SharedPrivateLinkResourcesClientBeginDeleteOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginDelete
+// method.
+type SharedPrivateLinkResourcesClientBeginDeleteOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// SharedPrivateLinkResourcesClientGetOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.Get
+// method.
+type SharedPrivateLinkResourcesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SharedPrivateLinkResourcesClientListByWatcherOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.NewListByWatcherPager
+// method.
+type SharedPrivateLinkResourcesClientListByWatcherOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TargetsClientCreateOrUpdateOptions contains the optional parameters for the TargetsClient.CreateOrUpdate method.
+type TargetsClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TargetsClientDeleteOptions contains the optional parameters for the TargetsClient.Delete method.
+type TargetsClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TargetsClientGetOptions contains the optional parameters for the TargetsClient.Get method.
+type TargetsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TargetsClientListByWatcherOptions contains the optional parameters for the TargetsClient.NewListByWatcherPager method.
+type TargetsClientListByWatcherOptions struct {
+ // placeholder for future optional parameters
+}
+
+// WatchersClientBeginCreateOrUpdateOptions contains the optional parameters for the WatchersClient.BeginCreateOrUpdate method.
+type WatchersClientBeginCreateOrUpdateOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// WatchersClientBeginDeleteOptions contains the optional parameters for the WatchersClient.BeginDelete method.
+type WatchersClientBeginDeleteOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// WatchersClientBeginStartOptions contains the optional parameters for the WatchersClient.BeginStart method.
+type WatchersClientBeginStartOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// WatchersClientBeginStopOptions contains the optional parameters for the WatchersClient.BeginStop method.
+type WatchersClientBeginStopOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// WatchersClientBeginUpdateOptions contains the optional parameters for the WatchersClient.BeginUpdate method.
+type WatchersClientBeginUpdateOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// WatchersClientGetOptions contains the optional parameters for the WatchersClient.Get method.
+type WatchersClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// WatchersClientListByResourceGroupOptions contains the optional parameters for the WatchersClient.NewListByResourceGroupPager
+// method.
+type WatchersClientListByResourceGroupOptions struct {
+ // placeholder for future optional parameters
+}
+
+// WatchersClientListBySubscriptionOptions contains the optional parameters for the WatchersClient.NewListBySubscriptionPager
+// method.
+type WatchersClientListBySubscriptionOptions struct {
+ // placeholder for future optional parameters
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/polymorphic_helpers.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/polymorphic_helpers.go
new file mode 100644
index 000000000000..23f16ce00208
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/polymorphic_helpers.go
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher
+
+import "encoding/json"
+
+func unmarshalTargetPropertiesClassification(rawMsg json.RawMessage) (TargetPropertiesClassification, error) {
+ if rawMsg == nil || string(rawMsg) == "null" {
+ return nil, nil
+ }
+ var m map[string]any
+ if err := json.Unmarshal(rawMsg, &m); err != nil {
+ return nil, err
+ }
+ var b TargetPropertiesClassification
+ switch m["targetType"] {
+ case "SqlDb":
+ b = &SQLDbSingleDatabaseTargetProperties{}
+ case "SqlEp":
+ b = &SQLDbElasticPoolTargetProperties{}
+ case "SqlMi":
+ b = &SQLMiTargetProperties{}
+ default:
+ b = &TargetProperties{}
+ }
+ if err := json.Unmarshal(rawMsg, b); err != nil {
+ return nil, err
+ }
+ return b, nil
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/responses.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/responses.go
new file mode 100644
index 000000000000..ddd743dc6a42
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/responses.go
@@ -0,0 +1,143 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher
+
+// AlertRuleResourcesClientCreateOrUpdateResponse contains the response from method AlertRuleResourcesClient.CreateOrUpdate.
+type AlertRuleResourcesClientCreateOrUpdateResponse struct {
+ // Concrete proxy resource types can be created by aliasing this type using a specific property type.
+ AlertRuleResource
+}
+
+// AlertRuleResourcesClientDeleteResponse contains the response from method AlertRuleResourcesClient.Delete.
+type AlertRuleResourcesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// AlertRuleResourcesClientGetResponse contains the response from method AlertRuleResourcesClient.Get.
+type AlertRuleResourcesClientGetResponse struct {
+ // Concrete proxy resource types can be created by aliasing this type using a specific property type.
+ AlertRuleResource
+}
+
+// AlertRuleResourcesClientListByParentResponse contains the response from method AlertRuleResourcesClient.NewListByParentPager.
+type AlertRuleResourcesClientListByParentResponse struct {
+ // The response of a AlertRuleResource list operation.
+ AlertRuleResourceListResult
+}
+
+// HealthValidationsClientGetResponse contains the response from method HealthValidationsClient.Get.
+type HealthValidationsClientGetResponse struct {
+ // Concrete proxy resource types can be created by aliasing this type using a specific property type.
+ HealthValidation
+}
+
+// HealthValidationsClientListByParentResponse contains the response from method HealthValidationsClient.NewListByParentPager.
+type HealthValidationsClientListByParentResponse struct {
+ // The response of a HealthValidation list operation.
+ HealthValidationListResult
+}
+
+// HealthValidationsClientStartValidationResponse contains the response from method HealthValidationsClient.BeginStartValidation.
+type HealthValidationsClientStartValidationResponse struct {
+ // Concrete proxy resource types can be created by aliasing this type using a specific property type.
+ HealthValidation
+}
+
+// OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
+type OperationsClientListResponse struct {
+ // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
+ OperationListResult
+}
+
+// SharedPrivateLinkResourcesClientCreateResponse contains the response from method SharedPrivateLinkResourcesClient.BeginCreate.
+type SharedPrivateLinkResourcesClientCreateResponse struct {
+ // Concrete proxy resource types can be created by aliasing this type using a specific property type.
+ SharedPrivateLinkResource
+}
+
+// SharedPrivateLinkResourcesClientDeleteResponse contains the response from method SharedPrivateLinkResourcesClient.BeginDelete.
+type SharedPrivateLinkResourcesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// SharedPrivateLinkResourcesClientGetResponse contains the response from method SharedPrivateLinkResourcesClient.Get.
+type SharedPrivateLinkResourcesClientGetResponse struct {
+ // Concrete proxy resource types can be created by aliasing this type using a specific property type.
+ SharedPrivateLinkResource
+}
+
+// SharedPrivateLinkResourcesClientListByWatcherResponse contains the response from method SharedPrivateLinkResourcesClient.NewListByWatcherPager.
+type SharedPrivateLinkResourcesClientListByWatcherResponse struct {
+ // The response of a SharedPrivateLinkResource list operation.
+ SharedPrivateLinkResourceListResult
+}
+
+// TargetsClientCreateOrUpdateResponse contains the response from method TargetsClient.CreateOrUpdate.
+type TargetsClientCreateOrUpdateResponse struct {
+ // Concrete proxy resource types can be created by aliasing this type using a specific property type.
+ Target
+}
+
+// TargetsClientDeleteResponse contains the response from method TargetsClient.Delete.
+type TargetsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// TargetsClientGetResponse contains the response from method TargetsClient.Get.
+type TargetsClientGetResponse struct {
+ // Concrete proxy resource types can be created by aliasing this type using a specific property type.
+ Target
+}
+
+// TargetsClientListByWatcherResponse contains the response from method TargetsClient.NewListByWatcherPager.
+type TargetsClientListByWatcherResponse struct {
+ // The response of a Target list operation.
+ TargetListResult
+}
+
+// WatchersClientCreateOrUpdateResponse contains the response from method WatchersClient.BeginCreateOrUpdate.
+type WatchersClientCreateOrUpdateResponse struct {
+ // The DatabaseWatcherProviderHub resource.
+ Watcher
+}
+
+// WatchersClientDeleteResponse contains the response from method WatchersClient.BeginDelete.
+type WatchersClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// WatchersClientGetResponse contains the response from method WatchersClient.Get.
+type WatchersClientGetResponse struct {
+ // The DatabaseWatcherProviderHub resource.
+ Watcher
+}
+
+// WatchersClientListByResourceGroupResponse contains the response from method WatchersClient.NewListByResourceGroupPager.
+type WatchersClientListByResourceGroupResponse struct {
+ // The response of a Watcher list operation.
+ WatcherListResult
+}
+
+// WatchersClientListBySubscriptionResponse contains the response from method WatchersClient.NewListBySubscriptionPager.
+type WatchersClientListBySubscriptionResponse struct {
+ // The response of a Watcher list operation.
+ WatcherListResult
+}
+
+// WatchersClientStartResponse contains the response from method WatchersClient.BeginStart.
+type WatchersClientStartResponse struct {
+ // placeholder for future response values
+}
+
+// WatchersClientStopResponse contains the response from method WatchersClient.BeginStop.
+type WatchersClientStopResponse struct {
+ // placeholder for future response values
+}
+
+// WatchersClientUpdateResponse contains the response from method WatchersClient.BeginUpdate.
+type WatchersClientUpdateResponse struct {
+ // The DatabaseWatcherProviderHub resource.
+ Watcher
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/sharedprivatelinkresources_client.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/sharedprivatelinkresources_client.go
new file mode 100644
index 000000000000..fdd605d88af4
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/sharedprivatelinkresources_client.go
@@ -0,0 +1,343 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// SharedPrivateLinkResourcesClient contains the methods for the SharedPrivateLinkResources group.
+// Don't use this type directly, use NewSharedPrivateLinkResourcesClient() instead.
+type SharedPrivateLinkResourcesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewSharedPrivateLinkResourcesClient creates a new instance of SharedPrivateLinkResourcesClient with the specified values.
+// - subscriptionID - The ID of the target subscription. The value must be an UUID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewSharedPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedPrivateLinkResourcesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &SharedPrivateLinkResourcesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreate - Create a SharedPrivateLinkResource
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - sharedPrivateLinkResourceName - The Shared Private Link resource name.
+// - resource - Resource create parameters.
+// - options - SharedPrivateLinkResourcesClientBeginCreateOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginCreate
+// method.
+func (client *SharedPrivateLinkResourcesClient) BeginCreate(ctx context.Context, resourceGroupName string, watcherName string, sharedPrivateLinkResourceName string, resource SharedPrivateLinkResource, options *SharedPrivateLinkResourcesClientBeginCreateOptions) (*runtime.Poller[SharedPrivateLinkResourcesClientCreateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.create(ctx, resourceGroupName, watcherName, sharedPrivateLinkResourceName, resource, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SharedPrivateLinkResourcesClientCreateResponse]{
+ FinalStateVia: runtime.FinalStateViaAzureAsyncOp,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SharedPrivateLinkResourcesClientCreateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Create - Create a SharedPrivateLinkResource
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+func (client *SharedPrivateLinkResourcesClient) create(ctx context.Context, resourceGroupName string, watcherName string, sharedPrivateLinkResourceName string, resource SharedPrivateLinkResource, options *SharedPrivateLinkResourcesClientBeginCreateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "SharedPrivateLinkResourcesClient.BeginCreate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createCreateRequest(ctx, resourceGroupName, watcherName, sharedPrivateLinkResourceName, resource, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createCreateRequest creates the Create request.
+func (client *SharedPrivateLinkResourcesClient) createCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, sharedPrivateLinkResourceName string, resource SharedPrivateLinkResource, _ *SharedPrivateLinkResourcesClientBeginCreateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ if sharedPrivateLinkResourceName == "" {
+ return nil, errors.New("parameter sharedPrivateLinkResourceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{sharedPrivateLinkResourceName}", url.PathEscape(sharedPrivateLinkResourceName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, resource); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Delete a SharedPrivateLinkResource
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - sharedPrivateLinkResourceName - The Shared Private Link resource name.
+// - options - SharedPrivateLinkResourcesClientBeginDeleteOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginDelete
+// method.
+func (client *SharedPrivateLinkResourcesClient) BeginDelete(ctx context.Context, resourceGroupName string, watcherName string, sharedPrivateLinkResourceName string, options *SharedPrivateLinkResourcesClientBeginDeleteOptions) (*runtime.Poller[SharedPrivateLinkResourcesClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, watcherName, sharedPrivateLinkResourceName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SharedPrivateLinkResourcesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SharedPrivateLinkResourcesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Delete a SharedPrivateLinkResource
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+func (client *SharedPrivateLinkResourcesClient) deleteOperation(ctx context.Context, resourceGroupName string, watcherName string, sharedPrivateLinkResourceName string, options *SharedPrivateLinkResourcesClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "SharedPrivateLinkResourcesClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, watcherName, sharedPrivateLinkResourceName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *SharedPrivateLinkResourcesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, sharedPrivateLinkResourceName string, _ *SharedPrivateLinkResourcesClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ if sharedPrivateLinkResourceName == "" {
+ return nil, errors.New("parameter sharedPrivateLinkResourceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{sharedPrivateLinkResourceName}", url.PathEscape(sharedPrivateLinkResourceName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Get a SharedPrivateLinkResource
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - sharedPrivateLinkResourceName - The Shared Private Link resource name.
+// - options - SharedPrivateLinkResourcesClientGetOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.Get
+// method.
+func (client *SharedPrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, watcherName string, sharedPrivateLinkResourceName string, options *SharedPrivateLinkResourcesClientGetOptions) (SharedPrivateLinkResourcesClientGetResponse, error) {
+ var err error
+ const operationName = "SharedPrivateLinkResourcesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, watcherName, sharedPrivateLinkResourceName, options)
+ if err != nil {
+ return SharedPrivateLinkResourcesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return SharedPrivateLinkResourcesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return SharedPrivateLinkResourcesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *SharedPrivateLinkResourcesClient) getCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, sharedPrivateLinkResourceName string, _ *SharedPrivateLinkResourcesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ if sharedPrivateLinkResourceName == "" {
+ return nil, errors.New("parameter sharedPrivateLinkResourceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{sharedPrivateLinkResourceName}", url.PathEscape(sharedPrivateLinkResourceName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *SharedPrivateLinkResourcesClient) getHandleResponse(resp *http.Response) (SharedPrivateLinkResourcesClientGetResponse, error) {
+ result := SharedPrivateLinkResourcesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SharedPrivateLinkResource); err != nil {
+ return SharedPrivateLinkResourcesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByWatcherPager - List SharedPrivateLinkResource resources by Watcher
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - options - SharedPrivateLinkResourcesClientListByWatcherOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.NewListByWatcherPager
+// method.
+func (client *SharedPrivateLinkResourcesClient) NewListByWatcherPager(resourceGroupName string, watcherName string, options *SharedPrivateLinkResourcesClientListByWatcherOptions) *runtime.Pager[SharedPrivateLinkResourcesClientListByWatcherResponse] {
+ return runtime.NewPager(runtime.PagingHandler[SharedPrivateLinkResourcesClientListByWatcherResponse]{
+ More: func(page SharedPrivateLinkResourcesClientListByWatcherResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *SharedPrivateLinkResourcesClientListByWatcherResponse) (SharedPrivateLinkResourcesClientListByWatcherResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SharedPrivateLinkResourcesClient.NewListByWatcherPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByWatcherCreateRequest(ctx, resourceGroupName, watcherName, options)
+ }, nil)
+ if err != nil {
+ return SharedPrivateLinkResourcesClientListByWatcherResponse{}, err
+ }
+ return client.listByWatcherHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByWatcherCreateRequest creates the ListByWatcher request.
+func (client *SharedPrivateLinkResourcesClient) listByWatcherCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, _ *SharedPrivateLinkResourcesClientListByWatcherOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByWatcherHandleResponse handles the ListByWatcher response.
+func (client *SharedPrivateLinkResourcesClient) listByWatcherHandleResponse(resp *http.Response) (SharedPrivateLinkResourcesClientListByWatcherResponse, error) {
+ result := SharedPrivateLinkResourcesClientListByWatcherResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SharedPrivateLinkResourceListResult); err != nil {
+ return SharedPrivateLinkResourcesClientListByWatcherResponse{}, err
+ }
+ return result, nil
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/sharedprivatelinkresources_client_example_test.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/sharedprivatelinkresources_client_example_test.go
new file mode 100644
index 000000000000..2df401e2e1f4
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/sharedprivatelinkresources_client_example_test.go
@@ -0,0 +1,182 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher_test
+
+import (
+ "context"
+ "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/databasewatcher/armdatabasewatcher"
+ "log"
+)
+
+// Generated from example definition: 2025-01-02/SharedPrivateLinkResources_Create_MaximumSet_Gen.json
+func ExampleSharedPrivateLinkResourcesClient_BeginCreate() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewSharedPrivateLinkResourcesClient().BeginCreate(ctx, "apiTest-ddat4p", "databasemo3ej9ih", "monitoringh22eed", armdatabasewatcher.SharedPrivateLinkResource{
+ Properties: &armdatabasewatcher.SharedPrivateLinkResourceProperties{
+ PrivateLinkResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.KeyVault/vaults/kvmo3ej9ih"),
+ GroupID: to.Ptr("vault"),
+ RequestMessage: to.Ptr("request message"),
+ DNSZone: to.Ptr("ec3ae9d410ba"),
+ Status: to.Ptr(armdatabasewatcher.SharedPrivateLinkResourceStatusPending),
+ },
+ }, 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 = armdatabasewatcher.SharedPrivateLinkResourcesClientCreateResponse{
+ // SharedPrivateLinkResource: &armdatabasewatcher.SharedPrivateLinkResource{
+ // Properties: &armdatabasewatcher.SharedPrivateLinkResourceProperties{
+ // PrivateLinkResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.KeyVault/vaults/kvmo3ej9ih"),
+ // GroupID: to.Ptr("vault"),
+ // RequestMessage: to.Ptr("request message"),
+ // DNSZone: to.Ptr("ec3ae9d410ba"),
+ // Status: to.Ptr(armdatabasewatcher.SharedPrivateLinkResourceStatusPending),
+ // },
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih/sharedPrivateLinkResources/monitoringh22eed"),
+ // Name: to.Ptr("monitoringh22eed"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers/sharedPrivateLinkResources"),
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-01-02/SharedPrivateLinkResources_Delete_MaximumSet_Gen.json
+func ExampleSharedPrivateLinkResourcesClient_BeginDelete() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewSharedPrivateLinkResourcesClient().BeginDelete(ctx, "apiTest-ddat4p", "databasemo3ej9ih", "monitoringh22eed", nil)
+ if err != nil {
+ log.Fatalf("failed to finish the request: %v", err)
+ }
+ _, err = poller.PollUntilDone(ctx, nil)
+ if err != nil {
+ log.Fatalf("failed to pull the result: %v", err)
+ }
+}
+
+// Generated from example definition: 2025-01-02/SharedPrivateLinkResources_Get_MaximumSet_Gen.json
+func ExampleSharedPrivateLinkResourcesClient_Get() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewSharedPrivateLinkResourcesClient().Get(ctx, "apiTest-ddat4p", "databasemo3ej9ih", "monitoringh22eed", 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 = armdatabasewatcher.SharedPrivateLinkResourcesClientGetResponse{
+ // SharedPrivateLinkResource: &armdatabasewatcher.SharedPrivateLinkResource{
+ // Properties: &armdatabasewatcher.SharedPrivateLinkResourceProperties{
+ // PrivateLinkResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.KeyVault/vaults/kvmo3ej9ih"),
+ // GroupID: to.Ptr("vault"),
+ // RequestMessage: to.Ptr("request message"),
+ // DNSZone: to.Ptr("ec3ae9d410ba"),
+ // Status: to.Ptr(armdatabasewatcher.SharedPrivateLinkResourceStatusPending),
+ // },
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih/sharedPrivateLinkResources/monitoringh22eed"),
+ // Name: to.Ptr("monitoringh22eed"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers/sharedPrivateLinkResources"),
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-01-02/SharedPrivateLinkResources_ListByWatcher_MaximumSet_Gen.json
+func ExampleSharedPrivateLinkResourcesClient_NewListByWatcherPager() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ pager := clientFactory.NewSharedPrivateLinkResourcesClient().NewListByWatcherPager("apiTest-ddat4p", "databasemo3ej9ih", 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 = armdatabasewatcher.SharedPrivateLinkResourcesClientListByWatcherResponse{
+ // SharedPrivateLinkResourceListResult: armdatabasewatcher.SharedPrivateLinkResourceListResult{
+ // Value: []*armdatabasewatcher.SharedPrivateLinkResource{
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih/sharedPrivateLinkResources/monitoringh22eed"),
+ // Name: to.Ptr("monitoringh22eed"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers/sharedPrivateLinkResources"),
+ // Properties: &armdatabasewatcher.SharedPrivateLinkResourceProperties{
+ // PrivateLinkResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.KeyVault/vaults/kvmo3ej9ih"),
+ // GroupID: to.Ptr("vault"),
+ // RequestMessage: to.Ptr("request message"),
+ // DNSZone: to.Ptr("ec3ae9d410ba"),
+ // Status: to.Ptr(armdatabasewatcher.SharedPrivateLinkResourceStatusPending),
+ // },
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // },
+ // NextLink: to.Ptr("https://microsoft.com/awfba"),
+ // },
+ // }
+ }
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/targets_client.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/targets_client.go
new file mode 100644
index 000000000000..5f489961892f
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/targets_client.go
@@ -0,0 +1,307 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// TargetsClient contains the methods for the Targets group.
+// Don't use this type directly, use NewTargetsClient() instead.
+type TargetsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewTargetsClient creates a new instance of TargetsClient with the specified values.
+// - subscriptionID - The ID of the target subscription. The value must be an UUID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewTargetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TargetsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &TargetsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - Create a Target
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - targetName - The target resource name.
+// - resource - Resource create parameters.
+// - options - TargetsClientCreateOrUpdateOptions contains the optional parameters for the TargetsClient.CreateOrUpdate method.
+func (client *TargetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, watcherName string, targetName string, resource Target, options *TargetsClientCreateOrUpdateOptions) (TargetsClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "TargetsClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, watcherName, targetName, resource, options)
+ if err != nil {
+ return TargetsClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TargetsClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return TargetsClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *TargetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, targetName string, resource Target, _ *TargetsClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ if targetName == "" {
+ return nil, errors.New("parameter targetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{targetName}", url.PathEscape(targetName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, resource); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *TargetsClient) createOrUpdateHandleResponse(resp *http.Response) (TargetsClientCreateOrUpdateResponse, error) {
+ result := TargetsClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Target); err != nil {
+ return TargetsClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Delete a Target
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - targetName - The target resource name.
+// - options - TargetsClientDeleteOptions contains the optional parameters for the TargetsClient.Delete method.
+func (client *TargetsClient) Delete(ctx context.Context, resourceGroupName string, watcherName string, targetName string, options *TargetsClientDeleteOptions) (TargetsClientDeleteResponse, error) {
+ var err error
+ const operationName = "TargetsClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, watcherName, targetName, options)
+ if err != nil {
+ return TargetsClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TargetsClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return TargetsClientDeleteResponse{}, err
+ }
+ return TargetsClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *TargetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, targetName string, _ *TargetsClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ if targetName == "" {
+ return nil, errors.New("parameter targetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{targetName}", url.PathEscape(targetName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Get a Target
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - targetName - The target resource name.
+// - options - TargetsClientGetOptions contains the optional parameters for the TargetsClient.Get method.
+func (client *TargetsClient) Get(ctx context.Context, resourceGroupName string, watcherName string, targetName string, options *TargetsClientGetOptions) (TargetsClientGetResponse, error) {
+ var err error
+ const operationName = "TargetsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, watcherName, targetName, options)
+ if err != nil {
+ return TargetsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TargetsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TargetsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *TargetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, targetName string, _ *TargetsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ if targetName == "" {
+ return nil, errors.New("parameter targetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{targetName}", url.PathEscape(targetName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *TargetsClient) getHandleResponse(resp *http.Response) (TargetsClientGetResponse, error) {
+ result := TargetsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Target); err != nil {
+ return TargetsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByWatcherPager - List Target resources by Watcher
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - options - TargetsClientListByWatcherOptions contains the optional parameters for the TargetsClient.NewListByWatcherPager
+// method.
+func (client *TargetsClient) NewListByWatcherPager(resourceGroupName string, watcherName string, options *TargetsClientListByWatcherOptions) *runtime.Pager[TargetsClientListByWatcherResponse] {
+ return runtime.NewPager(runtime.PagingHandler[TargetsClientListByWatcherResponse]{
+ More: func(page TargetsClientListByWatcherResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *TargetsClientListByWatcherResponse) (TargetsClientListByWatcherResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TargetsClient.NewListByWatcherPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByWatcherCreateRequest(ctx, resourceGroupName, watcherName, options)
+ }, nil)
+ if err != nil {
+ return TargetsClientListByWatcherResponse{}, err
+ }
+ return client.listByWatcherHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByWatcherCreateRequest creates the ListByWatcher request.
+func (client *TargetsClient) listByWatcherCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, _ *TargetsClientListByWatcherOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByWatcherHandleResponse handles the ListByWatcher response.
+func (client *TargetsClient) listByWatcherHandleResponse(resp *http.Response) (TargetsClientListByWatcherResponse, error) {
+ result := TargetsClientListByWatcherResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TargetListResult); err != nil {
+ return TargetsClientListByWatcherResponse{}, err
+ }
+ return result, nil
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/targets_client_example_test.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/targets_client_example_test.go
new file mode 100644
index 000000000000..60bca3d356ae
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/targets_client_example_test.go
@@ -0,0 +1,178 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher_test
+
+import (
+ "context"
+ "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/databasewatcher/armdatabasewatcher"
+ "log"
+)
+
+// Generated from example definition: 2025-01-02/Targets_CreateOrUpdate_MaximumSet_Gen.json
+func ExampleTargetsClient_CreateOrUpdate() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewTargetsClient().CreateOrUpdate(ctx, "apiTest-ddat4p", "databasemo3ej9ih", "monitoringh22eed", armdatabasewatcher.Target{
+ Properties: &armdatabasewatcher.SQLDbSingleDatabaseTargetProperties{
+ TargetType: to.Ptr("SqlDb"),
+ TargetAuthenticationType: to.Ptr(armdatabasewatcher.TargetAuthenticationTypeAAD),
+ ConnectionServerName: to.Ptr("sqlServero1ihe2"),
+ SQLDbResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.Sql/servers/m1/databases/m2"),
+ },
+ }, 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 = armdatabasewatcher.TargetsClientCreateOrUpdateResponse{
+ // Target: &armdatabasewatcher.Target{
+ // Properties: &armdatabasewatcher.SQLDbSingleDatabaseTargetProperties{
+ // TargetType: to.Ptr("SqlDb"),
+ // TargetAuthenticationType: to.Ptr(armdatabasewatcher.TargetAuthenticationTypeAAD),
+ // ConnectionServerName: to.Ptr("sqlServero1ihe2"),
+ // SQLDbResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.Sql/servers/m1/databases/m2"),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ResourceProvisioningStateSucceeded),
+ // },
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-px9ma7/providers/Microsoft.DatabaseWatcher/watchers/databasemo3d9sgt/targets/monitoringzkndgm"),
+ // Name: to.Ptr("monitoringzkndgm"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers/targets"),
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-01-02/Targets_Delete_MaximumSet_Gen.json
+func ExampleTargetsClient_Delete() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewTargetsClient().Delete(ctx, "apiTest-ddat4p", "databasemo3ej9ih", "monitoringh22eed", 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 = armdatabasewatcher.TargetsClientDeleteResponse{
+ // }
+}
+
+// Generated from example definition: 2025-01-02/Targets_Get_MaximumSet_Gen.json
+func ExampleTargetsClient_Get() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewTargetsClient().Get(ctx, "apiTest-ddat4p", "databasemo3ej9ih", "monitoringh22eed", 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 = armdatabasewatcher.TargetsClientGetResponse{
+ // Target: &armdatabasewatcher.Target{
+ // Properties: &armdatabasewatcher.SQLDbSingleDatabaseTargetProperties{
+ // TargetType: to.Ptr("SqlDb"),
+ // TargetAuthenticationType: to.Ptr(armdatabasewatcher.TargetAuthenticationTypeAAD),
+ // ConnectionServerName: to.Ptr("sqlServero1ihe2"),
+ // SQLDbResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.Sql/servers/m1/databases/m2"),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ResourceProvisioningStateSucceeded),
+ // },
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-px9ma7/providers/Microsoft.DatabaseWatcher/watchers/databasemo3d9sgt/targets/monitoringzkndgm"),
+ // Name: to.Ptr("monitoringzkndgm"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers/targets"),
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-01-02/Targets_ListByWatcher_MaximumSet_Gen.json
+func ExampleTargetsClient_NewListByWatcherPager() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ pager := clientFactory.NewTargetsClient().NewListByWatcherPager("apiTest-ddat4p", "databasemo3ej9ih", 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 = armdatabasewatcher.TargetsClientListByWatcherResponse{
+ // TargetListResult: armdatabasewatcher.TargetListResult{
+ // Value: []*armdatabasewatcher.Target{
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-px9ma7/providers/Microsoft.DatabaseWatcher/watchers/databasemo3d9sgt/targets/monitoringzkndgm"),
+ // Name: to.Ptr("monitoringzkndgm"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers/targets"),
+ // Properties: &armdatabasewatcher.SQLDbSingleDatabaseTargetProperties{
+ // TargetType: to.Ptr("SqlDb"),
+ // TargetAuthenticationType: to.Ptr(armdatabasewatcher.TargetAuthenticationTypeAAD),
+ // ConnectionServerName: to.Ptr("sqlServero1ihe2"),
+ // SQLDbResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.Sql/servers/m1/databases/m2"),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ResourceProvisioningStateSucceeded),
+ // },
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // },
+ // NextLink: to.Ptr("https://microsoft.com/a"),
+ // },
+ // }
+ }
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/time_rfc3339.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/time_rfc3339.go
new file mode 100644
index 000000000000..5f90c03ee1a6
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/time_rfc3339.go
@@ -0,0 +1,109 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "reflect"
+ "regexp"
+ "strings"
+ "time"
+)
+
+// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases.
+var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`)
+
+const (
+ utcDateTime = "2006-01-02T15:04:05.999999999"
+ utcDateTimeJSON = `"` + utcDateTime + `"`
+ utcDateTimeNoT = "2006-01-02 15:04:05.999999999"
+ utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"`
+ dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00`
+ dateTimeJSON = `"` + time.RFC3339Nano + `"`
+ dateTimeJSONNoT = `"` + dateTimeNoT + `"`
+)
+
+type dateTimeRFC3339 time.Time
+
+func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalJSON()
+}
+
+func (t dateTimeRFC3339) MarshalText() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalText()
+}
+
+func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error {
+ tzOffset := tzOffsetRegex.Match(data)
+ hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t")
+ var layout string
+ if tzOffset && hasT {
+ layout = dateTimeJSON
+ } else if tzOffset {
+ layout = dateTimeJSONNoT
+ } else if hasT {
+ layout = utcDateTimeJSON
+ } else {
+ layout = utcDateTimeJSONNoT
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) UnmarshalText(data []byte) error {
+ if len(data) == 0 {
+ return nil
+ }
+ tzOffset := tzOffsetRegex.Match(data)
+ hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t")
+ var layout string
+ if tzOffset && hasT {
+ layout = time.RFC3339Nano
+ } else if tzOffset {
+ layout = dateTimeNoT
+ } else if hasT {
+ layout = utcDateTime
+ } else {
+ layout = utcDateTimeNoT
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) Parse(layout, value string) error {
+ p, err := time.Parse(layout, strings.ToUpper(value))
+ *t = dateTimeRFC3339(p)
+ return err
+}
+
+func (t dateTimeRFC3339) String() string {
+ return time.Time(t).Format(time.RFC3339Nano)
+}
+
+func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) {
+ if t == nil {
+ return
+ } else if azcore.IsNullValue(t) {
+ m[k] = nil
+ return
+ } else if reflect.ValueOf(t).IsNil() {
+ return
+ }
+ m[k] = (*dateTimeRFC3339)(t)
+}
+
+func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error {
+ if data == nil || string(data) == "null" {
+ return nil
+ }
+ var aux dateTimeRFC3339
+ if err := json.Unmarshal(data, &aux); err != nil {
+ return fmt.Errorf("struct field %s: %v", fn, err)
+ }
+ *t = (*time.Time)(&aux)
+ return nil
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/tsp-location.yaml b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/tsp-location.yaml
new file mode 100644
index 000000000000..9b8f78437670
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/tsp-location.yaml
@@ -0,0 +1,4 @@
+directory: specification/databasewatcher/DatabaseWatcher.Management
+commit: 676334a284e5136f0a0721d6ae844bb04332f579
+repo: Azure/azure-rest-api-specs
+additionalDirectories:
\ No newline at end of file
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/watchers_client.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/watchers_client.go
new file mode 100644
index 000000000000..73f92e8aa909
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/watchers_client.go
@@ -0,0 +1,606 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// WatchersClient contains the methods for the Watchers group.
+// Don't use this type directly, use NewWatchersClient() instead.
+type WatchersClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewWatchersClient creates a new instance of WatchersClient with the specified values.
+// - subscriptionID - The ID of the target subscription. The value must be an UUID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewWatchersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WatchersClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &WatchersClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Create a Watcher
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - resource - Resource create parameters.
+// - options - WatchersClientBeginCreateOrUpdateOptions contains the optional parameters for the WatchersClient.BeginCreateOrUpdate
+// method.
+func (client *WatchersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, watcherName string, resource Watcher, options *WatchersClientBeginCreateOrUpdateOptions) (*runtime.Poller[WatchersClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, watcherName, resource, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientCreateOrUpdateResponse]{
+ FinalStateVia: runtime.FinalStateViaAzureAsyncOp,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[WatchersClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Create a Watcher
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+func (client *WatchersClient) createOrUpdate(ctx context.Context, resourceGroupName string, watcherName string, resource Watcher, options *WatchersClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "WatchersClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, watcherName, resource, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *WatchersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, resource Watcher, _ *WatchersClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, resource); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Delete a Watcher
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - options - WatchersClientBeginDeleteOptions contains the optional parameters for the WatchersClient.BeginDelete method.
+func (client *WatchersClient) BeginDelete(ctx context.Context, resourceGroupName string, watcherName string, options *WatchersClientBeginDeleteOptions) (*runtime.Poller[WatchersClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, watcherName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[WatchersClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Delete a Watcher
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+func (client *WatchersClient) deleteOperation(ctx context.Context, resourceGroupName string, watcherName string, options *WatchersClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "WatchersClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, watcherName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *WatchersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, _ *WatchersClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Get a Watcher
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - options - WatchersClientGetOptions contains the optional parameters for the WatchersClient.Get method.
+func (client *WatchersClient) Get(ctx context.Context, resourceGroupName string, watcherName string, options *WatchersClientGetOptions) (WatchersClientGetResponse, error) {
+ var err error
+ const operationName = "WatchersClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, watcherName, options)
+ if err != nil {
+ return WatchersClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return WatchersClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return WatchersClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *WatchersClient) getCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, _ *WatchersClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *WatchersClient) getHandleResponse(resp *http.Response) (WatchersClientGetResponse, error) {
+ result := WatchersClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Watcher); err != nil {
+ return WatchersClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - List Watcher resources by resource group
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - options - WatchersClientListByResourceGroupOptions contains the optional parameters for the WatchersClient.NewListByResourceGroupPager
+// method.
+func (client *WatchersClient) NewListByResourceGroupPager(resourceGroupName string, options *WatchersClientListByResourceGroupOptions) *runtime.Pager[WatchersClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[WatchersClientListByResourceGroupResponse]{
+ More: func(page WatchersClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *WatchersClientListByResourceGroupResponse) (WatchersClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "WatchersClient.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return WatchersClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *WatchersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *WatchersClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *WatchersClient) listByResourceGroupHandleResponse(resp *http.Response) (WatchersClientListByResourceGroupResponse, error) {
+ result := WatchersClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.WatcherListResult); err != nil {
+ return WatchersClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListBySubscriptionPager - List Watcher resources by subscription ID
+//
+// Generated from API version 2025-01-02
+// - options - WatchersClientListBySubscriptionOptions contains the optional parameters for the WatchersClient.NewListBySubscriptionPager
+// method.
+func (client *WatchersClient) NewListBySubscriptionPager(options *WatchersClientListBySubscriptionOptions) *runtime.Pager[WatchersClientListBySubscriptionResponse] {
+ return runtime.NewPager(runtime.PagingHandler[WatchersClientListBySubscriptionResponse]{
+ More: func(page WatchersClientListBySubscriptionResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *WatchersClientListBySubscriptionResponse) (WatchersClientListBySubscriptionResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "WatchersClient.NewListBySubscriptionPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listBySubscriptionCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return WatchersClientListBySubscriptionResponse{}, err
+ }
+ return client.listBySubscriptionHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listBySubscriptionCreateRequest creates the ListBySubscription request.
+func (client *WatchersClient) listBySubscriptionCreateRequest(ctx context.Context, _ *WatchersClientListBySubscriptionOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DatabaseWatcher/watchers"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listBySubscriptionHandleResponse handles the ListBySubscription response.
+func (client *WatchersClient) listBySubscriptionHandleResponse(resp *http.Response) (WatchersClientListBySubscriptionResponse, error) {
+ result := WatchersClientListBySubscriptionResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.WatcherListResult); err != nil {
+ return WatchersClientListBySubscriptionResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginStart - The action to start monitoring all targets configured for a database watcher.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - options - WatchersClientBeginStartOptions contains the optional parameters for the WatchersClient.BeginStart method.
+func (client *WatchersClient) BeginStart(ctx context.Context, resourceGroupName string, watcherName string, options *WatchersClientBeginStartOptions) (*runtime.Poller[WatchersClientStartResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.start(ctx, resourceGroupName, watcherName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientStartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[WatchersClientStartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Start - The action to start monitoring all targets configured for a database watcher.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+func (client *WatchersClient) start(ctx context.Context, resourceGroupName string, watcherName string, options *WatchersClientBeginStartOptions) (*http.Response, error) {
+ var err error
+ const operationName = "WatchersClient.BeginStart"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.startCreateRequest(ctx, resourceGroupName, watcherName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// startCreateRequest creates the Start request.
+func (client *WatchersClient) startCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, _ *WatchersClientBeginStartOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/start"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginStop - The action to stop monitoring all targets configured for a database watcher.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - options - WatchersClientBeginStopOptions contains the optional parameters for the WatchersClient.BeginStop method.
+func (client *WatchersClient) BeginStop(ctx context.Context, resourceGroupName string, watcherName string, options *WatchersClientBeginStopOptions) (*runtime.Poller[WatchersClientStopResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.stop(ctx, resourceGroupName, watcherName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientStopResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[WatchersClientStopResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Stop - The action to stop monitoring all targets configured for a database watcher.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+func (client *WatchersClient) stop(ctx context.Context, resourceGroupName string, watcherName string, options *WatchersClientBeginStopOptions) (*http.Response, error) {
+ var err error
+ const operationName = "WatchersClient.BeginStop"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.stopCreateRequest(ctx, resourceGroupName, watcherName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// stopCreateRequest creates the Stop request.
+func (client *WatchersClient) stopCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, _ *WatchersClientBeginStopOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/stop"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginUpdate - Update a Watcher
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - watcherName - The database watcher name.
+// - properties - The resource properties to be updated.
+// - options - WatchersClientBeginUpdateOptions contains the optional parameters for the WatchersClient.BeginUpdate method.
+func (client *WatchersClient) BeginUpdate(ctx context.Context, resourceGroupName string, watcherName string, properties WatcherUpdate, options *WatchersClientBeginUpdateOptions) (*runtime.Poller[WatchersClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, watcherName, properties, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[WatchersClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Update a Watcher
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-02
+func (client *WatchersClient) update(ctx context.Context, resourceGroupName string, watcherName string, properties WatcherUpdate, options *WatchersClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "WatchersClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, watcherName, properties, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *WatchersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, watcherName string, properties WatcherUpdate, _ *WatchersClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if watcherName == "" {
+ return nil, errors.New("parameter watcherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{watcherName}", url.PathEscape(watcherName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/sdk/resourcemanager/databasewatcher/armdatabasewatcher/watchers_client_example_test.go b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/watchers_client_example_test.go
new file mode 100644
index 000000000000..dfeb47ba5b7a
--- /dev/null
+++ b/sdk/resourcemanager/databasewatcher/armdatabasewatcher/watchers_client_example_test.go
@@ -0,0 +1,871 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armdatabasewatcher_test
+
+import (
+ "context"
+ "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/databasewatcher/armdatabasewatcher"
+ "log"
+)
+
+// Generated from example definition: 2025-01-02/Watchers_CreateOrUpdate_MaximumSet_Gen.json
+func ExampleWatchersClient_BeginCreateOrUpdate() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("A76F9850-996B-40B3-94D4-C98110A0EEC9", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewWatchersClient().BeginCreateOrUpdate(ctx, "rgWatcher", "testWatcher", armdatabasewatcher.Watcher{
+ Properties: &armdatabasewatcher.WatcherProperties{
+ Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ Datastore: &armdatabasewatcher.Datastore{
+ AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ },
+ },
+ Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ Type: to.Ptr(armdatabasewatcher.ManagedServiceIdentityTypeSystemAssigned),
+ },
+ Tags: map[string]*string{},
+ Location: to.Ptr("eastus2"),
+ }, 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 = armdatabasewatcher.WatchersClientCreateOrUpdateResponse{
+ // Watcher: &armdatabasewatcher.Watcher{
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // Type: to.Ptr(armdatabasewatcher.ManagedServiceIdentityTypeSystemAssigned),
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Tags: map[string]*string{
+ // },
+ // Location: to.Ptr("eastus2"),
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/dummyrg/providers/Microsoft.DatabaseWatcher/watchers/myWatcher"),
+ // Name: to.Ptr("myWatcher"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-01-02/Watchers_Delete_MaximumSet_Gen.json
+func ExampleWatchersClient_BeginDelete() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("A76F9850-996B-40B3-94D4-C98110A0EEC9", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewWatchersClient().BeginDelete(ctx, "rgWatcher", "testWatcher", nil)
+ if err != nil {
+ log.Fatalf("failed to finish the request: %v", err)
+ }
+ _, err = poller.PollUntilDone(ctx, nil)
+ if err != nil {
+ log.Fatalf("failed to pull the result: %v", err)
+ }
+}
+
+// Generated from example definition: 2025-01-02/Watchers_Get_MaximumSet_Gen.json
+func ExampleWatchersClient_Get() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("A76F9850-996B-40B3-94D4-C98110A0EEC9", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewWatchersClient().Get(ctx, "rgWatcher", "myWatcher", 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 = armdatabasewatcher.WatchersClientGetResponse{
+ // Watcher: &armdatabasewatcher.Watcher{
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Tags: map[string]*string{
+ // },
+ // Location: to.Ptr("eastus2"),
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/dummyrg/providers/Microsoft.DatabaseWatcher/watchers/myWatcher"),
+ // Name: to.Ptr("myWatcher"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-01-02/Watchers_ListByResourceGroup_MaximumSet_Gen.json
+func ExampleWatchersClient_NewListByResourceGroupPager() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("A76F9850-996B-40B3-94D4-C98110A0EEC9", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ pager := clientFactory.NewWatchersClient().NewListByResourceGroupPager("rgWatcher", 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 = armdatabasewatcher.WatchersClientListByResourceGroupResponse{
+ // WatcherListResult: armdatabasewatcher.WatcherListResult{
+ // Value: []*armdatabasewatcher.Watcher{
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/dummyrg/providers/Microsoft.DatabaseWatcher/watchers/myWatcher"),
+ // Name: to.Ptr("myWatcher"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // Location: to.Ptr("West US"),
+ // Tags: map[string]*string{
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // },
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-4sz1jg/providers/Microsoft.DatabaseWatcher/watchers/databasemo4o4zdf"),
+ // Name: to.Ptr("databasemo4o4zdf"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // Location: to.Ptr("westus"),
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Tags: map[string]*string{
+ // },
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-d77ftn/providers/Microsoft.DatabaseWatcher/watchers/databasemosn3h6l"),
+ // Name: to.Ptr("databasemosn3h6l"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // Location: to.Ptr("westus"),
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Tags: map[string]*string{
+ // },
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-nyb4gm/providers/Microsoft.DatabaseWatcher/watchers/databasemoyb6iar"),
+ // Name: to.Ptr("databasemoyb6iar"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // Location: to.Ptr("westus"),
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Tags: map[string]*string{
+ // },
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-llis4j/providers/Microsoft.DatabaseWatcher/watchers/databasemoi04xst"),
+ // Name: to.Ptr("databasemoi04xst"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // Location: to.Ptr("westus"),
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Tags: map[string]*string{
+ // },
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-thy6zd/providers/Microsoft.DatabaseWatcher/watchers/databasemonpyl24"),
+ // Name: to.Ptr("databasemonpyl24"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // Location: to.Ptr("westus"),
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("ysoqerxnmxqsvhmvjojoyzotc"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T18:01:18.690Z"); return t}()),
+ // LastModifiedBy: to.Ptr("yrilzsg"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T18:01:18.690Z"); return t}()),
+ // },
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Tags: map[string]*string{
+ // },
+ // },
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih"),
+ // Name: to.Ptr("databasemo3ej9ih"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // Location: to.Ptr("westus"),
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Tags: map[string]*string{
+ // },
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // },
+ // NextLink: to.Ptr("https://microsoft.com/a"),
+ // },
+ // }
+ }
+}
+
+// Generated from example definition: 2025-01-02/Watchers_ListBySubscription_MaximumSet_Gen.json
+func ExampleWatchersClient_NewListBySubscriptionPager() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("A76F9850-996B-40B3-94D4-C98110A0EEC9", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ pager := clientFactory.NewWatchersClient().NewListBySubscriptionPager(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 = armdatabasewatcher.WatchersClientListBySubscriptionResponse{
+ // WatcherListResult: armdatabasewatcher.WatcherListResult{
+ // Value: []*armdatabasewatcher.Watcher{
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/dummyrg/providers/Microsoft.DatabaseWatcher/watchers/myWatcher"),
+ // Name: to.Ptr("myWatcher"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // Location: to.Ptr("West US"),
+ // Tags: map[string]*string{
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // Type: to.Ptr(armdatabasewatcher.ManagedServiceIdentityTypeSystemAssigned),
+ // },
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // },
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-4sz1jg/providers/Microsoft.DatabaseWatcher/watchers/databasemo4o4zdf"),
+ // Name: to.Ptr("databasemo4o4zdf"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // Location: to.Ptr("westus"),
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Tags: map[string]*string{
+ // },
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-d77ftn/providers/Microsoft.DatabaseWatcher/watchers/databasemosn3h6l"),
+ // Name: to.Ptr("databasemosn3h6l"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // Location: to.Ptr("westus"),
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Tags: map[string]*string{
+ // },
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-nyb4gm/providers/Microsoft.DatabaseWatcher/watchers/databasemoyb6iar"),
+ // Name: to.Ptr("databasemoyb6iar"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // Location: to.Ptr("westus"),
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Tags: map[string]*string{
+ // },
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-llis4j/providers/Microsoft.DatabaseWatcher/watchers/databasemoi04xst"),
+ // Name: to.Ptr("databasemoi04xst"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // Location: to.Ptr("westus"),
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Tags: map[string]*string{
+ // },
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-thy6zd/providers/Microsoft.DatabaseWatcher/watchers/databasemonpyl24"),
+ // Name: to.Ptr("databasemonpyl24"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // Location: to.Ptr("westus"),
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("ysoqerxnmxqsvhmvjojoyzotc"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T18:01:18.690Z"); return t}()),
+ // LastModifiedBy: to.Ptr("yrilzsg"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T18:01:18.690Z"); return t}()),
+ // },
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Tags: map[string]*string{
+ // },
+ // },
+ // {
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih"),
+ // Name: to.Ptr("databasemo3ej9ih"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // Location: to.Ptr("westus"),
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Tags: map[string]*string{
+ // },
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // },
+ // NextLink: to.Ptr("https://microsoft.com/a"),
+ // },
+ // }
+ }
+}
+
+// Generated from example definition: 2025-01-02/Watchers_Start_MaximumSet_Gen.json
+func ExampleWatchersClient_BeginStart() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("A76F9850-996B-40B3-94D4-C98110A0EEC9", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewWatchersClient().BeginStart(ctx, "rgWatcher", "testWatcher", 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 = armdatabasewatcher.WatchersClientStartResponse{
+ // }
+}
+
+// Generated from example definition: 2025-01-02/Watchers_Stop_MaximumSet_Gen.json
+func ExampleWatchersClient_BeginStop() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("A76F9850-996B-40B3-94D4-C98110A0EEC9", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewWatchersClient().BeginStop(ctx, "rgWatcher", "myWatcher", 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 = armdatabasewatcher.WatchersClientStopResponse{
+ // }
+}
+
+// Generated from example definition: 2025-01-02/Watchers_Update_MaximumSet_Gen.json
+func ExampleWatchersClient_BeginUpdate() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdatabasewatcher.NewClientFactory("A76F9850-996B-40B3-94D4-C98110A0EEC9", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewWatchersClient().BeginUpdate(ctx, "rgWatcher", "testWatcher", armdatabasewatcher.WatcherUpdate{
+ Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ Type: to.Ptr(armdatabasewatcher.ManagedServiceIdentityTypeSystemAssigned),
+ },
+ Properties: &armdatabasewatcher.WatcherUpdateProperties{
+ Datastore: &armdatabasewatcher.Datastore{
+ AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ },
+ DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/newtest"),
+ },
+ Tags: map[string]*string{},
+ }, 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 = armdatabasewatcher.WatchersClientUpdateResponse{
+ // Watcher: &armdatabasewatcher.Watcher{
+ // Properties: &armdatabasewatcher.WatcherProperties{
+ // Status: to.Ptr(armdatabasewatcher.WatcherStatusStarting),
+ // DefaultAlertRuleIdentityResourceID: to.Ptr("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"),
+ // Datastore: &armdatabasewatcher.Datastore{
+ // AdxClusterResourceID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"),
+ // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"),
+ // KustoClusterDisplayName: to.Ptr("kustoUri-adx"),
+ // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"),
+ // KustoDatabaseName: to.Ptr("kustoDatabaseName1"),
+ // KustoManagementURL: to.Ptr("https://portal.azure.com/"),
+ // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx),
+ // },
+ // ProvisioningState: to.Ptr(armdatabasewatcher.ProvisioningStateSucceeded),
+ // },
+ // Identity: &armdatabasewatcher.ManagedServiceIdentityV4{
+ // Type: to.Ptr(armdatabasewatcher.ManagedServiceIdentityTypeSystemAssigned),
+ // UserAssignedIdentities: map[string]*armdatabasewatcher.UserAssignedIdentity{
+ // },
+ // PrincipalID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // TenantID: to.Ptr("49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"),
+ // },
+ // Tags: map[string]*string{
+ // },
+ // Location: to.Ptr("eastus2"),
+ // ID: to.Ptr("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/dummyrg/providers/Microsoft.DatabaseWatcher/watchers/myWatcher"),
+ // Name: to.Ptr("myWatcher"),
+ // Type: to.Ptr("microsoft.databasewatcher/watchers"),
+ // SystemData: &armdatabasewatcher.SystemData{
+ // CreatedBy: to.Ptr("enbpvlpqbwd"),
+ // CreatedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // LastModifiedBy: to.Ptr("mxp"),
+ // LastModifiedByType: to.Ptr(armdatabasewatcher.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-25T15:38:47.092Z"); return t}()),
+ // },
+ // },
+ // }
+}
diff --git a/sdk/resourcemanager/deviceregistry/armdeviceregistry/CHANGELOG.md b/sdk/resourcemanager/deviceregistry/armdeviceregistry/CHANGELOG.md
index 4d58f300b978..ad7998d2e845 100644
--- a/sdk/resourcemanager/deviceregistry/armdeviceregistry/CHANGELOG.md
+++ b/sdk/resourcemanager/deviceregistry/armdeviceregistry/CHANGELOG.md
@@ -1,5 +1,9 @@
# Release History
+## 1.0.1 (2025-02-27)
+### Other Changes
+
+
## 1.0.0 (2025-02-10)
### Features Added
diff --git a/sdk/resourcemanager/deviceregistry/armdeviceregistry/constants.go b/sdk/resourcemanager/deviceregistry/armdeviceregistry/constants.go
index 1a7e44fb45bc..6da3f4ded1d5 100644
--- a/sdk/resourcemanager/deviceregistry/armdeviceregistry/constants.go
+++ b/sdk/resourcemanager/deviceregistry/armdeviceregistry/constants.go
@@ -6,7 +6,7 @@ package armdeviceregistry
const (
moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceregistry/armdeviceregistry"
- moduleVersion = "v1.0.0"
+ moduleVersion = "v1.0.1"
)
// ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
diff --git a/sdk/resourcemanager/deviceregistry/armdeviceregistry/tsp-location.yaml b/sdk/resourcemanager/deviceregistry/armdeviceregistry/tsp-location.yaml
index f6af95165e4f..19166e7a63fc 100644
--- a/sdk/resourcemanager/deviceregistry/armdeviceregistry/tsp-location.yaml
+++ b/sdk/resourcemanager/deviceregistry/armdeviceregistry/tsp-location.yaml
@@ -1,4 +1,4 @@
directory: specification/deviceregistry/DeviceRegistry.Management
-commit: 53b2029545881f27d0f0fad3892065f39b1b9e83
+commit: 676334a284e5136f0a0721d6ae844bb04332f579
repo: Azure/azure-rest-api-specs
additionalDirectories:
\ No newline at end of file
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/CHANGELOG.md b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/CHANGELOG.md
index ff3cd4b4c66f..433b16510c0a 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/CHANGELOG.md
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/CHANGELOG.md
@@ -1,5 +1,21 @@
# Release History
+## 1.1.0 (2025-02-27)
+### Features Added
+
+- New enum type `AvailabilityStatus` with values `AvailabilityStatusAvailable`, `AvailabilityStatusUnavailable`
+- New enum type `CertificateStoreNameOption` with values `CertificateStoreNameOptionMy`, `CertificateStoreNameOptionRoot`
+- New enum type `CheckNameAvailabilityReason` with values `CheckNameAvailabilityReasonAlreadyExists`, `CheckNameAvailabilityReasonInvalid`
+- New enum type `EphemeralType` with values `EphemeralTypeAutomatic`, `EphemeralTypeCacheDisk`, `EphemeralTypeResourceDisk`
+- New enum type `ResourceType` with values `ResourceTypeMicrosoftDevOpsInfrastructurePools`
+- New function `*PoolsClient.CheckNameAvailability(context.Context, CheckNameAvailability, *PoolsClientCheckNameAvailabilityOptions) (PoolsClientCheckNameAvailabilityResponse, error)`
+- New struct `CheckNameAvailability`
+- New struct `CheckNameAvailabilityResult`
+- New field `OpenAccess` in struct `Organization`
+- New field `EphemeralType` in struct `PoolImage`
+- New field `CertificateStoreName` in struct `SecretsManagementSettings`
+
+
## 1.0.0 (2024-11-20)
### Breaking Changes
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/constants.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/constants.go
index 982aced6c92c..410fabd9e209 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/constants.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/constants.go
@@ -6,7 +6,7 @@ package armdevopsinfrastructure
const (
moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure"
- moduleVersion = "v1.0.0"
+ moduleVersion = "v1.1.0"
)
// ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
@@ -24,6 +24,24 @@ func PossibleActionTypeValues() []ActionType {
}
}
+// AvailabilityStatus - AvailabilityStatus of a name.
+type AvailabilityStatus string
+
+const (
+ // AvailabilityStatusAvailable - The name is available.
+ AvailabilityStatusAvailable AvailabilityStatus = "Available"
+ // AvailabilityStatusUnavailable - The name is unavailable
+ AvailabilityStatusUnavailable AvailabilityStatus = "Unavailable"
+)
+
+// PossibleAvailabilityStatusValues returns the possible values for the AvailabilityStatus const type.
+func PossibleAvailabilityStatusValues() []AvailabilityStatus {
+ return []AvailabilityStatus{
+ AvailabilityStatusAvailable,
+ AvailabilityStatusUnavailable,
+ }
+}
+
// AzureDevOpsPermissionType - Determines who has admin permissions to the Azure DevOps pool.
type AzureDevOpsPermissionType string
@@ -66,6 +84,42 @@ func PossibleCachingTypeValues() []CachingType {
}
}
+// CertificateStoreNameOption - The certificate store name type
+type CertificateStoreNameOption string
+
+const (
+ // CertificateStoreNameOptionMy - The X.509 certificate store for personal certificates.
+ CertificateStoreNameOptionMy CertificateStoreNameOption = "My"
+ // CertificateStoreNameOptionRoot - The X.509 certificate store for trusted root certificate authorities (CAs).
+ CertificateStoreNameOptionRoot CertificateStoreNameOption = "Root"
+)
+
+// PossibleCertificateStoreNameOptionValues returns the possible values for the CertificateStoreNameOption const type.
+func PossibleCertificateStoreNameOptionValues() []CertificateStoreNameOption {
+ return []CertificateStoreNameOption{
+ CertificateStoreNameOptionMy,
+ CertificateStoreNameOptionRoot,
+ }
+}
+
+// CheckNameAvailabilityReason - The reason code explaining why the name is unavailable. Will be null if the name is available.
+type CheckNameAvailabilityReason string
+
+const (
+ // CheckNameAvailabilityReasonAlreadyExists - The name already exists.
+ CheckNameAvailabilityReasonAlreadyExists CheckNameAvailabilityReason = "AlreadyExists"
+ // CheckNameAvailabilityReasonInvalid - The name is invalid.
+ CheckNameAvailabilityReasonInvalid CheckNameAvailabilityReason = "Invalid"
+)
+
+// PossibleCheckNameAvailabilityReasonValues returns the possible values for the CheckNameAvailabilityReason const type.
+func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason {
+ return []CheckNameAvailabilityReason{
+ CheckNameAvailabilityReasonAlreadyExists,
+ CheckNameAvailabilityReasonInvalid,
+ }
+}
+
// CreatedByType - The kind of entity that created the resource.
type CreatedByType string
@@ -90,6 +144,27 @@ func PossibleCreatedByTypeValues() []CreatedByType {
}
}
+// EphemeralType - The type of Ephemeral option the pool will use on underlying VMs when loading this image.
+type EphemeralType string
+
+const (
+ // EphemeralTypeAutomatic - Ephemeral is handled by Managed DevOps Pools service.
+ EphemeralTypeAutomatic EphemeralType = "Automatic"
+ // EphemeralTypeCacheDisk - CacheDisk ephemeral only, requires that the SKU has a cache that is large enough for the image.
+ EphemeralTypeCacheDisk EphemeralType = "CacheDisk"
+ // EphemeralTypeResourceDisk - ResourceDisk ephemeral only, requires only that the SKU supports it.
+ EphemeralTypeResourceDisk EphemeralType = "ResourceDisk"
+)
+
+// PossibleEphemeralTypeValues returns the possible values for the EphemeralType const type.
+func PossibleEphemeralTypeValues() []EphemeralType {
+ return []EphemeralType{
+ EphemeralTypeAutomatic,
+ EphemeralTypeCacheDisk,
+ EphemeralTypeResourceDisk,
+ }
+}
+
// LogonType - Determines how the service should be run.
type LogonType string
@@ -334,6 +409,21 @@ func PossibleResourceStatusValues() []ResourceStatus {
}
}
+// ResourceType - The type of resource.
+type ResourceType string
+
+const (
+ // ResourceTypeMicrosoftDevOpsInfrastructurePools - DevOpsInfrastructure pool resource.
+ ResourceTypeMicrosoftDevOpsInfrastructurePools ResourceType = "Microsoft.DevOpsInfrastructure/pools"
+)
+
+// PossibleResourceTypeValues returns the possible values for the ResourceType const type.
+func PossibleResourceTypeValues() []ResourceType {
+ return []ResourceType{
+ ResourceTypeMicrosoftDevOpsInfrastructurePools,
+ }
+}
+
// StorageAccountType - StorageAccountType enums
type StorageAccountType string
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/fake/pools_server.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/fake/pools_server.go
index 170370591c3f..88c1b88d6e3a 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/fake/pools_server.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/fake/pools_server.go
@@ -20,6 +20,10 @@ import (
// PoolsServer is a fake server for instances of the armdevopsinfrastructure.PoolsClient type.
type PoolsServer struct {
+ // CheckNameAvailability is the fake for method PoolsClient.CheckNameAvailability
+ // HTTP status codes to indicate success: http.StatusOK
+ CheckNameAvailability func(ctx context.Context, body armdevopsinfrastructure.CheckNameAvailability, options *armdevopsinfrastructure.PoolsClientCheckNameAvailabilityOptions) (resp azfake.Responder[armdevopsinfrastructure.PoolsClientCheckNameAvailabilityResponse], errResp azfake.ErrorResponder)
+
// BeginCreateOrUpdate is the fake for method PoolsClient.BeginCreateOrUpdate
// HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, poolName string, resource armdevopsinfrastructure.Pool, options *armdevopsinfrastructure.PoolsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdevopsinfrastructure.PoolsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)
@@ -93,6 +97,8 @@ func (p *PoolsServerTransport) dispatchToMethodFake(req *http.Request, method st
}
if !intercepted {
switch method {
+ case "PoolsClient.CheckNameAvailability":
+ res.resp, res.err = p.dispatchCheckNameAvailability(req)
case "PoolsClient.BeginCreateOrUpdate":
res.resp, res.err = p.dispatchBeginCreateOrUpdate(req)
case "PoolsClient.BeginDelete":
@@ -124,6 +130,35 @@ func (p *PoolsServerTransport) dispatchToMethodFake(req *http.Request, method st
}
}
+func (p *PoolsServerTransport) dispatchCheckNameAvailability(req *http.Request) (*http.Response, error) {
+ if p.srv.CheckNameAvailability == nil {
+ return nil, &nonRetriableError{errors.New("fake for method CheckNameAvailability not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DevOpsInfrastructure/checkNameAvailability`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 1 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armdevopsinfrastructure.CheckNameAvailability](req)
+ if err != nil {
+ return nil, err
+ }
+ respr, errRespr := p.srv.CheckNameAvailability(req.Context(), body, nil)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CheckNameAvailabilityResult, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
func (p *PoolsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) {
if p.srv.BeginCreateOrUpdate == nil {
return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")}
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/imageversions_client.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/imageversions_client.go
index e67fb049e3a9..81e28d410246 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/imageversions_client.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/imageversions_client.go
@@ -41,7 +41,7 @@ func NewImageVersionsClient(subscriptionID string, credential azcore.TokenCreden
// NewListByImagePager - List ImageVersion resources by Image
//
-// Generated from API version 2024-10-19
+// Generated from API version 2025-01-21
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - imageName - Name of the image.
// - options - ImageVersionsClientListByImageOptions contains the optional parameters for the ImageVersionsClient.NewListByImagePager
@@ -89,7 +89,7 @@ func (client *ImageVersionsClient) listByImageCreateRequest(ctx context.Context,
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-10-19")
+ reqQP.Set("api-version", "2025-01-21")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/imageversions_client_example_test.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/imageversions_client_example_test.go
index 7b5921223ee3..06abc8a1f545 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/imageversions_client_example_test.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/imageversions_client_example_test.go
@@ -11,7 +11,7 @@ import (
"log"
)
-// Generated from example definition: 2024-10-19/ImageVersions_ListByImage.json
+// Generated from example definition: 2025-01-21/ImageVersions_ListByImage.json
func ExampleImageVersionsClient_NewListByImagePager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/models.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/models.go
index 6ae02c449a5e..774b38db97c5 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/models.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/models.go
@@ -70,6 +70,30 @@ type AzureDevOpsPermissionProfile struct {
Users []*string
}
+// CheckNameAvailability - The parameters used to check the availability of a resource.
+type CheckNameAvailability struct {
+ // REQUIRED; The name of the resource.
+ Name *string
+
+ // REQUIRED; The type of resource that is used as the scope of the availability check.
+ Type *ResourceType
+}
+
+// CheckNameAvailabilityResult - The CheckNameAvailability operation response.
+type CheckNameAvailabilityResult struct {
+ // REQUIRED; Availability status of the name.
+ Available *AvailabilityStatus
+
+ // REQUIRED; A message explaining why the name is unavailable. Will be null if the name is available.
+ Message *string
+
+ // REQUIRED; The name whose availability was checked.
+ Name *string
+
+ // REQUIRED; The reason code explaining why the name is unavailable. Will be null if the name is available.
+ Reason *CheckNameAvailabilityReason
+}
+
// DataDisk - The data disk of the VMSS.
type DataDisk struct {
// The type of caching to be enabled for the data disks. The default value for caching is readwrite. For information about
@@ -198,12 +222,12 @@ type NetworkProfile struct {
// Operation - Details of a REST API operation, returned from the Resource Provider Operations API
type Operation struct {
- // Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
- ActionType *ActionType
-
- // READ-ONLY; Localized display information for this particular operation.
+ // Localized display information for this particular operation.
Display *OperationDisplay
+ // READ-ONLY; Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ ActionType *ActionType
+
// READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure
// Resource Manager/control-plane operations.
IsDataAction *bool
@@ -250,6 +274,9 @@ type Organization struct {
// REQUIRED; The Azure DevOps organization URL in which the pool should be created.
URL *string
+ // Determines if the pool should have open access to all projects in this organization.
+ OpenAccess *bool
+
// How many machines can be created at maximum in this organization out of the maximumConcurrency of the pool.
Parallelism *int32
@@ -319,6 +346,9 @@ type PoolImage struct {
// The percentage of the buffer to be allocated to this image.
Buffer *string
+ // The ephemeral type of the image.
+ EphemeralType *EphemeralType
+
// The resource id of the image.
ResourceID *string
@@ -589,6 +619,9 @@ type SecretsManagementSettings struct {
// Where to store certificates on the machine.
CertificateStoreLocation *string
+
+ // Name of the certificate store to use on the machine, currently 'My' and 'Root' are supported.
+ CertificateStoreName *CertificateStoreNameOption
}
// Stateful profile meaning that the machines will be returned to the pool after running a job.
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/models_serde.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/models_serde.go
index 507dc3d52167..259b1d3c84f7 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/models_serde.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/models_serde.go
@@ -147,6 +147,76 @@ func (a *AzureDevOpsPermissionProfile) UnmarshalJSON(data []byte) error {
return nil
}
+// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailability.
+func (c CheckNameAvailability) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", c.Name)
+ populate(objectMap, "type", c.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailability.
+func (c *CheckNameAvailability) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &c.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &c.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResult.
+func (c CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "available", c.Available)
+ populate(objectMap, "message", c.Message)
+ populate(objectMap, "name", c.Name)
+ populate(objectMap, "reason", c.Reason)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResult.
+func (c *CheckNameAvailabilityResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "available":
+ err = unpopulate(val, "Available", &c.Available)
+ delete(rawMsg, key)
+ case "message":
+ err = unpopulate(val, "Message", &c.Message)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &c.Name)
+ delete(rawMsg, key)
+ case "reason":
+ err = unpopulate(val, "Reason", &c.Reason)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
// MarshalJSON implements the json.Marshaller interface for type DataDisk.
func (d DataDisk) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
@@ -612,6 +682,7 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error {
// MarshalJSON implements the json.Marshaller interface for type Organization.
func (o Organization) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
+ populate(objectMap, "openAccess", o.OpenAccess)
populate(objectMap, "parallelism", o.Parallelism)
populate(objectMap, "projects", o.Projects)
populate(objectMap, "url", o.URL)
@@ -627,6 +698,9 @@ func (o *Organization) UnmarshalJSON(data []byte) error {
for key, val := range rawMsg {
var err error
switch key {
+ case "openAccess":
+ err = unpopulate(val, "OpenAccess", &o.OpenAccess)
+ delete(rawMsg, key)
case "parallelism":
err = unpopulate(val, "Parallelism", &o.Parallelism)
delete(rawMsg, key)
@@ -793,6 +867,7 @@ func (p PoolImage) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "aliases", p.Aliases)
populate(objectMap, "buffer", p.Buffer)
+ populate(objectMap, "ephemeralType", p.EphemeralType)
populate(objectMap, "resourceId", p.ResourceID)
populate(objectMap, "wellKnownImageName", p.WellKnownImageName)
return json.Marshal(objectMap)
@@ -813,6 +888,9 @@ func (p *PoolImage) UnmarshalJSON(data []byte) error {
case "buffer":
err = unpopulate(val, "Buffer", &p.Buffer)
delete(rawMsg, key)
+ case "ephemeralType":
+ err = unpopulate(val, "EphemeralType", &p.EphemeralType)
+ delete(rawMsg, key)
case "resourceId":
err = unpopulate(val, "ResourceID", &p.ResourceID)
delete(rawMsg, key)
@@ -1497,6 +1575,7 @@ func (r *ResourceSKUZoneDetails) UnmarshalJSON(data []byte) error {
func (s SecretsManagementSettings) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "certificateStoreLocation", s.CertificateStoreLocation)
+ populate(objectMap, "certificateStoreName", s.CertificateStoreName)
populate(objectMap, "keyExportable", s.KeyExportable)
populate(objectMap, "observedCertificates", s.ObservedCertificates)
return json.Marshal(objectMap)
@@ -1514,6 +1593,9 @@ func (s *SecretsManagementSettings) UnmarshalJSON(data []byte) error {
case "certificateStoreLocation":
err = unpopulate(val, "CertificateStoreLocation", &s.CertificateStoreLocation)
delete(rawMsg, key)
+ case "certificateStoreName":
+ err = unpopulate(val, "CertificateStoreName", &s.CertificateStoreName)
+ delete(rawMsg, key)
case "keyExportable":
err = unpopulate(val, "KeyExportable", &s.KeyExportable)
delete(rawMsg, key)
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/operations_client.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/operations_client.go
index ed41fb299331..dcc7f2d33a53 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/operations_client.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/operations_client.go
@@ -35,7 +35,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO
// NewListPager - List the operations for the provider
//
-// Generated from API version 2024-10-19
+// Generated from API version 2025-01-21
// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] {
return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{
@@ -68,7 +68,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *Operat
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-10-19")
+ reqQP.Set("api-version", "2025-01-21")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/operations_client_example_test.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/operations_client_example_test.go
index 3808c6d3cfac..cabc7014187d 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/operations_client_example_test.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/operations_client_example_test.go
@@ -11,7 +11,7 @@ import (
"log"
)
-// Generated from example definition: 2024-10-19/ListOperations.json
+// Generated from example definition: 2025-01-21/ListOperations.json
func ExampleOperationsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/options.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/options.go
index 2da748c0acfc..8043e77cc7fd 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/options.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/options.go
@@ -33,6 +33,11 @@ type PoolsClientBeginUpdateOptions struct {
ResumeToken string
}
+// PoolsClientCheckNameAvailabilityOptions contains the optional parameters for the PoolsClient.CheckNameAvailability method.
+type PoolsClientCheckNameAvailabilityOptions struct {
+ // placeholder for future optional parameters
+}
+
// PoolsClientGetOptions contains the optional parameters for the PoolsClient.Get method.
type PoolsClientGetOptions struct {
// placeholder for future optional parameters
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/pools_client.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/pools_client.go
index 94873e863f47..6deb49e7a07a 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/pools_client.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/pools_client.go
@@ -39,10 +39,70 @@ func NewPoolsClient(subscriptionID string, credential azcore.TokenCredential, op
return client, nil
}
+// CheckNameAvailability - Checks that the pool name is valid and is not already in use.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-21
+// - body - The CheckAvailability request
+// - options - PoolsClientCheckNameAvailabilityOptions contains the optional parameters for the PoolsClient.CheckNameAvailability
+// method.
+func (client *PoolsClient) CheckNameAvailability(ctx context.Context, body CheckNameAvailability, options *PoolsClientCheckNameAvailabilityOptions) (PoolsClientCheckNameAvailabilityResponse, error) {
+ var err error
+ const operationName = "PoolsClient.CheckNameAvailability"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.checkNameAvailabilityCreateRequest(ctx, body, options)
+ if err != nil {
+ return PoolsClientCheckNameAvailabilityResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return PoolsClientCheckNameAvailabilityResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return PoolsClientCheckNameAvailabilityResponse{}, err
+ }
+ resp, err := client.checkNameAvailabilityHandleResponse(httpResp)
+ return resp, err
+}
+
+// checkNameAvailabilityCreateRequest creates the CheckNameAvailability request.
+func (client *PoolsClient) checkNameAvailabilityCreateRequest(ctx context.Context, body CheckNameAvailability, _ *PoolsClientCheckNameAvailabilityOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/checkNameAvailability"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-21")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, body); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// checkNameAvailabilityHandleResponse handles the CheckNameAvailability response.
+func (client *PoolsClient) checkNameAvailabilityHandleResponse(resp *http.Response) (PoolsClientCheckNameAvailabilityResponse, error) {
+ result := PoolsClientCheckNameAvailabilityResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CheckNameAvailabilityResult); err != nil {
+ return PoolsClientCheckNameAvailabilityResponse{}, err
+ }
+ return result, nil
+}
+
// BeginCreateOrUpdate - Create a Pool
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-10-19
+// Generated from API version 2025-01-21
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - poolName - Name of the pool. It needs to be globally unique.
// - resource - Resource create parameters.
@@ -69,7 +129,7 @@ func (client *PoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGrou
// CreateOrUpdate - Create a Pool
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-10-19
+// Generated from API version 2025-01-21
func (client *PoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, poolName string, resource Pool, options *PoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
var err error
const operationName = "PoolsClient.BeginCreateOrUpdate"
@@ -111,7 +171,7 @@ func (client *PoolsClient) createOrUpdateCreateRequest(ctx context.Context, reso
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-10-19")
+ reqQP.Set("api-version", "2025-01-21")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
req.Raw().Header["Content-Type"] = []string{"application/json"}
@@ -124,7 +184,7 @@ func (client *PoolsClient) createOrUpdateCreateRequest(ctx context.Context, reso
// BeginDelete - Delete a Pool
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-10-19
+// Generated from API version 2025-01-21
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - poolName - Name of the pool. It needs to be globally unique.
// - options - PoolsClientBeginDeleteOptions contains the optional parameters for the PoolsClient.BeginDelete method.
@@ -148,7 +208,7 @@ func (client *PoolsClient) BeginDelete(ctx context.Context, resourceGroupName st
// Delete - Delete a Pool
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-10-19
+// Generated from API version 2025-01-21
func (client *PoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, poolName string, options *PoolsClientBeginDeleteOptions) (*http.Response, error) {
var err error
const operationName = "PoolsClient.BeginDelete"
@@ -190,7 +250,7 @@ func (client *PoolsClient) deleteCreateRequest(ctx context.Context, resourceGrou
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-10-19")
+ reqQP.Set("api-version", "2025-01-21")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -199,7 +259,7 @@ func (client *PoolsClient) deleteCreateRequest(ctx context.Context, resourceGrou
// Get - Get a Pool
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-10-19
+// Generated from API version 2025-01-21
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - poolName - Name of the pool. It needs to be globally unique.
// - options - PoolsClientGetOptions contains the optional parameters for the PoolsClient.Get method.
@@ -245,7 +305,7 @@ func (client *PoolsClient) getCreateRequest(ctx context.Context, resourceGroupNa
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-10-19")
+ reqQP.Set("api-version", "2025-01-21")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -262,7 +322,7 @@ func (client *PoolsClient) getHandleResponse(resp *http.Response) (PoolsClientGe
// NewListByResourceGroupPager - List Pool resources by resource group
//
-// Generated from API version 2024-10-19
+// Generated from API version 2025-01-21
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - options - PoolsClientListByResourceGroupOptions contains the optional parameters for the PoolsClient.NewListByResourceGroupPager
// method.
@@ -305,7 +365,7 @@ func (client *PoolsClient) listByResourceGroupCreateRequest(ctx context.Context,
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-10-19")
+ reqQP.Set("api-version", "2025-01-21")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -322,7 +382,7 @@ func (client *PoolsClient) listByResourceGroupHandleResponse(resp *http.Response
// NewListBySubscriptionPager - List Pool resources by subscription ID
//
-// Generated from API version 2024-10-19
+// Generated from API version 2025-01-21
// - options - PoolsClientListBySubscriptionOptions contains the optional parameters for the PoolsClient.NewListBySubscriptionPager
// method.
func (client *PoolsClient) NewListBySubscriptionPager(options *PoolsClientListBySubscriptionOptions) *runtime.Pager[PoolsClientListBySubscriptionResponse] {
@@ -360,7 +420,7 @@ func (client *PoolsClient) listBySubscriptionCreateRequest(ctx context.Context,
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-10-19")
+ reqQP.Set("api-version", "2025-01-21")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -378,7 +438,7 @@ func (client *PoolsClient) listBySubscriptionHandleResponse(resp *http.Response)
// BeginUpdate - Update a Pool
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-10-19
+// Generated from API version 2025-01-21
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - poolName - Name of the pool. It needs to be globally unique.
// - properties - The resource properties to be updated.
@@ -403,7 +463,7 @@ func (client *PoolsClient) BeginUpdate(ctx context.Context, resourceGroupName st
// Update - Update a Pool
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-10-19
+// Generated from API version 2025-01-21
func (client *PoolsClient) update(ctx context.Context, resourceGroupName string, poolName string, properties PoolUpdate, options *PoolsClientBeginUpdateOptions) (*http.Response, error) {
var err error
const operationName = "PoolsClient.BeginUpdate"
@@ -445,7 +505,7 @@ func (client *PoolsClient) updateCreateRequest(ctx context.Context, resourceGrou
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-10-19")
+ reqQP.Set("api-version", "2025-01-21")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
req.Raw().Header["Content-Type"] = []string{"application/json"}
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/pools_client_example_test.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/pools_client_example_test.go
index 7212fff354d0..4e09902a6239 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/pools_client_example_test.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/pools_client_example_test.go
@@ -12,7 +12,38 @@ import (
"log"
)
-// Generated from example definition: 2024-10-19/CreateOrUpdatePool.json
+// Generated from example definition: 2025-01-21/Pools_CheckNameAvailability.json
+func ExamplePoolsClient_CheckNameAvailability() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armdevopsinfrastructure.NewClientFactory("a2e95d27-c161-4b61-bda4-11512c14c2c2", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewPoolsClient().CheckNameAvailability(ctx, armdevopsinfrastructure.CheckNameAvailability{
+ Name: to.Ptr("mydevopspool"),
+ Type: to.Ptr(armdevopsinfrastructure.ResourceTypeMicrosoftDevOpsInfrastructurePools),
+ }, 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 = armdevopsinfrastructure.PoolsClientCheckNameAvailabilityResponse{
+ // CheckNameAvailabilityResult: &armdevopsinfrastructure.CheckNameAvailabilityResult{
+ // Available: to.Ptr(armdevopsinfrastructure.AvailabilityStatusUnavailable),
+ // Message: to.Ptr("Managed DevOps pool mydevopspool is already in use. Please choose a pool name that has not been taken."),
+ // Name: to.Ptr("mydevopspool"),
+ // Reason: to.Ptr(armdevopsinfrastructure.CheckNameAvailabilityReasonAlreadyExists),
+ // },
+ // }
+}
+
+// Generated from example definition: 2025-01-21/CreateOrUpdatePool.json
func ExamplePoolsClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -33,7 +64,8 @@ func ExamplePoolsClient_BeginCreateOrUpdate() {
Kind: to.Ptr("AzureDevOps"),
Organizations: []*armdevopsinfrastructure.Organization{
{
- URL: to.Ptr("https://mseng.visualstudio.com"),
+ URL: to.Ptr("https://mseng.visualstudio.com"),
+ OpenAccess: to.Ptr(true),
},
},
},
@@ -47,7 +79,17 @@ func ExamplePoolsClient_BeginCreateOrUpdate() {
},
Images: []*armdevopsinfrastructure.PoolImage{
{
- ResourceID: to.Ptr("/MicrosoftWindowsServer/WindowsServer/2019-Datacenter/latest"),
+ ResourceID: to.Ptr("/MicrosoftWindowsServer/WindowsServer/2019-Datacenter/latest"),
+ EphemeralType: to.Ptr(armdevopsinfrastructure.EphemeralTypeAutomatic),
+ },
+ },
+ OSProfile: &armdevopsinfrastructure.OsProfile{
+ SecretsManagementSettings: &armdevopsinfrastructure.SecretsManagementSettings{
+ CertificateStoreName: to.Ptr(armdevopsinfrastructure.CertificateStoreNameOptionRoot),
+ ObservedCertificates: []*string{
+ to.Ptr("https://abc.vault.azure.net/secrets/one"),
+ },
+ KeyExportable: to.Ptr(false),
},
},
},
@@ -90,6 +132,15 @@ func ExamplePoolsClient_BeginCreateOrUpdate() {
// ResourceID: to.Ptr("/MicrosoftWindowsServer/WindowsServer/2019-Datacenter/latest"),
// },
// },
+ // OSProfile: &armdevopsinfrastructure.OsProfile{
+ // SecretsManagementSettings: &armdevopsinfrastructure.SecretsManagementSettings{
+ // CertificateStoreName: to.Ptr(armdevopsinfrastructure.CertificateStoreNameOptionRoot),
+ // ObservedCertificates: []*string{
+ // to.Ptr("https://abc.vault.azure.net/secrets/one"),
+ // },
+ // KeyExportable: to.Ptr(false),
+ // },
+ // },
// },
// },
// ID: to.Ptr("/subscriptions/a2e95d27-c161-4b61-bda4-11512c14c2c2/resourceGroups/rg/providers/Microsoft.DevOpsInfrastructure/Pools/pool"),
@@ -98,7 +149,7 @@ func ExamplePoolsClient_BeginCreateOrUpdate() {
// }
}
-// Generated from example definition: 2024-10-19/DeletePool.json
+// Generated from example definition: 2025-01-21/DeletePool.json
func ExamplePoolsClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -119,7 +170,7 @@ func ExamplePoolsClient_BeginDelete() {
}
}
-// Generated from example definition: 2024-10-19/GetPool.json
+// Generated from example definition: 2025-01-21/GetPool.json
func ExamplePoolsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -172,7 +223,7 @@ func ExamplePoolsClient_Get() {
// }
}
-// Generated from example definition: 2024-10-19/ListPoolsBySubscriptionAndResourceGroup.json
+// Generated from example definition: 2025-01-21/ListPoolsBySubscriptionAndResourceGroup.json
func ExamplePoolsClient_NewListByResourceGroupPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -207,7 +258,7 @@ func ExamplePoolsClient_NewListByResourceGroupPager() {
}
}
-// Generated from example definition: 2024-10-19/ListPoolsBySubscription.json
+// Generated from example definition: 2025-01-21/ListPoolsBySubscription.json
func ExamplePoolsClient_NewListBySubscriptionPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -242,7 +293,7 @@ func ExamplePoolsClient_NewListBySubscriptionPager() {
}
}
-// Generated from example definition: 2024-10-19/UpdatePool.json
+// Generated from example definition: 2025-01-21/UpdatePool.json
func ExamplePoolsClient_BeginUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/resourcedetails_client.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/resourcedetails_client.go
index a6f45ca24b4d..6cef375578f4 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/resourcedetails_client.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/resourcedetails_client.go
@@ -41,7 +41,7 @@ func NewResourceDetailsClient(subscriptionID string, credential azcore.TokenCred
// NewListByPoolPager - List ResourceDetailsObject resources by Pool
//
-// Generated from API version 2024-10-19
+// Generated from API version 2025-01-21
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - poolName - Name of the pool. It needs to be globally unique.
// - options - ResourceDetailsClientListByPoolOptions contains the optional parameters for the ResourceDetailsClient.NewListByPoolPager
@@ -89,7 +89,7 @@ func (client *ResourceDetailsClient) listByPoolCreateRequest(ctx context.Context
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-10-19")
+ reqQP.Set("api-version", "2025-01-21")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/resourcedetails_client_example_test.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/resourcedetails_client_example_test.go
index 958a8be7c85a..5987c15e59a6 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/resourcedetails_client_example_test.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/resourcedetails_client_example_test.go
@@ -11,7 +11,7 @@ import (
"log"
)
-// Generated from example definition: 2024-10-19/ResourceDetails_ListByPool.json
+// Generated from example definition: 2025-01-21/ResourceDetails_ListByPool.json
func ExampleResourceDetailsClient_NewListByPoolPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/responses.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/responses.go
index ca74a46c3c40..c23ebf41bc71 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/responses.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/responses.go
@@ -16,6 +16,12 @@ type OperationsClientListResponse struct {
OperationListResult
}
+// PoolsClientCheckNameAvailabilityResponse contains the response from method PoolsClient.CheckNameAvailability.
+type PoolsClientCheckNameAvailabilityResponse struct {
+ // The CheckNameAvailability operation response.
+ CheckNameAvailabilityResult
+}
+
// PoolsClientCreateOrUpdateResponse contains the response from method PoolsClient.BeginCreateOrUpdate.
type PoolsClientCreateOrUpdateResponse struct {
// Concrete tracked resource types can be created by aliasing this type using a specific property type.
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/sku_client.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/sku_client.go
index 1b3a6762c841..a0eb66968680 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/sku_client.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/sku_client.go
@@ -41,7 +41,7 @@ func NewSKUClient(subscriptionID string, credential azcore.TokenCredential, opti
// NewListByLocationPager - List ResourceSku resources by subscription ID
//
-// Generated from API version 2024-10-19
+// Generated from API version 2025-01-21
// - locationName - Name of the location.
// - options - SKUClientListByLocationOptions contains the optional parameters for the SKUClient.NewListByLocationPager method.
func (client *SKUClient) NewListByLocationPager(locationName string, options *SKUClientListByLocationOptions) *runtime.Pager[SKUClientListByLocationResponse] {
@@ -83,7 +83,7 @@ func (client *SKUClient) listByLocationCreateRequest(ctx context.Context, locati
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-10-19")
+ reqQP.Set("api-version", "2025-01-21")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/sku_client_example_test.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/sku_client_example_test.go
index 13f94b53335b..85d7e4dfba21 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/sku_client_example_test.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/sku_client_example_test.go
@@ -11,7 +11,7 @@ import (
"log"
)
-// Generated from example definition: 2024-10-19/Sku_ListByLocation.json
+// Generated from example definition: 2025-01-21/Sku_ListByLocation.json
func ExampleSKUClient_NewListByLocationPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/subscriptionusages_client.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/subscriptionusages_client.go
index f65ab469bb3e..f5ec7c90ba72 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/subscriptionusages_client.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/subscriptionusages_client.go
@@ -41,7 +41,7 @@ func NewSubscriptionUsagesClient(subscriptionID string, credential azcore.TokenC
// NewUsagesPager - List Quota resources by subscription ID
//
-// Generated from API version 2024-10-19
+// Generated from API version 2025-01-21
// - location - The name of the Azure region.
// - options - SubscriptionUsagesClientUsagesOptions contains the optional parameters for the SubscriptionUsagesClient.NewUsagesPager
// method.
@@ -84,7 +84,7 @@ func (client *SubscriptionUsagesClient) usagesCreateRequest(ctx context.Context,
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-10-19")
+ reqQP.Set("api-version", "2025-01-21")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/subscriptionusages_client_example_test.go b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/subscriptionusages_client_example_test.go
index 89ea9b79654c..a78a73d9d59b 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/subscriptionusages_client_example_test.go
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/subscriptionusages_client_example_test.go
@@ -11,7 +11,7 @@ import (
"log"
)
-// Generated from example definition: 2024-10-19/SubscriptionUsages_Usages.json
+// Generated from example definition: 2025-01-21/SubscriptionUsages_Usages.json
func ExampleSubscriptionUsagesClient_NewUsagesPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
diff --git a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/tsp-location.yaml b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/tsp-location.yaml
index 77686a6437bb..52e128bd4c1b 100644
--- a/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/tsp-location.yaml
+++ b/sdk/resourcemanager/devopsinfrastructure/armdevopsinfrastructure/tsp-location.yaml
@@ -1,4 +1,4 @@
directory: specification/devopsinfrastructure/Microsoft.DevOpsInfrastructure.Management
-commit: d477c7caa09bf82e22c419be0a99d170552b5892
+commit: 676334a284e5136f0a0721d6ae844bb04332f579
repo: Azure/azure-rest-api-specs
-additionalDirectories:
+additionalDirectories:
\ No newline at end of file
diff --git a/sdk/resourcemanager/impactreporting/armimpactreporting/CHANGELOG.md b/sdk/resourcemanager/impactreporting/armimpactreporting/CHANGELOG.md
index 4109b5bd2a2e..a77df8e68303 100644
--- a/sdk/resourcemanager/impactreporting/armimpactreporting/CHANGELOG.md
+++ b/sdk/resourcemanager/impactreporting/armimpactreporting/CHANGELOG.md
@@ -1,5 +1,9 @@
# Release History
+## 0.1.1 (2025-02-27)
+### Other Changes
+
+
## 0.1.0 (2025-02-25)
### Other Changes
diff --git a/sdk/resourcemanager/impactreporting/armimpactreporting/constants.go b/sdk/resourcemanager/impactreporting/armimpactreporting/constants.go
index ef0ffc3378dc..9cdd8cb533dc 100644
--- a/sdk/resourcemanager/impactreporting/armimpactreporting/constants.go
+++ b/sdk/resourcemanager/impactreporting/armimpactreporting/constants.go
@@ -6,7 +6,7 @@ package armimpactreporting
const (
moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/impactreporting/armimpactreporting"
- moduleVersion = "v0.1.0"
+ moduleVersion = "v0.1.1"
)
// ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
diff --git a/sdk/resourcemanager/impactreporting/armimpactreporting/tsp-location.yaml b/sdk/resourcemanager/impactreporting/armimpactreporting/tsp-location.yaml
index f5b1e4191a76..f817b593d5bb 100644
--- a/sdk/resourcemanager/impactreporting/armimpactreporting/tsp-location.yaml
+++ b/sdk/resourcemanager/impactreporting/armimpactreporting/tsp-location.yaml
@@ -1,4 +1,4 @@
directory: specification/impact/Impact.Management
-commit: 2f4175af8e79fe3957f71c4d0c9c79d865622698
+commit: 676334a284e5136f0a0721d6ae844bb04332f579
repo: Azure/azure-rest-api-specs
additionalDirectories:
\ No newline at end of file
diff --git a/sdk/resourcemanager/iotoperations/armiotoperations/CHANGELOG.md b/sdk/resourcemanager/iotoperations/armiotoperations/CHANGELOG.md
index 127b7a374721..ad036648b878 100644
--- a/sdk/resourcemanager/iotoperations/armiotoperations/CHANGELOG.md
+++ b/sdk/resourcemanager/iotoperations/armiotoperations/CHANGELOG.md
@@ -1,5 +1,9 @@
# Release History
+## 1.0.1 (2025-02-27)
+### Other Changes
+
+
## 1.0.0 (2024-12-12)
### Breaking Changes
diff --git a/sdk/resourcemanager/iotoperations/armiotoperations/constants.go b/sdk/resourcemanager/iotoperations/armiotoperations/constants.go
index 1cf40a4b83ed..9b717ae241d3 100644
--- a/sdk/resourcemanager/iotoperations/armiotoperations/constants.go
+++ b/sdk/resourcemanager/iotoperations/armiotoperations/constants.go
@@ -6,7 +6,7 @@ package armiotoperations
const (
moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotoperations/armiotoperations"
- moduleVersion = "v1.0.0"
+ moduleVersion = "v1.0.1"
)
// ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
diff --git a/sdk/resourcemanager/iotoperations/armiotoperations/dataflowendpoint_client_example_test.go b/sdk/resourcemanager/iotoperations/armiotoperations/dataflowendpoint_client_example_test.go
index 804413411bf4..3bd088772c39 100644
--- a/sdk/resourcemanager/iotoperations/armiotoperations/dataflowendpoint_client_example_test.go
+++ b/sdk/resourcemanager/iotoperations/armiotoperations/dataflowendpoint_client_example_test.go
@@ -646,6 +646,99 @@ func ExampleDataflowEndpointClient_BeginCreateOrUpdate_dataflowEndpointCreateOrU
// }
}
+// Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_MQTT.json
+func ExampleDataflowEndpointClient_BeginCreateOrUpdate_dataflowEndpointCreateOrUpdateMqtt() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armiotoperations.NewClientFactory("F8C729F9-DF9C-4743-848F-96EE433D8E53", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewDataflowEndpointClient().BeginCreateOrUpdate(ctx, "rgiotoperations", "resource-name123", "generic-mqtt-broker-endpoint", armiotoperations.DataflowEndpointResource{
+ Properties: &armiotoperations.DataflowEndpointProperties{
+ EndpointType: to.Ptr(armiotoperations.EndpointTypeMqtt),
+ MqttSettings: &armiotoperations.DataflowEndpointMqtt{
+ Host: to.Ptr("example.broker.local:1883"),
+ Authentication: &armiotoperations.DataflowEndpointMqttAuthentication{
+ Method: to.Ptr(armiotoperations.MqttAuthMethodX509Certificate),
+ X509CertificateSettings: &armiotoperations.DataflowEndpointAuthenticationX509{
+ SecretRef: to.Ptr("example-secret"),
+ },
+ },
+ TLS: &armiotoperations.TLSProperties{
+ Mode: to.Ptr(armiotoperations.OperationalModeDisabled),
+ },
+ ClientIDPrefix: to.Ptr("factory-gateway"),
+ Retain: to.Ptr(armiotoperations.MqttRetainTypeKeep),
+ SessionExpirySeconds: to.Ptr[int32](3600),
+ Qos: to.Ptr[int32](1),
+ Protocol: to.Ptr(armiotoperations.BrokerProtocolTypeWebSockets),
+ MaxInflightMessages: to.Ptr[int32](100),
+ KeepAliveSeconds: to.Ptr[int32](60),
+ },
+ },
+ ExtendedLocation: &armiotoperations.ExtendedLocation{
+ Name: to.Ptr("qmbrfwcpwwhggszhrdjv"),
+ Type: to.Ptr(armiotoperations.ExtendedLocationTypeCustomLocation),
+ },
+ }, 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 = armiotoperations.DataflowEndpointClientCreateOrUpdateResponse{
+ // DataflowEndpointResource: &armiotoperations.DataflowEndpointResource{
+ // Properties: &armiotoperations.DataflowEndpointProperties{
+ // EndpointType: to.Ptr(armiotoperations.EndpointTypeMqtt),
+ // MqttSettings: &armiotoperations.DataflowEndpointMqtt{
+ // Host: to.Ptr("example.broker.local:1883"),
+ // Authentication: &armiotoperations.DataflowEndpointMqttAuthentication{
+ // Method: to.Ptr(armiotoperations.MqttAuthMethodX509Certificate),
+ // X509CertificateSettings: &armiotoperations.DataflowEndpointAuthenticationX509{
+ // SecretRef: to.Ptr("example-secret"),
+ // },
+ // },
+ // TLS: &armiotoperations.TLSProperties{
+ // Mode: to.Ptr(armiotoperations.OperationalModeDisabled),
+ // },
+ // ClientIDPrefix: to.Ptr("factory-gateway"),
+ // Retain: to.Ptr(armiotoperations.MqttRetainTypeKeep),
+ // SessionExpirySeconds: to.Ptr[int32](3600),
+ // Qos: to.Ptr[int32](1),
+ // Protocol: to.Ptr(armiotoperations.BrokerProtocolTypeWebSockets),
+ // MaxInflightMessages: to.Ptr[int32](100),
+ // KeepAliveSeconds: to.Ptr[int32](60),
+ // },
+ // ProvisioningState: to.Ptr(armiotoperations.ProvisioningStateSucceeded),
+ // },
+ // ExtendedLocation: &armiotoperations.ExtendedLocation{
+ // Name: to.Ptr("qmbrfwcpwwhggszhrdjv"),
+ // Type: to.Ptr(armiotoperations.ExtendedLocationTypeCustomLocation),
+ // },
+ // ID: to.Ptr("/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123"),
+ // Name: to.Ptr("zyhxscudobzfacetvgyjiav"),
+ // Type: to.Ptr("iay"),
+ // SystemData: &armiotoperations.SystemData{
+ // CreatedBy: to.Ptr("ssvaslsmudloholronopqyxjcu"),
+ // CreatedByType: to.Ptr(armiotoperations.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-09T18:13:29.389Z"); return t}()),
+ // LastModifiedBy: to.Ptr("gnicpuszwd"),
+ // LastModifiedByType: to.Ptr(armiotoperations.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-09T18:13:29.389Z"); return t}()),
+ // },
+ // },
+ // }
+}
+
// Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_MaximumSet_Gen.json
func ExampleDataflowEndpointClient_BeginCreateOrUpdate_dataflowEndpointCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
@@ -967,99 +1060,6 @@ func ExampleDataflowEndpointClient_BeginCreateOrUpdate_dataflowEndpointCreateOrU
// }
}
-// Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_MQTT.json
-func ExampleDataflowEndpointClient_BeginCreateOrUpdate_dataflowEndpointCreateOrUpdateMqtt() {
- cred, err := azidentity.NewDefaultAzureCredential(nil)
- if err != nil {
- log.Fatalf("failed to obtain a credential: %v", err)
- }
- ctx := context.Background()
- clientFactory, err := armiotoperations.NewClientFactory("F8C729F9-DF9C-4743-848F-96EE433D8E53", cred, nil)
- if err != nil {
- log.Fatalf("failed to create client: %v", err)
- }
- poller, err := clientFactory.NewDataflowEndpointClient().BeginCreateOrUpdate(ctx, "rgiotoperations", "resource-name123", "generic-mqtt-broker-endpoint", armiotoperations.DataflowEndpointResource{
- Properties: &armiotoperations.DataflowEndpointProperties{
- EndpointType: to.Ptr(armiotoperations.EndpointTypeMqtt),
- MqttSettings: &armiotoperations.DataflowEndpointMqtt{
- Host: to.Ptr("example.broker.local:1883"),
- Authentication: &armiotoperations.DataflowEndpointMqttAuthentication{
- Method: to.Ptr(armiotoperations.MqttAuthMethodX509Certificate),
- X509CertificateSettings: &armiotoperations.DataflowEndpointAuthenticationX509{
- SecretRef: to.Ptr("example-secret"),
- },
- },
- TLS: &armiotoperations.TLSProperties{
- Mode: to.Ptr(armiotoperations.OperationalModeDisabled),
- },
- ClientIDPrefix: to.Ptr("factory-gateway"),
- Retain: to.Ptr(armiotoperations.MqttRetainTypeKeep),
- SessionExpirySeconds: to.Ptr[int32](3600),
- Qos: to.Ptr[int32](1),
- Protocol: to.Ptr(armiotoperations.BrokerProtocolTypeWebSockets),
- MaxInflightMessages: to.Ptr[int32](100),
- KeepAliveSeconds: to.Ptr[int32](60),
- },
- },
- ExtendedLocation: &armiotoperations.ExtendedLocation{
- Name: to.Ptr("qmbrfwcpwwhggszhrdjv"),
- Type: to.Ptr(armiotoperations.ExtendedLocationTypeCustomLocation),
- },
- }, 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 = armiotoperations.DataflowEndpointClientCreateOrUpdateResponse{
- // DataflowEndpointResource: &armiotoperations.DataflowEndpointResource{
- // Properties: &armiotoperations.DataflowEndpointProperties{
- // EndpointType: to.Ptr(armiotoperations.EndpointTypeMqtt),
- // MqttSettings: &armiotoperations.DataflowEndpointMqtt{
- // Host: to.Ptr("example.broker.local:1883"),
- // Authentication: &armiotoperations.DataflowEndpointMqttAuthentication{
- // Method: to.Ptr(armiotoperations.MqttAuthMethodX509Certificate),
- // X509CertificateSettings: &armiotoperations.DataflowEndpointAuthenticationX509{
- // SecretRef: to.Ptr("example-secret"),
- // },
- // },
- // TLS: &armiotoperations.TLSProperties{
- // Mode: to.Ptr(armiotoperations.OperationalModeDisabled),
- // },
- // ClientIDPrefix: to.Ptr("factory-gateway"),
- // Retain: to.Ptr(armiotoperations.MqttRetainTypeKeep),
- // SessionExpirySeconds: to.Ptr[int32](3600),
- // Qos: to.Ptr[int32](1),
- // Protocol: to.Ptr(armiotoperations.BrokerProtocolTypeWebSockets),
- // MaxInflightMessages: to.Ptr[int32](100),
- // KeepAliveSeconds: to.Ptr[int32](60),
- // },
- // ProvisioningState: to.Ptr(armiotoperations.ProvisioningStateSucceeded),
- // },
- // ExtendedLocation: &armiotoperations.ExtendedLocation{
- // Name: to.Ptr("qmbrfwcpwwhggszhrdjv"),
- // Type: to.Ptr(armiotoperations.ExtendedLocationTypeCustomLocation),
- // },
- // ID: to.Ptr("/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123"),
- // Name: to.Ptr("zyhxscudobzfacetvgyjiav"),
- // Type: to.Ptr("iay"),
- // SystemData: &armiotoperations.SystemData{
- // CreatedBy: to.Ptr("ssvaslsmudloholronopqyxjcu"),
- // CreatedByType: to.Ptr(armiotoperations.CreatedByTypeUser),
- // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-09T18:13:29.389Z"); return t}()),
- // LastModifiedBy: to.Ptr("gnicpuszwd"),
- // LastModifiedByType: to.Ptr(armiotoperations.CreatedByTypeUser),
- // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-09T18:13:29.389Z"); return t}()),
- // },
- // },
- // }
-}
-
// Generated from example definition: 2024-11-01/DataflowEndpoint_Delete_MaximumSet_Gen.json
func ExampleDataflowEndpointClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
diff --git a/sdk/resourcemanager/iotoperations/armiotoperations/models.go b/sdk/resourcemanager/iotoperations/armiotoperations/models.go
index ef1a2229ab7d..2c7a60ec3a49 100644
--- a/sdk/resourcemanager/iotoperations/armiotoperations/models.go
+++ b/sdk/resourcemanager/iotoperations/armiotoperations/models.go
@@ -1134,12 +1134,12 @@ type Metrics struct {
// Operation - Details of a REST API operation, returned from the Resource Provider Operations API
type Operation struct {
- // Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
- ActionType *ActionType
-
- // READ-ONLY; Localized display information for this particular operation.
+ // Localized display information for this particular operation.
Display *OperationDisplay
+ // READ-ONLY; Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ ActionType *ActionType
+
// READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure
// Resource Manager/control-plane operations.
IsDataAction *bool
diff --git a/sdk/resourcemanager/iotoperations/armiotoperations/tsp-location.yaml b/sdk/resourcemanager/iotoperations/armiotoperations/tsp-location.yaml
index 613fd52508c3..f8a9e6a33599 100644
--- a/sdk/resourcemanager/iotoperations/armiotoperations/tsp-location.yaml
+++ b/sdk/resourcemanager/iotoperations/armiotoperations/tsp-location.yaml
@@ -1,4 +1,4 @@
directory: specification/iotoperations/IoTOperations.Management
-commit: ab67c148ec716a0d0075770742d54468f128c72e
+commit: 676334a284e5136f0a0721d6ae844bb04332f579
repo: Azure/azure-rest-api-specs
-additionalDirectories:
+additionalDirectories:
\ No newline at end of file
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/CHANGELOG.md b/sdk/resourcemanager/mongocluster/armmongocluster/CHANGELOG.md
index 47629dbbcb66..643b6b773600 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/CHANGELOG.md
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/CHANGELOG.md
@@ -1,5 +1,14 @@
# Release History
+## 1.1.0-beta.1 (2025-02-27)
+### Features Added
+
+- New enum type `DataAPIMode` with values `DataAPIModeDisabled`, `DataAPIModeEnabled`
+- New struct `DataAPIProperties`
+- New field `DataAPI` in struct `Properties`
+- New field `DataAPI` in struct `UpdateProperties`
+
+
## 1.0.1 (2024-10-14)
### Other Changes
- Add examples
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/constants.go b/sdk/resourcemanager/mongocluster/armmongocluster/constants.go
index 8ebb465edcce..c742c7cf2bb3 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/constants.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/constants.go
@@ -6,7 +6,7 @@ package armmongocluster
const (
moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster"
- moduleVersion = "v1.0.1"
+ moduleVersion = "v1.1.0-beta.1"
)
// ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
@@ -90,6 +90,24 @@ func PossibleCreatedByTypeValues() []CreatedByType {
}
}
+// DataAPIMode - The mode to apply to the Mongo Data API.
+type DataAPIMode string
+
+const (
+ // DataAPIModeDisabled - Mongo Data API is disabled for the cluster.
+ DataAPIModeDisabled DataAPIMode = "Disabled"
+ // DataAPIModeEnabled - Mongo Data API is enabled for the cluster.
+ DataAPIModeEnabled DataAPIMode = "Enabled"
+)
+
+// PossibleDataAPIModeValues returns the possible values for the DataAPIMode const type.
+func PossibleDataAPIModeValues() []DataAPIMode {
+ return []DataAPIMode{
+ DataAPIModeDisabled,
+ DataAPIModeEnabled,
+ }
+}
+
// HighAvailabilityMode - The high availability modes for a cluster.
type HighAvailabilityMode string
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/fake/firewallrules_server.go b/sdk/resourcemanager/mongocluster/armmongocluster/fake/firewallrules_server.go
index 2fa0dba5139c..ca62e57c265e 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/fake/firewallrules_server.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/fake/firewallrules_server.go
@@ -25,7 +25,7 @@ type FirewallRulesServer struct {
BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, resource armmongocluster.FirewallRule, options *armmongocluster.FirewallRulesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmongocluster.FirewallRulesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)
// BeginDelete is the fake for method FirewallRulesClient.BeginDelete
- // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
BeginDelete func(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, options *armmongocluster.FirewallRulesClientBeginDeleteOptions) (resp azfake.PollerResponder[armmongocluster.FirewallRulesClientDeleteResponse], errResp azfake.ErrorResponder)
// Get is the fake for method FirewallRulesClient.Get
@@ -70,23 +70,42 @@ func (f *FirewallRulesServerTransport) Do(req *http.Request) (*http.Response, er
}
func (f *FirewallRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
- var resp *http.Response
- var err error
+ resultChan := make(chan result)
+ defer close(resultChan)
- switch method {
- case "FirewallRulesClient.BeginCreateOrUpdate":
- resp, err = f.dispatchBeginCreateOrUpdate(req)
- case "FirewallRulesClient.BeginDelete":
- resp, err = f.dispatchBeginDelete(req)
- case "FirewallRulesClient.Get":
- resp, err = f.dispatchGet(req)
- case "FirewallRulesClient.NewListByMongoClusterPager":
- resp, err = f.dispatchNewListByMongoClusterPager(req)
- default:
- err = fmt.Errorf("unhandled API %s", method)
- }
+ go func() {
+ var intercepted bool
+ var res result
+ if firewallRulesServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = firewallRulesServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "FirewallRulesClient.BeginCreateOrUpdate":
+ res.resp, res.err = f.dispatchBeginCreateOrUpdate(req)
+ case "FirewallRulesClient.BeginDelete":
+ res.resp, res.err = f.dispatchBeginDelete(req)
+ case "FirewallRulesClient.Get":
+ res.resp, res.err = f.dispatchGet(req)
+ case "FirewallRulesClient.NewListByMongoClusterPager":
+ res.resp, res.err = f.dispatchNewListByMongoClusterPager(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
- return resp, err
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
}
func (f *FirewallRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) {
@@ -178,9 +197,9 @@ func (f *FirewallRulesServerTransport) dispatchBeginDelete(req *http.Request) (*
return nil, err
}
- if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
f.beginDelete.remove(req)
- return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
}
if !server.PollerResponderMore(beginDelete) {
f.beginDelete.remove(req)
@@ -266,3 +285,9 @@ func (f *FirewallRulesServerTransport) dispatchNewListByMongoClusterPager(req *h
}
return resp, nil
}
+
+// set this to conditionally intercept incoming requests to FirewallRulesServerTransport
+var firewallRulesServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/fake/internal.go b/sdk/resourcemanager/mongocluster/armmongocluster/fake/internal.go
index 56a8f624f5f3..7425b6a669e2 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/fake/internal.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/fake/internal.go
@@ -10,6 +10,11 @@ import (
"sync"
)
+type result struct {
+ resp *http.Response
+ err error
+}
+
type nonRetriableError struct {
error
}
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/fake/mongoclusters_server.go b/sdk/resourcemanager/mongocluster/armmongocluster/fake/mongoclusters_server.go
index 282e05f31b53..71e5c8df2b66 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/fake/mongoclusters_server.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/fake/mongoclusters_server.go
@@ -29,7 +29,7 @@ type MongoClustersServer struct {
BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, mongoClusterName string, resource armmongocluster.MongoCluster, options *armmongocluster.MongoClustersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmongocluster.MongoClustersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)
// BeginDelete is the fake for method MongoClustersClient.BeginDelete
- // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
BeginDelete func(ctx context.Context, resourceGroupName string, mongoClusterName string, options *armmongocluster.MongoClustersClientBeginDeleteOptions) (resp azfake.PollerResponder[armmongocluster.MongoClustersClientDeleteResponse], errResp azfake.ErrorResponder)
// Get is the fake for method MongoClustersClient.Get
@@ -49,7 +49,7 @@ type MongoClustersServer struct {
ListConnectionStrings func(ctx context.Context, resourceGroupName string, mongoClusterName string, options *armmongocluster.MongoClustersClientListConnectionStringsOptions) (resp azfake.Responder[armmongocluster.MongoClustersClientListConnectionStringsResponse], errResp azfake.ErrorResponder)
// BeginPromote is the fake for method MongoClustersClient.BeginPromote
- // HTTP status codes to indicate success: http.StatusAccepted
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
BeginPromote func(ctx context.Context, resourceGroupName string, mongoClusterName string, body armmongocluster.PromoteReplicaRequest, options *armmongocluster.MongoClustersClientBeginPromoteOptions) (resp azfake.PollerResponder[armmongocluster.MongoClustersClientPromoteResponse], errResp azfake.ErrorResponder)
// BeginUpdate is the fake for method MongoClustersClient.BeginUpdate
@@ -96,33 +96,52 @@ func (m *MongoClustersServerTransport) Do(req *http.Request) (*http.Response, er
}
func (m *MongoClustersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
- var resp *http.Response
- var err error
-
- switch method {
- case "MongoClustersClient.CheckNameAvailability":
- resp, err = m.dispatchCheckNameAvailability(req)
- case "MongoClustersClient.BeginCreateOrUpdate":
- resp, err = m.dispatchBeginCreateOrUpdate(req)
- case "MongoClustersClient.BeginDelete":
- resp, err = m.dispatchBeginDelete(req)
- case "MongoClustersClient.Get":
- resp, err = m.dispatchGet(req)
- case "MongoClustersClient.NewListPager":
- resp, err = m.dispatchNewListPager(req)
- case "MongoClustersClient.NewListByResourceGroupPager":
- resp, err = m.dispatchNewListByResourceGroupPager(req)
- case "MongoClustersClient.ListConnectionStrings":
- resp, err = m.dispatchListConnectionStrings(req)
- case "MongoClustersClient.BeginPromote":
- resp, err = m.dispatchBeginPromote(req)
- case "MongoClustersClient.BeginUpdate":
- resp, err = m.dispatchBeginUpdate(req)
- default:
- err = fmt.Errorf("unhandled API %s", method)
- }
-
- return resp, err
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if mongoClustersServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = mongoClustersServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "MongoClustersClient.CheckNameAvailability":
+ res.resp, res.err = m.dispatchCheckNameAvailability(req)
+ case "MongoClustersClient.BeginCreateOrUpdate":
+ res.resp, res.err = m.dispatchBeginCreateOrUpdate(req)
+ case "MongoClustersClient.BeginDelete":
+ res.resp, res.err = m.dispatchBeginDelete(req)
+ case "MongoClustersClient.Get":
+ res.resp, res.err = m.dispatchGet(req)
+ case "MongoClustersClient.NewListPager":
+ res.resp, res.err = m.dispatchNewListPager(req)
+ case "MongoClustersClient.NewListByResourceGroupPager":
+ res.resp, res.err = m.dispatchNewListByResourceGroupPager(req)
+ case "MongoClustersClient.ListConnectionStrings":
+ res.resp, res.err = m.dispatchListConnectionStrings(req)
+ case "MongoClustersClient.BeginPromote":
+ res.resp, res.err = m.dispatchBeginPromote(req)
+ case "MongoClustersClient.BeginUpdate":
+ res.resp, res.err = m.dispatchBeginUpdate(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
}
func (m *MongoClustersServerTransport) dispatchCheckNameAvailability(req *http.Request) (*http.Response, error) {
@@ -239,9 +258,9 @@ func (m *MongoClustersServerTransport) dispatchBeginDelete(req *http.Request) (*
return nil, err
}
- if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
m.beginDelete.remove(req)
- return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
}
if !server.PollerResponderMore(beginDelete) {
m.beginDelete.remove(req)
@@ -423,9 +442,9 @@ func (m *MongoClustersServerTransport) dispatchBeginPromote(req *http.Request) (
return nil, err
}
- if !contains([]int{http.StatusAccepted}, resp.StatusCode) {
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
m.beginPromote.remove(req)
- return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)}
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
}
if !server.PollerResponderMore(beginPromote) {
m.beginPromote.remove(req)
@@ -481,3 +500,9 @@ func (m *MongoClustersServerTransport) dispatchBeginUpdate(req *http.Request) (*
return resp, nil
}
+
+// set this to conditionally intercept incoming requests to MongoClustersServerTransport
+var mongoClustersServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/fake/operations_server.go b/sdk/resourcemanager/mongocluster/armmongocluster/fake/operations_server.go
index e03576da7bf7..f9b0ab327954 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/fake/operations_server.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/fake/operations_server.go
@@ -51,17 +51,36 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error
}
func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
- var resp *http.Response
- var err error
+ resultChan := make(chan result)
+ defer close(resultChan)
- switch method {
- case "OperationsClient.NewListPager":
- resp, err = o.dispatchNewListPager(req)
- default:
- err = fmt.Errorf("unhandled API %s", method)
- }
+ go func() {
+ var intercepted bool
+ var res result
+ if operationsServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "OperationsClient.NewListPager":
+ res.resp, res.err = o.dispatchNewListPager(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
- return resp, err
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
}
func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) {
@@ -90,3 +109,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht
}
return resp, nil
}
+
+// set this to conditionally intercept incoming requests to OperationsServerTransport
+var operationsServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/fake/privateendpointconnections_server.go b/sdk/resourcemanager/mongocluster/armmongocluster/fake/privateendpointconnections_server.go
index 1857e3b2d3a2..2ff521073ce8 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/fake/privateendpointconnections_server.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/fake/privateendpointconnections_server.go
@@ -25,7 +25,7 @@ type PrivateEndpointConnectionsServer struct {
BeginCreate func(ctx context.Context, resourceGroupName string, mongoClusterName string, privateEndpointConnectionName string, resource armmongocluster.PrivateEndpointConnectionResource, options *armmongocluster.PrivateEndpointConnectionsClientBeginCreateOptions) (resp azfake.PollerResponder[armmongocluster.PrivateEndpointConnectionsClientCreateResponse], errResp azfake.ErrorResponder)
// BeginDelete is the fake for method PrivateEndpointConnectionsClient.BeginDelete
- // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
BeginDelete func(ctx context.Context, resourceGroupName string, mongoClusterName string, privateEndpointConnectionName string, options *armmongocluster.PrivateEndpointConnectionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmongocluster.PrivateEndpointConnectionsClientDeleteResponse], errResp azfake.ErrorResponder)
// Get is the fake for method PrivateEndpointConnectionsClient.Get
@@ -70,23 +70,42 @@ func (p *PrivateEndpointConnectionsServerTransport) Do(req *http.Request) (*http
}
func (p *PrivateEndpointConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
- var resp *http.Response
- var err error
+ resultChan := make(chan result)
+ defer close(resultChan)
- switch method {
- case "PrivateEndpointConnectionsClient.BeginCreate":
- resp, err = p.dispatchBeginCreate(req)
- case "PrivateEndpointConnectionsClient.BeginDelete":
- resp, err = p.dispatchBeginDelete(req)
- case "PrivateEndpointConnectionsClient.Get":
- resp, err = p.dispatchGet(req)
- case "PrivateEndpointConnectionsClient.NewListByMongoClusterPager":
- resp, err = p.dispatchNewListByMongoClusterPager(req)
- default:
- err = fmt.Errorf("unhandled API %s", method)
- }
+ go func() {
+ var intercepted bool
+ var res result
+ if privateEndpointConnectionsServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = privateEndpointConnectionsServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "PrivateEndpointConnectionsClient.BeginCreate":
+ res.resp, res.err = p.dispatchBeginCreate(req)
+ case "PrivateEndpointConnectionsClient.BeginDelete":
+ res.resp, res.err = p.dispatchBeginDelete(req)
+ case "PrivateEndpointConnectionsClient.Get":
+ res.resp, res.err = p.dispatchGet(req)
+ case "PrivateEndpointConnectionsClient.NewListByMongoClusterPager":
+ res.resp, res.err = p.dispatchNewListByMongoClusterPager(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
- return resp, err
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
}
func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) {
@@ -178,9 +197,9 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginDelete(req *htt
return nil, err
}
- if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
p.beginDelete.remove(req)
- return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
}
if !server.PollerResponderMore(beginDelete) {
p.beginDelete.remove(req)
@@ -266,3 +285,9 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchNewListByMongoCluste
}
return resp, nil
}
+
+// set this to conditionally intercept incoming requests to PrivateEndpointConnectionsServerTransport
+var privateEndpointConnectionsServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/fake/privatelinks_server.go b/sdk/resourcemanager/mongocluster/armmongocluster/fake/privatelinks_server.go
index c5c7f79a7086..e51c4ae7e0b3 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/fake/privatelinks_server.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/fake/privatelinks_server.go
@@ -53,17 +53,36 @@ func (p *PrivateLinksServerTransport) Do(req *http.Request) (*http.Response, err
}
func (p *PrivateLinksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
- var resp *http.Response
- var err error
+ resultChan := make(chan result)
+ defer close(resultChan)
- switch method {
- case "PrivateLinksClient.NewListByMongoClusterPager":
- resp, err = p.dispatchNewListByMongoClusterPager(req)
- default:
- err = fmt.Errorf("unhandled API %s", method)
- }
+ go func() {
+ var intercepted bool
+ var res result
+ if privateLinksServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = privateLinksServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "PrivateLinksClient.NewListByMongoClusterPager":
+ res.resp, res.err = p.dispatchNewListByMongoClusterPager(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
- return resp, err
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
}
func (p *PrivateLinksServerTransport) dispatchNewListByMongoClusterPager(req *http.Request) (*http.Response, error) {
@@ -106,3 +125,9 @@ func (p *PrivateLinksServerTransport) dispatchNewListByMongoClusterPager(req *ht
}
return resp, nil
}
+
+// set this to conditionally intercept incoming requests to PrivateLinksServerTransport
+var privateLinksServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/fake/replicas_server.go b/sdk/resourcemanager/mongocluster/armmongocluster/fake/replicas_server.go
index 380cc5823b3d..fe07670b3590 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/fake/replicas_server.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/fake/replicas_server.go
@@ -53,17 +53,36 @@ func (r *ReplicasServerTransport) Do(req *http.Request) (*http.Response, error)
}
func (r *ReplicasServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
- var resp *http.Response
- var err error
+ resultChan := make(chan result)
+ defer close(resultChan)
- switch method {
- case "ReplicasClient.NewListByParentPager":
- resp, err = r.dispatchNewListByParentPager(req)
- default:
- err = fmt.Errorf("unhandled API %s", method)
- }
+ go func() {
+ var intercepted bool
+ var res result
+ if replicasServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = replicasServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "ReplicasClient.NewListByParentPager":
+ res.resp, res.err = r.dispatchNewListByParentPager(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
- return resp, err
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
}
func (r *ReplicasServerTransport) dispatchNewListByParentPager(req *http.Request) (*http.Response, error) {
@@ -106,3 +125,9 @@ func (r *ReplicasServerTransport) dispatchNewListByParentPager(req *http.Request
}
return resp, nil
}
+
+// set this to conditionally intercept incoming requests to ReplicasServerTransport
+var replicasServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/firewallrules_client.go b/sdk/resourcemanager/mongocluster/armmongocluster/firewallrules_client.go
index 6796ca9e9b9c..f14df4739d24 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/firewallrules_client.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/firewallrules_client.go
@@ -42,7 +42,7 @@ func NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCreden
// BeginCreateOrUpdate - Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - firewallRuleName - The name of the mongo cluster firewall rule.
@@ -70,7 +70,7 @@ func (client *FirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, reso
// CreateOrUpdate - Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
func (client *FirewallRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, resource FirewallRule, options *FirewallRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) {
var err error
const operationName = "FirewallRulesClient.BeginCreateOrUpdate"
@@ -116,7 +116,7 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
req.Raw().Header["Content-Type"] = []string{"application/json"}
@@ -129,7 +129,7 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte
// BeginDelete - Deletes a mongo cluster firewall rule.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - firewallRuleName - The name of the mongo cluster firewall rule.
@@ -155,7 +155,7 @@ func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGrou
// Delete - Deletes a mongo cluster firewall rule.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
func (client *FirewallRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, options *FirewallRulesClientBeginDeleteOptions) (*http.Response, error) {
var err error
const operationName = "FirewallRulesClient.BeginDelete"
@@ -201,7 +201,7 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -210,7 +210,7 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso
// Get - Gets information about a mongo cluster firewall rule.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - firewallRuleName - The name of the mongo cluster firewall rule.
@@ -261,7 +261,7 @@ func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourc
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -278,7 +278,7 @@ func (client *FirewallRulesClient) getHandleResponse(resp *http.Response) (Firew
// NewListByMongoClusterPager - List all the firewall rules in a given mongo cluster.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - options - FirewallRulesClientListByMongoClusterOptions contains the optional parameters for the FirewallRulesClient.NewListByMongoClusterPager
@@ -326,7 +326,7 @@ func (client *FirewallRulesClient) listByMongoClusterCreateRequest(ctx context.C
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/firewallrules_client_example_test.go b/sdk/resourcemanager/mongocluster/armmongocluster/firewallrules_client_example_test.go
index 46b9b0d8cb32..7d26ee5a6f7e 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/firewallrules_client_example_test.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/firewallrules_client_example_test.go
@@ -12,7 +12,7 @@ import (
"log"
)
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_FirewallRuleCreate.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_FirewallRuleCreate.json
func ExampleFirewallRulesClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -61,7 +61,7 @@ func ExampleFirewallRulesClient_BeginCreateOrUpdate() {
// }
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_FirewallRuleDelete.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_FirewallRuleDelete.json
func ExampleFirewallRulesClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -82,7 +82,7 @@ func ExampleFirewallRulesClient_BeginDelete() {
}
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_FirewallRuleGet.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_FirewallRuleGet.json
func ExampleFirewallRulesClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -122,7 +122,7 @@ func ExampleFirewallRulesClient_Get() {
// }
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_FirewallRuleList.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_FirewallRuleList.json
func ExampleFirewallRulesClient_NewListByMongoClusterPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/models.go b/sdk/resourcemanager/mongocluster/armmongocluster/models.go
index 9494835cd5da..93171db81dbe 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/models.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/models.go
@@ -62,6 +62,12 @@ type ConnectionString struct {
Name *string
}
+// DataAPIProperties - Data API properties.
+type DataAPIProperties struct {
+ // The mode to indicate whether the Mongo Data API is enabled for a cluster.
+ Mode *DataAPIMode
+}
+
// FirewallRule - Represents a mongo cluster firewall rule.
type FirewallRule struct {
// The resource-specific properties for this resource.
@@ -148,12 +154,12 @@ type MongoCluster struct {
// Operation - Details of a REST API operation, returned from the Resource Provider Operations API
type Operation struct {
- // Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
- ActionType *ActionType
-
- // READ-ONLY; Localized display information for this particular operation.
+ // Localized display information for this particular operation.
Display *OperationDisplay
+ // READ-ONLY; Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ ActionType *ActionType
+
// READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure
// Resource Manager/control-plane operations.
IsDataAction *bool
@@ -337,6 +343,9 @@ type Properties struct {
// The mode to create a mongo cluster.
CreateMode *CreateMode
+ // The Data API properties of the mongo cluster.
+ DataAPI *DataAPIProperties
+
// The high availability properties of the mongo cluster.
HighAvailability *HighAvailabilityProperties
@@ -492,6 +501,9 @@ type UpdateProperties struct {
// The compute properties of the mongo cluster.
Compute *ComputeProperties
+ // The Data API properties of the mongo cluster.
+ DataAPI *DataAPIProperties
+
// The high availability properties of the mongo cluster.
HighAvailability *HighAvailabilityProperties
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/models_serde.go b/sdk/resourcemanager/mongocluster/armmongocluster/models_serde.go
index fba590971cba..82e653df63c0 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/models_serde.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/models_serde.go
@@ -197,6 +197,33 @@ func (c *ConnectionString) UnmarshalJSON(data []byte) error {
return nil
}
+// MarshalJSON implements the json.Marshaller interface for type DataAPIProperties.
+func (d DataAPIProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "mode", d.Mode)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DataAPIProperties.
+func (d *DataAPIProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "mode":
+ err = unpopulate(val, "Mode", &d.Mode)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
// MarshalJSON implements the json.Marshaller interface for type FirewallRule.
func (f FirewallRule) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
@@ -922,6 +949,7 @@ func (p Properties) MarshalJSON() ([]byte, error) {
populate(objectMap, "compute", p.Compute)
populate(objectMap, "connectionString", p.ConnectionString)
populate(objectMap, "createMode", p.CreateMode)
+ populate(objectMap, "dataApi", p.DataAPI)
populate(objectMap, "highAvailability", p.HighAvailability)
populate(objectMap, "infrastructureVersion", p.InfrastructureVersion)
populate(objectMap, "previewFeatures", p.PreviewFeatures)
@@ -964,6 +992,9 @@ func (p *Properties) UnmarshalJSON(data []byte) error {
case "createMode":
err = unpopulate(val, "CreateMode", &p.CreateMode)
delete(rawMsg, key)
+ case "dataApi":
+ err = unpopulate(val, "DataAPI", &p.DataAPI)
+ delete(rawMsg, key)
case "highAvailability":
err = unpopulate(val, "HighAvailability", &p.HighAvailability)
delete(rawMsg, key)
@@ -1317,6 +1348,7 @@ func (u UpdateProperties) MarshalJSON() ([]byte, error) {
populate(objectMap, "administrator", u.Administrator)
populate(objectMap, "backup", u.Backup)
populate(objectMap, "compute", u.Compute)
+ populate(objectMap, "dataApi", u.DataAPI)
populate(objectMap, "highAvailability", u.HighAvailability)
populate(objectMap, "previewFeatures", u.PreviewFeatures)
populate(objectMap, "publicNetworkAccess", u.PublicNetworkAccess)
@@ -1344,6 +1376,9 @@ func (u *UpdateProperties) UnmarshalJSON(data []byte) error {
case "compute":
err = unpopulate(val, "Compute", &u.Compute)
delete(rawMsg, key)
+ case "dataApi":
+ err = unpopulate(val, "DataAPI", &u.DataAPI)
+ delete(rawMsg, key)
case "highAvailability":
err = unpopulate(val, "HighAvailability", &u.HighAvailability)
delete(rawMsg, key)
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/mongoclusters_client.go b/sdk/resourcemanager/mongocluster/armmongocluster/mongoclusters_client.go
index 14410d6a7eab..741f5fc56c7a 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/mongoclusters_client.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/mongoclusters_client.go
@@ -42,8 +42,8 @@ func NewMongoClustersClient(subscriptionID string, credential azcore.TokenCreden
// CheckNameAvailability - Check if mongo cluster name is available for use.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
-// - location - The location name.
+// Generated from API version 2024-10-01-preview
+// - location - The name of the Azure region.
// - body - The CheckAvailability request
// - options - MongoClustersClientCheckNameAvailabilityOptions contains the optional parameters for the MongoClustersClient.CheckNameAvailability
// method.
@@ -85,7 +85,7 @@ func (client *MongoClustersClient) checkNameAvailabilityCreateRequest(ctx contex
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
req.Raw().Header["Content-Type"] = []string{"application/json"}
@@ -108,7 +108,7 @@ func (client *MongoClustersClient) checkNameAvailabilityHandleResponse(resp *htt
// some of the properties, use PATCH.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - resource - Resource create parameters.
@@ -136,7 +136,7 @@ func (client *MongoClustersClient) BeginCreateOrUpdate(ctx context.Context, reso
// of the properties, use PATCH.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
func (client *MongoClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, mongoClusterName string, resource MongoCluster, options *MongoClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) {
var err error
const operationName = "MongoClustersClient.BeginCreateOrUpdate"
@@ -178,7 +178,7 @@ func (client *MongoClustersClient) createOrUpdateCreateRequest(ctx context.Conte
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
req.Raw().Header["Content-Type"] = []string{"application/json"}
@@ -191,7 +191,7 @@ func (client *MongoClustersClient) createOrUpdateCreateRequest(ctx context.Conte
// BeginDelete - Deletes a mongo cluster.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - options - MongoClustersClientBeginDeleteOptions contains the optional parameters for the MongoClustersClient.BeginDelete
@@ -216,7 +216,7 @@ func (client *MongoClustersClient) BeginDelete(ctx context.Context, resourceGrou
// Delete - Deletes a mongo cluster.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
func (client *MongoClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, mongoClusterName string, options *MongoClustersClientBeginDeleteOptions) (*http.Response, error) {
var err error
const operationName = "MongoClustersClient.BeginDelete"
@@ -258,7 +258,7 @@ func (client *MongoClustersClient) deleteCreateRequest(ctx context.Context, reso
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -267,7 +267,7 @@ func (client *MongoClustersClient) deleteCreateRequest(ctx context.Context, reso
// Get - Gets information about a mongo cluster.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - options - MongoClustersClientGetOptions contains the optional parameters for the MongoClustersClient.Get method.
@@ -313,7 +313,7 @@ func (client *MongoClustersClient) getCreateRequest(ctx context.Context, resourc
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -330,7 +330,7 @@ func (client *MongoClustersClient) getHandleResponse(resp *http.Response) (Mongo
// NewListPager - List all the mongo clusters in a given subscription.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - options - MongoClustersClientListOptions contains the optional parameters for the MongoClustersClient.NewListPager method.
func (client *MongoClustersClient) NewListPager(options *MongoClustersClientListOptions) *runtime.Pager[MongoClustersClientListResponse] {
return runtime.NewPager(runtime.PagingHandler[MongoClustersClientListResponse]{
@@ -367,7 +367,7 @@ func (client *MongoClustersClient) listCreateRequest(ctx context.Context, _ *Mon
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -384,7 +384,7 @@ func (client *MongoClustersClient) listHandleResponse(resp *http.Response) (Mong
// NewListByResourceGroupPager - List all the mongo clusters in a given resource group.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - options - MongoClustersClientListByResourceGroupOptions contains the optional parameters for the MongoClustersClient.NewListByResourceGroupPager
// method.
@@ -427,7 +427,7 @@ func (client *MongoClustersClient) listByResourceGroupCreateRequest(ctx context.
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -446,7 +446,7 @@ func (client *MongoClustersClient) listByResourceGroupHandleResponse(resp *http.
// as well as other connection strings supported by the cluster.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - options - MongoClustersClientListConnectionStringsOptions contains the optional parameters for the MongoClustersClient.ListConnectionStrings
@@ -493,7 +493,7 @@ func (client *MongoClustersClient) listConnectionStringsCreateRequest(ctx contex
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -511,7 +511,7 @@ func (client *MongoClustersClient) listConnectionStringsHandleResponse(resp *htt
// BeginPromote - Promotes a replica mongo cluster to a primary role.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - body - The content of the action request
@@ -537,7 +537,7 @@ func (client *MongoClustersClient) BeginPromote(ctx context.Context, resourceGro
// Promote - Promotes a replica mongo cluster to a primary role.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
func (client *MongoClustersClient) promote(ctx context.Context, resourceGroupName string, mongoClusterName string, body PromoteReplicaRequest, options *MongoClustersClientBeginPromoteOptions) (*http.Response, error) {
var err error
const operationName = "MongoClustersClient.BeginPromote"
@@ -579,7 +579,7 @@ func (client *MongoClustersClient) promoteCreateRequest(ctx context.Context, res
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
req.Raw().Header["Content-Type"] = []string{"application/json"}
@@ -593,7 +593,7 @@ func (client *MongoClustersClient) promoteCreateRequest(ctx context.Context, res
// the normal mongo cluster definition.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - properties - The resource properties to be updated.
@@ -620,7 +620,7 @@ func (client *MongoClustersClient) BeginUpdate(ctx context.Context, resourceGrou
// mongo cluster definition.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
func (client *MongoClustersClient) update(ctx context.Context, resourceGroupName string, mongoClusterName string, properties Update, options *MongoClustersClientBeginUpdateOptions) (*http.Response, error) {
var err error
const operationName = "MongoClustersClient.BeginUpdate"
@@ -662,7 +662,7 @@ func (client *MongoClustersClient) updateCreateRequest(ctx context.Context, reso
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
req.Raw().Header["Content-Type"] = []string{"application/json"}
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/mongoclusters_client_example_test.go b/sdk/resourcemanager/mongocluster/armmongocluster/mongoclusters_client_example_test.go
index 5e7f6481eb99..d07abec7a662 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/mongoclusters_client_example_test.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/mongoclusters_client_example_test.go
@@ -13,7 +13,7 @@ import (
"time"
)
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_NameAvailability.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_NameAvailability.json
func ExampleMongoClustersClient_CheckNameAvailability_checksAndConfirmsTheMongoClusterNameIsAvailabilityForUse() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -41,7 +41,7 @@ func ExampleMongoClustersClient_CheckNameAvailability_checksAndConfirmsTheMongoC
// }
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_NameAvailability_AlreadyExists.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_NameAvailability_AlreadyExists.json
func ExampleMongoClustersClient_CheckNameAvailability_checksAndReturnsThatTheMongoClusterNameIsAlreadyInUse() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -71,7 +71,7 @@ func ExampleMongoClustersClient_CheckNameAvailability_checksAndReturnsThatTheMon
// }
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_Create.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_Create.json
func ExampleMongoClustersClient_BeginCreateOrUpdate_createsANewMongoClusterResource() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -156,13 +156,16 @@ func ExampleMongoClustersClient_BeginCreateOrUpdate_createsANewMongoClusterResou
// Replica: &armmongocluster.ReplicationProperties{
// Role: to.Ptr(armmongocluster.ReplicationRolePrimary),
// },
+ // DataAPI: &armmongocluster.DataAPIProperties{
+ // Mode: to.Ptr(armmongocluster.DataAPIModeDisabled),
+ // },
// },
// Location: to.Ptr("westus2"),
// },
// }
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_CreateGeoReplica.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_CreateGeoReplica.json
func ExampleMongoClustersClient_BeginCreateOrUpdate_createsAReplicaMongoClusterResourceFromASourceResource() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -230,13 +233,16 @@ func ExampleMongoClustersClient_BeginCreateOrUpdate_createsAReplicaMongoClusterR
// SourceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/mySourceMongoCluster"),
// ReplicationState: to.Ptr(armmongocluster.ReplicationStateProvisioning),
// },
+ // DataAPI: &armmongocluster.DataAPIProperties{
+ // Mode: to.Ptr(armmongocluster.DataAPIModeDisabled),
+ // },
// },
// Location: to.Ptr("centralus"),
// },
// }
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_CreatePITR.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_CreatePITR.json
func ExampleMongoClustersClient_BeginCreateOrUpdate_createsAMongoClusterResourceFromAPointInTimeRestore() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -301,13 +307,16 @@ func ExampleMongoClustersClient_BeginCreateOrUpdate_createsAMongoClusterResource
// Replica: &armmongocluster.ReplicationProperties{
// Role: to.Ptr(armmongocluster.ReplicationRolePrimary),
// },
+ // DataAPI: &armmongocluster.DataAPIProperties{
+ // Mode: to.Ptr(armmongocluster.DataAPIModeDisabled),
+ // },
// },
// Location: to.Ptr("westus2"),
// },
// }
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_Delete.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_Delete.json
func ExampleMongoClustersClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -328,7 +337,7 @@ func ExampleMongoClustersClient_BeginDelete() {
}
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_Get.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_Get.json
func ExampleMongoClustersClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -394,13 +403,16 @@ func ExampleMongoClustersClient_Get() {
// ReplicationState: to.Ptr(armmongocluster.ReplicationStateActive),
// Role: to.Ptr(armmongocluster.ReplicationRolePrimary),
// },
+ // DataAPI: &armmongocluster.DataAPIProperties{
+ // Mode: to.Ptr(armmongocluster.DataAPIModeDisabled),
+ // },
// },
// Location: to.Ptr("westus2"),
// },
// }
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_List.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_List.json
func ExampleMongoClustersClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -472,6 +484,9 @@ func ExampleMongoClustersClient_NewListPager() {
// ReplicationState: to.Ptr(armmongocluster.ReplicationStateActive),
// Role: to.Ptr(armmongocluster.ReplicationRolePrimary),
// },
+ // DataAPI: &armmongocluster.DataAPIProperties{
+ // Mode: to.Ptr(armmongocluster.DataAPIModeDisabled),
+ // },
// },
// Location: to.Ptr("westus2"),
// },
@@ -520,6 +535,9 @@ func ExampleMongoClustersClient_NewListPager() {
// ReplicationState: to.Ptr(armmongocluster.ReplicationStateActive),
// Role: to.Ptr(armmongocluster.ReplicationRolePrimary),
// },
+ // DataAPI: &armmongocluster.DataAPIProperties{
+ // Mode: to.Ptr(armmongocluster.DataAPIModeDisabled),
+ // },
// },
// Location: to.Ptr("eastus"),
// },
@@ -529,7 +547,7 @@ func ExampleMongoClustersClient_NewListPager() {
}
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_ListByResourceGroup.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_ListByResourceGroup.json
func ExampleMongoClustersClient_NewListByResourceGroupPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -601,6 +619,9 @@ func ExampleMongoClustersClient_NewListByResourceGroupPager() {
// ReplicationState: to.Ptr(armmongocluster.ReplicationStateActive),
// Role: to.Ptr(armmongocluster.ReplicationRolePrimary),
// },
+ // DataAPI: &armmongocluster.DataAPIProperties{
+ // Mode: to.Ptr(armmongocluster.DataAPIModeDisabled),
+ // },
// },
// Location: to.Ptr("westus2"),
// },
@@ -649,6 +670,9 @@ func ExampleMongoClustersClient_NewListByResourceGroupPager() {
// ReplicationState: to.Ptr(armmongocluster.ReplicationStateActive),
// Role: to.Ptr(armmongocluster.ReplicationRolePrimary),
// },
+ // DataAPI: &armmongocluster.DataAPIProperties{
+ // Mode: to.Ptr(armmongocluster.DataAPIModeDisabled),
+ // },
// },
// Location: to.Ptr("eastus"),
// },
@@ -658,7 +682,7 @@ func ExampleMongoClustersClient_NewListByResourceGroupPager() {
}
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_ListConnectionStrings.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_ListConnectionStrings.json
func ExampleMongoClustersClient_ListConnectionStrings() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -688,7 +712,7 @@ func ExampleMongoClustersClient_ListConnectionStrings() {
// }
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_ForcePromoteReplica.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_ForcePromoteReplica.json
func ExampleMongoClustersClient_BeginPromote() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -712,7 +736,112 @@ func ExampleMongoClustersClient_BeginPromote() {
}
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_PatchDiskSize.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_PatchDataApi.json
+func ExampleMongoClustersClient_BeginUpdate_enablesDataApiOnAMongoClusterResource() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewMongoClustersClient().BeginUpdate(ctx, "TestResourceGroup", "myMongoCluster", armmongocluster.Update{
+ Properties: &armmongocluster.UpdateProperties{
+ DataAPI: &armmongocluster.DataAPIProperties{
+ Mode: to.Ptr(armmongocluster.DataAPIModeEnabled),
+ },
+ },
+ }, 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 = armmongocluster.MongoClustersClientUpdateResponse{
+ // MongoCluster: &armmongocluster.MongoCluster{
+ // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"),
+ // Name: to.Ptr("myMongoCluster"),
+ // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"),
+ // SystemData: &armmongocluster.SystemData{
+ // CreatedBy: to.Ptr("user1"),
+ // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
+ // LastModifiedBy: to.Ptr("user2"),
+ // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
+ // },
+ // Properties: &armmongocluster.Properties{
+ // Administrator: &armmongocluster.AdministratorProperties{
+ // UserName: to.Ptr("mongoAdmin"),
+ // },
+ // ServerVersion: to.Ptr("5.0"),
+ // Storage: &armmongocluster.StorageProperties{
+ // SizeGb: to.Ptr[int64](256),
+ // },
+ // Compute: &armmongocluster.ComputeProperties{
+ // Tier: to.Ptr("M30"),
+ // },
+ // Sharding: &armmongocluster.ShardingProperties{
+ // ShardCount: to.Ptr[int32](4),
+ // },
+ // HighAvailability: &armmongocluster.HighAvailabilityProperties{
+ // TargetMode: to.Ptr(armmongocluster.HighAvailabilityModeSameZone),
+ // },
+ // Backup: &armmongocluster.BackupProperties{
+ // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"),
+ // },
+ // PrivateEndpointConnections: []*armmongocluster.PrivateEndpointConnection{
+ // {
+ // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/privateEndpointConnections/mymongocluster-pe.ffffffff-ffff-ffff-ffff-ffffffffffff"),
+ // SystemData: &armmongocluster.SystemData{
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-06T04:00:25.0509765Z"); return t}()),
+ // CreatedBy: to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff"),
+ // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeApplication),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-06T04:00:25.0509765Z"); return t}()),
+ // LastModifiedBy: to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff"),
+ // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeApplication),
+ // },
+ // Properties: &armmongocluster.PrivateEndpointConnectionProperties{
+ // PrivateEndpoint: &armmongocluster.PrivateEndpoint{
+ // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.Network/privateEndpoints/mymongocluster-pe"),
+ // },
+ // GroupIDs: []*string{
+ // to.Ptr("MongoCluster"),
+ // },
+ // PrivateLinkServiceConnectionState: &armmongocluster.PrivateLinkServiceConnectionState{
+ // Status: to.Ptr(armmongocluster.PrivateEndpointServiceConnectionStatusApproved),
+ // Description: to.Ptr("Auto-approved"),
+ // ActionsRequired: to.Ptr("None"),
+ // },
+ // },
+ // },
+ // },
+ // PreviewFeatures: []*armmongocluster.PreviewFeature{
+ // },
+ // InfrastructureVersion: to.Ptr("2.0"),
+ // PublicNetworkAccess: to.Ptr(armmongocluster.PublicNetworkAccessDisabled),
+ // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"),
+ // Replica: &armmongocluster.ReplicationProperties{
+ // ReplicationState: to.Ptr(armmongocluster.ReplicationStateActive),
+ // Role: to.Ptr(armmongocluster.ReplicationRolePrimary),
+ // },
+ // DataAPI: &armmongocluster.DataAPIProperties{
+ // Mode: to.Ptr(armmongocluster.DataAPIModeEnabled),
+ // },
+ // },
+ // Location: to.Ptr("westus2"),
+ // },
+ // }
+}
+
+// Generated from example definition: 2024-10-01-preview/MongoClusters_PatchDiskSize.json
func ExampleMongoClustersClient_BeginUpdate_updatesTheDiskSizeOnAMongoClusterResource() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -782,13 +911,16 @@ func ExampleMongoClustersClient_BeginUpdate_updatesTheDiskSizeOnAMongoClusterRes
// ReplicationState: to.Ptr(armmongocluster.ReplicationStateActive),
// Role: to.Ptr(armmongocluster.ReplicationRolePrimary),
// },
+ // DataAPI: &armmongocluster.DataAPIProperties{
+ // Mode: to.Ptr(armmongocluster.DataAPIModeDisabled),
+ // },
// },
// Location: to.Ptr("westus2"),
// },
// }
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_PatchPrivateNetworkAccess.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_PatchPrivateNetworkAccess.json
func ExampleMongoClustersClient_BeginUpdate_disablesPublicNetworkAccessOnAMongoClusterResourceWithAPrivateEndpointConnection() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -882,13 +1014,16 @@ func ExampleMongoClustersClient_BeginUpdate_disablesPublicNetworkAccessOnAMongoC
// ReplicationState: to.Ptr(armmongocluster.ReplicationStateActive),
// Role: to.Ptr(armmongocluster.ReplicationRolePrimary),
// },
+ // DataAPI: &armmongocluster.DataAPIProperties{
+ // Mode: to.Ptr(armmongocluster.DataAPIModeDisabled),
+ // },
// },
// Location: to.Ptr("westus2"),
// },
// }
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_ResetPassword.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_ResetPassword.json
func ExampleMongoClustersClient_BeginUpdate_resetsTheAdministratorLoginPassword() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -959,13 +1094,16 @@ func ExampleMongoClustersClient_BeginUpdate_resetsTheAdministratorLoginPassword(
// ReplicationState: to.Ptr(armmongocluster.ReplicationStateActive),
// Role: to.Ptr(armmongocluster.ReplicationRolePrimary),
// },
+ // DataAPI: &armmongocluster.DataAPIProperties{
+ // Mode: to.Ptr(armmongocluster.DataAPIModeDisabled),
+ // },
// },
// Location: to.Ptr("westus2"),
// },
// }
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_Update.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_Update.json
func ExampleMongoClustersClient_BeginUpdate_updatesAMongoClusterResource() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -1051,6 +1189,9 @@ func ExampleMongoClustersClient_BeginUpdate_updatesAMongoClusterResource() {
// ReplicationState: to.Ptr(armmongocluster.ReplicationStateActive),
// Role: to.Ptr(armmongocluster.ReplicationRolePrimary),
// },
+ // DataAPI: &armmongocluster.DataAPIProperties{
+ // Mode: to.Ptr(armmongocluster.DataAPIModeDisabled),
+ // },
// },
// Location: to.Ptr("westus2"),
// },
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/operations_client.go b/sdk/resourcemanager/mongocluster/armmongocluster/operations_client.go
index 92c1aa08839c..9de73877bc54 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/operations_client.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/operations_client.go
@@ -35,7 +35,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO
// NewListPager - List the operations for the provider
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] {
return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{
@@ -68,7 +68,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *Operat
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/operations_client_example_test.go b/sdk/resourcemanager/mongocluster/armmongocluster/operations_client_example_test.go
index 560fc23c093a..8d1d7e995c38 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/operations_client_example_test.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/operations_client_example_test.go
@@ -11,7 +11,7 @@ import (
"log"
)
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/Operations_List.json
+// Generated from example definition: 2024-10-01-preview/Operations_List.json
func ExampleOperationsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/privateendpointconnections_client.go b/sdk/resourcemanager/mongocluster/armmongocluster/privateendpointconnections_client.go
index 4a4bce2e5469..1faa32d0199a 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/privateendpointconnections_client.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/privateendpointconnections_client.go
@@ -42,7 +42,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor
// BeginCreate - Create a Private endpoint connection
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource.
@@ -70,7 +70,7 @@ func (client *PrivateEndpointConnectionsClient) BeginCreate(ctx context.Context,
// Create - Create a Private endpoint connection
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
func (client *PrivateEndpointConnectionsClient) create(ctx context.Context, resourceGroupName string, mongoClusterName string, privateEndpointConnectionName string, resource PrivateEndpointConnectionResource, options *PrivateEndpointConnectionsClientBeginCreateOptions) (*http.Response, error) {
var err error
const operationName = "PrivateEndpointConnectionsClient.BeginCreate"
@@ -116,7 +116,7 @@ func (client *PrivateEndpointConnectionsClient) createCreateRequest(ctx context.
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
req.Raw().Header["Content-Type"] = []string{"application/json"}
@@ -129,7 +129,7 @@ func (client *PrivateEndpointConnectionsClient) createCreateRequest(ctx context.
// BeginDelete - Delete the private endpoint connection
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource.
@@ -155,7 +155,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context,
// Delete - Delete the private endpoint connection
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, mongoClusterName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) {
var err error
const operationName = "PrivateEndpointConnectionsClient.BeginDelete"
@@ -201,7 +201,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -210,7 +210,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.
// Get - Get a specific private connection
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource.
@@ -262,7 +262,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -279,7 +279,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res
// NewListByMongoClusterPager - List existing private connections
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - options - PrivateEndpointConnectionsClientListByMongoClusterOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByMongoClusterPager
@@ -327,7 +327,7 @@ func (client *PrivateEndpointConnectionsClient) listByMongoClusterCreateRequest(
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/mongocluster/armmongocluster/privateendpointconnections_client_example_test.go
index 9f27e134b3ee..b74c02aa22ea 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/privateendpointconnections_client_example_test.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/privateendpointconnections_client_example_test.go
@@ -12,7 +12,7 @@ import (
"log"
)
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_PrivateEndpointConnectionPut.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionPut.json
func ExamplePrivateEndpointConnectionsClient_BeginCreate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -72,7 +72,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginCreate() {
// }
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_PrivateEndpointConnectionDelete.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionDelete.json
func ExamplePrivateEndpointConnectionsClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -93,7 +93,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginDelete() {
}
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_PrivateEndpointConnectionGet.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionGet.json
func ExamplePrivateEndpointConnectionsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
@@ -142,7 +142,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() {
// }
}
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_PrivateEndpointConnectionList.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionList.json
func ExamplePrivateEndpointConnectionsClient_NewListByMongoClusterPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/privatelinks_client.go b/sdk/resourcemanager/mongocluster/armmongocluster/privatelinks_client.go
index 840e98926789..00f3482c0faf 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/privatelinks_client.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/privatelinks_client.go
@@ -41,7 +41,7 @@ func NewPrivateLinksClient(subscriptionID string, credential azcore.TokenCredent
// NewListByMongoClusterPager - list private links on the given resource
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - options - PrivateLinksClientListByMongoClusterOptions contains the optional parameters for the PrivateLinksClient.NewListByMongoClusterPager
@@ -89,7 +89,7 @@ func (client *PrivateLinksClient) listByMongoClusterCreateRequest(ctx context.Co
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/privatelinks_client_example_test.go b/sdk/resourcemanager/mongocluster/armmongocluster/privatelinks_client_example_test.go
index 70399d79c0ad..22e24167562e 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/privatelinks_client_example_test.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/privatelinks_client_example_test.go
@@ -11,7 +11,7 @@ import (
"log"
)
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_PrivateLinkResourceList.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_PrivateLinkResourceList.json
func ExamplePrivateLinksClient_NewListByMongoClusterPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/replicas_client.go b/sdk/resourcemanager/mongocluster/armmongocluster/replicas_client.go
index 61edf522a6f5..03b5b293df44 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/replicas_client.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/replicas_client.go
@@ -41,7 +41,7 @@ func NewReplicasClient(subscriptionID string, credential azcore.TokenCredential,
// NewListByParentPager - List all the replicas for the mongo cluster.
//
-// Generated from API version 2024-07-01
+// Generated from API version 2024-10-01-preview
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - mongoClusterName - The name of the mongo cluster.
// - options - ReplicasClientListByParentOptions contains the optional parameters for the ReplicasClient.NewListByParentPager
@@ -89,7 +89,7 @@ func (client *ReplicasClient) listByParentCreateRequest(ctx context.Context, res
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2024-07-01")
+ reqQP.Set("api-version", "2024-10-01-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/replicas_client_example_test.go b/sdk/resourcemanager/mongocluster/armmongocluster/replicas_client_example_test.go
index 30c3f632e55f..49bbf366e086 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/replicas_client_example_test.go
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/replicas_client_example_test.go
@@ -11,7 +11,7 @@ import (
"log"
)
-// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_ReplicaList.json
+// Generated from example definition: 2024-10-01-preview/MongoClusters_ReplicaList.json
func ExampleReplicasClient_NewListByParentPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
diff --git a/sdk/resourcemanager/mongocluster/armmongocluster/tsp-location.yaml b/sdk/resourcemanager/mongocluster/armmongocluster/tsp-location.yaml
index efed7142ec15..01993d153c08 100644
--- a/sdk/resourcemanager/mongocluster/armmongocluster/tsp-location.yaml
+++ b/sdk/resourcemanager/mongocluster/armmongocluster/tsp-location.yaml
@@ -1,4 +1,4 @@
directory: specification/mongocluster/DocumentDB.MongoCluster.Management
-commit: 02ff8f08a132a5a68fcdd48da118e36e5ececc3d
+commit: 676334a284e5136f0a0721d6ae844bb04332f579
repo: Azure/azure-rest-api-specs
-additionalDirectories:
+additionalDirectories:
\ No newline at end of file
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/CHANGELOG.md b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/CHANGELOG.md
index b1718bc8b92b..a7ad4b7dc158 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/CHANGELOG.md
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/CHANGELOG.md
@@ -1,5 +1,259 @@
# Release History
+## 1.0.0 (2025-02-27)
+### Breaking Changes
+
+- Function `*ProtectedItemClient.BeginPlannedFailover` parameter(s) have been changed from `(context.Context, string, string, string, *ProtectedItemClientBeginPlannedFailoverOptions)` to `(context.Context, string, string, string, PlannedFailoverModel, *ProtectedItemClientBeginPlannedFailoverOptions)`
+- Type of `EmailConfigurationModel.SystemData` has been changed from `*EmailConfigurationModelSystemData` to `*SystemData`
+- Type of `EventModel.SystemData` has been changed from `*EventModelSystemData` to `*SystemData`
+- Type of `FabricModel.SystemData` has been changed from `*FabricModelSystemData` to `*SystemData`
+- Type of `FabricModelUpdate.SystemData` has been changed from `*FabricModelUpdateSystemData` to `*SystemData`
+- Type of `PolicyModel.SystemData` has been changed from `*PolicyModelSystemData` to `*SystemData`
+- Type of `ProtectedItemModel.SystemData` has been changed from `*ProtectedItemModelSystemData` to `*SystemData`
+- Type of `ProtectedItemModelProperties.CurrentJob` has been changed from `*ProtectedItemModelPropertiesCurrentJob` to `*ProtectedItemJobProperties`
+- Type of `ProtectedItemModelProperties.LastFailedEnableProtectionJob` has been changed from `*ProtectedItemModelPropertiesLastFailedEnableProtectionJob` to `*ProtectedItemJobProperties`
+- Type of `ProtectedItemModelProperties.LastFailedPlannedFailoverJob` has been changed from `*ProtectedItemModelPropertiesLastFailedPlannedFailoverJob` to `*ProtectedItemJobProperties`
+- Type of `ProtectedItemModelProperties.LastTestFailoverJob` has been changed from `*ProtectedItemModelPropertiesLastTestFailoverJob` to `*ProtectedItemJobProperties`
+- Type of `RecoveryPointModel.SystemData` has been changed from `*RecoveryPointModelSystemData` to `*SystemData`
+- Type of `ReplicationExtensionModel.SystemData` has been changed from `*ReplicationExtensionModelSystemData` to `*SystemData`
+- Type of `VaultModel.SystemData` has been changed from `*VaultModelSystemData` to `*SystemData`
+- Type of `VaultModelUpdate.SystemData` has been changed from `*VaultModelUpdateSystemData` to `*SystemData`
+- Enum `WorkflowObjectType` has been removed
+- Enum `WorkflowState` has been removed
+- Function `NewAzureSiteRecoveryManagementServiceAPIClient` has been removed
+- Function `*AzureSiteRecoveryManagementServiceAPIClient.CheckNameAvailability` has been removed
+- Function `*AzureSiteRecoveryManagementServiceAPIClient.DeploymentPreflight` has been removed
+- Function `*ClientFactory.NewAzureSiteRecoveryManagementServiceAPIClient` has been removed
+- Function `*ClientFactory.NewDraClient` has been removed
+- Function `*ClientFactory.NewDraOperationStatusClient` has been removed
+- Function `*ClientFactory.NewFabricOperationsStatusClient` has been removed
+- Function `*ClientFactory.NewPolicyOperationStatusClient` has been removed
+- Function `*ClientFactory.NewProtectedItemOperationStatusClient` has been removed
+- Function `*ClientFactory.NewRecoveryPointsClient` has been removed
+- Function `*ClientFactory.NewReplicationExtensionOperationStatusClient` has been removed
+- Function `*ClientFactory.NewVaultOperationStatusClient` has been removed
+- Function `*ClientFactory.NewWorkflowClient` has been removed
+- Function `*ClientFactory.NewWorkflowOperationStatusClient` has been removed
+- Function `NewDraClient` has been removed
+- Function `*DraClient.BeginCreate` has been removed
+- Function `*DraClient.BeginDelete` has been removed
+- Function `*DraClient.Get` has been removed
+- Function `*DraClient.NewListPager` has been removed
+- Function `*DraModelCustomProperties.GetDraModelCustomProperties` has been removed
+- Function `NewDraOperationStatusClient` has been removed
+- Function `*DraOperationStatusClient.Get` has been removed
+- Function `NewFabricOperationsStatusClient` has been removed
+- Function `*FabricOperationsStatusClient.Get` has been removed
+- Function `*FailoverWorkflowModelCustomProperties.GetWorkflowModelCustomProperties` has been removed
+- Function `NewPolicyOperationStatusClient` has been removed
+- Function `*PolicyOperationStatusClient.Get` has been removed
+- Function `NewProtectedItemOperationStatusClient` has been removed
+- Function `*ProtectedItemOperationStatusClient.Get` has been removed
+- Function `NewRecoveryPointsClient` has been removed
+- Function `*RecoveryPointsClient.Get` has been removed
+- Function `*RecoveryPointsClient.NewListPager` has been removed
+- Function `NewReplicationExtensionOperationStatusClient` has been removed
+- Function `*ReplicationExtensionOperationStatusClient.Get` has been removed
+- Function `*TestFailoverCleanupWorkflowModelCustomProperties.GetWorkflowModelCustomProperties` has been removed
+- Function `*TestFailoverWorkflowModelCustomProperties.GetWorkflowModelCustomProperties` has been removed
+- Function `*VMwareDraModelCustomProperties.GetDraModelCustomProperties` has been removed
+- Function `NewVaultOperationStatusClient` has been removed
+- Function `*VaultOperationStatusClient.Get` has been removed
+- Function `NewWorkflowClient` has been removed
+- Function `*WorkflowClient.Get` has been removed
+- Function `*WorkflowClient.NewListPager` has been removed
+- Function `*WorkflowModelCustomProperties.GetWorkflowModelCustomProperties` has been removed
+- Function `NewWorkflowOperationStatusClient` has been removed
+- Function `*WorkflowOperationStatusClient.Get` has been removed
+- Struct `DraModel` has been removed
+- Struct `DraModelCollection` has been removed
+- Struct `DraModelProperties` has been removed
+- Struct `DraModelSystemData` has been removed
+- Struct `EmailConfigurationModelCollection` has been removed
+- Struct `EmailConfigurationModelSystemData` has been removed
+- Struct `EventModelCollection` has been removed
+- Struct `EventModelSystemData` has been removed
+- Struct `FabricModelCollection` has been removed
+- Struct `FabricModelSystemData` has been removed
+- Struct `FabricModelUpdateSystemData` has been removed
+- Struct `FailoverWorkflowModelCustomProperties` has been removed
+- Struct `PolicyModelCollection` has been removed
+- Struct `PolicyModelSystemData` has been removed
+- Struct `ProtectedItemModelCollection` has been removed
+- Struct `ProtectedItemModelPropertiesCurrentJob` has been removed
+- Struct `ProtectedItemModelPropertiesLastFailedEnableProtectionJob` has been removed
+- Struct `ProtectedItemModelPropertiesLastFailedPlannedFailoverJob` has been removed
+- Struct `ProtectedItemModelPropertiesLastTestFailoverJob` has been removed
+- Struct `ProtectedItemModelSystemData` has been removed
+- Struct `RecoveryPointModelCollection` has been removed
+- Struct `RecoveryPointModelSystemData` has been removed
+- Struct `ReplicationExtensionModelCollection` has been removed
+- Struct `ReplicationExtensionModelSystemData` has been removed
+- Struct `TestFailoverCleanupWorkflowModelCustomProperties` has been removed
+- Struct `TestFailoverWorkflowModelCustomProperties` has been removed
+- Struct `VMwareDraModelCustomProperties` has been removed
+- Struct `VaultModelCollection` has been removed
+- Struct `VaultModelSystemData` has been removed
+- Struct `VaultModelUpdateSystemData` has been removed
+- Struct `WorkflowModel` has been removed
+- Struct `WorkflowModelCollection` has been removed
+- Struct `WorkflowModelProperties` has been removed
+- Struct `WorkflowModelSystemData` has been removed
+- Field `EmailConfigurationModelCollection` of struct `EmailConfigurationClientListResponse` has been removed
+- Field `Filter` of struct `EventClientListOptions` has been removed
+- Field `EventModelCollection` of struct `EventClientListResponse` has been removed
+- Field `ContinuationToken` of struct `FabricClientListBySubscriptionOptions` has been removed
+- Field `FabricModelCollection` of struct `FabricClientListBySubscriptionResponse` has been removed
+- Field `FabricModelCollection` of struct `FabricClientListResponse` has been removed
+- Field `SourceDraName`, `TargetDraName` of struct `HyperVToAzStackHCIProtectedItemModelCustomProperties` has been removed
+- Field `PolicyModelCollection` of struct `PolicyClientListResponse` has been removed
+- Field `Body` of struct `ProtectedItemClientBeginPlannedFailoverOptions` has been removed
+- Field `ProtectedItemModelCollection` of struct `ProtectedItemClientListResponse` has been removed
+- Field `DraID`, `TargetDraID` of struct `ProtectedItemModelProperties` has been removed
+- Field `ReplicationExtensionModelCollection` of struct `ReplicationExtensionClientListResponse` has been removed
+- Field `ChildrenWorkflows` of struct `TaskModel` has been removed
+- Field `SourceDraName`, `TargetDraName` of struct `VMwareToAzStackHCIProtectedItemModelCustomProperties` has been removed
+- Field `ContinuationToken` of struct `VaultClientListBySubscriptionOptions` has been removed
+- Field `VaultModelCollection` of struct `VaultClientListBySubscriptionResponse` has been removed
+- Field `VaultModelCollection` of struct `VaultClientListResponse` has been removed
+
+### Features Added
+
+- New enum type `CreatedByType` with values `CreatedByTypeApplication`, `CreatedByTypeKey`, `CreatedByTypeManagedIdentity`, `CreatedByTypeUser`
+- New enum type `JobObjectType` with values `JobObjectTypeAvsDiskPool`, `JobObjectTypeFabric`, `JobObjectTypeFabricAgent`, `JobObjectTypePolicy`, `JobObjectTypeProtectedItem`, `JobObjectTypeRecoveryPlan`, `JobObjectTypeReplicationExtension`, `JobObjectTypeVault`
+- New enum type `JobState` with values `JobStateCancelled`, `JobStateCancelling`, `JobStateCompletedWithErrors`, `JobStateCompletedWithInformation`, `JobStateCompletedWithWarnings`, `JobStateFailed`, `JobStatePending`, `JobStateStarted`, `JobStateSucceeded`
+- New enum type `ManagedServiceIdentityType` with values `ManagedServiceIdentityTypeNone`, `ManagedServiceIdentityTypeSystemAssigned`, `ManagedServiceIdentityTypeSystemAssignedUserAssigned`, `ManagedServiceIdentityTypeUserAssigned`
+- New enum type `PrivateEndpointConnectionStatus` with values `PrivateEndpointConnectionStatusApproved`, `PrivateEndpointConnectionStatusDisconnected`, `PrivateEndpointConnectionStatusPending`, `PrivateEndpointConnectionStatusRejected`
+- New enum type `VaultIdentityType` with values `VaultIdentityTypeNone`, `VaultIdentityTypeSystemAssigned`, `VaultIdentityTypeUserAssigned`
+- New function `NewCheckNameAvailabilityClient(string, azcore.TokenCredential, *arm.ClientOptions) (*CheckNameAvailabilityClient, error)`
+- New function `*CheckNameAvailabilityClient.Post(context.Context, string, *CheckNameAvailabilityClientPostOptions) (CheckNameAvailabilityClientPostResponse, error)`
+- New function `*ClientFactory.NewCheckNameAvailabilityClient() *CheckNameAvailabilityClient`
+- New function `*ClientFactory.NewDeploymentPreflightClient() *DeploymentPreflightClient`
+- New function `*ClientFactory.NewFabricAgentClient() *FabricAgentClient`
+- New function `*ClientFactory.NewJobClient() *JobClient`
+- New function `*ClientFactory.NewOperationResultsClient() *OperationResultsClient`
+- New function `*ClientFactory.NewPrivateEndpointConnectionProxiesClient() *PrivateEndpointConnectionProxiesClient`
+- New function `*ClientFactory.NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient`
+- New function `*ClientFactory.NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient`
+- New function `*ClientFactory.NewRecoveryPointClient() *RecoveryPointClient`
+- New function `NewDeploymentPreflightClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DeploymentPreflightClient, error)`
+- New function `*DeploymentPreflightClient.Post(context.Context, string, string, *DeploymentPreflightClientPostOptions) (DeploymentPreflightClientPostResponse, error)`
+- New function `NewFabricAgentClient(string, azcore.TokenCredential, *arm.ClientOptions) (*FabricAgentClient, error)`
+- New function `*FabricAgentClient.BeginCreate(context.Context, string, string, string, FabricAgentModel, *FabricAgentClientBeginCreateOptions) (*runtime.Poller[FabricAgentClientCreateResponse], error)`
+- New function `*FabricAgentClient.BeginDelete(context.Context, string, string, string, *FabricAgentClientBeginDeleteOptions) (*runtime.Poller[FabricAgentClientDeleteResponse], error)`
+- New function `*FabricAgentClient.Get(context.Context, string, string, string, *FabricAgentClientGetOptions) (FabricAgentClientGetResponse, error)`
+- New function `*FabricAgentClient.NewListPager(string, string, *FabricAgentClientListOptions) *runtime.Pager[FabricAgentClientListResponse]`
+- New function `*FabricAgentModelCustomProperties.GetFabricAgentModelCustomProperties() *FabricAgentModelCustomProperties`
+- New function `*FailoverJobModelCustomProperties.GetJobModelCustomProperties() *JobModelCustomProperties`
+- New function `*HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate.GetProtectedItemModelCustomPropertiesUpdate() *ProtectedItemModelCustomPropertiesUpdate`
+- New function `NewJobClient(string, azcore.TokenCredential, *arm.ClientOptions) (*JobClient, error)`
+- New function `*JobClient.Get(context.Context, string, string, string, *JobClientGetOptions) (JobClientGetResponse, error)`
+- New function `*JobClient.NewListPager(string, string, *JobClientListOptions) *runtime.Pager[JobClientListResponse]`
+- New function `*JobModelCustomProperties.GetJobModelCustomProperties() *JobModelCustomProperties`
+- New function `NewOperationResultsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*OperationResultsClient, error)`
+- New function `*OperationResultsClient.Get(context.Context, string, string, *OperationResultsClientGetOptions) (OperationResultsClientGetResponse, error)`
+- New function `NewPrivateEndpointConnectionProxiesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PrivateEndpointConnectionProxiesClient, error)`
+- New function `*PrivateEndpointConnectionProxiesClient.Create(context.Context, string, string, string, PrivateEndpointConnectionProxy, *PrivateEndpointConnectionProxiesClientCreateOptions) (PrivateEndpointConnectionProxiesClientCreateResponse, error)`
+- New function `*PrivateEndpointConnectionProxiesClient.BeginDelete(context.Context, string, string, string, *PrivateEndpointConnectionProxiesClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionProxiesClientDeleteResponse], error)`
+- New function `*PrivateEndpointConnectionProxiesClient.Get(context.Context, string, string, string, *PrivateEndpointConnectionProxiesClientGetOptions) (PrivateEndpointConnectionProxiesClientGetResponse, error)`
+- New function `*PrivateEndpointConnectionProxiesClient.NewListPager(string, string, *PrivateEndpointConnectionProxiesClientListOptions) *runtime.Pager[PrivateEndpointConnectionProxiesClientListResponse]`
+- New function `*PrivateEndpointConnectionProxiesClient.Validate(context.Context, string, string, string, PrivateEndpointConnectionProxy, *PrivateEndpointConnectionProxiesClientValidateOptions) (PrivateEndpointConnectionProxiesClientValidateResponse, error)`
+- New function `NewPrivateEndpointConnectionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error)`
+- New function `*PrivateEndpointConnectionsClient.BeginDelete(context.Context, string, string, string, *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)`
+- New function `*PrivateEndpointConnectionsClient.Get(context.Context, string, string, string, *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error)`
+- New function `*PrivateEndpointConnectionsClient.NewListPager(string, string, *PrivateEndpointConnectionsClientListOptions) *runtime.Pager[PrivateEndpointConnectionsClientListResponse]`
+- New function `*PrivateEndpointConnectionsClient.Update(context.Context, string, string, string, PrivateEndpointConnection, *PrivateEndpointConnectionsClientUpdateOptions) (PrivateEndpointConnectionsClientUpdateResponse, error)`
+- New function `NewPrivateLinkResourcesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PrivateLinkResourcesClient, error)`
+- New function `*PrivateLinkResourcesClient.Get(context.Context, string, string, string, *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error)`
+- New function `*PrivateLinkResourcesClient.NewListPager(string, string, *PrivateLinkResourcesClientListOptions) *runtime.Pager[PrivateLinkResourcesClientListResponse]`
+- New function `*ProtectedItemClient.BeginUpdate(context.Context, string, string, string, ProtectedItemModelUpdate, *ProtectedItemClientBeginUpdateOptions) (*runtime.Poller[ProtectedItemClientUpdateResponse], error)`
+- New function `*ProtectedItemModelCustomPropertiesUpdate.GetProtectedItemModelCustomPropertiesUpdate() *ProtectedItemModelCustomPropertiesUpdate`
+- New function `NewRecoveryPointClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RecoveryPointClient, error)`
+- New function `*RecoveryPointClient.Get(context.Context, string, string, string, string, *RecoveryPointClientGetOptions) (RecoveryPointClientGetResponse, error)`
+- New function `*RecoveryPointClient.NewListPager(string, string, string, *RecoveryPointClientListOptions) *runtime.Pager[RecoveryPointClientListResponse]`
+- New function `*TestFailoverCleanupJobModelCustomProperties.GetJobModelCustomProperties() *JobModelCustomProperties`
+- New function `*TestFailoverJobModelCustomProperties.GetJobModelCustomProperties() *JobModelCustomProperties`
+- New function `*VMwareFabricAgentModelCustomProperties.GetFabricAgentModelCustomProperties() *FabricAgentModelCustomProperties`
+- New function `*VMwareToAzStackHCIEventModelCustomProperties.GetEventModelCustomProperties() *EventModelCustomProperties`
+- New function `*VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate.GetProtectedItemModelCustomPropertiesUpdate() *ProtectedItemModelCustomPropertiesUpdate`
+- New function `*VMwareToAzStackHCIRecoveryPointModelCustomProperties.GetRecoveryPointModelCustomProperties() *RecoveryPointModelCustomProperties`
+- New struct `ConnectionDetails`
+- New struct `DiskControllerInputs`
+- New struct `EmailConfigurationModelListResult`
+- New struct `EventModelListResult`
+- New struct `FabricAgentModel`
+- New struct `FabricAgentModelListResult`
+- New struct `FabricAgentModelProperties`
+- New struct `FabricModelListResult`
+- New struct `FailoverJobModelCustomProperties`
+- New struct `GroupConnectivityInformation`
+- New struct `HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate`
+- New struct `JobModel`
+- New struct `JobModelCustomPropertiesAffectedObjectDetails`
+- New struct `JobModelListResult`
+- New struct `JobModelProperties`
+- New struct `ManagedServiceIdentity`
+- New struct `PolicyModelListResult`
+- New struct `PrivateEndpoint`
+- New struct `PrivateEndpointConnection`
+- New struct `PrivateEndpointConnectionListResult`
+- New struct `PrivateEndpointConnectionProxy`
+- New struct `PrivateEndpointConnectionProxyListResult`
+- New struct `PrivateEndpointConnectionProxyProperties`
+- New struct `PrivateEndpointConnectionResponseProperties`
+- New struct `PrivateLinkResource`
+- New struct `PrivateLinkResourceListResult`
+- New struct `PrivateLinkResourceProperties`
+- New struct `PrivateLinkServiceConnection`
+- New struct `PrivateLinkServiceConnectionState`
+- New struct `PrivateLinkServiceProxy`
+- New struct `ProtectedItemJobProperties`
+- New struct `ProtectedItemModelListResult`
+- New struct `ProtectedItemModelPropertiesUpdate`
+- New struct `ProtectedItemModelUpdate`
+- New struct `RecoveryPointModelListResult`
+- New struct `RemotePrivateEndpoint`
+- New struct `RemotePrivateEndpointConnection`
+- New struct `ReplicationExtensionModelListResult`
+- New struct `SystemData`
+- New struct `TestFailoverCleanupJobModelCustomProperties`
+- New struct `TestFailoverJobModelCustomProperties`
+- New struct `UserAssignedIdentity`
+- New struct `VMwareFabricAgentModelCustomProperties`
+- New struct `VMwareToAzStackHCIEventModelCustomProperties`
+- New struct `VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate`
+- New struct `VMwareToAzStackHCIRecoveryPointModelCustomProperties`
+- New struct `VaultIdentityModel`
+- New struct `VaultModelListResult`
+- New field `Properties` in struct `DeploymentPreflightResource`
+- New anonymous field `EmailConfigurationModelListResult` in struct `EmailConfigurationClientListResponse`
+- New field `ProvisioningState` in struct `EmailConfigurationModelProperties`
+- New field `OdataOptions`, `PageSize` in struct `EventClientListOptions`
+- New anonymous field `EventModelListResult` in struct `EventClientListResponse`
+- New field `ProvisioningState` in struct `EventModelProperties`
+- New anonymous field `FabricModelListResult` in struct `FabricClientListBySubscriptionResponse`
+- New anonymous field `FabricModelListResult` in struct `FabricClientListResponse`
+- New field `DiskBlockSize`, `DiskController`, `DiskIdentifier`, `DiskLogicalSectorSize`, `DiskPhysicalSectorSize` in struct `HyperVToAzStackHCIDiskInput`
+- New field `IsMacMigrationEnabled`, `IsStaticIPMigrationEnabled` in struct `HyperVToAzStackHCINicInput`
+- New field `DiskBlockSize`, `DiskLogicalSectorSize`, `DiskPhysicalSectorSize` in struct `HyperVToAzStackHCIProtectedDiskProperties`
+- New field `SourceFabricAgentName`, `TargetFabricAgentName` in struct `HyperVToAzStackHCIProtectedItemModelCustomProperties`
+- New anonymous field `PolicyModelListResult` in struct `PolicyClientListResponse`
+- New field `ContinuationToken`, `OdataOptions`, `PageSize` in struct `ProtectedItemClientListOptions`
+- New anonymous field `ProtectedItemModelListResult` in struct `ProtectedItemClientListResponse`
+- New field `FabricAgentID`, `TargetFabricAgentID` in struct `ProtectedItemModelProperties`
+- New field `ProvisioningState` in struct `RecoveryPointModelProperties`
+- New anonymous field `ReplicationExtensionModelListResult` in struct `ReplicationExtensionClientListResponse`
+- New field `ChildrenJobs` in struct `TaskModel`
+- New field `DiskBlockSize`, `DiskController`, `DiskIdentifier`, `DiskLogicalSectorSize`, `DiskPhysicalSectorSize` in struct `VMwareToAzStackHCIDiskInput`
+- New field `IsMacMigrationEnabled`, `IsStaticIPMigrationEnabled` in struct `VMwareToAzStackHCINicInput`
+- New field `DiskBlockSize`, `DiskLogicalSectorSize`, `DiskPhysicalSectorSize` in struct `VMwareToAzStackHCIProtectedDiskProperties`
+- New field `SourceFabricAgentName`, `TargetFabricAgentName` in struct `VMwareToAzStackHCIProtectedItemModelCustomProperties`
+- New anonymous field `VaultModelListResult` in struct `VaultClientListBySubscriptionResponse`
+- New anonymous field `VaultModelListResult` in struct `VaultClientListResponse`
+- New field `Identity` in struct `VaultModel`
+- New field `Identity` in struct `VaultModelUpdate`
+
+
## 0.2.0 (2023-11-24)
### Features Added
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/README.md b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/README.md
index 8b606b67d68d..dc9d153c496b 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/README.md
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/README.md
@@ -55,7 +55,7 @@ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory( see https://aka.ms/autorest
-
-``` yaml
-azure-arm: true
-require:
-- https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/readme.md
-- https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/readme.go.md
-license-header: MICROSOFT_MIT_NO_VERSION
-module-version: 0.2.0
-tag: package-2021-02-16-preview
-```
\ No newline at end of file
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/azuresiterecoverymanagementserviceapi_client.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/azuresiterecoverymanagementserviceapi_client.go
deleted file mode 100644
index 2a3e44d70258..000000000000
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/azuresiterecoverymanagementserviceapi_client.go
+++ /dev/null
@@ -1,181 +0,0 @@
-//go:build go1.18
-// +build go1.18
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-package armrecoveryservicesdatareplication
-
-import (
- "context"
- "errors"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
- "net/http"
- "net/url"
- "strings"
-)
-
-// AzureSiteRecoveryManagementServiceAPIClient contains the methods for the AzureSiteRecoveryManagementServiceAPI group.
-// Don't use this type directly, use NewAzureSiteRecoveryManagementServiceAPIClient() instead.
-type AzureSiteRecoveryManagementServiceAPIClient struct {
- internal *arm.Client
- subscriptionID string
-}
-
-// NewAzureSiteRecoveryManagementServiceAPIClient creates a new instance of AzureSiteRecoveryManagementServiceAPIClient with the specified values.
-// - subscriptionID - The ID of the target subscription. The value must be an UUID.
-// - credential - used to authorize requests. Usually a credential from azidentity.
-// - options - pass nil to accept the default values.
-func NewAzureSiteRecoveryManagementServiceAPIClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureSiteRecoveryManagementServiceAPIClient, error) {
- cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
- if err != nil {
- return nil, err
- }
- client := &AzureSiteRecoveryManagementServiceAPIClient{
- subscriptionID: subscriptionID,
- internal: cl,
- }
- return client, nil
-}
-
-// CheckNameAvailability - Checks the resource name availability.
-// If the operation fails it returns an *azcore.ResponseError type.
-//
-// Generated from API version 2021-02-16-preview
-// - location - The name of the Azure region.
-// - options - AzureSiteRecoveryManagementServiceAPIClientCheckNameAvailabilityOptions contains the optional parameters for
-// the AzureSiteRecoveryManagementServiceAPIClient.CheckNameAvailability method.
-func (client *AzureSiteRecoveryManagementServiceAPIClient) CheckNameAvailability(ctx context.Context, location string, options *AzureSiteRecoveryManagementServiceAPIClientCheckNameAvailabilityOptions) (AzureSiteRecoveryManagementServiceAPIClientCheckNameAvailabilityResponse, error) {
- var err error
- const operationName = "AzureSiteRecoveryManagementServiceAPIClient.CheckNameAvailability"
- ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
- ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
- defer func() { endSpan(err) }()
- req, err := client.checkNameAvailabilityCreateRequest(ctx, location, options)
- if err != nil {
- return AzureSiteRecoveryManagementServiceAPIClientCheckNameAvailabilityResponse{}, err
- }
- httpResp, err := client.internal.Pipeline().Do(req)
- if err != nil {
- return AzureSiteRecoveryManagementServiceAPIClientCheckNameAvailabilityResponse{}, err
- }
- if !runtime.HasStatusCode(httpResp, http.StatusOK) {
- err = runtime.NewResponseError(httpResp)
- return AzureSiteRecoveryManagementServiceAPIClientCheckNameAvailabilityResponse{}, err
- }
- resp, err := client.checkNameAvailabilityHandleResponse(httpResp)
- return resp, err
-}
-
-// checkNameAvailabilityCreateRequest creates the CheckNameAvailability request.
-func (client *AzureSiteRecoveryManagementServiceAPIClient) checkNameAvailabilityCreateRequest(ctx context.Context, location string, options *AzureSiteRecoveryManagementServiceAPIClientCheckNameAvailabilityOptions) (*policy.Request, error) {
- urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability"
- if client.subscriptionID == "" {
- return nil, errors.New("parameter client.subscriptionID cannot be empty")
- }
- urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
- if location == "" {
- return nil, errors.New("parameter location cannot be empty")
- }
- urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
- req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
- if err != nil {
- return nil, err
- }
- reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
- req.Raw().URL.RawQuery = reqQP.Encode()
- req.Raw().Header["Accept"] = []string{"application/json"}
- if options != nil && options.Body != nil {
- if err := runtime.MarshalAsJSON(req, *options.Body); err != nil {
- return nil, err
- }
- return req, nil
- }
- return req, nil
-}
-
-// checkNameAvailabilityHandleResponse handles the CheckNameAvailability response.
-func (client *AzureSiteRecoveryManagementServiceAPIClient) checkNameAvailabilityHandleResponse(resp *http.Response) (AzureSiteRecoveryManagementServiceAPIClientCheckNameAvailabilityResponse, error) {
- result := AzureSiteRecoveryManagementServiceAPIClientCheckNameAvailabilityResponse{}
- if err := runtime.UnmarshalAsJSON(resp, &result.CheckNameAvailabilityResponseModel); err != nil {
- return AzureSiteRecoveryManagementServiceAPIClientCheckNameAvailabilityResponse{}, err
- }
- return result, nil
-}
-
-// DeploymentPreflight - Performs resource deployment validation.
-// If the operation fails it returns an *azcore.ResponseError type.
-//
-// Generated from API version 2021-02-16-preview
-// - resourceGroupName - The name of the resource group. The name is case insensitive.
-// - deploymentID - Deployment Id.
-// - options - AzureSiteRecoveryManagementServiceAPIClientDeploymentPreflightOptions contains the optional parameters for the
-// AzureSiteRecoveryManagementServiceAPIClient.DeploymentPreflight method.
-func (client *AzureSiteRecoveryManagementServiceAPIClient) DeploymentPreflight(ctx context.Context, resourceGroupName string, deploymentID string, options *AzureSiteRecoveryManagementServiceAPIClientDeploymentPreflightOptions) (AzureSiteRecoveryManagementServiceAPIClientDeploymentPreflightResponse, error) {
- var err error
- const operationName = "AzureSiteRecoveryManagementServiceAPIClient.DeploymentPreflight"
- ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
- ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
- defer func() { endSpan(err) }()
- req, err := client.deploymentPreflightCreateRequest(ctx, resourceGroupName, deploymentID, options)
- if err != nil {
- return AzureSiteRecoveryManagementServiceAPIClientDeploymentPreflightResponse{}, err
- }
- httpResp, err := client.internal.Pipeline().Do(req)
- if err != nil {
- return AzureSiteRecoveryManagementServiceAPIClientDeploymentPreflightResponse{}, err
- }
- if !runtime.HasStatusCode(httpResp, http.StatusOK) {
- err = runtime.NewResponseError(httpResp)
- return AzureSiteRecoveryManagementServiceAPIClientDeploymentPreflightResponse{}, err
- }
- resp, err := client.deploymentPreflightHandleResponse(httpResp)
- return resp, err
-}
-
-// deploymentPreflightCreateRequest creates the DeploymentPreflight request.
-func (client *AzureSiteRecoveryManagementServiceAPIClient) deploymentPreflightCreateRequest(ctx context.Context, resourceGroupName string, deploymentID string, options *AzureSiteRecoveryManagementServiceAPIClientDeploymentPreflightOptions) (*policy.Request, error) {
- urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight"
- if client.subscriptionID == "" {
- return nil, errors.New("parameter client.subscriptionID cannot be empty")
- }
- urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
- if resourceGroupName == "" {
- return nil, errors.New("parameter resourceGroupName cannot be empty")
- }
- urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
- if deploymentID == "" {
- return nil, errors.New("parameter deploymentID cannot be empty")
- }
- urlPath = strings.ReplaceAll(urlPath, "{deploymentId}", url.PathEscape(deploymentID))
- req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
- if err != nil {
- return nil, err
- }
- reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
- req.Raw().URL.RawQuery = reqQP.Encode()
- req.Raw().Header["Accept"] = []string{"application/json"}
- if options != nil && options.Body != nil {
- if err := runtime.MarshalAsJSON(req, *options.Body); err != nil {
- return nil, err
- }
- return req, nil
- }
- return req, nil
-}
-
-// deploymentPreflightHandleResponse handles the DeploymentPreflight response.
-func (client *AzureSiteRecoveryManagementServiceAPIClient) deploymentPreflightHandleResponse(resp *http.Response) (AzureSiteRecoveryManagementServiceAPIClientDeploymentPreflightResponse, error) {
- result := AzureSiteRecoveryManagementServiceAPIClientDeploymentPreflightResponse{}
- if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentPreflightModel); err != nil {
- return AzureSiteRecoveryManagementServiceAPIClientDeploymentPreflightResponse{}, err
- }
- return result, nil
-}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/azuresiterecoverymanagementserviceapi_client_example_test.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/azuresiterecoverymanagementserviceapi_client_example_test.go
deleted file mode 100644
index 2af8e81c4f31..000000000000
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/azuresiterecoverymanagementserviceapi_client_example_test.go
+++ /dev/null
@@ -1,86 +0,0 @@
-//go:build go1.18
-// +build go1.18
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-// DO NOT EDIT.
-
-package armrecoveryservicesdatareplication_test
-
-import (
- "context"
- "log"
-
- "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
- "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
- "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication"
-)
-
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/CheckNameAvailability.json
-func ExampleAzureSiteRecoveryManagementServiceAPIClient_CheckNameAvailability() {
- cred, err := azidentity.NewDefaultAzureCredential(nil)
- if err != nil {
- log.Fatalf("failed to obtain a credential: %v", err)
- }
- ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
- if err != nil {
- log.Fatalf("failed to create client: %v", err)
- }
- res, err := clientFactory.NewAzureSiteRecoveryManagementServiceAPIClient().CheckNameAvailability(ctx, "trfqtbtmusswpibw", &armrecoveryservicesdatareplication.AzureSiteRecoveryManagementServiceAPIClientCheckNameAvailabilityOptions{Body: &armrecoveryservicesdatareplication.CheckNameAvailabilityModel{
- Name: to.Ptr("updkdcixs"),
- Type: to.Ptr("gngmcancdauwhdixjjvqnfkvqc"),
- },
- })
- 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.CheckNameAvailabilityResponseModel = armrecoveryservicesdatareplication.CheckNameAvailabilityResponseModel{
- // Message: to.Ptr("gddmrunlrhtuhm"),
- // NameAvailable: to.Ptr(true),
- // Reason: to.Ptr("wwbvswyrmghbmv"),
- // }
-}
-
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/DeploymentPreflight.json
-func ExampleAzureSiteRecoveryManagementServiceAPIClient_DeploymentPreflight() {
- cred, err := azidentity.NewDefaultAzureCredential(nil)
- if err != nil {
- log.Fatalf("failed to obtain a credential: %v", err)
- }
- ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
- if err != nil {
- log.Fatalf("failed to create client: %v", err)
- }
- res, err := clientFactory.NewAzureSiteRecoveryManagementServiceAPIClient().DeploymentPreflight(ctx, "rgrecoveryservicesdatareplication", "kjoiahxljomjcmvabaobumg", &armrecoveryservicesdatareplication.AzureSiteRecoveryManagementServiceAPIClientDeploymentPreflightOptions{Body: &armrecoveryservicesdatareplication.DeploymentPreflightModel{
- Resources: []*armrecoveryservicesdatareplication.DeploymentPreflightResource{
- {
- Name: to.Ptr("xtgugoflfc"),
- Type: to.Ptr("nsnaptduolqcxsikrewvgjbxqpt"),
- APIVersion: to.Ptr("otihymhvzblycdoxo"),
- Location: to.Ptr("cbsgtxkjdzwbyp"),
- }},
- },
- })
- 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.DeploymentPreflightModel = armrecoveryservicesdatareplication.DeploymentPreflightModel{
- // Resources: []*armrecoveryservicesdatareplication.DeploymentPreflightResource{
- // {
- // Name: to.Ptr("xtgugoflfc"),
- // Type: to.Ptr("nsnaptduolqcxsikrewvgjbxqpt"),
- // APIVersion: to.Ptr("otihymhvzblycdoxo"),
- // Location: to.Ptr("cbsgtxkjdzwbyp"),
- // }},
- // }
-}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/build.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/build.go
deleted file mode 100644
index cd5948344dab..000000000000
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/build.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-
-// This file enables 'go generate' to regenerate this specific SDK
-//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate -alwaysSetBodyParamRequired -removeUnreferencedTypes resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication
-
-package armrecoveryservicesdatareplication
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/checknameavailability_client.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/checknameavailability_client.go
new file mode 100644
index 000000000000..75fb4c8569d3
--- /dev/null
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/checknameavailability_client.go
@@ -0,0 +1,109 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armrecoveryservicesdatareplication
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// CheckNameAvailabilityClient contains the methods for the CheckNameAvailability group.
+// Don't use this type directly, use NewCheckNameAvailabilityClient() instead.
+type CheckNameAvailabilityClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewCheckNameAvailabilityClient creates a new instance of CheckNameAvailabilityClient with the specified values.
+// - subscriptionID - The ID of the target subscription. The value must be an UUID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewCheckNameAvailabilityClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CheckNameAvailabilityClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &CheckNameAvailabilityClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Post - Performs the resource name availability check.
+//
+// Checks the resource name availability.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2024-09-01
+// - location - The name of the Azure region.
+// - options - CheckNameAvailabilityClientPostOptions contains the optional parameters for the CheckNameAvailabilityClient.Post
+// method.
+func (client *CheckNameAvailabilityClient) Post(ctx context.Context, location string, options *CheckNameAvailabilityClientPostOptions) (CheckNameAvailabilityClientPostResponse, error) {
+ var err error
+ const operationName = "CheckNameAvailabilityClient.Post"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.postCreateRequest(ctx, location, options)
+ if err != nil {
+ return CheckNameAvailabilityClientPostResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CheckNameAvailabilityClientPostResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CheckNameAvailabilityClientPostResponse{}, err
+ }
+ resp, err := client.postHandleResponse(httpResp)
+ return resp, err
+}
+
+// postCreateRequest creates the Post request.
+func (client *CheckNameAvailabilityClient) postCreateRequest(ctx context.Context, location string, options *CheckNameAvailabilityClientPostOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2024-09-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Body != nil {
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, *options.Body); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// postHandleResponse handles the Post response.
+func (client *CheckNameAvailabilityClient) postHandleResponse(resp *http.Response) (CheckNameAvailabilityClientPostResponse, error) {
+ result := CheckNameAvailabilityClientPostResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CheckNameAvailabilityResponseModel); err != nil {
+ return CheckNameAvailabilityClientPostResponse{}, err
+ }
+ return result, nil
+}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/vaultoperationstatus_client_example_test.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/checknameavailability_client_example_test.go
similarity index 52%
rename from sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/vaultoperationstatus_client_example_test.go
rename to sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/checknameavailability_client_example_test.go
index 19de2a72b6a0..7ff513da7eb9 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/vaultoperationstatus_client_example_test.go
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/checknameavailability_client_example_test.go
@@ -1,45 +1,44 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-// DO NOT EDIT.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armrecoveryservicesdatareplication_test
import (
"context"
- "log"
-
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication"
+ "log"
)
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/VaultOperationStatus_Get.json
-func ExampleVaultOperationStatusClient_Get() {
+// Generated from example definition: 2024-09-01/CheckNameAvailability_Post.json
+func ExampleCheckNameAvailabilityClient_Post() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
- res, err := clientFactory.NewVaultOperationStatusClient().Get(ctx, "rgrecoveryservicesdatareplication", "4", "vsdvwe", nil)
+ res, err := clientFactory.NewCheckNameAvailabilityClient().Post(ctx, "trfqtbtmusswpibw", &CheckNameAvailabilityClientPostOptions{
+ body: &armrecoveryservicesdatareplication.CheckNameAvailabilityModel{
+ Name: to.Ptr("updkdcixs"),
+ Type: to.Ptr("gngmcancdauwhdixjjvqnfkvqc"),
+ }})
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.OperationStatus = armrecoveryservicesdatareplication.OperationStatus{
- // Name: to.Ptr("wzdasptnwlxgobklayoqapjcgcf"),
- // EndTime: to.Ptr("nauyrfh"),
- // ID: to.Ptr("sf"),
- // StartTime: to.Ptr("xuzwmfrhluafmwwsmzqxsytyehsh"),
- // Status: to.Ptr("plbnngzfppdram"),
+ // res = armrecoveryservicesdatareplication.CheckNameAvailabilityClientPostResponse{
+ // CheckNameAvailabilityResponseModel: &armrecoveryservicesdatareplication.CheckNameAvailabilityResponseModel{
+ // NameAvailable: to.Ptr(true),
+ // Reason: to.Ptr("wwbvswyrmghbmv"),
+ // Message: to.Ptr("gddmrunlrhtuhm"),
+ // },
// }
}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/client_factory.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/client_factory.go
index 5524eca60a1b..2f1ce90c9bea 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/client_factory.go
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/client_factory.go
@@ -1,10 +1,6 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armrecoveryservicesdatareplication
@@ -17,8 +13,7 @@ import (
// Don't use this type directly, use NewClientFactory instead.
type ClientFactory struct {
subscriptionID string
- credential azcore.TokenCredential
- options *arm.ClientOptions
+ internal *arm.Client
}
// NewClientFactory creates a new instance of ClientFactory with the specified values.
@@ -27,126 +22,147 @@ type ClientFactory struct {
// - credential - used to authorize requests. Usually a credential from azidentity.
// - options - pass nil to accept the default values.
func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) {
- _, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ internal, err := arm.NewClient(moduleName, moduleVersion, credential, options)
if err != nil {
return nil, err
}
return &ClientFactory{
- subscriptionID: subscriptionID, credential: credential,
- options: options.Clone(),
+ subscriptionID: subscriptionID,
+ internal: internal,
}, nil
}
-// NewAzureSiteRecoveryManagementServiceAPIClient creates a new instance of AzureSiteRecoveryManagementServiceAPIClient.
-func (c *ClientFactory) NewAzureSiteRecoveryManagementServiceAPIClient() *AzureSiteRecoveryManagementServiceAPIClient {
- subClient, _ := NewAzureSiteRecoveryManagementServiceAPIClient(c.subscriptionID, c.credential, c.options)
- return subClient
-}
-
-// NewDraClient creates a new instance of DraClient.
-func (c *ClientFactory) NewDraClient() *DraClient {
- subClient, _ := NewDraClient(c.subscriptionID, c.credential, c.options)
- return subClient
+// NewCheckNameAvailabilityClient creates a new instance of CheckNameAvailabilityClient.
+func (c *ClientFactory) NewCheckNameAvailabilityClient() *CheckNameAvailabilityClient {
+ return &CheckNameAvailabilityClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
}
-// NewDraOperationStatusClient creates a new instance of DraOperationStatusClient.
-func (c *ClientFactory) NewDraOperationStatusClient() *DraOperationStatusClient {
- subClient, _ := NewDraOperationStatusClient(c.subscriptionID, c.credential, c.options)
- return subClient
+// NewDeploymentPreflightClient creates a new instance of DeploymentPreflightClient.
+func (c *ClientFactory) NewDeploymentPreflightClient() *DeploymentPreflightClient {
+ return &DeploymentPreflightClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
}
// NewEmailConfigurationClient creates a new instance of EmailConfigurationClient.
func (c *ClientFactory) NewEmailConfigurationClient() *EmailConfigurationClient {
- subClient, _ := NewEmailConfigurationClient(c.subscriptionID, c.credential, c.options)
- return subClient
+ return &EmailConfigurationClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
}
// NewEventClient creates a new instance of EventClient.
func (c *ClientFactory) NewEventClient() *EventClient {
- subClient, _ := NewEventClient(c.subscriptionID, c.credential, c.options)
- return subClient
+ return &EventClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewFabricAgentClient creates a new instance of FabricAgentClient.
+func (c *ClientFactory) NewFabricAgentClient() *FabricAgentClient {
+ return &FabricAgentClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
}
// NewFabricClient creates a new instance of FabricClient.
func (c *ClientFactory) NewFabricClient() *FabricClient {
- subClient, _ := NewFabricClient(c.subscriptionID, c.credential, c.options)
- return subClient
+ return &FabricClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
}
-// NewFabricOperationsStatusClient creates a new instance of FabricOperationsStatusClient.
-func (c *ClientFactory) NewFabricOperationsStatusClient() *FabricOperationsStatusClient {
- subClient, _ := NewFabricOperationsStatusClient(c.subscriptionID, c.credential, c.options)
- return subClient
+// NewJobClient creates a new instance of JobClient.
+func (c *ClientFactory) NewJobClient() *JobClient {
+ return &JobClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewOperationResultsClient creates a new instance of OperationResultsClient.
+func (c *ClientFactory) NewOperationResultsClient() *OperationResultsClient {
+ return &OperationResultsClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
}
// NewOperationsClient creates a new instance of OperationsClient.
func (c *ClientFactory) NewOperationsClient() *OperationsClient {
- subClient, _ := NewOperationsClient(c.credential, c.options)
- return subClient
+ return &OperationsClient{
+ internal: c.internal,
+ }
}
// NewPolicyClient creates a new instance of PolicyClient.
func (c *ClientFactory) NewPolicyClient() *PolicyClient {
- subClient, _ := NewPolicyClient(c.subscriptionID, c.credential, c.options)
- return subClient
+ return &PolicyClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
}
-// NewPolicyOperationStatusClient creates a new instance of PolicyOperationStatusClient.
-func (c *ClientFactory) NewPolicyOperationStatusClient() *PolicyOperationStatusClient {
- subClient, _ := NewPolicyOperationStatusClient(c.subscriptionID, c.credential, c.options)
- return subClient
+// NewPrivateEndpointConnectionProxiesClient creates a new instance of PrivateEndpointConnectionProxiesClient.
+func (c *ClientFactory) NewPrivateEndpointConnectionProxiesClient() *PrivateEndpointConnectionProxiesClient {
+ return &PrivateEndpointConnectionProxiesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
}
-// NewProtectedItemClient creates a new instance of ProtectedItemClient.
-func (c *ClientFactory) NewProtectedItemClient() *ProtectedItemClient {
- subClient, _ := NewProtectedItemClient(c.subscriptionID, c.credential, c.options)
- return subClient
+// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient.
+func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient {
+ return &PrivateEndpointConnectionsClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
}
-// NewProtectedItemOperationStatusClient creates a new instance of ProtectedItemOperationStatusClient.
-func (c *ClientFactory) NewProtectedItemOperationStatusClient() *ProtectedItemOperationStatusClient {
- subClient, _ := NewProtectedItemOperationStatusClient(c.subscriptionID, c.credential, c.options)
- return subClient
+// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient.
+func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient {
+ return &PrivateLinkResourcesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
}
-// NewRecoveryPointsClient creates a new instance of RecoveryPointsClient.
-func (c *ClientFactory) NewRecoveryPointsClient() *RecoveryPointsClient {
- subClient, _ := NewRecoveryPointsClient(c.subscriptionID, c.credential, c.options)
- return subClient
+// NewProtectedItemClient creates a new instance of ProtectedItemClient.
+func (c *ClientFactory) NewProtectedItemClient() *ProtectedItemClient {
+ return &ProtectedItemClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
}
-// NewReplicationExtensionClient creates a new instance of ReplicationExtensionClient.
-func (c *ClientFactory) NewReplicationExtensionClient() *ReplicationExtensionClient {
- subClient, _ := NewReplicationExtensionClient(c.subscriptionID, c.credential, c.options)
- return subClient
+// NewRecoveryPointClient creates a new instance of RecoveryPointClient.
+func (c *ClientFactory) NewRecoveryPointClient() *RecoveryPointClient {
+ return &RecoveryPointClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
}
-// NewReplicationExtensionOperationStatusClient creates a new instance of ReplicationExtensionOperationStatusClient.
-func (c *ClientFactory) NewReplicationExtensionOperationStatusClient() *ReplicationExtensionOperationStatusClient {
- subClient, _ := NewReplicationExtensionOperationStatusClient(c.subscriptionID, c.credential, c.options)
- return subClient
+// NewReplicationExtensionClient creates a new instance of ReplicationExtensionClient.
+func (c *ClientFactory) NewReplicationExtensionClient() *ReplicationExtensionClient {
+ return &ReplicationExtensionClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
}
// NewVaultClient creates a new instance of VaultClient.
func (c *ClientFactory) NewVaultClient() *VaultClient {
- subClient, _ := NewVaultClient(c.subscriptionID, c.credential, c.options)
- return subClient
-}
-
-// NewVaultOperationStatusClient creates a new instance of VaultOperationStatusClient.
-func (c *ClientFactory) NewVaultOperationStatusClient() *VaultOperationStatusClient {
- subClient, _ := NewVaultOperationStatusClient(c.subscriptionID, c.credential, c.options)
- return subClient
-}
-
-// NewWorkflowClient creates a new instance of WorkflowClient.
-func (c *ClientFactory) NewWorkflowClient() *WorkflowClient {
- subClient, _ := NewWorkflowClient(c.subscriptionID, c.credential, c.options)
- return subClient
-}
-
-// NewWorkflowOperationStatusClient creates a new instance of WorkflowOperationStatusClient.
-func (c *ClientFactory) NewWorkflowOperationStatusClient() *WorkflowOperationStatusClient {
- subClient, _ := NewWorkflowOperationStatusClient(c.subscriptionID, c.credential, c.options)
- return subClient
+ return &VaultClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/constants.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/constants.go
index bde98da71bdc..9910189149e4 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/constants.go
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/constants.go
@@ -1,22 +1,19 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armrecoveryservicesdatareplication
const (
moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication"
- moduleVersion = "v0.2.0"
+ moduleVersion = "v1.0.0"
)
-// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+// ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
type ActionType string
const (
+ // ActionTypeInternal - Actions are for internal-only APIs.
ActionTypeInternal ActionType = "Internal"
)
@@ -27,13 +24,40 @@ func PossibleActionTypeValues() []ActionType {
}
}
+// CreatedByType - The kind of entity that created the resource.
+type CreatedByType string
+
+const (
+ // CreatedByTypeApplication - The entity was created by an application.
+ CreatedByTypeApplication CreatedByType = "Application"
+ // CreatedByTypeKey - The entity was created by a key.
+ CreatedByTypeKey CreatedByType = "Key"
+ // CreatedByTypeManagedIdentity - The entity was created by a managed identity.
+ CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
+ // CreatedByTypeUser - The entity was created by a user.
+ CreatedByTypeUser CreatedByType = "User"
+)
+
+// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.
+func PossibleCreatedByTypeValues() []CreatedByType {
+ return []CreatedByType{
+ CreatedByTypeApplication,
+ CreatedByTypeKey,
+ CreatedByTypeManagedIdentity,
+ CreatedByTypeUser,
+ }
+}
+
// HealthStatus - Gets or sets the fabric health.
type HealthStatus string
const (
+ // HealthStatusCritical - Critical Status.
HealthStatusCritical HealthStatus = "Critical"
- HealthStatusNormal HealthStatus = "Normal"
- HealthStatusWarning HealthStatus = "Warning"
+ // HealthStatusNormal - Healthy Status.
+ HealthStatusNormal HealthStatus = "Normal"
+ // HealthStatusWarning - Warning Status.
+ HealthStatusWarning HealthStatus = "Warning"
)
// PossibleHealthStatusValues returns the possible values for the HealthStatus const type.
@@ -45,13 +69,115 @@ func PossibleHealthStatusValues() []HealthStatus {
}
}
+// JobObjectType - Gets or sets the object type.
+type JobObjectType string
+
+const (
+ // JobObjectTypeAvsDiskPool - AVS disk pool.
+ JobObjectTypeAvsDiskPool JobObjectType = "AvsDiskPool"
+ // JobObjectTypeFabric - Fabric level job.
+ JobObjectTypeFabric JobObjectType = "Fabric"
+ // JobObjectTypeFabricAgent - Fabric agent level workflow.
+ JobObjectTypeFabricAgent JobObjectType = "FabricAgent"
+ // JobObjectTypePolicy - Policy level job.
+ JobObjectTypePolicy JobObjectType = "Policy"
+ // JobObjectTypeProtectedItem - Protected item level job.
+ JobObjectTypeProtectedItem JobObjectType = "ProtectedItem"
+ // JobObjectTypeRecoveryPlan - Recovery plan level job.
+ JobObjectTypeRecoveryPlan JobObjectType = "RecoveryPlan"
+ // JobObjectTypeReplicationExtension - Replication extension level job.
+ JobObjectTypeReplicationExtension JobObjectType = "ReplicationExtension"
+ // JobObjectTypeVault - Vault level job.
+ JobObjectTypeVault JobObjectType = "Vault"
+)
+
+// PossibleJobObjectTypeValues returns the possible values for the JobObjectType const type.
+func PossibleJobObjectTypeValues() []JobObjectType {
+ return []JobObjectType{
+ JobObjectTypeAvsDiskPool,
+ JobObjectTypeFabric,
+ JobObjectTypeFabricAgent,
+ JobObjectTypePolicy,
+ JobObjectTypeProtectedItem,
+ JobObjectTypeRecoveryPlan,
+ JobObjectTypeReplicationExtension,
+ JobObjectTypeVault,
+ }
+}
+
+// JobState - Gets or sets the job state.
+type JobState string
+
+const (
+ // JobStateCancelled - Job has been cancelled.
+ JobStateCancelled JobState = "Cancelled"
+ // JobStateCancelling - Job cancellation is in progress.
+ JobStateCancelling JobState = "Cancelling"
+ // JobStateCompletedWithErrors - Job has completed with errors.
+ JobStateCompletedWithErrors JobState = "CompletedWithErrors"
+ // JobStateCompletedWithInformation - Job has completed with information.
+ JobStateCompletedWithInformation JobState = "CompletedWithInformation"
+ // JobStateCompletedWithWarnings - Job has completed with warnings.
+ JobStateCompletedWithWarnings JobState = "CompletedWithWarnings"
+ // JobStateFailed - Job failed.
+ JobStateFailed JobState = "Failed"
+ // JobStatePending - Job has not been started.
+ JobStatePending JobState = "Pending"
+ // JobStateStarted - Job is in progress.
+ JobStateStarted JobState = "Started"
+ // JobStateSucceeded - Job has completed successfully.
+ JobStateSucceeded JobState = "Succeeded"
+)
+
+// PossibleJobStateValues returns the possible values for the JobState const type.
+func PossibleJobStateValues() []JobState {
+ return []JobState{
+ JobStateCancelled,
+ JobStateCancelling,
+ JobStateCompletedWithErrors,
+ JobStateCompletedWithInformation,
+ JobStateCompletedWithWarnings,
+ JobStateFailed,
+ JobStatePending,
+ JobStateStarted,
+ JobStateSucceeded,
+ }
+}
+
+// ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
+type ManagedServiceIdentityType string
+
+const (
+ // ManagedServiceIdentityTypeNone - No managed identity.
+ ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None"
+ // ManagedServiceIdentityTypeSystemAssigned - System assigned managed identity.
+ ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned"
+ // ManagedServiceIdentityTypeSystemAssignedUserAssigned - System and user assigned managed identity.
+ ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned"
+ // ManagedServiceIdentityTypeUserAssigned - User assigned managed identity.
+ ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned"
+)
+
+// PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type.
+func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType {
+ return []ManagedServiceIdentityType{
+ ManagedServiceIdentityTypeNone,
+ ManagedServiceIdentityTypeSystemAssigned,
+ ManagedServiceIdentityTypeSystemAssignedUserAssigned,
+ ManagedServiceIdentityTypeUserAssigned,
+ }
+}
+
// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
// value is "user,system"
type Origin string
const (
- OriginSystem Origin = "system"
- OriginUser Origin = "user"
+ // OriginSystem - Indicates the operation is initiated by a system.
+ OriginSystem Origin = "system"
+ // OriginUser - Indicates the operation is initiated by a user.
+ OriginUser Origin = "user"
+ // OriginUserSystem - Indicates the operation is initiated by a user or system.
OriginUserSystem Origin = "user,system"
)
@@ -64,11 +190,37 @@ func PossibleOriginValues() []Origin {
}
}
+// PrivateEndpointConnectionStatus - Gets or sets the status.
+type PrivateEndpointConnectionStatus string
+
+const (
+ // PrivateEndpointConnectionStatusApproved - Approved Status.
+ PrivateEndpointConnectionStatusApproved PrivateEndpointConnectionStatus = "Approved"
+ // PrivateEndpointConnectionStatusDisconnected - Disconnected Status.
+ PrivateEndpointConnectionStatusDisconnected PrivateEndpointConnectionStatus = "Disconnected"
+ // PrivateEndpointConnectionStatusPending - Pending Status.
+ PrivateEndpointConnectionStatusPending PrivateEndpointConnectionStatus = "Pending"
+ // PrivateEndpointConnectionStatusRejected - Rejected Status.
+ PrivateEndpointConnectionStatusRejected PrivateEndpointConnectionStatus = "Rejected"
+)
+
+// PossiblePrivateEndpointConnectionStatusValues returns the possible values for the PrivateEndpointConnectionStatus const type.
+func PossiblePrivateEndpointConnectionStatusValues() []PrivateEndpointConnectionStatus {
+ return []PrivateEndpointConnectionStatus{
+ PrivateEndpointConnectionStatusApproved,
+ PrivateEndpointConnectionStatusDisconnected,
+ PrivateEndpointConnectionStatusPending,
+ PrivateEndpointConnectionStatusRejected,
+ }
+}
+
// ProtectedItemActiveLocation - Gets or sets the location of the protected item.
type ProtectedItemActiveLocation string
const (
- ProtectedItemActiveLocationPrimary ProtectedItemActiveLocation = "Primary"
+ // ProtectedItemActiveLocationPrimary - Protected item is active on Primary.
+ ProtectedItemActiveLocationPrimary ProtectedItemActiveLocation = "Primary"
+ // ProtectedItemActiveLocationRecovery - Protected item is active on Recovery.
ProtectedItemActiveLocationRecovery ProtectedItemActiveLocation = "Recovery"
)
@@ -84,58 +236,112 @@ func PossibleProtectedItemActiveLocationValues() []ProtectedItemActiveLocation {
type ProtectionState string
const (
- ProtectionStateCancelFailoverFailedOnPrimary ProtectionState = "CancelFailoverFailedOnPrimary"
- ProtectionStateCancelFailoverFailedOnRecovery ProtectionState = "CancelFailoverFailedOnRecovery"
- ProtectionStateCancelFailoverInProgressOnPrimary ProtectionState = "CancelFailoverInProgressOnPrimary"
- ProtectionStateCancelFailoverInProgressOnRecovery ProtectionState = "CancelFailoverInProgressOnRecovery"
- ProtectionStateCancelFailoverStatesBegin ProtectionState = "CancelFailoverStatesBegin"
- ProtectionStateCancelFailoverStatesEnd ProtectionState = "CancelFailoverStatesEnd"
- ProtectionStateChangeRecoveryPointCompleted ProtectionState = "ChangeRecoveryPointCompleted"
- ProtectionStateChangeRecoveryPointFailed ProtectionState = "ChangeRecoveryPointFailed"
- ProtectionStateChangeRecoveryPointInitiated ProtectionState = "ChangeRecoveryPointInitiated"
- ProtectionStateChangeRecoveryPointStatesBegin ProtectionState = "ChangeRecoveryPointStatesBegin"
- ProtectionStateChangeRecoveryPointStatesEnd ProtectionState = "ChangeRecoveryPointStatesEnd"
- ProtectionStateCommitFailoverCompleted ProtectionState = "CommitFailoverCompleted"
- ProtectionStateCommitFailoverFailedOnPrimary ProtectionState = "CommitFailoverFailedOnPrimary"
- ProtectionStateCommitFailoverFailedOnRecovery ProtectionState = "CommitFailoverFailedOnRecovery"
- ProtectionStateCommitFailoverInProgressOnPrimary ProtectionState = "CommitFailoverInProgressOnPrimary"
- ProtectionStateCommitFailoverInProgressOnRecovery ProtectionState = "CommitFailoverInProgressOnRecovery"
- ProtectionStateCommitFailoverStatesBegin ProtectionState = "CommitFailoverStatesBegin"
- ProtectionStateCommitFailoverStatesEnd ProtectionState = "CommitFailoverStatesEnd"
- ProtectionStateDisablingFailed ProtectionState = "DisablingFailed"
- ProtectionStateDisablingProtection ProtectionState = "DisablingProtection"
- ProtectionStateEnablingFailed ProtectionState = "EnablingFailed"
- ProtectionStateEnablingProtection ProtectionState = "EnablingProtection"
- ProtectionStateInitialReplicationCompletedOnPrimary ProtectionState = "InitialReplicationCompletedOnPrimary"
- ProtectionStateInitialReplicationCompletedOnRecovery ProtectionState = "InitialReplicationCompletedOnRecovery"
- ProtectionStateInitialReplicationFailed ProtectionState = "InitialReplicationFailed"
- ProtectionStateInitialReplicationInProgress ProtectionState = "InitialReplicationInProgress"
- ProtectionStateInitialReplicationStatesBegin ProtectionState = "InitialReplicationStatesBegin"
- ProtectionStateInitialReplicationStatesEnd ProtectionState = "InitialReplicationStatesEnd"
- ProtectionStateMarkedForDeletion ProtectionState = "MarkedForDeletion"
- ProtectionStatePlannedFailoverCompleted ProtectionState = "PlannedFailoverCompleted"
- ProtectionStatePlannedFailoverCompleting ProtectionState = "PlannedFailoverCompleting"
- ProtectionStatePlannedFailoverCompletionFailed ProtectionState = "PlannedFailoverCompletionFailed"
- ProtectionStatePlannedFailoverFailed ProtectionState = "PlannedFailoverFailed"
- ProtectionStatePlannedFailoverInitiated ProtectionState = "PlannedFailoverInitiated"
- ProtectionStatePlannedFailoverTransitionStatesBegin ProtectionState = "PlannedFailoverTransitionStatesBegin"
- ProtectionStatePlannedFailoverTransitionStatesEnd ProtectionState = "PlannedFailoverTransitionStatesEnd"
- ProtectionStateProtected ProtectionState = "Protected"
- ProtectionStateProtectedStatesBegin ProtectionState = "ProtectedStatesBegin"
- ProtectionStateProtectedStatesEnd ProtectionState = "ProtectedStatesEnd"
- ProtectionStateReprotectFailed ProtectionState = "ReprotectFailed"
- ProtectionStateReprotectInitiated ProtectionState = "ReprotectInitiated"
- ProtectionStateReprotectStatesBegin ProtectionState = "ReprotectStatesBegin"
- ProtectionStateReprotectStatesEnd ProtectionState = "ReprotectStatesEnd"
- ProtectionStateUnplannedFailoverCompleted ProtectionState = "UnplannedFailoverCompleted"
- ProtectionStateUnplannedFailoverCompleting ProtectionState = "UnplannedFailoverCompleting"
- ProtectionStateUnplannedFailoverCompletionFailed ProtectionState = "UnplannedFailoverCompletionFailed"
- ProtectionStateUnplannedFailoverFailed ProtectionState = "UnplannedFailoverFailed"
- ProtectionStateUnplannedFailoverInitiated ProtectionState = "UnplannedFailoverInitiated"
+ // ProtectionStateCancelFailoverFailedOnPrimary - Cancel failover failed on the primary side.
+ ProtectionStateCancelFailoverFailedOnPrimary ProtectionState = "CancelFailoverFailedOnPrimary"
+ // ProtectionStateCancelFailoverFailedOnRecovery - Cancel failover failed on the recovery side.
+ ProtectionStateCancelFailoverFailedOnRecovery ProtectionState = "CancelFailoverFailedOnRecovery"
+ // ProtectionStateCancelFailoverInProgressOnPrimary - Cancel failover is in progress on the primary side.
+ ProtectionStateCancelFailoverInProgressOnPrimary ProtectionState = "CancelFailoverInProgressOnPrimary"
+ // ProtectionStateCancelFailoverInProgressOnRecovery - Cancel failover is in progress on the recovery side.
+ ProtectionStateCancelFailoverInProgressOnRecovery ProtectionState = "CancelFailoverInProgressOnRecovery"
+ // ProtectionStateCancelFailoverStatesBegin - Begin marker for cancel failover states.
+ ProtectionStateCancelFailoverStatesBegin ProtectionState = "CancelFailoverStatesBegin"
+ // ProtectionStateCancelFailoverStatesEnd - End marker for cancel failover states.
+ ProtectionStateCancelFailoverStatesEnd ProtectionState = "CancelFailoverStatesEnd"
+ // ProtectionStateChangeRecoveryPointCompleted - Change recovery point has been completed successfully.
+ ProtectionStateChangeRecoveryPointCompleted ProtectionState = "ChangeRecoveryPointCompleted"
+ // ProtectionStateChangeRecoveryPointFailed - Change recovery point has failed.
+ ProtectionStateChangeRecoveryPointFailed ProtectionState = "ChangeRecoveryPointFailed"
+ // ProtectionStateChangeRecoveryPointInitiated - Change recovery point has been initiated..
+ ProtectionStateChangeRecoveryPointInitiated ProtectionState = "ChangeRecoveryPointInitiated"
+ // ProtectionStateChangeRecoveryPointStatesBegin - Begin marker for change recovery point states.
+ ProtectionStateChangeRecoveryPointStatesBegin ProtectionState = "ChangeRecoveryPointStatesBegin"
+ // ProtectionStateChangeRecoveryPointStatesEnd - End marker for change recovery point states.
+ ProtectionStateChangeRecoveryPointStatesEnd ProtectionState = "ChangeRecoveryPointStatesEnd"
+ // ProtectionStateCommitFailoverCompleted - Commit failover has been completed successfully.
+ ProtectionStateCommitFailoverCompleted ProtectionState = "CommitFailoverCompleted"
+ // ProtectionStateCommitFailoverFailedOnPrimary - Commit failover failed on the primary side.
+ ProtectionStateCommitFailoverFailedOnPrimary ProtectionState = "CommitFailoverFailedOnPrimary"
+ // ProtectionStateCommitFailoverFailedOnRecovery - Commit failover failed on the recovery side.
+ ProtectionStateCommitFailoverFailedOnRecovery ProtectionState = "CommitFailoverFailedOnRecovery"
+ // ProtectionStateCommitFailoverInProgressOnPrimary - Commit failover is in progress on the primary side.
+ ProtectionStateCommitFailoverInProgressOnPrimary ProtectionState = "CommitFailoverInProgressOnPrimary"
+ // ProtectionStateCommitFailoverInProgressOnRecovery - Commit failover is in progress on the recovery side.
+ ProtectionStateCommitFailoverInProgressOnRecovery ProtectionState = "CommitFailoverInProgressOnRecovery"
+ // ProtectionStateCommitFailoverStatesBegin - Begin marker for commit failover states.
+ ProtectionStateCommitFailoverStatesBegin ProtectionState = "CommitFailoverStatesBegin"
+ // ProtectionStateCommitFailoverStatesEnd - End marker for commit failover states.
+ ProtectionStateCommitFailoverStatesEnd ProtectionState = "CommitFailoverStatesEnd"
+ // ProtectionStateDisablingFailed - Disable protection failed.
+ ProtectionStateDisablingFailed ProtectionState = "DisablingFailed"
+ // ProtectionStateDisablingProtection - Disabling protection is in progress.
+ ProtectionStateDisablingProtection ProtectionState = "DisablingProtection"
+ // ProtectionStateEnablingFailed - Enable protection failed.
+ ProtectionStateEnablingFailed ProtectionState = "EnablingFailed"
+ // ProtectionStateEnablingProtection - Enable protection is in progress.
+ ProtectionStateEnablingProtection ProtectionState = "EnablingProtection"
+ // ProtectionStateInitialReplicationCompletedOnPrimary - Initial replication has completed on the primary side.
+ ProtectionStateInitialReplicationCompletedOnPrimary ProtectionState = "InitialReplicationCompletedOnPrimary"
+ // ProtectionStateInitialReplicationCompletedOnRecovery - Initial replication has completed on the recovery side.
+ ProtectionStateInitialReplicationCompletedOnRecovery ProtectionState = "InitialReplicationCompletedOnRecovery"
+ // ProtectionStateInitialReplicationFailed - Initial replication failed and would need to be started again.
+ ProtectionStateInitialReplicationFailed ProtectionState = "InitialReplicationFailed"
+ // ProtectionStateInitialReplicationInProgress - Initial replication is in progress.
+ ProtectionStateInitialReplicationInProgress ProtectionState = "InitialReplicationInProgress"
+ // ProtectionStateInitialReplicationStatesBegin - Begin marker for initial replication states.
+ ProtectionStateInitialReplicationStatesBegin ProtectionState = "InitialReplicationStatesBegin"
+ // ProtectionStateInitialReplicationStatesEnd - End marker for initial replication states.
+ ProtectionStateInitialReplicationStatesEnd ProtectionState = "InitialReplicationStatesEnd"
+ // ProtectionStateMarkedForDeletion - Disabling protection succeeded. This is a transient state before the protected item
+ // is deleted.
+ ProtectionStateMarkedForDeletion ProtectionState = "MarkedForDeletion"
+ // ProtectionStatePlannedFailoverCompleted - Planned failover has been completed successfully.
+ ProtectionStatePlannedFailoverCompleted ProtectionState = "PlannedFailoverCompleted"
+ // ProtectionStatePlannedFailoverCompleting - Planned failover preparing protected entities is in progress.
+ ProtectionStatePlannedFailoverCompleting ProtectionState = "PlannedFailoverCompleting"
+ // ProtectionStatePlannedFailoverCompletionFailed - Planned failover preparing protected entities failed.
+ ProtectionStatePlannedFailoverCompletionFailed ProtectionState = "PlannedFailoverCompletionFailed"
+ // ProtectionStatePlannedFailoverFailed - Planned failover initiation failed.
+ ProtectionStatePlannedFailoverFailed ProtectionState = "PlannedFailoverFailed"
+ // ProtectionStatePlannedFailoverInitiated - Planned failover has been initiated.
+ ProtectionStatePlannedFailoverInitiated ProtectionState = "PlannedFailoverInitiated"
+ // ProtectionStatePlannedFailoverTransitionStatesBegin - Begin marker for planned failover transition states.
+ ProtectionStatePlannedFailoverTransitionStatesBegin ProtectionState = "PlannedFailoverTransitionStatesBegin"
+ // ProtectionStatePlannedFailoverTransitionStatesEnd - End marker for planned failover transition states.
+ ProtectionStatePlannedFailoverTransitionStatesEnd ProtectionState = "PlannedFailoverTransitionStatesEnd"
+ // ProtectionStateProtected - Protected item is protected and replication is on-going. Any issues with replication will be
+ // surfaced separately via the health property and will not affect the state.
+ ProtectionStateProtected ProtectionState = "Protected"
+ // ProtectionStateProtectedStatesBegin - Begin marker for protected steady-state states.
+ ProtectionStateProtectedStatesBegin ProtectionState = "ProtectedStatesBegin"
+ // ProtectionStateProtectedStatesEnd - End marker for protected steady-state states.
+ ProtectionStateProtectedStatesEnd ProtectionState = "ProtectedStatesEnd"
+ // ProtectionStateReprotectFailed - Reprotect has failed.
+ ProtectionStateReprotectFailed ProtectionState = "ReprotectFailed"
+ // ProtectionStateReprotectInitiated - Reprotect has been initiated.
+ ProtectionStateReprotectInitiated ProtectionState = "ReprotectInitiated"
+ // ProtectionStateReprotectStatesBegin - Begin marker for reprotect states.
+ ProtectionStateReprotectStatesBegin ProtectionState = "ReprotectStatesBegin"
+ // ProtectionStateReprotectStatesEnd - End marker for reprotect states.
+ ProtectionStateReprotectStatesEnd ProtectionState = "ReprotectStatesEnd"
+ // ProtectionStateUnplannedFailoverCompleted - Unplanned failover preparing protected entities is in progress.
+ ProtectionStateUnplannedFailoverCompleted ProtectionState = "UnplannedFailoverCompleted"
+ // ProtectionStateUnplannedFailoverCompleting - Unplanned failover preparing protected entities is in progress.
+ ProtectionStateUnplannedFailoverCompleting ProtectionState = "UnplannedFailoverCompleting"
+ // ProtectionStateUnplannedFailoverCompletionFailed - Unplanned failover preparing protected entities failed.
+ ProtectionStateUnplannedFailoverCompletionFailed ProtectionState = "UnplannedFailoverCompletionFailed"
+ // ProtectionStateUnplannedFailoverFailed - Unplanned failover initiation failed.
+ ProtectionStateUnplannedFailoverFailed ProtectionState = "UnplannedFailoverFailed"
+ // ProtectionStateUnplannedFailoverInitiated - Unplanned failover has been initiated.
+ ProtectionStateUnplannedFailoverInitiated ProtectionState = "UnplannedFailoverInitiated"
+ // ProtectionStateUnplannedFailoverTransitionStatesBegin - Begin marker for unplanned failover transition states.
ProtectionStateUnplannedFailoverTransitionStatesBegin ProtectionState = "UnplannedFailoverTransitionStatesBegin"
- ProtectionStateUnplannedFailoverTransitionStatesEnd ProtectionState = "UnplannedFailoverTransitionStatesEnd"
- ProtectionStateUnprotectedStatesBegin ProtectionState = "UnprotectedStatesBegin"
- ProtectionStateUnprotectedStatesEnd ProtectionState = "UnprotectedStatesEnd"
+ // ProtectionStateUnplannedFailoverTransitionStatesEnd - End marker for unplanned failover transition states.
+ ProtectionStateUnplannedFailoverTransitionStatesEnd ProtectionState = "UnplannedFailoverTransitionStatesEnd"
+ // ProtectionStateUnprotectedStatesBegin - Begin marker for unprotected states.
+ ProtectionStateUnprotectedStatesBegin ProtectionState = "UnprotectedStatesBegin"
+ // ProtectionStateUnprotectedStatesEnd - End marker for unprotected states.
+ ProtectionStateUnprotectedStatesEnd ProtectionState = "UnprotectedStatesEnd"
)
// PossibleProtectionStateValues returns the possible values for the ProtectionState const type.
@@ -196,17 +402,24 @@ func PossibleProtectionStateValues() []ProtectionState {
}
}
-// ProvisioningState - Gets or sets the provisioning state of the Dra.
+// ProvisioningState - Gets or sets the provisioning state of the email configuration.
type ProvisioningState string
const (
- ProvisioningStateCanceled ProvisioningState = "Canceled"
- ProvisioningStateCreating ProvisioningState = "Creating"
- ProvisioningStateDeleted ProvisioningState = "Deleted"
- ProvisioningStateDeleting ProvisioningState = "Deleting"
- ProvisioningStateFailed ProvisioningState = "Failed"
+ // ProvisioningStateCanceled - Resource creation has been canceled
+ ProvisioningStateCanceled ProvisioningState = "Canceled"
+ // ProvisioningStateCreating - Resource is being created.
+ ProvisioningStateCreating ProvisioningState = "Creating"
+ // ProvisioningStateDeleted - Resource has been deleted.
+ ProvisioningStateDeleted ProvisioningState = "Deleted"
+ // ProvisioningStateDeleting - Resource is being deleted.
+ ProvisioningStateDeleting ProvisioningState = "Deleting"
+ // ProvisioningStateFailed - Resource creation failed.
+ ProvisioningStateFailed ProvisioningState = "Failed"
+ // ProvisioningStateSucceeded - Resource creation/update succeeded.
ProvisioningStateSucceeded ProvisioningState = "Succeeded"
- ProvisioningStateUpdating ProvisioningState = "Updating"
+ // ProvisioningStateUpdating - Resource is being updated.
+ ProvisioningStateUpdating ProvisioningState = "Updating"
)
// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.
@@ -226,8 +439,10 @@ func PossibleProvisioningStateValues() []ProvisioningState {
type RecoveryPointType string
const (
+ // RecoveryPointTypeApplicationConsistent - Application consistent recovery point.
RecoveryPointTypeApplicationConsistent RecoveryPointType = "ApplicationConsistent"
- RecoveryPointTypeCrashConsistent RecoveryPointType = "CrashConsistent"
+ // RecoveryPointTypeCrashConsistent - Crash consistent recovery point.
+ RecoveryPointTypeCrashConsistent RecoveryPointType = "CrashConsistent"
)
// PossibleRecoveryPointTypeValues returns the possible values for the RecoveryPointType const type.
@@ -242,8 +457,10 @@ func PossibleRecoveryPointTypeValues() []RecoveryPointType {
type ReplicationVaultType string
const (
+ // ReplicationVaultTypeDisasterRecovery - Disaster recovery vault.
ReplicationVaultTypeDisasterRecovery ReplicationVaultType = "DisasterRecovery"
- ReplicationVaultTypeMigrate ReplicationVaultType = "Migrate"
+ // ReplicationVaultTypeMigrate - Migrate vault.
+ ReplicationVaultTypeMigrate ReplicationVaultType = "Migrate"
)
// PossibleReplicationVaultTypeValues returns the possible values for the ReplicationVaultType const type.
@@ -258,9 +475,13 @@ func PossibleReplicationVaultTypeValues() []ReplicationVaultType {
type ResynchronizationState string
const (
- ResynchronizationStateNone ResynchronizationState = "None"
+ // ResynchronizationStateNone - Resynchronization is not active.
+ ResynchronizationStateNone ResynchronizationState = "None"
+ // ResynchronizationStateResynchronizationCompleted - Resynchronization has been completed successfully.
ResynchronizationStateResynchronizationCompleted ResynchronizationState = "ResynchronizationCompleted"
- ResynchronizationStateResynchronizationFailed ResynchronizationState = "ResynchronizationFailed"
+ // ResynchronizationStateResynchronizationFailed - Resynchronization has failed and would need to be started again.
+ ResynchronizationStateResynchronizationFailed ResynchronizationState = "ResynchronizationFailed"
+ // ResynchronizationStateResynchronizationInitiated - Resynchronization has been initiated.
ResynchronizationStateResynchronizationInitiated ResynchronizationState = "ResynchronizationInitiated"
)
@@ -278,11 +499,17 @@ func PossibleResynchronizationStateValues() []ResynchronizationState {
type TaskState string
const (
+ // TaskStateCancelled - Task has been cancelled.
TaskStateCancelled TaskState = "Cancelled"
- TaskStateFailed TaskState = "Failed"
- TaskStatePending TaskState = "Pending"
- TaskStateSkipped TaskState = "Skipped"
- TaskStateStarted TaskState = "Started"
+ // TaskStateFailed - Task failed.
+ TaskStateFailed TaskState = "Failed"
+ // TaskStatePending - Task has not been started.
+ TaskStatePending TaskState = "Pending"
+ // TaskStateSkipped - Task has been skipped.
+ TaskStateSkipped TaskState = "Skipped"
+ // TaskStateStarted - Task is in progress.
+ TaskStateStarted TaskState = "Started"
+ // TaskStateSucceeded - Task has completed successfully.
TaskStateSucceeded TaskState = "Succeeded"
)
@@ -302,15 +529,25 @@ func PossibleTaskStateValues() []TaskState {
type TestFailoverState string
const (
- TestFailoverStateMarkedForDeletion TestFailoverState = "MarkedForDeletion"
- TestFailoverStateNone TestFailoverState = "None"
+ // TestFailoverStateMarkedForDeletion - Test failover cleanup has completed/failed. This is a transient state before the state
+ // is moved back to None.
+ TestFailoverStateMarkedForDeletion TestFailoverState = "MarkedForDeletion"
+ // TestFailoverStateNone - Test failover is not active.
+ TestFailoverStateNone TestFailoverState = "None"
+ // TestFailoverStateTestFailoverCleanupCompleting - Cleaning up test protected entities is in progress.
TestFailoverStateTestFailoverCleanupCompleting TestFailoverState = "TestFailoverCleanupCompleting"
- TestFailoverStateTestFailoverCleanupInitiated TestFailoverState = "TestFailoverCleanupInitiated"
- TestFailoverStateTestFailoverCompleted TestFailoverState = "TestFailoverCompleted"
- TestFailoverStateTestFailoverCompleting TestFailoverState = "TestFailoverCompleting"
- TestFailoverStateTestFailoverCompletionFailed TestFailoverState = "TestFailoverCompletionFailed"
- TestFailoverStateTestFailoverFailed TestFailoverState = "TestFailoverFailed"
- TestFailoverStateTestFailoverInitiated TestFailoverState = "TestFailoverInitiated"
+ // TestFailoverStateTestFailoverCleanupInitiated - Test failover cleanup has been initiated.
+ TestFailoverStateTestFailoverCleanupInitiated TestFailoverState = "TestFailoverCleanupInitiated"
+ // TestFailoverStateTestFailoverCompleted - Test failover has been completed successfully.
+ TestFailoverStateTestFailoverCompleted TestFailoverState = "TestFailoverCompleted"
+ // TestFailoverStateTestFailoverCompleting - Preparing test protected entities is in progress.
+ TestFailoverStateTestFailoverCompleting TestFailoverState = "TestFailoverCompleting"
+ // TestFailoverStateTestFailoverCompletionFailed - Preparing test protected entities failed.
+ TestFailoverStateTestFailoverCompletionFailed TestFailoverState = "TestFailoverCompletionFailed"
+ // TestFailoverStateTestFailoverFailed - Test failover initiation failed..
+ TestFailoverStateTestFailoverFailed TestFailoverState = "TestFailoverFailed"
+ // TestFailoverStateTestFailoverInitiated - Test failover has been initiated.
+ TestFailoverStateTestFailoverInitiated TestFailoverState = "TestFailoverInitiated"
)
// PossibleTestFailoverStateValues returns the possible values for the TestFailoverState const type.
@@ -332,9 +569,15 @@ func PossibleTestFailoverStateValues() []TestFailoverState {
type VMNicSelection string
const (
- VMNicSelectionNotSelected VMNicSelection = "NotSelected"
- VMNicSelectionSelectedByDefault VMNicSelection = "SelectedByDefault"
- VMNicSelectionSelectedByUser VMNicSelection = "SelectedByUser"
+ // VMNicSelectionNotSelected - Not Selected.
+ VMNicSelectionNotSelected VMNicSelection = "NotSelected"
+ // VMNicSelectionSelectedByDefault - Default selection by ASR.
+ VMNicSelectionSelectedByDefault VMNicSelection = "SelectedByDefault"
+ // VMNicSelectionSelectedByUser - Selected by user.
+ VMNicSelectionSelectedByUser VMNicSelection = "SelectedByUser"
+ // VMNicSelectionSelectedByUserOverride - NIC configuration overridden by user. Differs from SelectedByUser in the sense that
+ // the legacy SelectedByUser is used both for explicit modification by user and implicit approval of user if the settings
+ // are used for TFO/FO. SelectedByUserOverride implies user overriding at least one of the configurations.
VMNicSelectionSelectedByUserOverride VMNicSelection = "SelectedByUserOverride"
)
@@ -352,9 +595,12 @@ func PossibleVMNicSelectionValues() []VMNicSelection {
type VMwareToAzureMigrateResyncState string
const (
- VMwareToAzureMigrateResyncStateNone VMwareToAzureMigrateResyncState = "None"
+ // VMwareToAzureMigrateResyncStateNone - None state.
+ VMwareToAzureMigrateResyncStateNone VMwareToAzureMigrateResyncState = "None"
+ // VMwareToAzureMigrateResyncStatePreparedForResynchronization - Prepared for resynchronization state.
VMwareToAzureMigrateResyncStatePreparedForResynchronization VMwareToAzureMigrateResyncState = "PreparedForResynchronization"
- VMwareToAzureMigrateResyncStateStartedResynchronization VMwareToAzureMigrateResyncState = "StartedResynchronization"
+ // VMwareToAzureMigrateResyncStateStartedResynchronization - Started resynchronization state.
+ VMwareToAzureMigrateResyncStateStartedResynchronization VMwareToAzureMigrateResyncState = "StartedResynchronization"
)
// PossibleVMwareToAzureMigrateResyncStateValues returns the possible values for the VMwareToAzureMigrateResyncState const type.
@@ -366,60 +612,23 @@ func PossibleVMwareToAzureMigrateResyncStateValues() []VMwareToAzureMigrateResyn
}
}
-// WorkflowObjectType - Gets or sets the object type.
-type WorkflowObjectType string
-
-const (
- WorkflowObjectTypeAvsDiskPool WorkflowObjectType = "AvsDiskPool"
- WorkflowObjectTypeDra WorkflowObjectType = "Dra"
- WorkflowObjectTypeFabric WorkflowObjectType = "Fabric"
- WorkflowObjectTypePolicy WorkflowObjectType = "Policy"
- WorkflowObjectTypeProtectedItem WorkflowObjectType = "ProtectedItem"
- WorkflowObjectTypeRecoveryPlan WorkflowObjectType = "RecoveryPlan"
- WorkflowObjectTypeReplicationExtension WorkflowObjectType = "ReplicationExtension"
- WorkflowObjectTypeVault WorkflowObjectType = "Vault"
-)
-
-// PossibleWorkflowObjectTypeValues returns the possible values for the WorkflowObjectType const type.
-func PossibleWorkflowObjectTypeValues() []WorkflowObjectType {
- return []WorkflowObjectType{
- WorkflowObjectTypeAvsDiskPool,
- WorkflowObjectTypeDra,
- WorkflowObjectTypeFabric,
- WorkflowObjectTypePolicy,
- WorkflowObjectTypeProtectedItem,
- WorkflowObjectTypeRecoveryPlan,
- WorkflowObjectTypeReplicationExtension,
- WorkflowObjectTypeVault,
- }
-}
-
-// WorkflowState - Gets or sets the workflow state.
-type WorkflowState string
+// VaultIdentityType - Gets or sets the identityType which can be either SystemAssigned or None.
+type VaultIdentityType string
const (
- WorkflowStateCancelled WorkflowState = "Cancelled"
- WorkflowStateCancelling WorkflowState = "Cancelling"
- WorkflowStateCompletedWithErrors WorkflowState = "CompletedWithErrors"
- WorkflowStateCompletedWithInformation WorkflowState = "CompletedWithInformation"
- WorkflowStateCompletedWithWarnings WorkflowState = "CompletedWithWarnings"
- WorkflowStateFailed WorkflowState = "Failed"
- WorkflowStatePending WorkflowState = "Pending"
- WorkflowStateStarted WorkflowState = "Started"
- WorkflowStateSucceeded WorkflowState = "Succeeded"
+ // VaultIdentityTypeNone - No identity.
+ VaultIdentityTypeNone VaultIdentityType = "None"
+ // VaultIdentityTypeSystemAssigned - System assigned identity.
+ VaultIdentityTypeSystemAssigned VaultIdentityType = "SystemAssigned"
+ // VaultIdentityTypeUserAssigned - User assigned identity.
+ VaultIdentityTypeUserAssigned VaultIdentityType = "UserAssigned"
)
-// PossibleWorkflowStateValues returns the possible values for the WorkflowState const type.
-func PossibleWorkflowStateValues() []WorkflowState {
- return []WorkflowState{
- WorkflowStateCancelled,
- WorkflowStateCancelling,
- WorkflowStateCompletedWithErrors,
- WorkflowStateCompletedWithInformation,
- WorkflowStateCompletedWithWarnings,
- WorkflowStateFailed,
- WorkflowStatePending,
- WorkflowStateStarted,
- WorkflowStateSucceeded,
+// PossibleVaultIdentityTypeValues returns the possible values for the VaultIdentityType const type.
+func PossibleVaultIdentityTypeValues() []VaultIdentityType {
+ return []VaultIdentityType{
+ VaultIdentityTypeNone,
+ VaultIdentityTypeSystemAssigned,
+ VaultIdentityTypeUserAssigned,
}
}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/deploymentpreflight_client.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/deploymentpreflight_client.go
new file mode 100644
index 000000000000..f6c80f1b24fd
--- /dev/null
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/deploymentpreflight_client.go
@@ -0,0 +1,114 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armrecoveryservicesdatareplication
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// DeploymentPreflightClient contains the methods for the DeploymentPreflight group.
+// Don't use this type directly, use NewDeploymentPreflightClient() instead.
+type DeploymentPreflightClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewDeploymentPreflightClient creates a new instance of DeploymentPreflightClient with the specified values.
+// - subscriptionID - The ID of the target subscription. The value must be an UUID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewDeploymentPreflightClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeploymentPreflightClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &DeploymentPreflightClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Post - Performs resource deployment validation.
+//
+// Performs resource deployment preflight validation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2024-09-01
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - deploymentID - Deployment Id.
+// - options - DeploymentPreflightClientPostOptions contains the optional parameters for the DeploymentPreflightClient.Post
+// method.
+func (client *DeploymentPreflightClient) Post(ctx context.Context, resourceGroupName string, deploymentID string, options *DeploymentPreflightClientPostOptions) (DeploymentPreflightClientPostResponse, error) {
+ var err error
+ const operationName = "DeploymentPreflightClient.Post"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.postCreateRequest(ctx, resourceGroupName, deploymentID, options)
+ if err != nil {
+ return DeploymentPreflightClientPostResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentPreflightClientPostResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentPreflightClientPostResponse{}, err
+ }
+ resp, err := client.postHandleResponse(httpResp)
+ return resp, err
+}
+
+// postCreateRequest creates the Post request.
+func (client *DeploymentPreflightClient) postCreateRequest(ctx context.Context, resourceGroupName string, deploymentID string, options *DeploymentPreflightClientPostOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if deploymentID == "" {
+ return nil, errors.New("parameter deploymentID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentId}", url.PathEscape(deploymentID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2024-09-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Body != nil {
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, *options.Body); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// postHandleResponse handles the Post response.
+func (client *DeploymentPreflightClient) postHandleResponse(resp *http.Response) (DeploymentPreflightClientPostResponse, error) {
+ result := DeploymentPreflightClientPostResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentPreflightModel); err != nil {
+ return DeploymentPreflightClientPostResponse{}, err
+ }
+ return result, nil
+}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/deploymentpreflight_client_example_test.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/deploymentpreflight_client_example_test.go
new file mode 100644
index 000000000000..57a7be470294
--- /dev/null
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/deploymentpreflight_client_example_test.go
@@ -0,0 +1,55 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package armrecoveryservicesdatareplication_test
+
+import (
+ "context"
+ "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/recoveryservicesdatareplication/armrecoveryservicesdatareplication"
+ "log"
+)
+
+// Generated from example definition: 2024-09-01/DeploymentPreflight_Post.json
+func ExampleDeploymentPreflightClient_Post() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewDeploymentPreflightClient().Post(ctx, "rgswagger_2024-09-01", "lnfcwsmlowbwkndkztzvaj", &DeploymentPreflightClientPostOptions{
+ body: &armrecoveryservicesdatareplication.DeploymentPreflightModel{
+ Resources: []*armrecoveryservicesdatareplication.DeploymentPreflightResource{
+ {
+ Name: to.Ptr("xtgugoflfc"),
+ Type: to.Ptr("nsnaptduolqcxsikrewvgjbxqpt"),
+ Location: to.Ptr("cbsgtxkjdzwbyp"),
+ APIVersion: to.Ptr("otihymhvzblycdoxo"),
+ },
+ },
+ }})
+ 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 = armrecoveryservicesdatareplication.DeploymentPreflightClientPostResponse{
+ // DeploymentPreflightModel: &armrecoveryservicesdatareplication.DeploymentPreflightModel{
+ // Resources: []*armrecoveryservicesdatareplication.DeploymentPreflightResource{
+ // {
+ // Name: to.Ptr("xtgugoflfc"),
+ // Type: to.Ptr("nsnaptduolqcxsikrewvgjbxqpt"),
+ // Location: to.Ptr("cbsgtxkjdzwbyp"),
+ // APIVersion: to.Ptr("otihymhvzblycdoxo"),
+ // },
+ // },
+ // },
+ // }
+}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/draoperationstatus_client.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/draoperationstatus_client.go
deleted file mode 100644
index 781754ee35fa..000000000000
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/draoperationstatus_client.go
+++ /dev/null
@@ -1,118 +0,0 @@
-//go:build go1.18
-// +build go1.18
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-package armrecoveryservicesdatareplication
-
-import (
- "context"
- "errors"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
- "net/http"
- "net/url"
- "strings"
-)
-
-// DraOperationStatusClient contains the methods for the DraOperationStatus group.
-// Don't use this type directly, use NewDraOperationStatusClient() instead.
-type DraOperationStatusClient struct {
- internal *arm.Client
- subscriptionID string
-}
-
-// NewDraOperationStatusClient creates a new instance of DraOperationStatusClient with the specified values.
-// - subscriptionID - The ID of the target subscription. The value must be an UUID.
-// - credential - used to authorize requests. Usually a credential from azidentity.
-// - options - pass nil to accept the default values.
-func NewDraOperationStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DraOperationStatusClient, error) {
- cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
- if err != nil {
- return nil, err
- }
- client := &DraOperationStatusClient{
- subscriptionID: subscriptionID,
- internal: cl,
- }
- return client, nil
-}
-
-// Get - Tracks the results of an asynchronous operation on the fabric agent.
-// If the operation fails it returns an *azcore.ResponseError type.
-//
-// Generated from API version 2021-02-16-preview
-// - resourceGroupName - The name of the resource group. The name is case insensitive.
-// - fabricName - The fabric name.
-// - fabricAgentName - The fabric agent (Dra) name.
-// - operationID - The ID of an ongoing async operation.
-// - options - DraOperationStatusClientGetOptions contains the optional parameters for the DraOperationStatusClient.Get method.
-func (client *DraOperationStatusClient) Get(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, operationID string, options *DraOperationStatusClientGetOptions) (DraOperationStatusClientGetResponse, error) {
- var err error
- const operationName = "DraOperationStatusClient.Get"
- ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
- ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
- defer func() { endSpan(err) }()
- req, err := client.getCreateRequest(ctx, resourceGroupName, fabricName, fabricAgentName, operationID, options)
- if err != nil {
- return DraOperationStatusClientGetResponse{}, err
- }
- httpResp, err := client.internal.Pipeline().Do(req)
- if err != nil {
- return DraOperationStatusClientGetResponse{}, err
- }
- if !runtime.HasStatusCode(httpResp, http.StatusOK) {
- err = runtime.NewResponseError(httpResp)
- return DraOperationStatusClientGetResponse{}, err
- }
- resp, err := client.getHandleResponse(httpResp)
- return resp, err
-}
-
-// getCreateRequest creates the Get request.
-func (client *DraOperationStatusClient) getCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, operationID string, options *DraOperationStatusClientGetOptions) (*policy.Request, error) {
- urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName}/operations/{operationId}"
- if client.subscriptionID == "" {
- return nil, errors.New("parameter client.subscriptionID cannot be empty")
- }
- urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
- if resourceGroupName == "" {
- return nil, errors.New("parameter resourceGroupName cannot be empty")
- }
- urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
- if fabricName == "" {
- return nil, errors.New("parameter fabricName cannot be empty")
- }
- urlPath = strings.ReplaceAll(urlPath, "{fabricName}", url.PathEscape(fabricName))
- if fabricAgentName == "" {
- return nil, errors.New("parameter fabricAgentName cannot be empty")
- }
- urlPath = strings.ReplaceAll(urlPath, "{fabricAgentName}", url.PathEscape(fabricAgentName))
- if operationID == "" {
- return nil, errors.New("parameter operationID cannot be empty")
- }
- urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID))
- req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
- if err != nil {
- return nil, err
- }
- reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
- req.Raw().URL.RawQuery = reqQP.Encode()
- req.Raw().Header["Accept"] = []string{"application/json"}
- return req, nil
-}
-
-// getHandleResponse handles the Get response.
-func (client *DraOperationStatusClient) getHandleResponse(resp *http.Response) (DraOperationStatusClientGetResponse, error) {
- result := DraOperationStatusClientGetResponse{}
- if err := runtime.UnmarshalAsJSON(resp, &result.OperationStatus); err != nil {
- return DraOperationStatusClientGetResponse{}, err
- }
- return result, nil
-}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/emailconfiguration_client.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/emailconfiguration_client.go
index 29623e9817c0..9ab3ce4e4563 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/emailconfiguration_client.go
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/emailconfiguration_client.go
@@ -1,10 +1,6 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armrecoveryservicesdatareplication
@@ -46,20 +42,20 @@ func NewEmailConfigurationClient(subscriptionID string, credential azcore.TokenC
// Create - Creates an alert configuration setting for the given vault.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - vaultName - The vault name.
// - emailConfigurationName - The email configuration name.
-// - body - EmailConfiguration model.
+// - resource - EmailConfiguration model.
// - options - EmailConfigurationClientCreateOptions contains the optional parameters for the EmailConfigurationClient.Create
// method.
-func (client *EmailConfigurationClient) Create(ctx context.Context, resourceGroupName string, vaultName string, emailConfigurationName string, body EmailConfigurationModel, options *EmailConfigurationClientCreateOptions) (EmailConfigurationClientCreateResponse, error) {
+func (client *EmailConfigurationClient) Create(ctx context.Context, resourceGroupName string, vaultName string, emailConfigurationName string, resource EmailConfigurationModel, options *EmailConfigurationClientCreateOptions) (EmailConfigurationClientCreateResponse, error) {
var err error
const operationName = "EmailConfigurationClient.Create"
ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
defer func() { endSpan(err) }()
- req, err := client.createCreateRequest(ctx, resourceGroupName, vaultName, emailConfigurationName, body, options)
+ req, err := client.createCreateRequest(ctx, resourceGroupName, vaultName, emailConfigurationName, resource, options)
if err != nil {
return EmailConfigurationClientCreateResponse{}, err
}
@@ -76,7 +72,7 @@ func (client *EmailConfigurationClient) Create(ctx context.Context, resourceGrou
}
// createCreateRequest creates the Create request.
-func (client *EmailConfigurationClient) createCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, emailConfigurationName string, body EmailConfigurationModel, options *EmailConfigurationClientCreateOptions) (*policy.Request, error) {
+func (client *EmailConfigurationClient) createCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, emailConfigurationName string, resource EmailConfigurationModel, _ *EmailConfigurationClientCreateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@@ -99,10 +95,11 @@ func (client *EmailConfigurationClient) createCreateRequest(ctx context.Context,
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
+ reqQP.Set("api-version", "2024-09-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
- if err := runtime.MarshalAsJSON(req, body); err != nil {
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, resource); err != nil {
return nil, err
}
return req, nil
@@ -120,7 +117,7 @@ func (client *EmailConfigurationClient) createHandleResponse(resp *http.Response
// Get - Gets the details of the alert configuration setting.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - vaultName - The vault name.
// - emailConfigurationName - The email configuration name.
@@ -148,7 +145,7 @@ func (client *EmailConfigurationClient) Get(ctx context.Context, resourceGroupNa
}
// getCreateRequest creates the Get request.
-func (client *EmailConfigurationClient) getCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, emailConfigurationName string, options *EmailConfigurationClientGetOptions) (*policy.Request, error) {
+func (client *EmailConfigurationClient) getCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, emailConfigurationName string, _ *EmailConfigurationClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@@ -171,7 +168,7 @@ func (client *EmailConfigurationClient) getCreateRequest(ctx context.Context, re
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
+ reqQP.Set("api-version", "2024-09-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -188,7 +185,7 @@ func (client *EmailConfigurationClient) getHandleResponse(resp *http.Response) (
// NewListPager - Gets the list of alert configuration settings for the given vault.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - vaultName - The vault name.
// - options - EmailConfigurationClientListOptions contains the optional parameters for the EmailConfigurationClient.NewListPager
@@ -217,7 +214,7 @@ func (client *EmailConfigurationClient) NewListPager(resourceGroupName string, v
}
// listCreateRequest creates the List request.
-func (client *EmailConfigurationClient) listCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, options *EmailConfigurationClientListOptions) (*policy.Request, error) {
+func (client *EmailConfigurationClient) listCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, _ *EmailConfigurationClientListOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@@ -236,7 +233,7 @@ func (client *EmailConfigurationClient) listCreateRequest(ctx context.Context, r
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
+ reqQP.Set("api-version", "2024-09-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -245,7 +242,7 @@ func (client *EmailConfigurationClient) listCreateRequest(ctx context.Context, r
// listHandleResponse handles the List response.
func (client *EmailConfigurationClient) listHandleResponse(resp *http.Response) (EmailConfigurationClientListResponse, error) {
result := EmailConfigurationClientListResponse{}
- if err := runtime.UnmarshalAsJSON(resp, &result.EmailConfigurationModelCollection); err != nil {
+ if err := runtime.UnmarshalAsJSON(resp, &result.EmailConfigurationModelListResult); err != nil {
return EmailConfigurationClientListResponse{}, err
}
return result, nil
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/emailconfiguration_client_example_test.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/emailconfiguration_client_example_test.go
index 5b8a05f0d56a..2debde5f9d1c 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/emailconfiguration_client_example_test.go
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/emailconfiguration_client_example_test.go
@@ -1,120 +1,119 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-// DO NOT EDIT.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armrecoveryservicesdatareplication_test
import (
"context"
- "log"
-
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication"
+ "log"
)
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/EmailConfiguration_Get.json
-func ExampleEmailConfigurationClient_Get() {
+// Generated from example definition: 2024-09-01/EmailConfiguration_Create.json
+func ExampleEmailConfigurationClient_Create() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
- res, err := clientFactory.NewEmailConfigurationClient().Get(ctx, "rgrecoveryservicesdatareplication", "4", "0", nil)
+ res, err := clientFactory.NewEmailConfigurationClient().Create(ctx, "rgswagger_2024-09-01", "4", "0", armrecoveryservicesdatareplication.EmailConfigurationModel{
+ Properties: &armrecoveryservicesdatareplication.EmailConfigurationModelProperties{
+ SendToOwners: to.Ptr(true),
+ CustomEmailAddresses: []*string{
+ to.Ptr("ketvbducyailcny"),
+ },
+ Locale: to.Ptr("vpnjxjvdqtebnucyxiyrjiko"),
+ },
+ }, 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.EmailConfigurationModel = armrecoveryservicesdatareplication.EmailConfigurationModel{
- // Name: to.Ptr("ywjplnjzaeu"),
- // Type: to.Ptr("bkaq"),
- // ID: to.Ptr("bvbfy"),
- // Properties: &armrecoveryservicesdatareplication.EmailConfigurationModelProperties{
- // CustomEmailAddresses: []*string{
- // to.Ptr("ketvbducyailcny")},
- // Locale: to.Ptr("vpnjxjvdqtebnucyxiyrjiko"),
+ // res = armrecoveryservicesdatareplication.EmailConfigurationClientCreateResponse{
+ // EmailConfigurationModel: &armrecoveryservicesdatareplication.EmailConfigurationModel{
+ // Properties: &armrecoveryservicesdatareplication.EmailConfigurationModelProperties{
// SendToOwners: to.Ptr(true),
+ // CustomEmailAddresses: []*string{
+ // to.Ptr("ketvbducyailcny"),
+ // },
+ // Locale: to.Ptr("vpnjxjvdqtebnucyxiyrjiko"),
+ // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
// },
- // SystemData: &armrecoveryservicesdatareplication.EmailConfigurationModelSystemData{
- // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
+ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationVaults/vault1/alertSettings/emailConfiguration1"),
+ // Name: to.Ptr("ywjplnjzaeu"),
+ // Type: to.Ptr("bkaq"),
+ // SystemData: &armrecoveryservicesdatareplication.SystemData{
// CreatedBy: to.Ptr("ewufpudzcjrljhmmzhfnxoqdqwnya"),
- // CreatedByType: to.Ptr("zioqm"),
- // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
// LastModifiedBy: to.Ptr("rx"),
- // LastModifiedByType: to.Ptr("tqbvuqoakaaqij"),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
// },
- // }
+ // },
+ // }
}
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/EmailConfiguration_Create.json
-func ExampleEmailConfigurationClient_Create() {
+// Generated from example definition: 2024-09-01/EmailConfiguration_Get.json
+func ExampleEmailConfigurationClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
- res, err := clientFactory.NewEmailConfigurationClient().Create(ctx, "rgrecoveryservicesdatareplication", "4", "0", armrecoveryservicesdatareplication.EmailConfigurationModel{
- Properties: &armrecoveryservicesdatareplication.EmailConfigurationModelProperties{
- CustomEmailAddresses: []*string{
- to.Ptr("ketvbducyailcny")},
- Locale: to.Ptr("vpnjxjvdqtebnucyxiyrjiko"),
- SendToOwners: to.Ptr(true),
- },
- }, nil)
+ res, err := clientFactory.NewEmailConfigurationClient().Get(ctx, "rgswagger_2024-09-01", "4", "0", 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.EmailConfigurationModel = armrecoveryservicesdatareplication.EmailConfigurationModel{
- // Name: to.Ptr("ywjplnjzaeu"),
- // Type: to.Ptr("bkaq"),
- // ID: to.Ptr("bvbfy"),
- // Properties: &armrecoveryservicesdatareplication.EmailConfigurationModelProperties{
- // CustomEmailAddresses: []*string{
- // to.Ptr("ketvbducyailcny")},
- // Locale: to.Ptr("vpnjxjvdqtebnucyxiyrjiko"),
+ // res = armrecoveryservicesdatareplication.EmailConfigurationClientGetResponse{
+ // EmailConfigurationModel: &armrecoveryservicesdatareplication.EmailConfigurationModel{
+ // Properties: &armrecoveryservicesdatareplication.EmailConfigurationModelProperties{
// SendToOwners: to.Ptr(true),
+ // CustomEmailAddresses: []*string{
+ // to.Ptr("ketvbducyailcny"),
+ // },
+ // Locale: to.Ptr("vpnjxjvdqtebnucyxiyrjiko"),
+ // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
// },
- // SystemData: &armrecoveryservicesdatareplication.EmailConfigurationModelSystemData{
- // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
+ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationVaults/vault1/alertSettings/emailConfiguration1"),
+ // Name: to.Ptr("ywjplnjzaeu"),
+ // Type: to.Ptr("bkaq"),
+ // SystemData: &armrecoveryservicesdatareplication.SystemData{
// CreatedBy: to.Ptr("ewufpudzcjrljhmmzhfnxoqdqwnya"),
- // CreatedByType: to.Ptr("zioqm"),
- // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
// LastModifiedBy: to.Ptr("rx"),
- // LastModifiedByType: to.Ptr("tqbvuqoakaaqij"),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
// },
- // }
+ // },
+ // }
}
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/EmailConfiguration_List.json
+// Generated from example definition: 2024-09-01/EmailConfiguration_List.json
func ExampleEmailConfigurationClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
- pager := clientFactory.NewEmailConfigurationClient().NewListPager("rgrecoveryservicesdatareplication", "4", nil)
+ pager := clientFactory.NewEmailConfigurationClient().NewListPager("rgswagger_2024-09-01", "4", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
@@ -125,27 +124,30 @@ func ExampleEmailConfigurationClient_NewListPager() {
_ = 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.EmailConfigurationModelCollection = armrecoveryservicesdatareplication.EmailConfigurationModelCollection{
- // Value: []*armrecoveryservicesdatareplication.EmailConfigurationModel{
- // {
- // Name: to.Ptr("ywjplnjzaeu"),
- // Type: to.Ptr("bkaq"),
- // ID: to.Ptr("bvbfy"),
- // Properties: &armrecoveryservicesdatareplication.EmailConfigurationModelProperties{
- // CustomEmailAddresses: []*string{
- // to.Ptr("ketvbducyailcny")},
- // Locale: to.Ptr("vpnjxjvdqtebnucyxiyrjiko"),
+ // page = armrecoveryservicesdatareplication.EmailConfigurationClientListResponse{
+ // EmailConfigurationModelListResult: armrecoveryservicesdatareplication.EmailConfigurationModelListResult{
+ // Value: []*armrecoveryservicesdatareplication.EmailConfigurationModel{
+ // {
+ // Properties: &armrecoveryservicesdatareplication.EmailConfigurationModelProperties{
// SendToOwners: to.Ptr(true),
+ // CustomEmailAddresses: []*string{
+ // to.Ptr("ketvbducyailcny"),
+ // },
+ // Locale: to.Ptr("vpnjxjvdqtebnucyxiyrjiko"),
+ // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
// },
- // SystemData: &armrecoveryservicesdatareplication.EmailConfigurationModelSystemData{
- // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
+ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationVaults/vault1/alertSettings/emailConfiguration1"),
+ // Name: to.Ptr("ywjplnjzaeu"),
+ // Type: to.Ptr("bkaq"),
+ // SystemData: &armrecoveryservicesdatareplication.SystemData{
// CreatedBy: to.Ptr("ewufpudzcjrljhmmzhfnxoqdqwnya"),
- // CreatedByType: to.Ptr("zioqm"),
- // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
// LastModifiedBy: to.Ptr("rx"),
- // LastModifiedByType: to.Ptr("tqbvuqoakaaqij"),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
// },
- // }},
- // }
+ // },
+ // },
+ // },
+ // }
}
}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/event_client.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/event_client.go
index 2e4d0ede5400..b2ddcfdd3684 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/event_client.go
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/event_client.go
@@ -1,10 +1,6 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armrecoveryservicesdatareplication
@@ -17,6 +13,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
"net/http"
"net/url"
+ "strconv"
"strings"
)
@@ -46,7 +43,7 @@ func NewEventClient(subscriptionID string, credential azcore.TokenCredential, op
// Get - Gets the details of the event.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - vaultName - The vault name.
// - eventName - The event name.
@@ -74,7 +71,7 @@ func (client *EventClient) Get(ctx context.Context, resourceGroupName string, va
}
// getCreateRequest creates the Get request.
-func (client *EventClient) getCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, eventName string, options *EventClientGetOptions) (*policy.Request, error) {
+func (client *EventClient) getCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, eventName string, _ *EventClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@@ -97,7 +94,7 @@ func (client *EventClient) getCreateRequest(ctx context.Context, resourceGroupNa
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
+ reqQP.Set("api-version", "2024-09-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -114,7 +111,7 @@ func (client *EventClient) getHandleResponse(resp *http.Response) (EventClientGe
// NewListPager - Gets the list of events in the given vault.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - vaultName - The vault name.
// - options - EventClientListOptions contains the optional parameters for the EventClient.NewListPager method.
@@ -161,13 +158,16 @@ func (client *EventClient) listCreateRequest(ctx context.Context, resourceGroupN
return nil, err
}
reqQP := req.Raw().URL.Query()
- if options != nil && options.Filter != nil {
- reqQP.Set("$filter", *options.Filter)
- }
+ reqQP.Set("api-version", "2024-09-01")
if options != nil && options.ContinuationToken != nil {
reqQP.Set("continuationToken", *options.ContinuationToken)
}
- reqQP.Set("api-version", "2021-02-16-preview")
+ if options != nil && options.OdataOptions != nil {
+ reqQP.Set("odataOptions", *options.OdataOptions)
+ }
+ if options != nil && options.PageSize != nil {
+ reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10))
+ }
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -176,7 +176,7 @@ func (client *EventClient) listCreateRequest(ctx context.Context, resourceGroupN
// listHandleResponse handles the List response.
func (client *EventClient) listHandleResponse(resp *http.Response) (EventClientListResponse, error) {
result := EventClientListResponse{}
- if err := runtime.UnmarshalAsJSON(resp, &result.EventModelCollection); err != nil {
+ if err := runtime.UnmarshalAsJSON(resp, &result.EventModelListResult); err != nil {
return EventClientListResponse{}, err
}
return result, nil
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/event_client_example_test.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/event_client_example_test.go
index 27712dbc1d58..888dc53b9fa1 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/event_client_example_test.go
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/event_client_example_test.go
@@ -1,114 +1,108 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-// DO NOT EDIT.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armrecoveryservicesdatareplication_test
import (
"context"
- "log"
-
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication"
+ "log"
)
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Event_Get.json
+// Generated from example definition: 2024-09-01/Event_Get.json
func ExampleEventClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
- res, err := clientFactory.NewEventClient().Get(ctx, "rgrecoveryservicesdatareplication", "4", "231CIG", nil)
+ res, err := clientFactory.NewEventClient().Get(ctx, "rgswagger_2024-09-01", "4", "231CIG", 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.EventModel = armrecoveryservicesdatareplication.EventModel{
- // Name: to.Ptr("j"),
- // Type: to.Ptr("lgk"),
- // ID: to.Ptr("fgbppsytxctsrsxlfugyohhu"),
- // Properties: &armrecoveryservicesdatareplication.EventModelProperties{
- // Description: to.Ptr("hkeiogebluvfpdgxogwesjmtbbok"),
- // CorrelationID: to.Ptr("lwfsxforxnhvpmheujutjicflmxv"),
- // CustomProperties: &armrecoveryservicesdatareplication.EventModelCustomProperties{
- // InstanceType: to.Ptr("EventModelCustomProperties"),
- // },
- // EventName: to.Ptr("s"),
- // EventType: to.Ptr("npumqmvspm"),
- // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
- // {
- // AffectedResourceCorrelationIDs: []*string{
- // to.Ptr("fope")},
+ // res = armrecoveryservicesdatareplication.EventClientGetResponse{
+ // EventModel: &armrecoveryservicesdatareplication.EventModel{
+ // Properties: &armrecoveryservicesdatareplication.EventModelProperties{
+ // ResourceType: to.Ptr("surgdzezskgregozynvlinfutyh"),
+ // ResourceName: to.Ptr("yhpkowkbvtqnbiklnjzc"),
+ // EventType: to.Ptr("npumqmvspm"),
+ // EventName: to.Ptr("s"),
+ // TimeOfOccurrence: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.432Z"); return t}()),
+ // Severity: to.Ptr("sjous"),
+ // CorrelationID: to.Ptr("lwfsxforxnhvpmheujutjicflmxv"),
+ // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
+ // {
// AffectedResourceType: to.Ptr("scfniv"),
- // Category: to.Ptr("leigw"),
- // Causes: to.Ptr("xznphqrrmsdzm"),
+ // AffectedResourceCorrelationIDs: []*string{
+ // to.Ptr("fope"),
+ // },
// ChildErrors: []*armrecoveryservicesdatareplication.InnerHealthErrorModel{
// {
- // Category: to.Ptr("lcsdxrqxquke"),
- // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
// Code: to.Ptr("yuxxpblihirpedwkigywgwjjrlzq"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("mhdgfjqwbikhxmhtomkl"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("sskcei"),
- // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // Category: to.Ptr("lcsdxrqxquke"),
// Severity: to.Ptr("wqxxiuaqjyagq"),
// Source: to.Ptr("wevvftugwydzzw"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("djsmgrltruljo"),
- // }},
+ // Message: to.Ptr("sskcei"),
+ // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
+ // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // },
+ // },
// Code: to.Ptr("dgxkefzmeukd"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("itc"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("lbywtdprdqdekl"),
- // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // Category: to.Ptr("leigw"),
// Severity: to.Ptr("vvdajssdcypewdyechilxjmuijvdd"),
// Source: to.Ptr("iy"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("jtooblbvaxxrvcwgscbobq"),
- // }},
- // ResourceName: to.Ptr("yhpkowkbvtqnbiklnjzc"),
- // ResourceType: to.Ptr("surgdzezskgregozynvlinfutyh"),
- // Severity: to.Ptr("sjous"),
- // TimeOfOccurrence: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.432Z"); return t}()),
+ // Message: to.Ptr("lbywtdprdqdekl"),
+ // Causes: to.Ptr("xznphqrrmsdzm"),
+ // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // },
+ // },
+ // Description: to.Ptr("kwjzliiqagudb"),
+ // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
// },
- // SystemData: &armrecoveryservicesdatareplication.EventModelSystemData{
- // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.432Z"); return t}()),
+ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationVaults/vault1/events/event1"),
+ // Name: to.Ptr("j"),
+ // Type: to.Ptr("lgk"),
+ // SystemData: &armrecoveryservicesdatareplication.SystemData{
// CreatedBy: to.Ptr("uske"),
- // CreatedByType: to.Ptr("luzowppyxjalugkef"),
- // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.432Z"); return t}()),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.432Z"); return t}()),
// LastModifiedBy: to.Ptr("ufrixpmhben"),
- // LastModifiedByType: to.Ptr("aubgraubkuaeipwzvbcgnlpseobx"),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.432Z"); return t}()),
// },
- // }
+ // },
+ // }
}
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Event_List.json
+// Generated from example definition: 2024-09-01/Event_List.json
func ExampleEventClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
- pager := clientFactory.NewEventClient().NewListPager("rgrecoveryservicesdatareplication", "4", &armrecoveryservicesdatareplication.EventClientListOptions{Filter: to.Ptr("wbglupjzvkirtgnnyasxom"),
- ContinuationToken: to.Ptr("cxtufi"),
- })
+ pager := clientFactory.NewEventClient().NewListPager("rgswagger_2024-09-01", "4", &EventClientListOptions{
+ continuationToken: to.Ptr("gabpzsxrifposvleqqcjnvofz")})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
@@ -119,65 +113,67 @@ func ExampleEventClient_NewListPager() {
_ = 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.EventModelCollection = armrecoveryservicesdatareplication.EventModelCollection{
- // Value: []*armrecoveryservicesdatareplication.EventModel{
- // {
- // Name: to.Ptr("j"),
- // Type: to.Ptr("lgk"),
- // ID: to.Ptr("fgbppsytxctsrsxlfugyohhu"),
- // Properties: &armrecoveryservicesdatareplication.EventModelProperties{
- // Description: to.Ptr("hkeiogebluvfpdgxogwesjmtbbok"),
- // CorrelationID: to.Ptr("lwfsxforxnhvpmheujutjicflmxv"),
- // CustomProperties: &armrecoveryservicesdatareplication.EventModelCustomProperties{
- // InstanceType: to.Ptr("EventModelCustomProperties"),
- // },
- // EventName: to.Ptr("s"),
- // EventType: to.Ptr("npumqmvspm"),
- // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
- // {
- // AffectedResourceCorrelationIDs: []*string{
- // to.Ptr("fope")},
+ // page = armrecoveryservicesdatareplication.EventClientListResponse{
+ // EventModelListResult: armrecoveryservicesdatareplication.EventModelListResult{
+ // Value: []*armrecoveryservicesdatareplication.EventModel{
+ // {
+ // Properties: &armrecoveryservicesdatareplication.EventModelProperties{
+ // ResourceType: to.Ptr("surgdzezskgregozynvlinfutyh"),
+ // ResourceName: to.Ptr("yhpkowkbvtqnbiklnjzc"),
+ // EventType: to.Ptr("npumqmvspm"),
+ // EventName: to.Ptr("s"),
+ // TimeOfOccurrence: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.432Z"); return t}()),
+ // Severity: to.Ptr("sjous"),
+ // CorrelationID: to.Ptr("lwfsxforxnhvpmheujutjicflmxv"),
+ // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
+ // {
// AffectedResourceType: to.Ptr("scfniv"),
- // Category: to.Ptr("leigw"),
- // Causes: to.Ptr("xznphqrrmsdzm"),
+ // AffectedResourceCorrelationIDs: []*string{
+ // to.Ptr("fope"),
+ // },
// ChildErrors: []*armrecoveryservicesdatareplication.InnerHealthErrorModel{
// {
- // Category: to.Ptr("lcsdxrqxquke"),
- // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
// Code: to.Ptr("yuxxpblihirpedwkigywgwjjrlzq"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("mhdgfjqwbikhxmhtomkl"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("sskcei"),
- // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // Category: to.Ptr("lcsdxrqxquke"),
// Severity: to.Ptr("wqxxiuaqjyagq"),
// Source: to.Ptr("wevvftugwydzzw"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("djsmgrltruljo"),
- // }},
+ // Message: to.Ptr("sskcei"),
+ // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
+ // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // },
+ // },
// Code: to.Ptr("dgxkefzmeukd"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("itc"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("lbywtdprdqdekl"),
- // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // Category: to.Ptr("leigw"),
// Severity: to.Ptr("vvdajssdcypewdyechilxjmuijvdd"),
// Source: to.Ptr("iy"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("jtooblbvaxxrvcwgscbobq"),
- // }},
- // ResourceName: to.Ptr("yhpkowkbvtqnbiklnjzc"),
- // ResourceType: to.Ptr("surgdzezskgregozynvlinfutyh"),
- // Severity: to.Ptr("sjous"),
- // TimeOfOccurrence: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.432Z"); return t}()),
+ // Message: to.Ptr("lbywtdprdqdekl"),
+ // Causes: to.Ptr("xznphqrrmsdzm"),
+ // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // },
+ // },
+ // Description: to.Ptr("dk"),
+ // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
// },
- // SystemData: &armrecoveryservicesdatareplication.EventModelSystemData{
- // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.432Z"); return t}()),
+ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationVaults/vault1/events/event1"),
+ // Name: to.Ptr("j"),
+ // Type: to.Ptr("lgk"),
+ // SystemData: &armrecoveryservicesdatareplication.SystemData{
// CreatedBy: to.Ptr("uske"),
- // CreatedByType: to.Ptr("luzowppyxjalugkef"),
- // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.432Z"); return t}()),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.432Z"); return t}()),
// LastModifiedBy: to.Ptr("ufrixpmhben"),
- // LastModifiedByType: to.Ptr("aubgraubkuaeipwzvbcgnlpseobx"),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.432Z"); return t}()),
// },
- // }},
- // }
+ // },
+ // },
+ // },
+ // }
}
}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabric_client.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabric_client.go
index 26f1dd118309..9141c891f1d5 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabric_client.go
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabric_client.go
@@ -1,10 +1,6 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armrecoveryservicesdatareplication
@@ -46,20 +42,19 @@ func NewFabricClient(subscriptionID string, credential azcore.TokenCredential, o
// BeginCreate - Creates the fabric.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - fabricName - The fabric name.
-// - body - Fabric properties.
+// - resource - Fabric properties.
// - options - FabricClientBeginCreateOptions contains the optional parameters for the FabricClient.BeginCreate method.
-func (client *FabricClient) BeginCreate(ctx context.Context, resourceGroupName string, fabricName string, body FabricModel, options *FabricClientBeginCreateOptions) (*runtime.Poller[FabricClientCreateResponse], error) {
+func (client *FabricClient) BeginCreate(ctx context.Context, resourceGroupName string, fabricName string, resource FabricModel, options *FabricClientBeginCreateOptions) (*runtime.Poller[FabricClientCreateResponse], error) {
if options == nil || options.ResumeToken == "" {
- resp, err := client.create(ctx, resourceGroupName, fabricName, body, options)
+ resp, err := client.create(ctx, resourceGroupName, fabricName, resource, options)
if err != nil {
return nil, err
}
poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FabricClientCreateResponse]{
- FinalStateVia: runtime.FinalStateViaLocation,
- Tracer: client.internal.Tracer(),
+ Tracer: client.internal.Tracer(),
})
return poller, err
} else {
@@ -72,14 +67,14 @@ func (client *FabricClient) BeginCreate(ctx context.Context, resourceGroupName s
// Create - Creates the fabric.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2021-02-16-preview
-func (client *FabricClient) create(ctx context.Context, resourceGroupName string, fabricName string, body FabricModel, options *FabricClientBeginCreateOptions) (*http.Response, error) {
+// Generated from API version 2024-09-01
+func (client *FabricClient) create(ctx context.Context, resourceGroupName string, fabricName string, resource FabricModel, options *FabricClientBeginCreateOptions) (*http.Response, error) {
var err error
const operationName = "FabricClient.BeginCreate"
ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
defer func() { endSpan(err) }()
- req, err := client.createCreateRequest(ctx, resourceGroupName, fabricName, body, options)
+ req, err := client.createCreateRequest(ctx, resourceGroupName, fabricName, resource, options)
if err != nil {
return nil, err
}
@@ -95,7 +90,7 @@ func (client *FabricClient) create(ctx context.Context, resourceGroupName string
}
// createCreateRequest creates the Create request.
-func (client *FabricClient) createCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, body FabricModel, options *FabricClientBeginCreateOptions) (*policy.Request, error) {
+func (client *FabricClient) createCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, resource FabricModel, _ *FabricClientBeginCreateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@@ -114,10 +109,11 @@ func (client *FabricClient) createCreateRequest(ctx context.Context, resourceGro
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
+ reqQP.Set("api-version", "2024-09-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
- if err := runtime.MarshalAsJSON(req, body); err != nil {
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, resource); err != nil {
return nil, err
}
return req, nil
@@ -126,7 +122,7 @@ func (client *FabricClient) createCreateRequest(ctx context.Context, resourceGro
// BeginDelete - Removes the fabric.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - fabricName - The fabric name.
// - options - FabricClientBeginDeleteOptions contains the optional parameters for the FabricClient.BeginDelete method.
@@ -137,8 +133,7 @@ func (client *FabricClient) BeginDelete(ctx context.Context, resourceGroupName s
return nil, err
}
poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FabricClientDeleteResponse]{
- FinalStateVia: runtime.FinalStateViaLocation,
- Tracer: client.internal.Tracer(),
+ Tracer: client.internal.Tracer(),
})
return poller, err
} else {
@@ -151,7 +146,7 @@ func (client *FabricClient) BeginDelete(ctx context.Context, resourceGroupName s
// Delete - Removes the fabric.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
func (client *FabricClient) deleteOperation(ctx context.Context, resourceGroupName string, fabricName string, options *FabricClientBeginDeleteOptions) (*http.Response, error) {
var err error
const operationName = "FabricClient.BeginDelete"
@@ -174,7 +169,7 @@ func (client *FabricClient) deleteOperation(ctx context.Context, resourceGroupNa
}
// deleteCreateRequest creates the Delete request.
-func (client *FabricClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, options *FabricClientBeginDeleteOptions) (*policy.Request, error) {
+func (client *FabricClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, _ *FabricClientBeginDeleteOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@@ -193,7 +188,7 @@ func (client *FabricClient) deleteCreateRequest(ctx context.Context, resourceGro
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
+ reqQP.Set("api-version", "2024-09-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -202,7 +197,7 @@ func (client *FabricClient) deleteCreateRequest(ctx context.Context, resourceGro
// Get - Gets the details of the fabric.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - fabricName - The fabric name.
// - options - FabricClientGetOptions contains the optional parameters for the FabricClient.Get method.
@@ -229,7 +224,7 @@ func (client *FabricClient) Get(ctx context.Context, resourceGroupName string, f
}
// getCreateRequest creates the Get request.
-func (client *FabricClient) getCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, options *FabricClientGetOptions) (*policy.Request, error) {
+func (client *FabricClient) getCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, _ *FabricClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@@ -248,7 +243,7 @@ func (client *FabricClient) getCreateRequest(ctx context.Context, resourceGroupN
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
+ reqQP.Set("api-version", "2024-09-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -265,7 +260,7 @@ func (client *FabricClient) getHandleResponse(resp *http.Response) (FabricClient
// NewListPager - Gets the list of fabrics in the given subscription and resource group.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - options - FabricClientListOptions contains the optional parameters for the FabricClient.NewListPager method.
func (client *FabricClient) NewListPager(resourceGroupName string, options *FabricClientListOptions) *runtime.Pager[FabricClientListResponse] {
@@ -307,10 +302,10 @@ func (client *FabricClient) listCreateRequest(ctx context.Context, resourceGroup
return nil, err
}
reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2024-09-01")
if options != nil && options.ContinuationToken != nil {
reqQP.Set("continuationToken", *options.ContinuationToken)
}
- reqQP.Set("api-version", "2021-02-16-preview")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -319,7 +314,7 @@ func (client *FabricClient) listCreateRequest(ctx context.Context, resourceGroup
// listHandleResponse handles the List response.
func (client *FabricClient) listHandleResponse(resp *http.Response) (FabricClientListResponse, error) {
result := FabricClientListResponse{}
- if err := runtime.UnmarshalAsJSON(resp, &result.FabricModelCollection); err != nil {
+ if err := runtime.UnmarshalAsJSON(resp, &result.FabricModelListResult); err != nil {
return FabricClientListResponse{}, err
}
return result, nil
@@ -327,7 +322,7 @@ func (client *FabricClient) listHandleResponse(resp *http.Response) (FabricClien
// NewListBySubscriptionPager - Gets the list of fabrics in the given subscription.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
// - options - FabricClientListBySubscriptionOptions contains the optional parameters for the FabricClient.NewListBySubscriptionPager
// method.
func (client *FabricClient) NewListBySubscriptionPager(options *FabricClientListBySubscriptionOptions) *runtime.Pager[FabricClientListBySubscriptionResponse] {
@@ -354,7 +349,7 @@ func (client *FabricClient) NewListBySubscriptionPager(options *FabricClientList
}
// listBySubscriptionCreateRequest creates the ListBySubscription request.
-func (client *FabricClient) listBySubscriptionCreateRequest(ctx context.Context, options *FabricClientListBySubscriptionOptions) (*policy.Request, error) {
+func (client *FabricClient) listBySubscriptionCreateRequest(ctx context.Context, _ *FabricClientListBySubscriptionOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@@ -365,10 +360,7 @@ func (client *FabricClient) listBySubscriptionCreateRequest(ctx context.Context,
return nil, err
}
reqQP := req.Raw().URL.Query()
- if options != nil && options.ContinuationToken != nil {
- reqQP.Set("continuationToken", *options.ContinuationToken)
- }
- reqQP.Set("api-version", "2021-02-16-preview")
+ reqQP.Set("api-version", "2024-09-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -377,7 +369,7 @@ func (client *FabricClient) listBySubscriptionCreateRequest(ctx context.Context,
// listBySubscriptionHandleResponse handles the ListBySubscription response.
func (client *FabricClient) listBySubscriptionHandleResponse(resp *http.Response) (FabricClientListBySubscriptionResponse, error) {
result := FabricClientListBySubscriptionResponse{}
- if err := runtime.UnmarshalAsJSON(resp, &result.FabricModelCollection); err != nil {
+ if err := runtime.UnmarshalAsJSON(resp, &result.FabricModelListResult); err != nil {
return FabricClientListBySubscriptionResponse{}, err
}
return result, nil
@@ -386,20 +378,19 @@ func (client *FabricClient) listBySubscriptionHandleResponse(resp *http.Response
// BeginUpdate - Performs update on the fabric.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - fabricName - The fabric name.
-// - body - Fabric properties.
+// - properties - Fabric properties.
// - options - FabricClientBeginUpdateOptions contains the optional parameters for the FabricClient.BeginUpdate method.
-func (client *FabricClient) BeginUpdate(ctx context.Context, resourceGroupName string, fabricName string, body FabricModelUpdate, options *FabricClientBeginUpdateOptions) (*runtime.Poller[FabricClientUpdateResponse], error) {
+func (client *FabricClient) BeginUpdate(ctx context.Context, resourceGroupName string, fabricName string, properties FabricModelUpdate, options *FabricClientBeginUpdateOptions) (*runtime.Poller[FabricClientUpdateResponse], error) {
if options == nil || options.ResumeToken == "" {
- resp, err := client.update(ctx, resourceGroupName, fabricName, body, options)
+ resp, err := client.update(ctx, resourceGroupName, fabricName, properties, options)
if err != nil {
return nil, err
}
poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FabricClientUpdateResponse]{
- FinalStateVia: runtime.FinalStateViaLocation,
- Tracer: client.internal.Tracer(),
+ Tracer: client.internal.Tracer(),
})
return poller, err
} else {
@@ -412,14 +403,14 @@ func (client *FabricClient) BeginUpdate(ctx context.Context, resourceGroupName s
// Update - Performs update on the fabric.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2021-02-16-preview
-func (client *FabricClient) update(ctx context.Context, resourceGroupName string, fabricName string, body FabricModelUpdate, options *FabricClientBeginUpdateOptions) (*http.Response, error) {
+// Generated from API version 2024-09-01
+func (client *FabricClient) update(ctx context.Context, resourceGroupName string, fabricName string, properties FabricModelUpdate, options *FabricClientBeginUpdateOptions) (*http.Response, error) {
var err error
const operationName = "FabricClient.BeginUpdate"
ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
defer func() { endSpan(err) }()
- req, err := client.updateCreateRequest(ctx, resourceGroupName, fabricName, body, options)
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, fabricName, properties, options)
if err != nil {
return nil, err
}
@@ -435,7 +426,7 @@ func (client *FabricClient) update(ctx context.Context, resourceGroupName string
}
// updateCreateRequest creates the Update request.
-func (client *FabricClient) updateCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, body FabricModelUpdate, options *FabricClientBeginUpdateOptions) (*policy.Request, error) {
+func (client *FabricClient) updateCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, properties FabricModelUpdate, _ *FabricClientBeginUpdateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@@ -454,10 +445,11 @@ func (client *FabricClient) updateCreateRequest(ctx context.Context, resourceGro
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
+ reqQP.Set("api-version", "2024-09-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
- if err := runtime.MarshalAsJSON(req, body); err != nil {
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
return nil, err
}
return req, nil
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabric_client_example_test.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabric_client_example_test.go
index def3033daaf4..c2fdac552c9d 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabric_client_example_test.go
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabric_client_example_test.go
@@ -1,314 +1,211 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-// DO NOT EDIT.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armrecoveryservicesdatareplication_test
import (
"context"
- "log"
-
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication"
+ "log"
)
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_Get.json
-func ExampleFabricClient_Get() {
+// Generated from example definition: 2024-09-01/Fabric_Create.json
+func ExampleFabricClient_BeginCreate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
- res, err := clientFactory.NewFabricClient().Get(ctx, "rgrecoveryservicesdatareplication", "wPR", nil)
+ poller, err := clientFactory.NewFabricClient().BeginCreate(ctx, "rgswagger_2024-09-01", "wPR", armrecoveryservicesdatareplication.FabricModel{
+ Location: to.Ptr("tqygutlpob"),
+ Properties: &armrecoveryservicesdatareplication.FabricModelProperties{},
+ }, 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.FabricModel = armrecoveryservicesdatareplication.FabricModel{
- // Name: to.Ptr("rhojydcwjgvgexpdwswjib"),
- // Type: to.Ptr("toipsryjyqchikyakeiuatshiu"),
- // ID: to.Ptr("ycaxtshcmldt"),
- // Location: to.Ptr("tqygutlpob"),
- // Properties: &armrecoveryservicesdatareplication.FabricModelProperties{
- // CustomProperties: &armrecoveryservicesdatareplication.FabricModelCustomProperties{
- // InstanceType: to.Ptr("FabricModelCustomProperties"),
- // },
- // Health: to.Ptr(armrecoveryservicesdatareplication.HealthStatusNormal),
- // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
- // {
- // AffectedResourceCorrelationIDs: []*string{
- // to.Ptr("fope")},
+ // res = armrecoveryservicesdatareplication.FabricClientCreateResponse{
+ // FabricModel: &armrecoveryservicesdatareplication.FabricModel{
+ // Location: to.Ptr("tqygutlpob"),
+ // Properties: &armrecoveryservicesdatareplication.FabricModelProperties{
+ // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
+ // ServiceEndpoint: to.Ptr("ilrfl"),
+ // ServiceResourceID: to.Ptr("xukigpdrbyyy"),
+ // Health: to.Ptr(armrecoveryservicesdatareplication.HealthStatusNormal),
+ // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
+ // {
// AffectedResourceType: to.Ptr("scfniv"),
- // Category: to.Ptr("leigw"),
- // Causes: to.Ptr("xznphqrrmsdzm"),
+ // AffectedResourceCorrelationIDs: []*string{
+ // to.Ptr("fope"),
+ // },
// ChildErrors: []*armrecoveryservicesdatareplication.InnerHealthErrorModel{
// {
- // Category: to.Ptr("lcsdxrqxquke"),
- // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
// Code: to.Ptr("yuxxpblihirpedwkigywgwjjrlzq"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("mhdgfjqwbikhxmhtomkl"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("sskcei"),
- // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // Category: to.Ptr("lcsdxrqxquke"),
// Severity: to.Ptr("wqxxiuaqjyagq"),
// Source: to.Ptr("wevvftugwydzzw"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("djsmgrltruljo"),
- // }},
+ // Message: to.Ptr("sskcei"),
+ // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
+ // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // },
+ // },
// Code: to.Ptr("dgxkefzmeukd"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("itc"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("lbywtdprdqdekl"),
- // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // Category: to.Ptr("leigw"),
// Severity: to.Ptr("vvdajssdcypewdyechilxjmuijvdd"),
// Source: to.Ptr("iy"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("jtooblbvaxxrvcwgscbobq"),
- // }},
- // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateSucceeded),
- // ServiceEndpoint: to.Ptr("ilrfl"),
- // ServiceResourceID: to.Ptr("xukigpdrbyyy"),
- // },
- // SystemData: &armrecoveryservicesdatareplication.FabricModelSystemData{
- // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
- // CreatedBy: to.Ptr("yhdmbqrsgimuucexvpas"),
- // CreatedByType: to.Ptr("brnojz"),
- // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
- // LastModifiedBy: to.Ptr("balecqnwu"),
- // LastModifiedByType: to.Ptr("ukvqlncihf"),
+ // Message: to.Ptr("lbywtdprdqdekl"),
+ // Causes: to.Ptr("xznphqrrmsdzm"),
+ // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // },
+ // },
// },
// Tags: map[string]*string{
- // "key3917": to.Ptr("vgralu"),
// },
- // }
+ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationFabrics/fabric1"),
+ // Name: to.Ptr("rhojydcwjgvgexpdwswjib"),
+ // Type: to.Ptr("toipsryjyqchikyakeiuatshiu"),
+ // SystemData: &armrecoveryservicesdatareplication.SystemData{
+ // CreatedBy: to.Ptr("ewufpudzcjrljhmmzhfnxoqdqwnya"),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
+ // LastModifiedBy: to.Ptr("rx"),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
+ // },
+ // },
+ // }
}
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_Create.json
-func ExampleFabricClient_BeginCreate() {
+// Generated from example definition: 2024-09-01/Fabric_Delete.json
+func ExampleFabricClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
- poller, err := clientFactory.NewFabricClient().BeginCreate(ctx, "rgrecoveryservicesdatareplication", "wPR", armrecoveryservicesdatareplication.FabricModel{
- Location: to.Ptr("tqygutlpob"),
- Properties: &armrecoveryservicesdatareplication.FabricModelProperties{
- CustomProperties: &armrecoveryservicesdatareplication.FabricModelCustomProperties{
- InstanceType: to.Ptr("FabricModelCustomProperties"),
- },
- },
- Tags: map[string]*string{
- "key3917": to.Ptr("vgralu"),
- },
- }, nil)
+ poller, err := clientFactory.NewFabricClient().BeginDelete(ctx, "rgrecoveryservicesdatareplication", "wPR", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
- res, err := poller.PollUntilDone(ctx, nil)
+ _, 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.FabricModel = armrecoveryservicesdatareplication.FabricModel{
- // Name: to.Ptr("rhojydcwjgvgexpdwswjib"),
- // Type: to.Ptr("toipsryjyqchikyakeiuatshiu"),
- // ID: to.Ptr("ycaxtshcmldt"),
- // Location: to.Ptr("tqygutlpob"),
- // Properties: &armrecoveryservicesdatareplication.FabricModelProperties{
- // CustomProperties: &armrecoveryservicesdatareplication.FabricModelCustomProperties{
- // InstanceType: to.Ptr("FabricModelCustomProperties"),
- // },
- // Health: to.Ptr(armrecoveryservicesdatareplication.HealthStatusNormal),
- // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
- // {
- // AffectedResourceCorrelationIDs: []*string{
- // to.Ptr("fope")},
- // AffectedResourceType: to.Ptr("scfniv"),
- // Category: to.Ptr("leigw"),
- // Causes: to.Ptr("xznphqrrmsdzm"),
- // ChildErrors: []*armrecoveryservicesdatareplication.InnerHealthErrorModel{
- // {
- // Category: to.Ptr("lcsdxrqxquke"),
- // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
- // Code: to.Ptr("yuxxpblihirpedwkigywgwjjrlzq"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
- // HealthCategory: to.Ptr("mhdgfjqwbikhxmhtomkl"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("sskcei"),
- // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
- // Severity: to.Ptr("wqxxiuaqjyagq"),
- // Source: to.Ptr("wevvftugwydzzw"),
- // Summary: to.Ptr("djsmgrltruljo"),
- // }},
- // Code: to.Ptr("dgxkefzmeukd"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
- // HealthCategory: to.Ptr("itc"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("lbywtdprdqdekl"),
- // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
- // Severity: to.Ptr("vvdajssdcypewdyechilxjmuijvdd"),
- // Source: to.Ptr("iy"),
- // Summary: to.Ptr("jtooblbvaxxrvcwgscbobq"),
- // }},
- // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateSucceeded),
- // ServiceEndpoint: to.Ptr("ilrfl"),
- // ServiceResourceID: to.Ptr("xukigpdrbyyy"),
- // },
- // SystemData: &armrecoveryservicesdatareplication.FabricModelSystemData{
- // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
- // CreatedBy: to.Ptr("yhdmbqrsgimuucexvpas"),
- // CreatedByType: to.Ptr("brnojz"),
- // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
- // LastModifiedBy: to.Ptr("balecqnwu"),
- // LastModifiedByType: to.Ptr("ukvqlncihf"),
- // },
- // Tags: map[string]*string{
- // "key3917": to.Ptr("vgralu"),
- // },
- // }
}
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_Update.json
-func ExampleFabricClient_BeginUpdate() {
+// Generated from example definition: 2024-09-01/Fabric_Get.json
+func ExampleFabricClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
- poller, err := clientFactory.NewFabricClient().BeginUpdate(ctx, "rgrecoveryservicesdatareplication", "wPR", armrecoveryservicesdatareplication.FabricModelUpdate{
- Properties: &armrecoveryservicesdatareplication.FabricModelProperties{
- CustomProperties: &armrecoveryservicesdatareplication.FabricModelCustomProperties{
- InstanceType: to.Ptr("FabricModelCustomProperties"),
- },
- },
- Tags: map[string]*string{
- "key6664": to.Ptr("def"),
- },
- }, nil)
+ res, err := clientFactory.NewFabricClient().Get(ctx, "rgrecoveryservicesdatareplication", "wPR", 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.FabricModel = armrecoveryservicesdatareplication.FabricModel{
- // Name: to.Ptr("rhojydcwjgvgexpdwswjib"),
- // Type: to.Ptr("toipsryjyqchikyakeiuatshiu"),
- // ID: to.Ptr("ycaxtshcmldt"),
- // Location: to.Ptr("tqygutlpob"),
- // Properties: &armrecoveryservicesdatareplication.FabricModelProperties{
- // CustomProperties: &armrecoveryservicesdatareplication.FabricModelCustomProperties{
- // InstanceType: to.Ptr("FabricModelCustomProperties"),
- // },
- // Health: to.Ptr(armrecoveryservicesdatareplication.HealthStatusNormal),
- // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
- // {
- // AffectedResourceCorrelationIDs: []*string{
- // to.Ptr("fope")},
+ // res = armrecoveryservicesdatareplication.FabricClientGetResponse{
+ // FabricModel: &armrecoveryservicesdatareplication.FabricModel{
+ // Location: to.Ptr("tqygutlpob"),
+ // Properties: &armrecoveryservicesdatareplication.FabricModelProperties{
+ // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
+ // ServiceEndpoint: to.Ptr("ilrfl"),
+ // ServiceResourceID: to.Ptr("xukigpdrbyyy"),
+ // Health: to.Ptr(armrecoveryservicesdatareplication.HealthStatusNormal),
+ // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
+ // {
// AffectedResourceType: to.Ptr("scfniv"),
- // Category: to.Ptr("leigw"),
- // Causes: to.Ptr("xznphqrrmsdzm"),
+ // AffectedResourceCorrelationIDs: []*string{
+ // to.Ptr("fope"),
+ // },
// ChildErrors: []*armrecoveryservicesdatareplication.InnerHealthErrorModel{
// {
- // Category: to.Ptr("lcsdxrqxquke"),
- // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
// Code: to.Ptr("yuxxpblihirpedwkigywgwjjrlzq"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("mhdgfjqwbikhxmhtomkl"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("sskcei"),
- // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // Category: to.Ptr("lcsdxrqxquke"),
// Severity: to.Ptr("wqxxiuaqjyagq"),
// Source: to.Ptr("wevvftugwydzzw"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("djsmgrltruljo"),
- // }},
+ // Message: to.Ptr("sskcei"),
+ // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
+ // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // },
+ // },
// Code: to.Ptr("dgxkefzmeukd"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("itc"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("lbywtdprdqdekl"),
- // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // Category: to.Ptr("leigw"),
// Severity: to.Ptr("vvdajssdcypewdyechilxjmuijvdd"),
// Source: to.Ptr("iy"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("jtooblbvaxxrvcwgscbobq"),
- // }},
- // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateSucceeded),
- // ServiceEndpoint: to.Ptr("ilrfl"),
- // ServiceResourceID: to.Ptr("xukigpdrbyyy"),
+ // Message: to.Ptr("lbywtdprdqdekl"),
+ // Causes: to.Ptr("xznphqrrmsdzm"),
+ // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // },
+ // },
// },
- // SystemData: &armrecoveryservicesdatareplication.FabricModelSystemData{
- // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
+ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationFabrics/fabric1"),
+ // Name: to.Ptr("rhojydcwjgvgexpdwswjib"),
+ // Type: to.Ptr("toipsryjyqchikyakeiuatshiu"),
+ // SystemData: &armrecoveryservicesdatareplication.SystemData{
// CreatedBy: to.Ptr("yhdmbqrsgimuucexvpas"),
- // CreatedByType: to.Ptr("brnojz"),
- // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
// LastModifiedBy: to.Ptr("balecqnwu"),
- // LastModifiedByType: to.Ptr("ukvqlncihf"),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
// },
// Tags: map[string]*string{
// "key3917": to.Ptr("vgralu"),
// },
- // }
+ // },
+ // }
}
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_Delete.json
-func ExampleFabricClient_BeginDelete() {
- cred, err := azidentity.NewDefaultAzureCredential(nil)
- if err != nil {
- log.Fatalf("failed to obtain a credential: %v", err)
- }
- ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
- if err != nil {
- log.Fatalf("failed to create client: %v", err)
- }
- poller, err := clientFactory.NewFabricClient().BeginDelete(ctx, "rgrecoveryservicesdatareplication", "wPR", nil)
- if err != nil {
- log.Fatalf("failed to finish the request: %v", err)
- }
- _, err = poller.PollUntilDone(ctx, nil)
- if err != nil {
- log.Fatalf("failed to pull the result: %v", err)
- }
-}
-
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_ListBySubscription.json
-func ExampleFabricClient_NewListBySubscriptionPager() {
+// Generated from example definition: 2024-09-01/Fabric_List.json
+func ExampleFabricClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
- pager := clientFactory.NewFabricClient().NewListBySubscriptionPager(&armrecoveryservicesdatareplication.FabricClientListBySubscriptionOptions{ContinuationToken: to.Ptr("rmgqrpzucsizbyjscxzockbiyg")})
+ pager := clientFactory.NewFabricClient().NewListPager("rgswagger_2024-09-01", &FabricClientListOptions{
+ continuationToken: to.Ptr("jw")})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
@@ -319,81 +216,81 @@ func ExampleFabricClient_NewListBySubscriptionPager() {
_ = 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.FabricModelCollection = armrecoveryservicesdatareplication.FabricModelCollection{
- // Value: []*armrecoveryservicesdatareplication.FabricModel{
- // {
- // Name: to.Ptr("rhojydcwjgvgexpdwswjib"),
- // Type: to.Ptr("toipsryjyqchikyakeiuatshiu"),
- // ID: to.Ptr("ycaxtshcmldt"),
- // Location: to.Ptr("tqygutlpob"),
- // Properties: &armrecoveryservicesdatareplication.FabricModelProperties{
- // CustomProperties: &armrecoveryservicesdatareplication.FabricModelCustomProperties{
- // InstanceType: to.Ptr("FabricModelCustomProperties"),
- // },
- // Health: to.Ptr(armrecoveryservicesdatareplication.HealthStatusNormal),
- // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
- // {
- // AffectedResourceCorrelationIDs: []*string{
- // to.Ptr("fope")},
+ // page = armrecoveryservicesdatareplication.FabricClientListResponse{
+ // FabricModelListResult: armrecoveryservicesdatareplication.FabricModelListResult{
+ // Value: []*armrecoveryservicesdatareplication.FabricModel{
+ // {
+ // Location: to.Ptr("tqygutlpob"),
+ // Properties: &armrecoveryservicesdatareplication.FabricModelProperties{
+ // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
+ // ServiceEndpoint: to.Ptr("ilrfl"),
+ // ServiceResourceID: to.Ptr("xukigpdrbyyy"),
+ // Health: to.Ptr(armrecoveryservicesdatareplication.HealthStatusNormal),
+ // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
+ // {
// AffectedResourceType: to.Ptr("scfniv"),
- // Category: to.Ptr("leigw"),
- // Causes: to.Ptr("xznphqrrmsdzm"),
+ // AffectedResourceCorrelationIDs: []*string{
+ // to.Ptr("fope"),
+ // },
// ChildErrors: []*armrecoveryservicesdatareplication.InnerHealthErrorModel{
// {
- // Category: to.Ptr("lcsdxrqxquke"),
- // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
// Code: to.Ptr("yuxxpblihirpedwkigywgwjjrlzq"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("mhdgfjqwbikhxmhtomkl"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("sskcei"),
- // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // Category: to.Ptr("lcsdxrqxquke"),
// Severity: to.Ptr("wqxxiuaqjyagq"),
// Source: to.Ptr("wevvftugwydzzw"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("djsmgrltruljo"),
- // }},
+ // Message: to.Ptr("sskcei"),
+ // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
+ // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // },
+ // },
// Code: to.Ptr("dgxkefzmeukd"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("itc"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("lbywtdprdqdekl"),
- // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // Category: to.Ptr("leigw"),
// Severity: to.Ptr("vvdajssdcypewdyechilxjmuijvdd"),
// Source: to.Ptr("iy"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("jtooblbvaxxrvcwgscbobq"),
- // }},
- // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateSucceeded),
- // ServiceEndpoint: to.Ptr("ilrfl"),
- // ServiceResourceID: to.Ptr("xukigpdrbyyy"),
+ // Message: to.Ptr("lbywtdprdqdekl"),
+ // Causes: to.Ptr("xznphqrrmsdzm"),
+ // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // },
+ // },
// },
- // SystemData: &armrecoveryservicesdatareplication.FabricModelSystemData{
- // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
+ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationFabrics/fabric1"),
+ // Name: to.Ptr("rhojydcwjgvgexpdwswjib"),
+ // Type: to.Ptr("toipsryjyqchikyakeiuatshiu"),
+ // SystemData: &armrecoveryservicesdatareplication.SystemData{
// CreatedBy: to.Ptr("yhdmbqrsgimuucexvpas"),
- // CreatedByType: to.Ptr("brnojz"),
- // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
// LastModifiedBy: to.Ptr("balecqnwu"),
- // LastModifiedByType: to.Ptr("ukvqlncihf"),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
// },
// Tags: map[string]*string{
- // "key3917": to.Ptr("vgralu"),
// },
- // }},
- // }
+ // },
+ // },
+ // },
+ // }
}
}
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_List.json
-func ExampleFabricClient_NewListPager() {
+// Generated from example definition: 2024-09-01/Fabric_ListBySubscription.json
+func ExampleFabricClient_NewListBySubscriptionPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
- pager := clientFactory.NewFabricClient().NewListPager("rgrecoveryservicesdatareplication", &armrecoveryservicesdatareplication.FabricClientListOptions{ContinuationToken: to.Ptr("mjzsxwwmtvd")})
+ pager := clientFactory.NewFabricClient().NewListBySubscriptionPager(nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
@@ -404,65 +301,148 @@ func ExampleFabricClient_NewListPager() {
_ = 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.FabricModelCollection = armrecoveryservicesdatareplication.FabricModelCollection{
- // Value: []*armrecoveryservicesdatareplication.FabricModel{
- // {
- // Name: to.Ptr("rhojydcwjgvgexpdwswjib"),
- // Type: to.Ptr("toipsryjyqchikyakeiuatshiu"),
- // ID: to.Ptr("ycaxtshcmldt"),
- // Location: to.Ptr("tqygutlpob"),
- // Properties: &armrecoveryservicesdatareplication.FabricModelProperties{
- // CustomProperties: &armrecoveryservicesdatareplication.FabricModelCustomProperties{
- // InstanceType: to.Ptr("FabricModelCustomProperties"),
- // },
- // Health: to.Ptr(armrecoveryservicesdatareplication.HealthStatusNormal),
- // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
- // {
- // AffectedResourceCorrelationIDs: []*string{
- // to.Ptr("fope")},
+ // page = armrecoveryservicesdatareplication.FabricClientListBySubscriptionResponse{
+ // FabricModelListResult: armrecoveryservicesdatareplication.FabricModelListResult{
+ // Value: []*armrecoveryservicesdatareplication.FabricModel{
+ // {
+ // Location: to.Ptr("tqygutlpob"),
+ // Properties: &armrecoveryservicesdatareplication.FabricModelProperties{
+ // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
+ // ServiceEndpoint: to.Ptr("ilrfl"),
+ // ServiceResourceID: to.Ptr("xukigpdrbyyy"),
+ // Health: to.Ptr(armrecoveryservicesdatareplication.HealthStatusNormal),
+ // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
+ // {
// AffectedResourceType: to.Ptr("scfniv"),
- // Category: to.Ptr("leigw"),
- // Causes: to.Ptr("xznphqrrmsdzm"),
+ // AffectedResourceCorrelationIDs: []*string{
+ // to.Ptr("fope"),
+ // },
// ChildErrors: []*armrecoveryservicesdatareplication.InnerHealthErrorModel{
// {
- // Category: to.Ptr("lcsdxrqxquke"),
- // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
// Code: to.Ptr("yuxxpblihirpedwkigywgwjjrlzq"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("mhdgfjqwbikhxmhtomkl"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("sskcei"),
- // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // Category: to.Ptr("lcsdxrqxquke"),
// Severity: to.Ptr("wqxxiuaqjyagq"),
// Source: to.Ptr("wevvftugwydzzw"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("djsmgrltruljo"),
- // }},
+ // Message: to.Ptr("sskcei"),
+ // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
+ // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // },
+ // },
// Code: to.Ptr("dgxkefzmeukd"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("itc"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("lbywtdprdqdekl"),
- // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // Category: to.Ptr("leigw"),
// Severity: to.Ptr("vvdajssdcypewdyechilxjmuijvdd"),
// Source: to.Ptr("iy"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("jtooblbvaxxrvcwgscbobq"),
- // }},
- // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateSucceeded),
- // ServiceEndpoint: to.Ptr("ilrfl"),
- // ServiceResourceID: to.Ptr("xukigpdrbyyy"),
+ // Message: to.Ptr("lbywtdprdqdekl"),
+ // Causes: to.Ptr("xznphqrrmsdzm"),
+ // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // },
+ // },
// },
- // SystemData: &armrecoveryservicesdatareplication.FabricModelSystemData{
- // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
+ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DataReplication/replicationFabrics/fabric1"),
+ // Name: to.Ptr("rhojydcwjgvgexpdwswjib"),
+ // Type: to.Ptr("toipsryjyqchikyakeiuatshiu"),
+ // SystemData: &armrecoveryservicesdatareplication.SystemData{
// CreatedBy: to.Ptr("yhdmbqrsgimuucexvpas"),
- // CreatedByType: to.Ptr("brnojz"),
- // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
// LastModifiedBy: to.Ptr("balecqnwu"),
- // LastModifiedByType: to.Ptr("ukvqlncihf"),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
// },
// Tags: map[string]*string{
- // "key3917": to.Ptr("vgralu"),
// },
- // }},
- // }
+ // },
+ // },
+ // },
+ // }
+ }
+}
+
+// Generated from example definition: 2024-09-01/Fabric_Update.json
+func ExampleFabricClient_BeginUpdate() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ poller, err := clientFactory.NewFabricClient().BeginUpdate(ctx, "rgswagger_2024-09-01", "wPR", armrecoveryservicesdatareplication.FabricModelUpdate{
+ Properties: &armrecoveryservicesdatareplication.FabricModelProperties{},
+ Tags: map[string]*string{},
+ }, 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 = armrecoveryservicesdatareplication.FabricClientUpdateResponse{
+ // FabricModel: &armrecoveryservicesdatareplication.FabricModel{
+ // Location: to.Ptr("tqygutlpob"),
+ // Properties: &armrecoveryservicesdatareplication.FabricModelProperties{
+ // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
+ // ServiceEndpoint: to.Ptr("ilrfl"),
+ // ServiceResourceID: to.Ptr("xukigpdrbyyy"),
+ // Health: to.Ptr(armrecoveryservicesdatareplication.HealthStatusNormal),
+ // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
+ // {
+ // AffectedResourceType: to.Ptr("scfniv"),
+ // AffectedResourceCorrelationIDs: []*string{
+ // to.Ptr("fope"),
+ // },
+ // ChildErrors: []*armrecoveryservicesdatareplication.InnerHealthErrorModel{
+ // {
+ // Code: to.Ptr("yuxxpblihirpedwkigywgwjjrlzq"),
+ // HealthCategory: to.Ptr("mhdgfjqwbikhxmhtomkl"),
+ // Category: to.Ptr("lcsdxrqxquke"),
+ // Severity: to.Ptr("wqxxiuaqjyagq"),
+ // Source: to.Ptr("wevvftugwydzzw"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
+ // Summary: to.Ptr("djsmgrltruljo"),
+ // Message: to.Ptr("sskcei"),
+ // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
+ // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // },
+ // },
+ // Code: to.Ptr("dgxkefzmeukd"),
+ // HealthCategory: to.Ptr("itc"),
+ // Category: to.Ptr("leigw"),
+ // Severity: to.Ptr("vvdajssdcypewdyechilxjmuijvdd"),
+ // Source: to.Ptr("iy"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
+ // Summary: to.Ptr("jtooblbvaxxrvcwgscbobq"),
+ // Message: to.Ptr("lbywtdprdqdekl"),
+ // Causes: to.Ptr("xznphqrrmsdzm"),
+ // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // },
+ // },
+ // },
+ // Tags: map[string]*string{
+ // },
+ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationFabrics/fabric1"),
+ // Name: to.Ptr("rhojydcwjgvgexpdwswjib"),
+ // Type: to.Ptr("toipsryjyqchikyakeiuatshiu"),
+ // SystemData: &armrecoveryservicesdatareplication.SystemData{
+ // CreatedBy: to.Ptr("ewufpudzcjrljhmmzhfnxoqdqwnya"),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
+ // LastModifiedBy: to.Ptr("rx"),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
+ // },
+ // },
+ // }
}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/dra_client.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabricagent_client.go
similarity index 66%
rename from sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/dra_client.go
rename to sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabricagent_client.go
index 72dc6e811e53..4e8a18a97512 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/dra_client.go
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabricagent_client.go
@@ -1,10 +1,6 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armrecoveryservicesdatareplication
@@ -20,23 +16,23 @@ import (
"strings"
)
-// DraClient contains the methods for the Dra group.
-// Don't use this type directly, use NewDraClient() instead.
-type DraClient struct {
+// FabricAgentClient contains the methods for the FabricAgent group.
+// Don't use this type directly, use NewFabricAgentClient() instead.
+type FabricAgentClient struct {
internal *arm.Client
subscriptionID string
}
-// NewDraClient creates a new instance of DraClient with the specified values.
+// NewFabricAgentClient creates a new instance of FabricAgentClient with the specified values.
// - subscriptionID - The ID of the target subscription. The value must be an UUID.
// - credential - used to authorize requests. Usually a credential from azidentity.
// - options - pass nil to accept the default values.
-func NewDraClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DraClient, error) {
+func NewFabricAgentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FabricAgentClient, error) {
cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
if err != nil {
return nil, err
}
- client := &DraClient{
+ client := &FabricAgentClient{
subscriptionID: subscriptionID,
internal: cl,
}
@@ -46,25 +42,24 @@ func NewDraClient(subscriptionID string, credential azcore.TokenCredential, opti
// BeginCreate - Creates the fabric agent.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - fabricName - The fabric name.
-// - fabricAgentName - The fabric agent (Dra) name.
-// - body - Dra model.
-// - options - DraClientBeginCreateOptions contains the optional parameters for the DraClient.BeginCreate method.
-func (client *DraClient) BeginCreate(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, body DraModel, options *DraClientBeginCreateOptions) (*runtime.Poller[DraClientCreateResponse], error) {
+// - fabricAgentName - The fabric agent name.
+// - resource - Fabric agent model.
+// - options - FabricAgentClientBeginCreateOptions contains the optional parameters for the FabricAgentClient.BeginCreate method.
+func (client *FabricAgentClient) BeginCreate(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, resource FabricAgentModel, options *FabricAgentClientBeginCreateOptions) (*runtime.Poller[FabricAgentClientCreateResponse], error) {
if options == nil || options.ResumeToken == "" {
- resp, err := client.create(ctx, resourceGroupName, fabricName, fabricAgentName, body, options)
+ resp, err := client.create(ctx, resourceGroupName, fabricName, fabricAgentName, resource, options)
if err != nil {
return nil, err
}
- poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DraClientCreateResponse]{
- FinalStateVia: runtime.FinalStateViaLocation,
- Tracer: client.internal.Tracer(),
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FabricAgentClientCreateResponse]{
+ Tracer: client.internal.Tracer(),
})
return poller, err
} else {
- return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DraClientCreateResponse]{
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FabricAgentClientCreateResponse]{
Tracer: client.internal.Tracer(),
})
}
@@ -73,14 +68,14 @@ func (client *DraClient) BeginCreate(ctx context.Context, resourceGroupName stri
// Create - Creates the fabric agent.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2021-02-16-preview
-func (client *DraClient) create(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, body DraModel, options *DraClientBeginCreateOptions) (*http.Response, error) {
+// Generated from API version 2024-09-01
+func (client *FabricAgentClient) create(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, resource FabricAgentModel, options *FabricAgentClientBeginCreateOptions) (*http.Response, error) {
var err error
- const operationName = "DraClient.BeginCreate"
+ const operationName = "FabricAgentClient.BeginCreate"
ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
defer func() { endSpan(err) }()
- req, err := client.createCreateRequest(ctx, resourceGroupName, fabricName, fabricAgentName, body, options)
+ req, err := client.createCreateRequest(ctx, resourceGroupName, fabricName, fabricAgentName, resource, options)
if err != nil {
return nil, err
}
@@ -96,7 +91,7 @@ func (client *DraClient) create(ctx context.Context, resourceGroupName string, f
}
// createCreateRequest creates the Create request.
-func (client *DraClient) createCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, body DraModel, options *DraClientBeginCreateOptions) (*policy.Request, error) {
+func (client *FabricAgentClient) createCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, resource FabricAgentModel, _ *FabricAgentClientBeginCreateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@@ -119,48 +114,48 @@ func (client *DraClient) createCreateRequest(ctx context.Context, resourceGroupN
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
+ reqQP.Set("api-version", "2024-09-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
- if err := runtime.MarshalAsJSON(req, body); err != nil {
+ req.Raw().Header["Content-Type"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, resource); err != nil {
return nil, err
}
return req, nil
}
-// BeginDelete - Deletes the fabric agent.
+// BeginDelete - Deletes fabric agent.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - fabricName - The fabric name.
-// - fabricAgentName - The fabric agent (Dra) name.
-// - options - DraClientBeginDeleteOptions contains the optional parameters for the DraClient.BeginDelete method.
-func (client *DraClient) BeginDelete(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, options *DraClientBeginDeleteOptions) (*runtime.Poller[DraClientDeleteResponse], error) {
+// - fabricAgentName - The fabric agent name.
+// - options - FabricAgentClientBeginDeleteOptions contains the optional parameters for the FabricAgentClient.BeginDelete method.
+func (client *FabricAgentClient) BeginDelete(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, options *FabricAgentClientBeginDeleteOptions) (*runtime.Poller[FabricAgentClientDeleteResponse], error) {
if options == nil || options.ResumeToken == "" {
resp, err := client.deleteOperation(ctx, resourceGroupName, fabricName, fabricAgentName, options)
if err != nil {
return nil, err
}
- poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DraClientDeleteResponse]{
- FinalStateVia: runtime.FinalStateViaLocation,
- Tracer: client.internal.Tracer(),
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FabricAgentClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
})
return poller, err
} else {
- return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DraClientDeleteResponse]{
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FabricAgentClientDeleteResponse]{
Tracer: client.internal.Tracer(),
})
}
}
-// Delete - Deletes the fabric agent.
+// Delete - Deletes fabric agent.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2021-02-16-preview
-func (client *DraClient) deleteOperation(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, options *DraClientBeginDeleteOptions) (*http.Response, error) {
+// Generated from API version 2024-09-01
+func (client *FabricAgentClient) deleteOperation(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, options *FabricAgentClientBeginDeleteOptions) (*http.Response, error) {
var err error
- const operationName = "DraClient.BeginDelete"
+ const operationName = "FabricAgentClient.BeginDelete"
ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
defer func() { endSpan(err) }()
@@ -180,7 +175,7 @@ func (client *DraClient) deleteOperation(ctx context.Context, resourceGroupName
}
// deleteCreateRequest creates the Delete request.
-func (client *DraClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, options *DraClientBeginDeleteOptions) (*policy.Request, error) {
+func (client *FabricAgentClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, _ *FabricAgentClientBeginDeleteOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@@ -203,7 +198,7 @@ func (client *DraClient) deleteCreateRequest(ctx context.Context, resourceGroupN
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
+ reqQP.Set("api-version", "2024-09-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@@ -212,35 +207,35 @@ func (client *DraClient) deleteCreateRequest(ctx context.Context, resourceGroupN
// Get - Gets the details of the fabric agent.
// If the operation fails it returns an *azcore.ResponseError type.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - fabricName - The fabric name.
-// - fabricAgentName - The fabric agent (Dra) name.
-// - options - DraClientGetOptions contains the optional parameters for the DraClient.Get method.
-func (client *DraClient) Get(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, options *DraClientGetOptions) (DraClientGetResponse, error) {
+// - fabricAgentName - The fabric agent name.
+// - options - FabricAgentClientGetOptions contains the optional parameters for the FabricAgentClient.Get method.
+func (client *FabricAgentClient) Get(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, options *FabricAgentClientGetOptions) (FabricAgentClientGetResponse, error) {
var err error
- const operationName = "DraClient.Get"
+ const operationName = "FabricAgentClient.Get"
ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
defer func() { endSpan(err) }()
req, err := client.getCreateRequest(ctx, resourceGroupName, fabricName, fabricAgentName, options)
if err != nil {
- return DraClientGetResponse{}, err
+ return FabricAgentClientGetResponse{}, err
}
httpResp, err := client.internal.Pipeline().Do(req)
if err != nil {
- return DraClientGetResponse{}, err
+ return FabricAgentClientGetResponse{}, err
}
if !runtime.HasStatusCode(httpResp, http.StatusOK) {
err = runtime.NewResponseError(httpResp)
- return DraClientGetResponse{}, err
+ return FabricAgentClientGetResponse{}, err
}
resp, err := client.getHandleResponse(httpResp)
return resp, err
}
// getCreateRequest creates the Get request.
-func (client *DraClient) getCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, options *DraClientGetOptions) (*policy.Request, error) {
+func (client *FabricAgentClient) getCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, _ *FabricAgentClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@@ -263,34 +258,34 @@ func (client *DraClient) getCreateRequest(ctx context.Context, resourceGroupName
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
+ reqQP.Set("api-version", "2024-09-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
}
// getHandleResponse handles the Get response.
-func (client *DraClient) getHandleResponse(resp *http.Response) (DraClientGetResponse, error) {
- result := DraClientGetResponse{}
- if err := runtime.UnmarshalAsJSON(resp, &result.DraModel); err != nil {
- return DraClientGetResponse{}, err
+func (client *FabricAgentClient) getHandleResponse(resp *http.Response) (FabricAgentClientGetResponse, error) {
+ result := FabricAgentClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FabricAgentModel); err != nil {
+ return FabricAgentClientGetResponse{}, err
}
return result, nil
}
// NewListPager - Gets the list of fabric agents in the given fabric.
//
-// Generated from API version 2021-02-16-preview
+// Generated from API version 2024-09-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - fabricName - The fabric name.
-// - options - DraClientListOptions contains the optional parameters for the DraClient.NewListPager method.
-func (client *DraClient) NewListPager(resourceGroupName string, fabricName string, options *DraClientListOptions) *runtime.Pager[DraClientListResponse] {
- return runtime.NewPager(runtime.PagingHandler[DraClientListResponse]{
- More: func(page DraClientListResponse) bool {
+// - options - FabricAgentClientListOptions contains the optional parameters for the FabricAgentClient.NewListPager method.
+func (client *FabricAgentClient) NewListPager(resourceGroupName string, fabricName string, options *FabricAgentClientListOptions) *runtime.Pager[FabricAgentClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[FabricAgentClientListResponse]{
+ More: func(page FabricAgentClientListResponse) bool {
return page.NextLink != nil && len(*page.NextLink) > 0
},
- Fetcher: func(ctx context.Context, page *DraClientListResponse) (DraClientListResponse, error) {
- ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DraClient.NewListPager")
+ Fetcher: func(ctx context.Context, page *FabricAgentClientListResponse) (FabricAgentClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FabricAgentClient.NewListPager")
nextLink := ""
if page != nil {
nextLink = *page.NextLink
@@ -299,7 +294,7 @@ func (client *DraClient) NewListPager(resourceGroupName string, fabricName strin
return client.listCreateRequest(ctx, resourceGroupName, fabricName, options)
}, nil)
if err != nil {
- return DraClientListResponse{}, err
+ return FabricAgentClientListResponse{}, err
}
return client.listHandleResponse(resp)
},
@@ -308,7 +303,7 @@ func (client *DraClient) NewListPager(resourceGroupName string, fabricName strin
}
// listCreateRequest creates the List request.
-func (client *DraClient) listCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, options *DraClientListOptions) (*policy.Request, error) {
+func (client *FabricAgentClient) listCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, _ *FabricAgentClientListOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@@ -327,17 +322,17 @@ func (client *DraClient) listCreateRequest(ctx context.Context, resourceGroupNam
return nil, err
}
reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
+ reqQP.Set("api-version", "2024-09-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
}
// listHandleResponse handles the List response.
-func (client *DraClient) listHandleResponse(resp *http.Response) (DraClientListResponse, error) {
- result := DraClientListResponse{}
- if err := runtime.UnmarshalAsJSON(resp, &result.DraModelCollection); err != nil {
- return DraClientListResponse{}, err
+func (client *FabricAgentClient) listHandleResponse(resp *http.Response) (FabricAgentClientListResponse, error) {
+ result := FabricAgentClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FabricAgentModelListResult); err != nil {
+ return FabricAgentClientListResponse{}, err
}
return result, nil
}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/dra_client_example_test.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabricagent_client_example_test.go
similarity index 61%
rename from sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/dra_client_example_test.go
rename to sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabricagent_client_example_test.go
index 2bdd8ac581b3..e750fb54a13a 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/dra_client_example_test.go
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabricagent_client_example_test.go
@@ -1,262 +1,253 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-// DO NOT EDIT.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armrecoveryservicesdatareplication_test
import (
"context"
- "log"
-
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication"
+ "log"
)
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Dra_Get.json
-func ExampleDraClient_Get() {
+// Generated from example definition: 2024-09-01/FabricAgent_Create.json
+func ExampleFabricAgentClient_BeginCreate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
- res, err := clientFactory.NewDraClient().Get(ctx, "rgrecoveryservicesdatareplication", "wPR", "M", nil)
+ poller, err := clientFactory.NewFabricAgentClient().BeginCreate(ctx, "rgswagger_2024-09-01", "wPR", "M", armrecoveryservicesdatareplication.FabricAgentModel{
+ Properties: &armrecoveryservicesdatareplication.FabricAgentModelProperties{
+ MachineID: to.Ptr("envzcoijbqhtrpncbjbhk"),
+ MachineName: to.Ptr("y"),
+ AuthenticationIdentity: &armrecoveryservicesdatareplication.IdentityModel{
+ TenantID: to.Ptr("joclkkdovixwapephhxaqtefubhhmq"),
+ ApplicationID: to.Ptr("cwktzrwajuvfyyymfstpey"),
+ ObjectID: to.Ptr("khsiaqfbpuhp"),
+ Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
+ AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
+ },
+ ResourceAccessIdentity: &armrecoveryservicesdatareplication.IdentityModel{
+ TenantID: to.Ptr("joclkkdovixwapephhxaqtefubhhmq"),
+ ApplicationID: to.Ptr("cwktzrwajuvfyyymfstpey"),
+ ObjectID: to.Ptr("khsiaqfbpuhp"),
+ Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
+ AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
+ },
+ },
+ }, 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.DraModel = armrecoveryservicesdatareplication.DraModel{
- // Name: to.Ptr("ioxmwhzrzdilxivkvhpvzexl"),
- // Type: to.Ptr("ptgmahzsyv"),
- // ID: to.Ptr("anp"),
- // Properties: &armrecoveryservicesdatareplication.DraModelProperties{
- // AuthenticationIdentity: &armrecoveryservicesdatareplication.IdentityModel{
- // AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
- // ApplicationID: to.Ptr("cwktzrwajuvfyyymfstpey"),
- // Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
- // ObjectID: to.Ptr("khsiaqfbpuhp"),
- // TenantID: to.Ptr("joclkkdovixwapephhxaqtefubhhmq"),
- // },
- // CorrelationID: to.Ptr("t"),
- // CustomProperties: &armrecoveryservicesdatareplication.DraModelCustomProperties{
- // InstanceType: to.Ptr("DraModelCustomProperties"),
- // },
- // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
- // {
- // AffectedResourceCorrelationIDs: []*string{
- // to.Ptr("fope")},
+ // res = armrecoveryservicesdatareplication.FabricAgentClientCreateResponse{
+ // FabricAgentModel: &armrecoveryservicesdatareplication.FabricAgentModel{
+ // Properties: &armrecoveryservicesdatareplication.FabricAgentModelProperties{
+ // MachineID: to.Ptr("envzcoijbqhtrpncbjbhk"),
+ // MachineName: to.Ptr("y"),
+ // AuthenticationIdentity: &armrecoveryservicesdatareplication.IdentityModel{
+ // TenantID: to.Ptr("joclkkdovixwapephhxaqtefubhhmq"),
+ // ApplicationID: to.Ptr("cwktzrwajuvfyyymfstpey"),
+ // ObjectID: to.Ptr("khsiaqfbpuhp"),
+ // Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
+ // AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
+ // },
+ // ResourceAccessIdentity: &armrecoveryservicesdatareplication.IdentityModel{
+ // TenantID: to.Ptr("joclkkdovixwapephhxaqtefubhhmq"),
+ // ApplicationID: to.Ptr("cwktzrwajuvfyyymfstpey"),
+ // ObjectID: to.Ptr("khsiaqfbpuhp"),
+ // Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
+ // AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
+ // },
+ // CorrelationID: to.Ptr("t"),
+ // IsResponsive: to.Ptr(true),
+ // LastHeartbeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.127Z"); return t}()),
+ // VersionNumber: to.Ptr("wnksfnisrhs"),
+ // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
+ // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
+ // {
// AffectedResourceType: to.Ptr("scfniv"),
- // Category: to.Ptr("leigw"),
- // Causes: to.Ptr("xznphqrrmsdzm"),
+ // AffectedResourceCorrelationIDs: []*string{
+ // to.Ptr("fope"),
+ // },
// ChildErrors: []*armrecoveryservicesdatareplication.InnerHealthErrorModel{
// {
- // Category: to.Ptr("lcsdxrqxquke"),
- // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
// Code: to.Ptr("yuxxpblihirpedwkigywgwjjrlzq"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("mhdgfjqwbikhxmhtomkl"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("sskcei"),
- // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // Category: to.Ptr("lcsdxrqxquke"),
// Severity: to.Ptr("wqxxiuaqjyagq"),
// Source: to.Ptr("wevvftugwydzzw"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("djsmgrltruljo"),
- // }},
+ // Message: to.Ptr("sskcei"),
+ // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
+ // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // },
+ // },
// Code: to.Ptr("dgxkefzmeukd"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("itc"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("lbywtdprdqdekl"),
- // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // Category: to.Ptr("leigw"),
// Severity: to.Ptr("vvdajssdcypewdyechilxjmuijvdd"),
// Source: to.Ptr("iy"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("jtooblbvaxxrvcwgscbobq"),
- // }},
- // IsResponsive: to.Ptr(true),
- // LastHeartbeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.127Z"); return t}()),
- // MachineID: to.Ptr("envzcoijbqhtrpncbjbhk"),
- // MachineName: to.Ptr("y"),
- // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateSucceeded),
- // ResourceAccessIdentity: &armrecoveryservicesdatareplication.IdentityModel{
- // AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
- // ApplicationID: to.Ptr("cwktzrwajuvfyyymfstpey"),
- // Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
- // ObjectID: to.Ptr("khsiaqfbpuhp"),
- // TenantID: to.Ptr("joclkkdovixwapephhxaqtefubhhmq"),
+ // Message: to.Ptr("lbywtdprdqdekl"),
+ // Causes: to.Ptr("xznphqrrmsdzm"),
+ // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // },
// },
- // VersionNumber: to.Ptr("wnksfnisrhs"),
// },
- // SystemData: &armrecoveryservicesdatareplication.DraModelSystemData{
- // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
- // CreatedBy: to.Ptr("fazidmklka"),
- // CreatedByType: to.Ptr("obpndgkaeyklqzmpjh"),
- // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
- // LastModifiedBy: to.Ptr("cfoopkrisaroztncgss"),
- // LastModifiedByType: to.Ptr("dysxbvohxhrpl"),
+ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationFabrics/fabric1/fabricAgents/agent1"),
+ // Name: to.Ptr("ioxmwhzrzdilxivkvhpvzexl"),
+ // Type: to.Ptr("ptgmahzsyv"),
+ // SystemData: &armrecoveryservicesdatareplication.SystemData{
+ // CreatedBy: to.Ptr("ewufpudzcjrljhmmzhfnxoqdqwnya"),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
+ // LastModifiedBy: to.Ptr("rx"),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
// },
- // }
+ // },
+ // }
}
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Dra_Create.json
-func ExampleDraClient_BeginCreate() {
+// Generated from example definition: 2024-09-01/FabricAgent_Delete.json
+func ExampleFabricAgentClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
- poller, err := clientFactory.NewDraClient().BeginCreate(ctx, "rgrecoveryservicesdatareplication", "wPR", "M", armrecoveryservicesdatareplication.DraModel{
- Properties: &armrecoveryservicesdatareplication.DraModelProperties{
- AuthenticationIdentity: &armrecoveryservicesdatareplication.IdentityModel{
- AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
- ApplicationID: to.Ptr("cwktzrwajuvfyyymfstpey"),
- Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
- ObjectID: to.Ptr("khsiaqfbpuhp"),
- TenantID: to.Ptr("joclkkdovixwapephhxaqtefubhhmq"),
- },
- CustomProperties: &armrecoveryservicesdatareplication.DraModelCustomProperties{
- InstanceType: to.Ptr("DraModelCustomProperties"),
- },
- MachineID: to.Ptr("envzcoijbqhtrpncbjbhk"),
- MachineName: to.Ptr("y"),
- ResourceAccessIdentity: &armrecoveryservicesdatareplication.IdentityModel{
- AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
- ApplicationID: to.Ptr("cwktzrwajuvfyyymfstpey"),
- Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
- ObjectID: to.Ptr("khsiaqfbpuhp"),
- TenantID: to.Ptr("joclkkdovixwapephhxaqtefubhhmq"),
- },
- },
- }, nil)
+ poller, err := clientFactory.NewFabricAgentClient().BeginDelete(ctx, "rgswagger_2024-09-01", "wPR", "M", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
- res, err := poller.PollUntilDone(ctx, nil)
+ _, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
+}
+
+// Generated from example definition: 2024-09-01/FabricAgent_Get.json
+func ExampleFabricAgentClient_Get() {
+ cred, err := azidentity.NewDefaultAzureCredential(nil)
+ if err != nil {
+ log.Fatalf("failed to obtain a credential: %v", err)
+ }
+ ctx := context.Background()
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
+ if err != nil {
+ log.Fatalf("failed to create client: %v", err)
+ }
+ res, err := clientFactory.NewFabricAgentClient().Get(ctx, "rgrecoveryservicesdatareplication", "wPR", "M", 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.DraModel = armrecoveryservicesdatareplication.DraModel{
- // Name: to.Ptr("ioxmwhzrzdilxivkvhpvzexl"),
- // Type: to.Ptr("ptgmahzsyv"),
- // ID: to.Ptr("anp"),
- // Properties: &armrecoveryservicesdatareplication.DraModelProperties{
- // AuthenticationIdentity: &armrecoveryservicesdatareplication.IdentityModel{
- // AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
- // ApplicationID: to.Ptr("cwktzrwajuvfyyymfstpey"),
- // Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
- // ObjectID: to.Ptr("khsiaqfbpuhp"),
- // TenantID: to.Ptr("joclkkdovixwapephhxaqtefubhhmq"),
- // },
- // CorrelationID: to.Ptr("t"),
- // CustomProperties: &armrecoveryservicesdatareplication.DraModelCustomProperties{
- // InstanceType: to.Ptr("DraModelCustomProperties"),
- // },
- // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
- // {
- // AffectedResourceCorrelationIDs: []*string{
- // to.Ptr("fope")},
+ // res = armrecoveryservicesdatareplication.FabricAgentClientGetResponse{
+ // FabricAgentModel: &armrecoveryservicesdatareplication.FabricAgentModel{
+ // Properties: &armrecoveryservicesdatareplication.FabricAgentModelProperties{
+ // CorrelationID: to.Ptr("t"),
+ // MachineID: to.Ptr("envzcoijbqhtrpncbjbhk"),
+ // MachineName: to.Ptr("y"),
+ // AuthenticationIdentity: &armrecoveryservicesdatareplication.IdentityModel{
+ // TenantID: to.Ptr("joclkkdovixwapephhxaqtefubhhmq"),
+ // ApplicationID: to.Ptr("cwktzrwajuvfyyymfstpey"),
+ // ObjectID: to.Ptr("khsiaqfbpuhp"),
+ // Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
+ // AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
+ // },
+ // ResourceAccessIdentity: &armrecoveryservicesdatareplication.IdentityModel{
+ // TenantID: to.Ptr("joclkkdovixwapephhxaqtefubhhmq"),
+ // ApplicationID: to.Ptr("cwktzrwajuvfyyymfstpey"),
+ // ObjectID: to.Ptr("khsiaqfbpuhp"),
+ // Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
+ // AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
+ // },
+ // IsResponsive: to.Ptr(true),
+ // LastHeartbeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.127Z"); return t}()),
+ // VersionNumber: to.Ptr("wnksfnisrhs"),
+ // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
+ // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
+ // {
// AffectedResourceType: to.Ptr("scfniv"),
- // Category: to.Ptr("leigw"),
- // Causes: to.Ptr("xznphqrrmsdzm"),
+ // AffectedResourceCorrelationIDs: []*string{
+ // to.Ptr("fope"),
+ // },
// ChildErrors: []*armrecoveryservicesdatareplication.InnerHealthErrorModel{
// {
- // Category: to.Ptr("lcsdxrqxquke"),
- // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
// Code: to.Ptr("yuxxpblihirpedwkigywgwjjrlzq"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("mhdgfjqwbikhxmhtomkl"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("sskcei"),
- // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // Category: to.Ptr("lcsdxrqxquke"),
// Severity: to.Ptr("wqxxiuaqjyagq"),
// Source: to.Ptr("wevvftugwydzzw"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("djsmgrltruljo"),
- // }},
+ // Message: to.Ptr("sskcei"),
+ // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
+ // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // },
+ // },
// Code: to.Ptr("dgxkefzmeukd"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("itc"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("lbywtdprdqdekl"),
- // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // Category: to.Ptr("leigw"),
// Severity: to.Ptr("vvdajssdcypewdyechilxjmuijvdd"),
// Source: to.Ptr("iy"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("jtooblbvaxxrvcwgscbobq"),
- // }},
- // IsResponsive: to.Ptr(true),
- // LastHeartbeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.127Z"); return t}()),
- // MachineID: to.Ptr("envzcoijbqhtrpncbjbhk"),
- // MachineName: to.Ptr("y"),
- // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateSucceeded),
- // ResourceAccessIdentity: &armrecoveryservicesdatareplication.IdentityModel{
- // AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
- // ApplicationID: to.Ptr("cwktzrwajuvfyyymfstpey"),
- // Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
- // ObjectID: to.Ptr("khsiaqfbpuhp"),
- // TenantID: to.Ptr("joclkkdovixwapephhxaqtefubhhmq"),
+ // Message: to.Ptr("lbywtdprdqdekl"),
+ // Causes: to.Ptr("xznphqrrmsdzm"),
+ // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // },
// },
- // VersionNumber: to.Ptr("wnksfnisrhs"),
// },
- // SystemData: &armrecoveryservicesdatareplication.DraModelSystemData{
- // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationFabrics/fabric1/fabricAgents/agent1"),
+ // Name: to.Ptr("ioxmwhzrzdilxivkvhpvzexl"),
+ // Type: to.Ptr("ptgmahzsyv"),
+ // SystemData: &armrecoveryservicesdatareplication.SystemData{
// CreatedBy: to.Ptr("fazidmklka"),
- // CreatedByType: to.Ptr("obpndgkaeyklqzmpjh"),
- // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// LastModifiedBy: to.Ptr("cfoopkrisaroztncgss"),
- // LastModifiedByType: to.Ptr("dysxbvohxhrpl"),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// },
- // }
+ // },
+ // }
}
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Dra_Delete.json
-func ExampleDraClient_BeginDelete() {
+// Generated from example definition: 2024-09-01/FabricAgent_List.json
+func ExampleFabricAgentClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
+ clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
- poller, err := clientFactory.NewDraClient().BeginDelete(ctx, "rgrecoveryservicesdatareplication", "wPR", "M", nil)
- if err != nil {
- log.Fatalf("failed to finish the request: %v", err)
- }
- _, err = poller.PollUntilDone(ctx, nil)
- if err != nil {
- log.Fatalf("failed to pull the result: %v", err)
- }
-}
-
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Dra_List.json
-func ExampleDraClient_NewListPager() {
- cred, err := azidentity.NewDefaultAzureCredential(nil)
- if err != nil {
- log.Fatalf("failed to obtain a credential: %v", err)
- }
- ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
- if err != nil {
- log.Fatalf("failed to create client: %v", err)
- }
- pager := clientFactory.NewDraClient().NewListPager("rgrecoveryservicesdatareplication", "wPR", nil)
+ pager := clientFactory.NewFabricAgentClient().NewListPager("rgswagger_2024-09-01", "wPR", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
@@ -267,78 +258,75 @@ func ExampleDraClient_NewListPager() {
_ = 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.DraModelCollection = armrecoveryservicesdatareplication.DraModelCollection{
- // Value: []*armrecoveryservicesdatareplication.DraModel{
- // {
- // Name: to.Ptr("ioxmwhzrzdilxivkvhpvzexl"),
- // Type: to.Ptr("ptgmahzsyv"),
- // ID: to.Ptr("anp"),
- // Properties: &armrecoveryservicesdatareplication.DraModelProperties{
- // AuthenticationIdentity: &armrecoveryservicesdatareplication.IdentityModel{
- // AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
- // ApplicationID: to.Ptr("cwktzrwajuvfyyymfstpey"),
- // Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
- // ObjectID: to.Ptr("khsiaqfbpuhp"),
- // TenantID: to.Ptr("joclkkdovixwapephhxaqtefubhhmq"),
- // },
- // CorrelationID: to.Ptr("t"),
- // CustomProperties: &armrecoveryservicesdatareplication.DraModelCustomProperties{
- // InstanceType: to.Ptr("DraModelCustomProperties"),
- // },
- // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
- // {
- // AffectedResourceCorrelationIDs: []*string{
- // to.Ptr("fope")},
+ // page = armrecoveryservicesdatareplication.FabricAgentClientListResponse{
+ // FabricAgentModelListResult: armrecoveryservicesdatareplication.FabricAgentModelListResult{
+ // Value: []*armrecoveryservicesdatareplication.FabricAgentModel{
+ // {
+ // Properties: &armrecoveryservicesdatareplication.FabricAgentModelProperties{
+ // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
+ // HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
+ // {
// AffectedResourceType: to.Ptr("scfniv"),
- // Category: to.Ptr("leigw"),
- // Causes: to.Ptr("xznphqrrmsdzm"),
+ // AffectedResourceCorrelationIDs: []*string{
+ // to.Ptr("fope"),
+ // },
// ChildErrors: []*armrecoveryservicesdatareplication.InnerHealthErrorModel{
// {
- // Category: to.Ptr("lcsdxrqxquke"),
- // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
// Code: to.Ptr("yuxxpblihirpedwkigywgwjjrlzq"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("mhdgfjqwbikhxmhtomkl"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("sskcei"),
- // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // Category: to.Ptr("lcsdxrqxquke"),
// Severity: to.Ptr("wqxxiuaqjyagq"),
// Source: to.Ptr("wevvftugwydzzw"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("djsmgrltruljo"),
- // }},
+ // Message: to.Ptr("sskcei"),
+ // Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
+ // Recommendation: to.Ptr("kqybwaesqumywtjepi"),
+ // },
+ // },
// Code: to.Ptr("dgxkefzmeukd"),
- // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
// HealthCategory: to.Ptr("itc"),
- // IsCustomerResolvable: to.Ptr(true),
- // Message: to.Ptr("lbywtdprdqdekl"),
- // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // Category: to.Ptr("leigw"),
// Severity: to.Ptr("vvdajssdcypewdyechilxjmuijvdd"),
// Source: to.Ptr("iy"),
+ // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
+ // IsCustomerResolvable: to.Ptr(true),
// Summary: to.Ptr("jtooblbvaxxrvcwgscbobq"),
- // }},
- // IsResponsive: to.Ptr(true),
- // LastHeartbeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.127Z"); return t}()),
+ // Message: to.Ptr("lbywtdprdqdekl"),
+ // Causes: to.Ptr("xznphqrrmsdzm"),
+ // Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
+ // },
+ // },
// MachineID: to.Ptr("envzcoijbqhtrpncbjbhk"),
// MachineName: to.Ptr("y"),
- // ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateSucceeded),
- // ResourceAccessIdentity: &armrecoveryservicesdatareplication.IdentityModel{
- // AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
+ // AuthenticationIdentity: &armrecoveryservicesdatareplication.IdentityModel{
+ // TenantID: to.Ptr("joclkkdovixwapephhxaqtefubhhmq"),
// ApplicationID: to.Ptr("cwktzrwajuvfyyymfstpey"),
- // Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
// ObjectID: to.Ptr("khsiaqfbpuhp"),
+ // Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
+ // AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
+ // },
+ // ResourceAccessIdentity: &armrecoveryservicesdatareplication.IdentityModel{
// TenantID: to.Ptr("joclkkdovixwapephhxaqtefubhhmq"),
+ // ApplicationID: to.Ptr("cwktzrwajuvfyyymfstpey"),
+ // ObjectID: to.Ptr("khsiaqfbpuhp"),
+ // Audience: to.Ptr("dkjobanyqgzenivyxhvavottpc"),
+ // AADAuthority: to.Ptr("bubwwbowfhdmujrt"),
// },
- // VersionNumber: to.Ptr("wnksfnisrhs"),
// },
- // SystemData: &armrecoveryservicesdatareplication.DraModelSystemData{
- // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
- // CreatedBy: to.Ptr("fazidmklka"),
- // CreatedByType: to.Ptr("obpndgkaeyklqzmpjh"),
- // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
- // LastModifiedBy: to.Ptr("cfoopkrisaroztncgss"),
- // LastModifiedByType: to.Ptr("dysxbvohxhrpl"),
+ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationFabrics/fabric1/fabricAgents/agent1"),
+ // Name: to.Ptr("rhojydcwjgvgexpdwswjib"),
+ // Type: to.Ptr("toipsryjyqchikyakeiuatshiu"),
+ // SystemData: &armrecoveryservicesdatareplication.SystemData{
+ // CreatedBy: to.Ptr("yhdmbqrsgimuucexvpas"),
+ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
+ // LastModifiedBy: to.Ptr("balecqnwu"),
+ // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.716Z"); return t}()),
// },
- // }},
- // }
+ // },
+ // },
+ // },
+ // }
}
}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabricoperationsstatus_client.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabricoperationsstatus_client.go
deleted file mode 100644
index 5040d6ee8038..000000000000
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabricoperationsstatus_client.go
+++ /dev/null
@@ -1,114 +0,0 @@
-//go:build go1.18
-// +build go1.18
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-package armrecoveryservicesdatareplication
-
-import (
- "context"
- "errors"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
- "net/http"
- "net/url"
- "strings"
-)
-
-// FabricOperationsStatusClient contains the methods for the FabricOperationsStatus group.
-// Don't use this type directly, use NewFabricOperationsStatusClient() instead.
-type FabricOperationsStatusClient struct {
- internal *arm.Client
- subscriptionID string
-}
-
-// NewFabricOperationsStatusClient creates a new instance of FabricOperationsStatusClient with the specified values.
-// - subscriptionID - The ID of the target subscription. The value must be an UUID.
-// - credential - used to authorize requests. Usually a credential from azidentity.
-// - options - pass nil to accept the default values.
-func NewFabricOperationsStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FabricOperationsStatusClient, error) {
- cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
- if err != nil {
- return nil, err
- }
- client := &FabricOperationsStatusClient{
- subscriptionID: subscriptionID,
- internal: cl,
- }
- return client, nil
-}
-
-// Get - Tracks the results of an asynchronous operation on the fabric.
-// If the operation fails it returns an *azcore.ResponseError type.
-//
-// Generated from API version 2021-02-16-preview
-// - resourceGroupName - The name of the resource group. The name is case insensitive.
-// - fabricName - The fabric name.
-// - operationID - The ID of an ongoing async operation.
-// - options - FabricOperationsStatusClientGetOptions contains the optional parameters for the FabricOperationsStatusClient.Get
-// method.
-func (client *FabricOperationsStatusClient) Get(ctx context.Context, resourceGroupName string, fabricName string, operationID string, options *FabricOperationsStatusClientGetOptions) (FabricOperationsStatusClientGetResponse, error) {
- var err error
- const operationName = "FabricOperationsStatusClient.Get"
- ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
- ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
- defer func() { endSpan(err) }()
- req, err := client.getCreateRequest(ctx, resourceGroupName, fabricName, operationID, options)
- if err != nil {
- return FabricOperationsStatusClientGetResponse{}, err
- }
- httpResp, err := client.internal.Pipeline().Do(req)
- if err != nil {
- return FabricOperationsStatusClientGetResponse{}, err
- }
- if !runtime.HasStatusCode(httpResp, http.StatusOK) {
- err = runtime.NewResponseError(httpResp)
- return FabricOperationsStatusClientGetResponse{}, err
- }
- resp, err := client.getHandleResponse(httpResp)
- return resp, err
-}
-
-// getCreateRequest creates the Get request.
-func (client *FabricOperationsStatusClient) getCreateRequest(ctx context.Context, resourceGroupName string, fabricName string, operationID string, options *FabricOperationsStatusClientGetOptions) (*policy.Request, error) {
- urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/operations/{operationId}"
- if client.subscriptionID == "" {
- return nil, errors.New("parameter client.subscriptionID cannot be empty")
- }
- urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
- if resourceGroupName == "" {
- return nil, errors.New("parameter resourceGroupName cannot be empty")
- }
- urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
- if fabricName == "" {
- return nil, errors.New("parameter fabricName cannot be empty")
- }
- urlPath = strings.ReplaceAll(urlPath, "{fabricName}", url.PathEscape(fabricName))
- if operationID == "" {
- return nil, errors.New("parameter operationID cannot be empty")
- }
- urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID))
- req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
- if err != nil {
- return nil, err
- }
- reqQP := req.Raw().URL.Query()
- reqQP.Set("api-version", "2021-02-16-preview")
- req.Raw().URL.RawQuery = reqQP.Encode()
- req.Raw().Header["Accept"] = []string{"application/json"}
- return req, nil
-}
-
-// getHandleResponse handles the Get response.
-func (client *FabricOperationsStatusClient) getHandleResponse(resp *http.Response) (FabricOperationsStatusClientGetResponse, error) {
- result := FabricOperationsStatusClientGetResponse{}
- if err := runtime.UnmarshalAsJSON(resp, &result.OperationStatus); err != nil {
- return FabricOperationsStatusClientGetResponse{}, err
- }
- return result, nil
-}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabricoperationsstatus_client_example_test.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabricoperationsstatus_client_example_test.go
deleted file mode 100644
index aa16c991ae06..000000000000
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fabricoperationsstatus_client_example_test.go
+++ /dev/null
@@ -1,45 +0,0 @@
-//go:build go1.18
-// +build go1.18
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-// DO NOT EDIT.
-
-package armrecoveryservicesdatareplication_test
-
-import (
- "context"
- "log"
-
- "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
- "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication"
-)
-
-// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/FabricOperationsStatus_Get.json
-func ExampleFabricOperationsStatusClient_Get() {
- cred, err := azidentity.NewDefaultAzureCredential(nil)
- if err != nil {
- log.Fatalf("failed to obtain a credential: %v", err)
- }
- ctx := context.Background()
- clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("", cred, nil)
- if err != nil {
- log.Fatalf("failed to create client: %v", err)
- }
- res, err := clientFactory.NewFabricOperationsStatusClient().Get(ctx, "rgrecoveryservicesdatareplication", "wPR", "dvfwerv", 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.OperationStatus = armrecoveryservicesdatareplication.OperationStatus{
- // Name: to.Ptr("wzdasptnwlxgobklayoqapjcgcf"),
- // EndTime: to.Ptr("nauyrfh"),
- // ID: to.Ptr("sf"),
- // StartTime: to.Ptr("xuzwmfrhluafmwwsmzqxsytyehsh"),
- // Status: to.Ptr("plbnngzfppdram"),
- // }
-}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/azuresiterecoverymanagementserviceapi_server.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/azuresiterecoverymanagementserviceapi_server.go
deleted file mode 100644
index 0ee5620aab6e..000000000000
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/azuresiterecoverymanagementserviceapi_server.go
+++ /dev/null
@@ -1,156 +0,0 @@
-//go:build go1.18
-// +build go1.18
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-package fake
-
-import (
- "context"
- "errors"
- "fmt"
- azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
- "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication"
- "net/http"
- "net/url"
- "reflect"
- "regexp"
-)
-
-// AzureSiteRecoveryManagementServiceAPIServer is a fake server for instances of the armrecoveryservicesdatareplication.AzureSiteRecoveryManagementServiceAPIClient type.
-type AzureSiteRecoveryManagementServiceAPIServer struct {
- // CheckNameAvailability is the fake for method AzureSiteRecoveryManagementServiceAPIClient.CheckNameAvailability
- // HTTP status codes to indicate success: http.StatusOK
- CheckNameAvailability func(ctx context.Context, location string, options *armrecoveryservicesdatareplication.AzureSiteRecoveryManagementServiceAPIClientCheckNameAvailabilityOptions) (resp azfake.Responder[armrecoveryservicesdatareplication.AzureSiteRecoveryManagementServiceAPIClientCheckNameAvailabilityResponse], errResp azfake.ErrorResponder)
-
- // DeploymentPreflight is the fake for method AzureSiteRecoveryManagementServiceAPIClient.DeploymentPreflight
- // HTTP status codes to indicate success: http.StatusOK
- DeploymentPreflight func(ctx context.Context, resourceGroupName string, deploymentID string, options *armrecoveryservicesdatareplication.AzureSiteRecoveryManagementServiceAPIClientDeploymentPreflightOptions) (resp azfake.Responder[armrecoveryservicesdatareplication.AzureSiteRecoveryManagementServiceAPIClientDeploymentPreflightResponse], errResp azfake.ErrorResponder)
-}
-
-// NewAzureSiteRecoveryManagementServiceAPIServerTransport creates a new instance of AzureSiteRecoveryManagementServiceAPIServerTransport with the provided implementation.
-// The returned AzureSiteRecoveryManagementServiceAPIServerTransport instance is connected to an instance of armrecoveryservicesdatareplication.AzureSiteRecoveryManagementServiceAPIClient via the
-// azcore.ClientOptions.Transporter field in the client's constructor parameters.
-func NewAzureSiteRecoveryManagementServiceAPIServerTransport(srv *AzureSiteRecoveryManagementServiceAPIServer) *AzureSiteRecoveryManagementServiceAPIServerTransport {
- return &AzureSiteRecoveryManagementServiceAPIServerTransport{srv: srv}
-}
-
-// AzureSiteRecoveryManagementServiceAPIServerTransport connects instances of armrecoveryservicesdatareplication.AzureSiteRecoveryManagementServiceAPIClient to instances of AzureSiteRecoveryManagementServiceAPIServer.
-// Don't use this type directly, use NewAzureSiteRecoveryManagementServiceAPIServerTransport instead.
-type AzureSiteRecoveryManagementServiceAPIServerTransport struct {
- srv *AzureSiteRecoveryManagementServiceAPIServer
-}
-
-// Do implements the policy.Transporter interface for AzureSiteRecoveryManagementServiceAPIServerTransport.
-func (a *AzureSiteRecoveryManagementServiceAPIServerTransport) Do(req *http.Request) (*http.Response, error) {
- rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
- method, ok := rawMethod.(string)
- if !ok {
- return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
- }
-
- var resp *http.Response
- var err error
-
- switch method {
- case "AzureSiteRecoveryManagementServiceAPIClient.CheckNameAvailability":
- resp, err = a.dispatchCheckNameAvailability(req)
- case "AzureSiteRecoveryManagementServiceAPIClient.DeploymentPreflight":
- resp, err = a.dispatchDeploymentPreflight(req)
- default:
- err = fmt.Errorf("unhandled API %s", method)
- }
-
- if err != nil {
- return nil, err
- }
-
- return resp, nil
-}
-
-func (a *AzureSiteRecoveryManagementServiceAPIServerTransport) dispatchCheckNameAvailability(req *http.Request) (*http.Response, error) {
- if a.srv.CheckNameAvailability == nil {
- return nil, &nonRetriableError{errors.New("fake for method CheckNameAvailability not implemented")}
- }
- const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataReplication/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkNameAvailability`
- regex := regexp.MustCompile(regexStr)
- matches := regex.FindStringSubmatch(req.URL.EscapedPath())
- if matches == nil || len(matches) < 2 {
- return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
- }
- body, err := server.UnmarshalRequestAsJSON[armrecoveryservicesdatareplication.CheckNameAvailabilityModel](req)
- if err != nil {
- return nil, err
- }
- locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")])
- if err != nil {
- return nil, err
- }
- var options *armrecoveryservicesdatareplication.AzureSiteRecoveryManagementServiceAPIClientCheckNameAvailabilityOptions
- if !reflect.ValueOf(body).IsZero() {
- options = &armrecoveryservicesdatareplication.AzureSiteRecoveryManagementServiceAPIClientCheckNameAvailabilityOptions{
- Body: &body,
- }
- }
- respr, errRespr := a.srv.CheckNameAvailability(req.Context(), locationParam, options)
- if respErr := server.GetError(errRespr, req); respErr != nil {
- return nil, respErr
- }
- respContent := server.GetResponseContent(respr)
- if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
- return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
- }
- resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CheckNameAvailabilityResponseModel, req)
- if err != nil {
- return nil, err
- }
- return resp, nil
-}
-
-func (a *AzureSiteRecoveryManagementServiceAPIServerTransport) dispatchDeploymentPreflight(req *http.Request) (*http.Response, error) {
- if a.srv.DeploymentPreflight == nil {
- return nil, &nonRetriableError{errors.New("fake for method DeploymentPreflight not implemented")}
- }
- const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataReplication/deployments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/preflight`
- regex := regexp.MustCompile(regexStr)
- matches := regex.FindStringSubmatch(req.URL.EscapedPath())
- if matches == nil || len(matches) < 3 {
- return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
- }
- body, err := server.UnmarshalRequestAsJSON[armrecoveryservicesdatareplication.DeploymentPreflightModel](req)
- if err != nil {
- return nil, err
- }
- resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
- if err != nil {
- return nil, err
- }
- deploymentIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentId")])
- if err != nil {
- return nil, err
- }
- var options *armrecoveryservicesdatareplication.AzureSiteRecoveryManagementServiceAPIClientDeploymentPreflightOptions
- if !reflect.ValueOf(body).IsZero() {
- options = &armrecoveryservicesdatareplication.AzureSiteRecoveryManagementServiceAPIClientDeploymentPreflightOptions{
- Body: &body,
- }
- }
- respr, errRespr := a.srv.DeploymentPreflight(req.Context(), resourceGroupNameParam, deploymentIDParam, options)
- if respErr := server.GetError(errRespr, req); respErr != nil {
- return nil, respErr
- }
- respContent := server.GetResponseContent(respr)
- if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
- return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
- }
- resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DeploymentPreflightModel, req)
- if err != nil {
- return nil, err
- }
- return resp, nil
-}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/checknameavailability_server.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/checknameavailability_server.go
new file mode 100644
index 000000000000..8845f402769e
--- /dev/null
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/checknameavailability_server.go
@@ -0,0 +1,128 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication"
+ "net/http"
+ "net/url"
+ "reflect"
+ "regexp"
+)
+
+// CheckNameAvailabilityServer is a fake server for instances of the armrecoveryservicesdatareplication.CheckNameAvailabilityClient type.
+type CheckNameAvailabilityServer struct {
+ // Post is the fake for method CheckNameAvailabilityClient.Post
+ // HTTP status codes to indicate success: http.StatusOK
+ Post func(ctx context.Context, location string, options *armrecoveryservicesdatareplication.CheckNameAvailabilityClientPostOptions) (resp azfake.Responder[armrecoveryservicesdatareplication.CheckNameAvailabilityClientPostResponse], errResp azfake.ErrorResponder)
+}
+
+// NewCheckNameAvailabilityServerTransport creates a new instance of CheckNameAvailabilityServerTransport with the provided implementation.
+// The returned CheckNameAvailabilityServerTransport instance is connected to an instance of armrecoveryservicesdatareplication.CheckNameAvailabilityClient via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewCheckNameAvailabilityServerTransport(srv *CheckNameAvailabilityServer) *CheckNameAvailabilityServerTransport {
+ return &CheckNameAvailabilityServerTransport{srv: srv}
+}
+
+// CheckNameAvailabilityServerTransport connects instances of armrecoveryservicesdatareplication.CheckNameAvailabilityClient to instances of CheckNameAvailabilityServer.
+// Don't use this type directly, use NewCheckNameAvailabilityServerTransport instead.
+type CheckNameAvailabilityServerTransport struct {
+ srv *CheckNameAvailabilityServer
+}
+
+// Do implements the policy.Transporter interface for CheckNameAvailabilityServerTransport.
+func (c *CheckNameAvailabilityServerTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ return c.dispatchToMethodFake(req, method)
+}
+
+func (c *CheckNameAvailabilityServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if checkNameAvailabilityServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = checkNameAvailabilityServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "CheckNameAvailabilityClient.Post":
+ res.resp, res.err = c.dispatchPost(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
+}
+
+func (c *CheckNameAvailabilityServerTransport) dispatchPost(req *http.Request) (*http.Response, error) {
+ if c.srv.Post == nil {
+ return nil, &nonRetriableError{errors.New("fake for method Post not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataReplication/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkNameAvailability`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 2 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armrecoveryservicesdatareplication.CheckNameAvailabilityModel](req)
+ if err != nil {
+ return nil, err
+ }
+ locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")])
+ if err != nil {
+ return nil, err
+ }
+ var options *armrecoveryservicesdatareplication.CheckNameAvailabilityClientPostOptions
+ if !reflect.ValueOf(body).IsZero() {
+ options = &armrecoveryservicesdatareplication.CheckNameAvailabilityClientPostOptions{
+ Body: &body,
+ }
+ }
+ respr, errRespr := c.srv.Post(req.Context(), locationParam, options)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CheckNameAvailabilityResponseModel, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// set this to conditionally intercept incoming requests to CheckNameAvailabilityServerTransport
+var checkNameAvailabilityServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/deploymentpreflight_server.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/deploymentpreflight_server.go
new file mode 100644
index 000000000000..3d4d025bdc5f
--- /dev/null
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/deploymentpreflight_server.go
@@ -0,0 +1,132 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication"
+ "net/http"
+ "net/url"
+ "reflect"
+ "regexp"
+)
+
+// DeploymentPreflightServer is a fake server for instances of the armrecoveryservicesdatareplication.DeploymentPreflightClient type.
+type DeploymentPreflightServer struct {
+ // Post is the fake for method DeploymentPreflightClient.Post
+ // HTTP status codes to indicate success: http.StatusOK
+ Post func(ctx context.Context, resourceGroupName string, deploymentID string, options *armrecoveryservicesdatareplication.DeploymentPreflightClientPostOptions) (resp azfake.Responder[armrecoveryservicesdatareplication.DeploymentPreflightClientPostResponse], errResp azfake.ErrorResponder)
+}
+
+// NewDeploymentPreflightServerTransport creates a new instance of DeploymentPreflightServerTransport with the provided implementation.
+// The returned DeploymentPreflightServerTransport instance is connected to an instance of armrecoveryservicesdatareplication.DeploymentPreflightClient via the
+// azcore.ClientOptions.Transporter field in the client's constructor parameters.
+func NewDeploymentPreflightServerTransport(srv *DeploymentPreflightServer) *DeploymentPreflightServerTransport {
+ return &DeploymentPreflightServerTransport{srv: srv}
+}
+
+// DeploymentPreflightServerTransport connects instances of armrecoveryservicesdatareplication.DeploymentPreflightClient to instances of DeploymentPreflightServer.
+// Don't use this type directly, use NewDeploymentPreflightServerTransport instead.
+type DeploymentPreflightServerTransport struct {
+ srv *DeploymentPreflightServer
+}
+
+// Do implements the policy.Transporter interface for DeploymentPreflightServerTransport.
+func (d *DeploymentPreflightServerTransport) Do(req *http.Request) (*http.Response, error) {
+ rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
+ method, ok := rawMethod.(string)
+ if !ok {
+ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
+ }
+
+ return d.dispatchToMethodFake(req, method)
+}
+
+func (d *DeploymentPreflightServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
+
+ go func() {
+ var intercepted bool
+ var res result
+ if deploymentPreflightServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = deploymentPreflightServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "DeploymentPreflightClient.Post":
+ res.resp, res.err = d.dispatchPost(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
+
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
+}
+
+func (d *DeploymentPreflightServerTransport) dispatchPost(req *http.Request) (*http.Response, error) {
+ if d.srv.Post == nil {
+ return nil, &nonRetriableError{errors.New("fake for method Post not implemented")}
+ }
+ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataReplication/deployments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/preflight`
+ regex := regexp.MustCompile(regexStr)
+ matches := regex.FindStringSubmatch(req.URL.EscapedPath())
+ if matches == nil || len(matches) < 3 {
+ return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
+ }
+ body, err := server.UnmarshalRequestAsJSON[armrecoveryservicesdatareplication.DeploymentPreflightModel](req)
+ if err != nil {
+ return nil, err
+ }
+ resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
+ if err != nil {
+ return nil, err
+ }
+ deploymentIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentId")])
+ if err != nil {
+ return nil, err
+ }
+ var options *armrecoveryservicesdatareplication.DeploymentPreflightClientPostOptions
+ if !reflect.ValueOf(body).IsZero() {
+ options = &armrecoveryservicesdatareplication.DeploymentPreflightClientPostOptions{
+ Body: &body,
+ }
+ }
+ respr, errRespr := d.srv.Post(req.Context(), resourceGroupNameParam, deploymentIDParam, options)
+ if respErr := server.GetError(errRespr, req); respErr != nil {
+ return nil, respErr
+ }
+ respContent := server.GetResponseContent(respr)
+ if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
+ }
+ resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DeploymentPreflightModel, req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// set this to conditionally intercept incoming requests to DeploymentPreflightServerTransport
+var deploymentPreflightServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/draoperationstatus_server.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/draoperationstatus_server.go
deleted file mode 100644
index a75730929104..000000000000
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/draoperationstatus_server.go
+++ /dev/null
@@ -1,108 +0,0 @@
-//go:build go1.18
-// +build go1.18
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-package fake
-
-import (
- "context"
- "errors"
- "fmt"
- azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
- "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication"
- "net/http"
- "net/url"
- "regexp"
-)
-
-// DraOperationStatusServer is a fake server for instances of the armrecoveryservicesdatareplication.DraOperationStatusClient type.
-type DraOperationStatusServer struct {
- // Get is the fake for method DraOperationStatusClient.Get
- // HTTP status codes to indicate success: http.StatusOK
- Get func(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, operationID string, options *armrecoveryservicesdatareplication.DraOperationStatusClientGetOptions) (resp azfake.Responder[armrecoveryservicesdatareplication.DraOperationStatusClientGetResponse], errResp azfake.ErrorResponder)
-}
-
-// NewDraOperationStatusServerTransport creates a new instance of DraOperationStatusServerTransport with the provided implementation.
-// The returned DraOperationStatusServerTransport instance is connected to an instance of armrecoveryservicesdatareplication.DraOperationStatusClient via the
-// azcore.ClientOptions.Transporter field in the client's constructor parameters.
-func NewDraOperationStatusServerTransport(srv *DraOperationStatusServer) *DraOperationStatusServerTransport {
- return &DraOperationStatusServerTransport{srv: srv}
-}
-
-// DraOperationStatusServerTransport connects instances of armrecoveryservicesdatareplication.DraOperationStatusClient to instances of DraOperationStatusServer.
-// Don't use this type directly, use NewDraOperationStatusServerTransport instead.
-type DraOperationStatusServerTransport struct {
- srv *DraOperationStatusServer
-}
-
-// Do implements the policy.Transporter interface for DraOperationStatusServerTransport.
-func (d *DraOperationStatusServerTransport) Do(req *http.Request) (*http.Response, error) {
- rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
- method, ok := rawMethod.(string)
- if !ok {
- return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
- }
-
- var resp *http.Response
- var err error
-
- switch method {
- case "DraOperationStatusClient.Get":
- resp, err = d.dispatchGet(req)
- default:
- err = fmt.Errorf("unhandled API %s", method)
- }
-
- if err != nil {
- return nil, err
- }
-
- return resp, nil
-}
-
-func (d *DraOperationStatusServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
- if d.srv.Get == nil {
- return nil, &nonRetriableError{errors.New("fake for method Get not implemented")}
- }
- const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataReplication/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fabricAgents/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/operations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
- regex := regexp.MustCompile(regexStr)
- matches := regex.FindStringSubmatch(req.URL.EscapedPath())
- if matches == nil || len(matches) < 5 {
- return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
- }
- resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
- if err != nil {
- return nil, err
- }
- fabricNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricName")])
- if err != nil {
- return nil, err
- }
- fabricAgentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricAgentName")])
- if err != nil {
- return nil, err
- }
- operationIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("operationId")])
- if err != nil {
- return nil, err
- }
- respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, fabricNameParam, fabricAgentNameParam, operationIDParam, nil)
- if respErr := server.GetError(errRespr, req); respErr != nil {
- return nil, respErr
- }
- respContent := server.GetResponseContent(respr)
- if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
- return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
- }
- resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).OperationStatus, req)
- if err != nil {
- return nil, err
- }
- return resp, nil
-}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/emailconfiguration_server.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/emailconfiguration_server.go
index f83de718be7b..7a4f832ff46e 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/emailconfiguration_server.go
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/emailconfiguration_server.go
@@ -1,10 +1,6 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package fake
@@ -26,7 +22,7 @@ import (
type EmailConfigurationServer struct {
// Create is the fake for method EmailConfigurationClient.Create
// HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
- Create func(ctx context.Context, resourceGroupName string, vaultName string, emailConfigurationName string, body armrecoveryservicesdatareplication.EmailConfigurationModel, options *armrecoveryservicesdatareplication.EmailConfigurationClientCreateOptions) (resp azfake.Responder[armrecoveryservicesdatareplication.EmailConfigurationClientCreateResponse], errResp azfake.ErrorResponder)
+ Create func(ctx context.Context, resourceGroupName string, vaultName string, emailConfigurationName string, resource armrecoveryservicesdatareplication.EmailConfigurationModel, options *armrecoveryservicesdatareplication.EmailConfigurationClientCreateOptions) (resp azfake.Responder[armrecoveryservicesdatareplication.EmailConfigurationClientCreateResponse], errResp azfake.ErrorResponder)
// Get is the fake for method EmailConfigurationClient.Get
// HTTP status codes to indicate success: http.StatusOK
@@ -62,25 +58,44 @@ func (e *EmailConfigurationServerTransport) Do(req *http.Request) (*http.Respons
return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
}
- var resp *http.Response
- var err error
+ return e.dispatchToMethodFake(req, method)
+}
- switch method {
- case "EmailConfigurationClient.Create":
- resp, err = e.dispatchCreate(req)
- case "EmailConfigurationClient.Get":
- resp, err = e.dispatchGet(req)
- case "EmailConfigurationClient.NewListPager":
- resp, err = e.dispatchNewListPager(req)
- default:
- err = fmt.Errorf("unhandled API %s", method)
- }
+func (e *EmailConfigurationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
- if err != nil {
- return nil, err
- }
+ go func() {
+ var intercepted bool
+ var res result
+ if emailConfigurationServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = emailConfigurationServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "EmailConfigurationClient.Create":
+ res.resp, res.err = e.dispatchCreate(req)
+ case "EmailConfigurationClient.Get":
+ res.resp, res.err = e.dispatchGet(req)
+ case "EmailConfigurationClient.NewListPager":
+ res.resp, res.err = e.dispatchNewListPager(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
- return resp, nil
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
}
func (e *EmailConfigurationServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) {
@@ -201,3 +216,9 @@ func (e *EmailConfigurationServerTransport) dispatchNewListPager(req *http.Reque
}
return resp, nil
}
+
+// set this to conditionally intercept incoming requests to EmailConfigurationServerTransport
+var emailConfigurationServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/event_server.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/event_server.go
index d90d1ea812b1..26fd8cd22092 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/event_server.go
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/event_server.go
@@ -1,10 +1,6 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package fake
@@ -20,6 +16,7 @@ import (
"net/http"
"net/url"
"regexp"
+ "strconv"
)
// EventServer is a fake server for instances of the armrecoveryservicesdatareplication.EventClient type.
@@ -58,23 +55,42 @@ func (e *EventServerTransport) Do(req *http.Request) (*http.Response, error) {
return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
}
- var resp *http.Response
- var err error
+ return e.dispatchToMethodFake(req, method)
+}
- switch method {
- case "EventClient.Get":
- resp, err = e.dispatchGet(req)
- case "EventClient.NewListPager":
- resp, err = e.dispatchNewListPager(req)
- default:
- err = fmt.Errorf("unhandled API %s", method)
- }
+func (e *EventServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
- if err != nil {
- return nil, err
- }
+ go func() {
+ var intercepted bool
+ var res result
+ if eventServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = eventServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "EventClient.Get":
+ res.resp, res.err = e.dispatchGet(req)
+ case "EventClient.NewListPager":
+ res.resp, res.err = e.dispatchNewListPager(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
- return resp, nil
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
}
func (e *EventServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
@@ -131,25 +147,40 @@ func (e *EventServerTransport) dispatchNewListPager(req *http.Request) (*http.Re
if err != nil {
return nil, err
}
- vaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("vaultName")])
+ odataOptionsUnescaped, err := url.QueryUnescape(qp.Get("odataOptions"))
if err != nil {
return nil, err
}
- filterUnescaped, err := url.QueryUnescape(qp.Get("$filter"))
+ odataOptionsParam := getOptional(odataOptionsUnescaped)
+ continuationTokenUnescaped, err := url.QueryUnescape(qp.Get("continuationToken"))
if err != nil {
return nil, err
}
- filterParam := getOptional(filterUnescaped)
- continuationTokenUnescaped, err := url.QueryUnescape(qp.Get("continuationToken"))
+ continuationTokenParam := getOptional(continuationTokenUnescaped)
+ pageSizeUnescaped, err := url.QueryUnescape(qp.Get("pageSize"))
+ if err != nil {
+ return nil, err
+ }
+ pageSizeParam, err := parseOptional(pageSizeUnescaped, func(v string) (int32, error) {
+ p, parseErr := strconv.ParseInt(v, 10, 32)
+ if parseErr != nil {
+ return 0, parseErr
+ }
+ return int32(p), nil
+ })
+ if err != nil {
+ return nil, err
+ }
+ vaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("vaultName")])
if err != nil {
return nil, err
}
- continuationTokenParam := getOptional(continuationTokenUnescaped)
var options *armrecoveryservicesdatareplication.EventClientListOptions
- if filterParam != nil || continuationTokenParam != nil {
+ if odataOptionsParam != nil || continuationTokenParam != nil || pageSizeParam != nil {
options = &armrecoveryservicesdatareplication.EventClientListOptions{
- Filter: filterParam,
+ OdataOptions: odataOptionsParam,
ContinuationToken: continuationTokenParam,
+ PageSize: pageSizeParam,
}
}
resp := e.srv.NewListPager(resourceGroupNameParam, vaultNameParam, options)
@@ -172,3 +203,9 @@ func (e *EventServerTransport) dispatchNewListPager(req *http.Request) (*http.Re
}
return resp, nil
}
+
+// set this to conditionally intercept incoming requests to EventServerTransport
+var eventServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/fabric_server.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/fabric_server.go
index 5796316ad798..9d1a381b2774 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/fabric_server.go
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/fabric_server.go
@@ -1,10 +1,6 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package fake
@@ -26,10 +22,10 @@ import (
type FabricServer struct {
// BeginCreate is the fake for method FabricClient.BeginCreate
// HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
- BeginCreate func(ctx context.Context, resourceGroupName string, fabricName string, body armrecoveryservicesdatareplication.FabricModel, options *armrecoveryservicesdatareplication.FabricClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicesdatareplication.FabricClientCreateResponse], errResp azfake.ErrorResponder)
+ BeginCreate func(ctx context.Context, resourceGroupName string, fabricName string, resource armrecoveryservicesdatareplication.FabricModel, options *armrecoveryservicesdatareplication.FabricClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicesdatareplication.FabricClientCreateResponse], errResp azfake.ErrorResponder)
// BeginDelete is the fake for method FabricClient.BeginDelete
- // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
BeginDelete func(ctx context.Context, resourceGroupName string, fabricName string, options *armrecoveryservicesdatareplication.FabricClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicesdatareplication.FabricClientDeleteResponse], errResp azfake.ErrorResponder)
// Get is the fake for method FabricClient.Get
@@ -46,7 +42,7 @@ type FabricServer struct {
// BeginUpdate is the fake for method FabricClient.BeginUpdate
// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
- BeginUpdate func(ctx context.Context, resourceGroupName string, fabricName string, body armrecoveryservicesdatareplication.FabricModelUpdate, options *armrecoveryservicesdatareplication.FabricClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicesdatareplication.FabricClientUpdateResponse], errResp azfake.ErrorResponder)
+ BeginUpdate func(ctx context.Context, resourceGroupName string, fabricName string, properties armrecoveryservicesdatareplication.FabricModelUpdate, options *armrecoveryservicesdatareplication.FabricClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicesdatareplication.FabricClientUpdateResponse], errResp azfake.ErrorResponder)
}
// NewFabricServerTransport creates a new instance of FabricServerTransport with the provided implementation.
@@ -82,31 +78,50 @@ func (f *FabricServerTransport) Do(req *http.Request) (*http.Response, error) {
return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
}
- var resp *http.Response
- var err error
+ return f.dispatchToMethodFake(req, method)
+}
- switch method {
- case "FabricClient.BeginCreate":
- resp, err = f.dispatchBeginCreate(req)
- case "FabricClient.BeginDelete":
- resp, err = f.dispatchBeginDelete(req)
- case "FabricClient.Get":
- resp, err = f.dispatchGet(req)
- case "FabricClient.NewListPager":
- resp, err = f.dispatchNewListPager(req)
- case "FabricClient.NewListBySubscriptionPager":
- resp, err = f.dispatchNewListBySubscriptionPager(req)
- case "FabricClient.BeginUpdate":
- resp, err = f.dispatchBeginUpdate(req)
- default:
- err = fmt.Errorf("unhandled API %s", method)
- }
+func (f *FabricServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
- if err != nil {
- return nil, err
- }
+ go func() {
+ var intercepted bool
+ var res result
+ if fabricServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = fabricServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "FabricClient.BeginCreate":
+ res.resp, res.err = f.dispatchBeginCreate(req)
+ case "FabricClient.BeginDelete":
+ res.resp, res.err = f.dispatchBeginDelete(req)
+ case "FabricClient.Get":
+ res.resp, res.err = f.dispatchGet(req)
+ case "FabricClient.NewListPager":
+ res.resp, res.err = f.dispatchNewListPager(req)
+ case "FabricClient.NewListBySubscriptionPager":
+ res.resp, res.err = f.dispatchNewListBySubscriptionPager(req)
+ case "FabricClient.BeginUpdate":
+ res.resp, res.err = f.dispatchBeginUpdate(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
- return resp, nil
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
}
func (f *FabricServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) {
@@ -190,9 +205,9 @@ func (f *FabricServerTransport) dispatchBeginDelete(req *http.Request) (*http.Re
return nil, err
}
- if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
+ if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
f.beginDelete.remove(req)
- return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
+ return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
}
if !server.PollerResponderMore(beginDelete) {
f.beginDelete.remove(req)
@@ -295,19 +310,7 @@ func (f *FabricServerTransport) dispatchNewListBySubscriptionPager(req *http.Req
if matches == nil || len(matches) < 1 {
return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
}
- qp := req.URL.Query()
- continuationTokenUnescaped, err := url.QueryUnescape(qp.Get("continuationToken"))
- if err != nil {
- return nil, err
- }
- continuationTokenParam := getOptional(continuationTokenUnescaped)
- var options *armrecoveryservicesdatareplication.FabricClientListBySubscriptionOptions
- if continuationTokenParam != nil {
- options = &armrecoveryservicesdatareplication.FabricClientListBySubscriptionOptions{
- ContinuationToken: continuationTokenParam,
- }
- }
- resp := f.srv.NewListBySubscriptionPager(options)
+ resp := f.srv.NewListBySubscriptionPager(nil)
newListBySubscriptionPager = &resp
f.newListBySubscriptionPager.add(req, newListBySubscriptionPager)
server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armrecoveryservicesdatareplication.FabricClientListBySubscriptionResponse, createLink func() string) {
@@ -375,3 +378,9 @@ func (f *FabricServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Re
return resp, nil
}
+
+// set this to conditionally intercept incoming requests to FabricServerTransport
+var fabricServerTransportInterceptor interface {
+ // Do returns true if the server transport should use the returned response/error
+ Do(*http.Request) (*http.Response, error, bool)
+}
diff --git a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/dra_server.go b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/fabricagent_server.go
similarity index 59%
rename from sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/dra_server.go
rename to sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/fabricagent_server.go
index a143f61daa2e..4e5c15ee9294 100644
--- a/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/dra_server.go
+++ b/sdk/resourcemanager/recoveryservicesdatareplication/armrecoveryservicesdatareplication/fake/fabricagent_server.go
@@ -1,10 +1,6 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
-// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package fake
@@ -22,82 +18,101 @@ import (
"regexp"
)
-// DraServer is a fake server for instances of the armrecoveryservicesdatareplication.DraClient type.
-type DraServer struct {
- // BeginCreate is the fake for method DraClient.BeginCreate
+// FabricAgentServer is a fake server for instances of the armrecoveryservicesdatareplication.FabricAgentClient type.
+type FabricAgentServer struct {
+ // BeginCreate is the fake for method FabricAgentClient.BeginCreate
// HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
- BeginCreate func(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, body armrecoveryservicesdatareplication.DraModel, options *armrecoveryservicesdatareplication.DraClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicesdatareplication.DraClientCreateResponse], errResp azfake.ErrorResponder)
+ BeginCreate func(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, resource armrecoveryservicesdatareplication.FabricAgentModel, options *armrecoveryservicesdatareplication.FabricAgentClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicesdatareplication.FabricAgentClientCreateResponse], errResp azfake.ErrorResponder)
- // BeginDelete is the fake for method DraClient.BeginDelete
- // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent
- BeginDelete func(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, options *armrecoveryservicesdatareplication.DraClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicesdatareplication.DraClientDeleteResponse], errResp azfake.ErrorResponder)
+ // BeginDelete is the fake for method FabricAgentClient.BeginDelete
+ // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
+ BeginDelete func(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, options *armrecoveryservicesdatareplication.FabricAgentClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicesdatareplication.FabricAgentClientDeleteResponse], errResp azfake.ErrorResponder)
- // Get is the fake for method DraClient.Get
+ // Get is the fake for method FabricAgentClient.Get
// HTTP status codes to indicate success: http.StatusOK
- Get func(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, options *armrecoveryservicesdatareplication.DraClientGetOptions) (resp azfake.Responder[armrecoveryservicesdatareplication.DraClientGetResponse], errResp azfake.ErrorResponder)
+ Get func(ctx context.Context, resourceGroupName string, fabricName string, fabricAgentName string, options *armrecoveryservicesdatareplication.FabricAgentClientGetOptions) (resp azfake.Responder[armrecoveryservicesdatareplication.FabricAgentClientGetResponse], errResp azfake.ErrorResponder)
- // NewListPager is the fake for method DraClient.NewListPager
+ // NewListPager is the fake for method FabricAgentClient.NewListPager
// HTTP status codes to indicate success: http.StatusOK
- NewListPager func(resourceGroupName string, fabricName string, options *armrecoveryservicesdatareplication.DraClientListOptions) (resp azfake.PagerResponder[armrecoveryservicesdatareplication.DraClientListResponse])
+ NewListPager func(resourceGroupName string, fabricName string, options *armrecoveryservicesdatareplication.FabricAgentClientListOptions) (resp azfake.PagerResponder[armrecoveryservicesdatareplication.FabricAgentClientListResponse])
}
-// NewDraServerTransport creates a new instance of DraServerTransport with the provided implementation.
-// The returned DraServerTransport instance is connected to an instance of armrecoveryservicesdatareplication.DraClient via the
+// NewFabricAgentServerTransport creates a new instance of FabricAgentServerTransport with the provided implementation.
+// The returned FabricAgentServerTransport instance is connected to an instance of armrecoveryservicesdatareplication.FabricAgentClient via the
// azcore.ClientOptions.Transporter field in the client's constructor parameters.
-func NewDraServerTransport(srv *DraServer) *DraServerTransport {
- return &DraServerTransport{
+func NewFabricAgentServerTransport(srv *FabricAgentServer) *FabricAgentServerTransport {
+ return &FabricAgentServerTransport{
srv: srv,
- beginCreate: newTracker[azfake.PollerResponder[armrecoveryservicesdatareplication.DraClientCreateResponse]](),
- beginDelete: newTracker[azfake.PollerResponder[armrecoveryservicesdatareplication.DraClientDeleteResponse]](),
- newListPager: newTracker[azfake.PagerResponder[armrecoveryservicesdatareplication.DraClientListResponse]](),
+ beginCreate: newTracker[azfake.PollerResponder[armrecoveryservicesdatareplication.FabricAgentClientCreateResponse]](),
+ beginDelete: newTracker[azfake.PollerResponder[armrecoveryservicesdatareplication.FabricAgentClientDeleteResponse]](),
+ newListPager: newTracker[azfake.PagerResponder[armrecoveryservicesdatareplication.FabricAgentClientListResponse]](),
}
}
-// DraServerTransport connects instances of armrecoveryservicesdatareplication.DraClient to instances of DraServer.
-// Don't use this type directly, use NewDraServerTransport instead.
-type DraServerTransport struct {
- srv *DraServer
- beginCreate *tracker[azfake.PollerResponder[armrecoveryservicesdatareplication.DraClientCreateResponse]]
- beginDelete *tracker[azfake.PollerResponder[armrecoveryservicesdatareplication.DraClientDeleteResponse]]
- newListPager *tracker[azfake.PagerResponder[armrecoveryservicesdatareplication.DraClientListResponse]]
+// FabricAgentServerTransport connects instances of armrecoveryservicesdatareplication.FabricAgentClient to instances of FabricAgentServer.
+// Don't use this type directly, use NewFabricAgentServerTransport instead.
+type FabricAgentServerTransport struct {
+ srv *FabricAgentServer
+ beginCreate *tracker[azfake.PollerResponder[armrecoveryservicesdatareplication.FabricAgentClientCreateResponse]]
+ beginDelete *tracker[azfake.PollerResponder[armrecoveryservicesdatareplication.FabricAgentClientDeleteResponse]]
+ newListPager *tracker[azfake.PagerResponder[armrecoveryservicesdatareplication.FabricAgentClientListResponse]]
}
-// Do implements the policy.Transporter interface for DraServerTransport.
-func (d *DraServerTransport) Do(req *http.Request) (*http.Response, error) {
+// Do implements the policy.Transporter interface for FabricAgentServerTransport.
+func (f *FabricAgentServerTransport) Do(req *http.Request) (*http.Response, error) {
rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
method, ok := rawMethod.(string)
if !ok {
return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
}
- var resp *http.Response
- var err error
+ return f.dispatchToMethodFake(req, method)
+}
- switch method {
- case "DraClient.BeginCreate":
- resp, err = d.dispatchBeginCreate(req)
- case "DraClient.BeginDelete":
- resp, err = d.dispatchBeginDelete(req)
- case "DraClient.Get":
- resp, err = d.dispatchGet(req)
- case "DraClient.NewListPager":
- resp, err = d.dispatchNewListPager(req)
- default:
- err = fmt.Errorf("unhandled API %s", method)
- }
+func (f *FabricAgentServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
+ resultChan := make(chan result)
+ defer close(resultChan)
- if err != nil {
- return nil, err
- }
+ go func() {
+ var intercepted bool
+ var res result
+ if fabricAgentServerTransportInterceptor != nil {
+ res.resp, res.err, intercepted = fabricAgentServerTransportInterceptor.Do(req)
+ }
+ if !intercepted {
+ switch method {
+ case "FabricAgentClient.BeginCreate":
+ res.resp, res.err = f.dispatchBeginCreate(req)
+ case "FabricAgentClient.BeginDelete":
+ res.resp, res.err = f.dispatchBeginDelete(req)
+ case "FabricAgentClient.Get":
+ res.resp, res.err = f.dispatchGet(req)
+ case "FabricAgentClient.NewListPager":
+ res.resp, res.err = f.dispatchNewListPager(req)
+ default:
+ res.err = fmt.Errorf("unhandled API %s", method)
+ }
- return resp, nil
+ }
+ select {
+ case resultChan <- res:
+ case <-req.Context().Done():
+ }
+ }()
+
+ select {
+ case <-req.Context().Done():
+ return nil, req.Context().Err()
+ case res := <-resultChan:
+ return res.resp, res.err
+ }
}
-func (d *DraServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) {
- if d.srv.BeginCreate == nil {
+func (f *FabricAgentServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginCreate == nil {
return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")}
}
- beginCreate := d.beginCreate.get(req)
+ beginCreate := f.beginCreate.get(req)
if beginCreate == nil {
const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataReplication/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fabricAgents/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
regex := regexp.MustCompile(regexStr)
@@ -105,7 +120,7 @@ func (d *DraServerTransport) dispatchBeginCreate(req *http.Request) (*http.Respo
if matches == nil || len(matches) < 4 {
return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
}
- body, err := server.UnmarshalRequestAsJSON[armrecoveryservicesdatareplication.DraModel](req)
+ body, err := server.UnmarshalRequestAsJSON[armrecoveryservicesdatareplication.FabricAgentModel](req)
if err != nil {
return nil, err
}
@@ -121,12 +136,12 @@ func (d *DraServerTransport) dispatchBeginCreate(req *http.Request) (*http.Respo
if err != nil {
return nil, err
}
- respr, errRespr := d.srv.BeginCreate(req.Context(), resourceGroupNameParam, fabricNameParam, fabricAgentNameParam, body, nil)
+ respr, errRespr := f.srv.BeginCreate(req.Context(), resourceGroupNameParam, fabricNameParam, fabricAgentNameParam, body, nil)
if respErr := server.GetError(errRespr, req); respErr != nil {
return nil, respErr
}
beginCreate = &respr
- d.beginCreate.add(req, beginCreate)
+ f.beginCreate.add(req, beginCreate)
}
resp, err := server.PollerResponderNext(beginCreate, req)
@@ -135,21 +150,21 @@ func (d *DraServerTransport) dispatchBeginCreate(req *http.Request) (*http.Respo
}
if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) {
- d.beginCreate.remove(req)
+ f.beginCreate.remove(req)
return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)}
}
if !server.PollerResponderMore(beginCreate) {
- d.beginCreate.remove(req)
+ f.beginCreate.remove(req)
}
return resp, nil
}
-func (d *DraServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) {
- if d.srv.BeginDelete == nil {
+func (f *FabricAgentServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) {
+ if f.srv.BeginDelete == nil {
return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")}
}
- beginDelete := d.beginDelete.get(req)
+ beginDelete := f.beginDelete.get(req)
if beginDelete == nil {
const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P