diff --git a/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md b/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md index 3e2c1000d1f6..bf185aacb601 100644 --- a/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md +++ b/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md @@ -1,5 +1,220 @@ # Release History +## 0.3.0 (2023-01-20) +### Breaking Changes + +- Function `*SAPApplicationServerInstancesClient.BeginCreate` parameter(s) have been changed from `(context.Context, string, string, string, SAPApplicationServerInstance, *SAPApplicationServerInstancesClientBeginCreateOptions)` to `(context.Context, string, string, string, *SAPApplicationServerInstancesClientBeginCreateOptions)` +- Function `*SAPApplicationServerInstancesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, UpdateSAPApplicationInstanceRequest, *SAPApplicationServerInstancesClientBeginUpdateOptions)` to `(context.Context, string, string, string, *SAPApplicationServerInstancesClientBeginUpdateOptions)` +- Function `*SAPCentralInstancesClient.BeginCreate` parameter(s) have been changed from `(context.Context, string, string, string, SAPCentralServerInstance, *SAPCentralInstancesClientBeginCreateOptions)` to `(context.Context, string, string, string, *SAPCentralInstancesClientBeginCreateOptions)` +- Function `*SAPCentralInstancesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, UpdateSAPCentralInstanceRequest, *SAPCentralInstancesClientBeginUpdateOptions)` to `(context.Context, string, string, string, *SAPCentralInstancesClientBeginUpdateOptions)` +- Function `*SAPDatabaseInstancesClient.BeginCreate` parameter(s) have been changed from `(context.Context, string, string, string, SAPDatabaseInstance, *SAPDatabaseInstancesClientBeginCreateOptions)` to `(context.Context, string, string, string, *SAPDatabaseInstancesClientBeginCreateOptions)` +- Function `*SAPDatabaseInstancesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, UpdateSAPDatabaseInstanceRequest, *SAPDatabaseInstancesClientBeginUpdateOptions)` to `(context.Context, string, string, string, *SAPDatabaseInstancesClientBeginUpdateOptions)` +- Function `*SAPVirtualInstancesClient.BeginCreate` parameter(s) have been changed from `(context.Context, string, string, SAPVirtualInstance, *SAPVirtualInstancesClientBeginCreateOptions)` to `(context.Context, string, string, *SAPVirtualInstancesClientBeginCreateOptions)` +- Function `*SAPVirtualInstancesClient.Update` parameter(s) have been changed from `(context.Context, string, string, UpdateSAPVirtualInstanceRequest, *SAPVirtualInstancesClientUpdateOptions)` to `(context.Context, string, string, *SAPVirtualInstancesClientUpdateOptions)` +- Type of `ErrorAdditionalInfo.Info` has been changed from `interface{}` to `any` +- Type of `OperationsDefinition.Properties` has been changed from `interface{}` to `any` +- Type alias `ApplicationProvisioningState` has been removed +- Type alias `AzureFrontDoorEnabled` has been removed +- Type alias `DatabaseTier` has been removed +- Type alias `DatabaseType` has been removed +- Type alias `DiskStorageType` has been removed +- Type alias `EnableBackup` has been removed +- Type alias `EnableSSLEnforcement` has been removed +- Type alias `FileShareStorageType` has been removed +- Type alias `FileShareType` has been removed +- Type alias `HAEnabled` has been removed +- Type alias `LoadBalancerType` has been removed +- Type alias `LocationType` has been removed +- Type alias `OSImageOffer` has been removed +- Type alias `OSImagePublisher` has been removed +- Type alias `OSImageSKU` has been removed +- Type alias `OSImageVersion` has been removed +- Type alias `PHPVersion` has been removed +- Type alias `PhpWorkloadProvisioningState` has been removed +- Type alias `RedisCacheFamily` has been removed +- Type alias `SKURestrictionReasonCode` has been removed +- Type alias `SKURestrictionType` has been removed +- Type alias `SKUScaleType` has been removed +- Type alias `SKUTier` has been removed +- Type alias `SearchType` has been removed +- Type alias `WordpressVersions` has been removed +- Type alias `WorkloadKind` has been removed +- Function `NewPhpWorkloadsClient` has been removed +- Function `*PhpWorkloadsClient.BeginCreateOrUpdate` has been removed +- Function `*PhpWorkloadsClient.BeginDelete` has been removed +- Function `*PhpWorkloadsClient.Get` has been removed +- Function `*PhpWorkloadsClient.NewListByResourceGroupPager` has been removed +- Function `*PhpWorkloadsClient.NewListBySubscriptionPager` has been removed +- Function `*PhpWorkloadsClient.Update` has been removed +- Function `NewSKUsClient` has been removed +- Function `*SKUsClient.NewListPager` has been removed +- Function `NewWordpressInstancesClient` has been removed +- Function `*WordpressInstancesClient.BeginCreateOrUpdate` has been removed +- Function `*WordpressInstancesClient.Delete` has been removed +- Function `*WordpressInstancesClient.Get` has been removed +- Function `*WordpressInstancesClient.NewListPager` has been removed +- Struct `BackupProfile` has been removed +- Struct `CacheProfile` has been removed +- Struct `DatabaseProfile` has been removed +- Struct `DiskInfo` has been removed +- Struct `FileshareProfile` has been removed +- Struct `NetworkProfile` has been removed +- Struct `NodeProfile` has been removed +- Struct `OsImageProfile` has been removed +- Struct `PatchResourceRequestBody` has been removed +- Struct `PatchResourceRequestBodyIdentity` has been removed +- Struct `PhpProfile` has been removed +- Struct `PhpWorkloadResource` has been removed +- Struct `PhpWorkloadResourceIdentity` has been removed +- Struct `PhpWorkloadResourceList` has been removed +- Struct `PhpWorkloadResourceProperties` has been removed +- Struct `PhpWorkloadsClient` has been removed +- Struct `PhpWorkloadsClientCreateOrUpdateResponse` has been removed +- Struct `PhpWorkloadsClientDeleteResponse` has been removed +- Struct `PhpWorkloadsClientListByResourceGroupResponse` has been removed +- Struct `PhpWorkloadsClientListBySubscriptionResponse` has been removed +- Struct `RestrictionInfo` has been removed +- Struct `SKU` has been removed +- Struct `SKUCapability` has been removed +- Struct `SKUCapacity` has been removed +- Struct `SKUCost` has been removed +- Struct `SKUDefinition` has been removed +- Struct `SKULocationAndZones` has been removed +- Struct `SKURestriction` has been removed +- Struct `SKUZoneDetail` has been removed +- Struct `SKUsClient` has been removed +- Struct `SKUsClientListResponse` has been removed +- Struct `SKUsListResult` has been removed +- Struct `SearchProfile` has been removed +- Struct `SiteProfile` has been removed +- Struct `UserProfile` has been removed +- Struct `VmssNodesProfile` has been removed +- Struct `WordpressInstanceResource` has been removed +- Struct `WordpressInstanceResourceList` has been removed +- Struct `WordpressInstanceResourceProperties` has been removed +- Struct `WordpressInstancesClient` has been removed +- Struct `WordpressInstancesClientCreateOrUpdateResponse` has been removed +- Struct `WordpressInstancesClientListResponse` has been removed +- Field `DbSSLCertificateURI` of struct `HanaDbProviderInstanceProperties` has been removed +- Field `VirtualMachineID` of struct `SAPApplicationServerProperties` has been removed +- Field `DiskCount` of struct `SAPDiskConfiguration` has been removed +- Field `DiskIopsReadWrite` of struct `SAPDiskConfiguration` has been removed +- Field `DiskMBpsReadWrite` of struct `SAPDiskConfiguration` has been removed +- Field `DiskSizeGB` of struct `SAPDiskConfiguration` has been removed +- Field `DiskStorageType` of struct `SAPDiskConfiguration` has been removed +- Field `DiskType` of struct `SAPDiskConfiguration` has been removed +- Field `Volume` of struct `SAPDiskConfiguration` has been removed +- Field `DiskConfigurations` of struct `SAPDiskConfigurationsResult` has been removed +- Field `SapSSLCertificateURI` of struct `SapNetWeaverProviderInstanceProperties` has been removed +- Field `HardStop` of struct `StopRequest` has been removed + +### Features Added + +- New value `SAPSoftwareInstallationTypeExternal` added to type alias `SAPSoftwareInstallationType` +- New value `SAPVirtualInstanceStateSoftwareDetectionFailed`, `SAPVirtualInstanceStateSoftwareDetectionInProgress` added to type alias `SAPVirtualInstanceState` +- New value `SAPVirtualInstanceStatusSoftShutdown` added to type alias `SAPVirtualInstanceStatus` +- New type alias `ApplicationServerVirtualMachineType` with values `ApplicationServerVirtualMachineTypeActive`, `ApplicationServerVirtualMachineTypeStandby`, `ApplicationServerVirtualMachineTypeUnknown` +- New type alias `ConfigurationType` with values `ConfigurationTypeCreateAndMount`, `ConfigurationTypeMount`, `ConfigurationTypeSkip` +- New type alias `DiskSKUName` with values `DiskSKUNamePremiumLRS`, `DiskSKUNamePremiumV2LRS`, `DiskSKUNamePremiumZRS`, `DiskSKUNameStandardLRS`, `DiskSKUNameStandardSSDLRS`, `DiskSKUNameStandardSSDZRS`, `DiskSKUNameUltraSSDLRS` +- New type alias `NamingPatternType` with values `NamingPatternTypeFullResourceName` +- New type alias `SSLPreference` with values `SSLPreferenceDisabled`, `SSLPreferenceRootCertificate`, `SSLPreferenceServerCertificate` +- New type alias `SapLandscapeMonitorProvisioningState` with values `SapLandscapeMonitorProvisioningStateAccepted`, `SapLandscapeMonitorProvisioningStateCanceled`, `SapLandscapeMonitorProvisioningStateCreated`, `SapLandscapeMonitorProvisioningStateFailed`, `SapLandscapeMonitorProvisioningStateSucceeded` +- New function `*CreateAndMountFileShareConfiguration.GetFileShareConfiguration() *FileShareConfiguration` +- New function `*ExternalInstallationSoftwareConfiguration.GetSoftwareConfiguration() *SoftwareConfiguration` +- New function `*FileShareConfiguration.GetFileShareConfiguration() *FileShareConfiguration` +- New function `*MountFileShareConfiguration.GetFileShareConfiguration() *FileShareConfiguration` +- New function `*SAPApplicationServerInstancesClient.BeginStartInstance(context.Context, string, string, string, *SAPApplicationServerInstancesClientBeginStartInstanceOptions) (*runtime.Poller[SAPApplicationServerInstancesClientStartInstanceResponse], error)` +- New function `*SAPApplicationServerInstancesClient.BeginStopInstance(context.Context, string, string, string, *SAPApplicationServerInstancesClientBeginStopInstanceOptions) (*runtime.Poller[SAPApplicationServerInstancesClientStopInstanceResponse], error)` +- New function `*SAPCentralInstancesClient.BeginStartInstance(context.Context, string, string, string, *SAPCentralInstancesClientBeginStartInstanceOptions) (*runtime.Poller[SAPCentralInstancesClientStartInstanceResponse], error)` +- New function `*SAPCentralInstancesClient.BeginStopInstance(context.Context, string, string, string, *SAPCentralInstancesClientBeginStopInstanceOptions) (*runtime.Poller[SAPCentralInstancesClientStopInstanceResponse], error)` +- New function `*SAPDatabaseInstancesClient.BeginStartInstance(context.Context, string, string, string, *SAPDatabaseInstancesClientBeginStartInstanceOptions) (*runtime.Poller[SAPDatabaseInstancesClientStartInstanceResponse], error)` +- New function `*SAPDatabaseInstancesClient.BeginStopInstance(context.Context, string, string, string, *SAPDatabaseInstancesClientBeginStopInstanceOptions) (*runtime.Poller[SAPDatabaseInstancesClientStopInstanceResponse], error)` +- New function `NewSapLandscapeMonitorClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SapLandscapeMonitorClient, error)` +- New function `*SapLandscapeMonitorClient.Create(context.Context, string, string, SapLandscapeMonitor, *SapLandscapeMonitorClientCreateOptions) (SapLandscapeMonitorClientCreateResponse, error)` +- New function `*SapLandscapeMonitorClient.Delete(context.Context, string, string, *SapLandscapeMonitorClientDeleteOptions) (SapLandscapeMonitorClientDeleteResponse, error)` +- New function `*SapLandscapeMonitorClient.Get(context.Context, string, string, *SapLandscapeMonitorClientGetOptions) (SapLandscapeMonitorClientGetResponse, error)` +- New function `*SapLandscapeMonitorClient.List(context.Context, string, string, *SapLandscapeMonitorClientListOptions) (SapLandscapeMonitorClientListResponse, error)` +- New function `*SapLandscapeMonitorClient.Update(context.Context, string, string, SapLandscapeMonitor, *SapLandscapeMonitorClientUpdateOptions) (SapLandscapeMonitorClientUpdateResponse, error)` +- New function `*SingleServerCustomResourceNames.GetSingleServerCustomResourceNames() *SingleServerCustomResourceNames` +- New function `*SingleServerFullResourceNames.GetSingleServerCustomResourceNames() *SingleServerCustomResourceNames` +- New function `*SkipFileShareConfiguration.GetFileShareConfiguration() *FileShareConfiguration` +- New function `*ThreeTierCustomResourceNames.GetThreeTierCustomResourceNames() *ThreeTierCustomResourceNames` +- New function `*ThreeTierFullResourceNames.GetThreeTierCustomResourceNames() *ThreeTierCustomResourceNames` +- New struct `ApplicationServerFullResourceNames` +- New struct `ApplicationServerVMDetails` +- New struct `CentralServerFullResourceNames` +- New struct `CreateAndMountFileShareConfiguration` +- New struct `DatabaseServerFullResourceNames` +- New struct `DiskConfiguration` +- New struct `DiskDetails` +- New struct `DiskSKU` +- New struct `DiskVolumeConfiguration` +- New struct `ExternalInstallationSoftwareConfiguration` +- New struct `LoadBalancerDetails` +- New struct `LoadBalancerResourceNames` +- New struct `MountFileShareConfiguration` +- New struct `NetworkInterfaceResourceNames` +- New struct `SAPApplicationServerInstancesClientStartInstanceResponse` +- New struct `SAPApplicationServerInstancesClientStopInstanceResponse` +- New struct `SAPCentralInstancesClientStartInstanceResponse` +- New struct `SAPCentralInstancesClientStopInstanceResponse` +- New struct `SAPDatabaseInstancesClientStartInstanceResponse` +- New struct `SAPDatabaseInstancesClientStopInstanceResponse` +- New struct `SapLandscapeMonitor` +- New struct `SapLandscapeMonitorClient` +- New struct `SapLandscapeMonitorListResult` +- New struct `SapLandscapeMonitorMetricThresholds` +- New struct `SapLandscapeMonitorProperties` +- New struct `SapLandscapeMonitorPropertiesGrouping` +- New struct `SapLandscapeMonitorSidMapping` +- New struct `SharedStorageResourceNames` +- New struct `SingleServerFullResourceNames` +- New struct `SkipFileShareConfiguration` +- New struct `StorageConfiguration` +- New struct `StorageInformation` +- New struct `ThreeTierFullResourceNames` +- New struct `VirtualMachineResourceNames` +- New field `StorageDetails` in struct `CentralServerVMDetails` +- New field `SSLCertificateURI` in struct `DB2ProviderInstanceProperties` +- New field `SSLPreference` in struct `DB2ProviderInstanceProperties` +- New field `DiskConfiguration` in struct `DatabaseConfiguration` +- New field `StorageDetails` in struct `DatabaseVMDetails` +- New field `SSLCertificateURI` in struct `HanaDbProviderInstanceProperties` +- New field `SSLPreference` in struct `HanaDbProviderInstanceProperties` +- New field `SapSid` in struct `HanaDbProviderInstanceProperties` +- New field `StorageAccountArmID` in struct `MonitorProperties` +- New field `ZoneRedundancyPreference` in struct `MonitorProperties` +- New field `SSLCertificateURI` in struct `MsSQLServerProviderInstanceProperties` +- New field `SSLPreference` in struct `MsSQLServerProviderInstanceProperties` +- New field `SSLCertificateURI` in struct `PrometheusHaClusterProviderInstanceProperties` +- New field `SSLPreference` in struct `PrometheusHaClusterProviderInstanceProperties` +- New field `SSLCertificateURI` in struct `PrometheusOSProviderInstanceProperties` +- New field `SSLPreference` in struct `PrometheusOSProviderInstanceProperties` +- New field `SapSid` in struct `PrometheusOSProviderInstanceProperties` +- New field `Body` in struct `SAPApplicationServerInstancesClientBeginCreateOptions` +- New field `Body` in struct `SAPApplicationServerInstancesClientBeginUpdateOptions` +- New field `LoadBalancerDetails` in struct `SAPApplicationServerProperties` +- New field `VMDetails` in struct `SAPApplicationServerProperties` +- New field `Body` in struct `SAPCentralInstancesClientBeginCreateOptions` +- New field `Body` in struct `SAPCentralInstancesClientBeginUpdateOptions` +- New field `LoadBalancerDetails` in struct `SAPCentralServerProperties` +- New field `Body` in struct `SAPDatabaseInstancesClientBeginCreateOptions` +- New field `Body` in struct `SAPDatabaseInstancesClientBeginUpdateOptions` +- New field `LoadBalancerDetails` in struct `SAPDatabaseProperties` +- New field `RecommendedConfiguration` in struct `SAPDiskConfiguration` +- New field `SupportedConfigurations` in struct `SAPDiskConfiguration` +- New field `VolumeConfigurations` in struct `SAPDiskConfigurationsResult` +- New field `Body` in struct `SAPVirtualInstancesClientBeginCreateOptions` +- New field `Body` in struct `SAPVirtualInstancesClientUpdateOptions` +- New field `SSLCertificateURI` in struct `SapNetWeaverProviderInstanceProperties` +- New field `SSLPreference` in struct `SapNetWeaverProviderInstanceProperties` +- New field `CustomResourceNames` in struct `SingleServerConfiguration` +- New field `DbDiskConfiguration` in struct `SingleServerConfiguration` +- New field `SoftStopTimeoutSeconds` in struct `StopRequest` +- New field `CustomResourceNames` in struct `ThreeTierConfiguration` +- New field `StorageConfiguration` in struct `ThreeTierConfiguration` + + ## 0.2.0 (2022-06-30) ### Breaking Changes diff --git a/sdk/resourcemanager/workloads/armworkloads/autorest.md b/sdk/resourcemanager/workloads/armworkloads/autorest.md index a3737c11c6e5..198c018f3a0d 100644 --- a/sdk/resourcemanager/workloads/armworkloads/autorest.md +++ b/sdk/resourcemanager/workloads/armworkloads/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/45472ea9fc026c14e8962f78757a589b6586fe9d/specification/workloads/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/45472ea9fc026c14e8962f78757a589b6586fe9d/specification/workloads/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/workloads/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/workloads/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.2.0 +module-version: 0.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/workloads/armworkloads/client.go b/sdk/resourcemanager/workloads/armworkloads/client.go index 60ed2d3ed885..fe55f26934a1 100644 --- a/sdk/resourcemanager/workloads/armworkloads/client.go +++ b/sdk/resourcemanager/workloads/armworkloads/client.go @@ -32,9 +32,9 @@ type Client struct { } // NewClient creates a new instance of Client with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,12 +55,13 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options return client, nil } -// SAPAvailabilityZoneDetails - Get SAP Availability Zone Details. +// SAPAvailabilityZoneDetails - Get the recommended SAP Availability Zone Pair Details for your region. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// location - The name of Azure region. -// options - ClientSAPAvailabilityZoneDetailsOptions contains the optional parameters for the Client.SAPAvailabilityZoneDetails -// method. +// +// Generated from API version 2022-11-01-preview +// - location - The name of Azure region. +// - options - ClientSAPAvailabilityZoneDetailsOptions contains the optional parameters for the Client.SAPAvailabilityZoneDetails +// method. func (client *Client) SAPAvailabilityZoneDetails(ctx context.Context, location string, options *ClientSAPAvailabilityZoneDetailsOptions) (ClientSAPAvailabilityZoneDetailsResponse, error) { req, err := client.sapAvailabilityZoneDetailsCreateRequest(ctx, location, options) if err != nil { @@ -92,7 +93,7 @@ func (client *Client) sapAvailabilityZoneDetailsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.SAPAvailabilityZoneDetails != nil { @@ -110,11 +111,12 @@ func (client *Client) sapAvailabilityZoneDetailsHandleResponse(resp *http.Respon return result, nil } -// SAPDiskConfigurations - Get SAP Disk Configurations. +// SAPDiskConfigurations - Get the SAP Disk Configuration Layout prod/non-prod SAP System. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// location - The name of Azure region. -// options - ClientSAPDiskConfigurationsOptions contains the optional parameters for the Client.SAPDiskConfigurations method. +// +// Generated from API version 2022-11-01-preview +// - location - The name of Azure region. +// - options - ClientSAPDiskConfigurationsOptions contains the optional parameters for the Client.SAPDiskConfigurations method. func (client *Client) SAPDiskConfigurations(ctx context.Context, location string, options *ClientSAPDiskConfigurationsOptions) (ClientSAPDiskConfigurationsResponse, error) { req, err := client.sapDiskConfigurationsCreateRequest(ctx, location, options) if err != nil { @@ -146,7 +148,7 @@ func (client *Client) sapDiskConfigurationsCreateRequest(ctx context.Context, lo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.SAPDiskConfigurations != nil { @@ -164,12 +166,14 @@ func (client *Client) sapDiskConfigurationsHandleResponse(resp *http.Response) ( return result, nil } -// SAPSizingRecommendations - Get SAP sizing recommendations. +// SAPSizingRecommendations - Get SAP sizing recommendations by providing input SAPS for application tier and memory required +// for database tier // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// location - The name of Azure region. -// options - ClientSAPSizingRecommendationsOptions contains the optional parameters for the Client.SAPSizingRecommendations -// method. +// +// Generated from API version 2022-11-01-preview +// - location - The name of Azure region. +// - options - ClientSAPSizingRecommendationsOptions contains the optional parameters for the Client.SAPSizingRecommendations +// method. func (client *Client) SAPSizingRecommendations(ctx context.Context, location string, options *ClientSAPSizingRecommendationsOptions) (ClientSAPSizingRecommendationsResponse, error) { req, err := client.sapSizingRecommendationsCreateRequest(ctx, location, options) if err != nil { @@ -201,7 +205,7 @@ func (client *Client) sapSizingRecommendationsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.SAPSizingRecommendation != nil { @@ -219,11 +223,12 @@ func (client *Client) sapSizingRecommendationsHandleResponse(resp *http.Response return result, nil } -// SAPSupportedSKU - Get SAP supported SKUs. +// SAPSupportedSKU - Get a list of SAP supported SKUs for ASCS, Application and Database tier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// location - The name of Azure region. -// options - ClientSAPSupportedSKUOptions contains the optional parameters for the Client.SAPSupportedSKU method. +// +// Generated from API version 2022-11-01-preview +// - location - The name of Azure region. +// - options - ClientSAPSupportedSKUOptions contains the optional parameters for the Client.SAPSupportedSKU method. func (client *Client) SAPSupportedSKU(ctx context.Context, location string, options *ClientSAPSupportedSKUOptions) (ClientSAPSupportedSKUResponse, error) { req, err := client.sapSupportedSKUCreateRequest(ctx, location, options) if err != nil { @@ -255,7 +260,7 @@ func (client *Client) sapSupportedSKUCreateRequest(ctx context.Context, location return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.SAPSupportedSKU != nil { diff --git a/sdk/resourcemanager/workloads/armworkloads/constants.go b/sdk/resourcemanager/workloads/armworkloads/constants.go index bc47439234b8..5056ccc2abda 100644 --- a/sdk/resourcemanager/workloads/armworkloads/constants.go +++ b/sdk/resourcemanager/workloads/armworkloads/constants.go @@ -11,7 +11,7 @@ package armworkloads const ( moduleName = "armworkloads" - moduleVersion = "v0.2.0" + moduleVersion = "v0.3.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -28,45 +28,21 @@ func PossibleActionTypeValues() []ActionType { } } -// ApplicationProvisioningState - WordPress instance provisioning state -type ApplicationProvisioningState string +// ApplicationServerVirtualMachineType - Defines the type of application server VM. +type ApplicationServerVirtualMachineType string const ( - ApplicationProvisioningStateAccepted ApplicationProvisioningState = "Accepted" - ApplicationProvisioningStateCanceled ApplicationProvisioningState = "Canceled" - ApplicationProvisioningStateCreated ApplicationProvisioningState = "Created" - ApplicationProvisioningStateFailed ApplicationProvisioningState = "Failed" - ApplicationProvisioningStateInstalling ApplicationProvisioningState = "Installing" - ApplicationProvisioningStateNotSpecified ApplicationProvisioningState = "NotSpecified" - ApplicationProvisioningStateSucceeded ApplicationProvisioningState = "Succeeded" + ApplicationServerVirtualMachineTypeActive ApplicationServerVirtualMachineType = "Active" + ApplicationServerVirtualMachineTypeStandby ApplicationServerVirtualMachineType = "Standby" + ApplicationServerVirtualMachineTypeUnknown ApplicationServerVirtualMachineType = "Unknown" ) -// PossibleApplicationProvisioningStateValues returns the possible values for the ApplicationProvisioningState const type. -func PossibleApplicationProvisioningStateValues() []ApplicationProvisioningState { - return []ApplicationProvisioningState{ - ApplicationProvisioningStateAccepted, - ApplicationProvisioningStateCanceled, - ApplicationProvisioningStateCreated, - ApplicationProvisioningStateFailed, - ApplicationProvisioningStateInstalling, - ApplicationProvisioningStateNotSpecified, - ApplicationProvisioningStateSucceeded, - } -} - -// AzureFrontDoorEnabled - Whether to enable Azure front door -type AzureFrontDoorEnabled string - -const ( - AzureFrontDoorEnabledDisabled AzureFrontDoorEnabled = "Disabled" - AzureFrontDoorEnabledEnabled AzureFrontDoorEnabled = "Enabled" -) - -// PossibleAzureFrontDoorEnabledValues returns the possible values for the AzureFrontDoorEnabled const type. -func PossibleAzureFrontDoorEnabledValues() []AzureFrontDoorEnabled { - return []AzureFrontDoorEnabled{ - AzureFrontDoorEnabledDisabled, - AzureFrontDoorEnabledEnabled, +// PossibleApplicationServerVirtualMachineTypeValues returns the possible values for the ApplicationServerVirtualMachineType const type. +func PossibleApplicationServerVirtualMachineTypeValues() []ApplicationServerVirtualMachineType { + return []ApplicationServerVirtualMachineType{ + ApplicationServerVirtualMachineTypeActive, + ApplicationServerVirtualMachineTypeStandby, + ApplicationServerVirtualMachineTypeUnknown, } } @@ -96,6 +72,24 @@ func PossibleCentralServerVirtualMachineTypeValues() []CentralServerVirtualMachi } } +// ConfigurationType - The type of file share config. +type ConfigurationType string + +const ( + ConfigurationTypeCreateAndMount ConfigurationType = "CreateAndMount" + ConfigurationTypeMount ConfigurationType = "Mount" + ConfigurationTypeSkip ConfigurationType = "Skip" +) + +// PossibleConfigurationTypeValues returns the possible values for the ConfigurationType const type. +func PossibleConfigurationTypeValues() []ConfigurationType { + return []ConfigurationType{ + ConfigurationTypeCreateAndMount, + ConfigurationTypeMount, + ConfigurationTypeSkip, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -116,85 +110,29 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// DatabaseTier - Tier of the server SKU -type DatabaseTier string +// DiskSKUName - Defines the disk sku name. +type DiskSKUName string const ( - DatabaseTierBurstable DatabaseTier = "Burstable" - DatabaseTierGeneralPurpose DatabaseTier = "GeneralPurpose" - DatabaseTierMemoryOptimized DatabaseTier = "MemoryOptimized" + DiskSKUNamePremiumLRS DiskSKUName = "Premium_LRS" + DiskSKUNamePremiumV2LRS DiskSKUName = "PremiumV2_LRS" + DiskSKUNamePremiumZRS DiskSKUName = "Premium_ZRS" + DiskSKUNameStandardLRS DiskSKUName = "Standard_LRS" + DiskSKUNameStandardSSDLRS DiskSKUName = "StandardSSD_LRS" + DiskSKUNameStandardSSDZRS DiskSKUName = "StandardSSD_ZRS" + DiskSKUNameUltraSSDLRS DiskSKUName = "UltraSSD_LRS" ) -// PossibleDatabaseTierValues returns the possible values for the DatabaseTier const type. -func PossibleDatabaseTierValues() []DatabaseTier { - return []DatabaseTier{ - DatabaseTierBurstable, - DatabaseTierGeneralPurpose, - DatabaseTierMemoryOptimized, - } -} - -// DatabaseType - Database type -type DatabaseType string - -const ( - DatabaseTypeMySQL DatabaseType = "MySql" -) - -// PossibleDatabaseTypeValues returns the possible values for the DatabaseType const type. -func PossibleDatabaseTypeValues() []DatabaseType { - return []DatabaseType{ - DatabaseTypeMySQL, - } -} - -// DiskStorageType - Storage type -type DiskStorageType string - -const ( - DiskStorageTypePremiumLRS DiskStorageType = "Premium_LRS" - DiskStorageTypeStandardLRS DiskStorageType = "Standard_LRS" - DiskStorageTypeStandardSSDLRS DiskStorageType = "StandardSSD_LRS" -) - -// PossibleDiskStorageTypeValues returns the possible values for the DiskStorageType const type. -func PossibleDiskStorageTypeValues() []DiskStorageType { - return []DiskStorageType{ - DiskStorageTypePremiumLRS, - DiskStorageTypeStandardLRS, - DiskStorageTypeStandardSSDLRS, - } -} - -// EnableBackup - Whether to enable Azure backup for the workload -type EnableBackup string - -const ( - EnableBackupDisabled EnableBackup = "Disabled" - EnableBackupEnabled EnableBackup = "Enabled" -) - -// PossibleEnableBackupValues returns the possible values for the EnableBackup const type. -func PossibleEnableBackupValues() []EnableBackup { - return []EnableBackup{ - EnableBackupDisabled, - EnableBackupEnabled, - } -} - -// EnableSSLEnforcement - Whether to enable SSL enforcement on the database -type EnableSSLEnforcement string - -const ( - EnableSSLEnforcementDisabled EnableSSLEnforcement = "Disabled" - EnableSSLEnforcementEnabled EnableSSLEnforcement = "Enabled" -) - -// PossibleEnableSSLEnforcementValues returns the possible values for the EnableSSLEnforcement const type. -func PossibleEnableSSLEnforcementValues() []EnableSSLEnforcement { - return []EnableSSLEnforcement{ - EnableSSLEnforcementDisabled, - EnableSSLEnforcementEnabled, +// PossibleDiskSKUNameValues returns the possible values for the DiskSKUName const type. +func PossibleDiskSKUNameValues() []DiskSKUName { + return []DiskSKUName{ + DiskSKUNamePremiumLRS, + DiskSKUNamePremiumV2LRS, + DiskSKUNamePremiumZRS, + DiskSKUNameStandardLRS, + DiskSKUNameStandardSSDLRS, + DiskSKUNameStandardSSDZRS, + DiskSKUNameUltraSSDLRS, } } @@ -214,90 +152,6 @@ func PossibleEnqueueReplicationServerTypeValues() []EnqueueReplicationServerType } } -// FileShareStorageType - File share backing storage type -type FileShareStorageType string - -const ( - FileShareStorageTypePremiumLRS FileShareStorageType = "Premium_LRS" - FileShareStorageTypeStandardGRS FileShareStorageType = "Standard_GRS" - FileShareStorageTypeStandardLRS FileShareStorageType = "Standard_LRS" - FileShareStorageTypeStandardZRS FileShareStorageType = "Standard_ZRS" -) - -// PossibleFileShareStorageTypeValues returns the possible values for the FileShareStorageType const type. -func PossibleFileShareStorageTypeValues() []FileShareStorageType { - return []FileShareStorageType{ - FileShareStorageTypePremiumLRS, - FileShareStorageTypeStandardGRS, - FileShareStorageTypeStandardLRS, - FileShareStorageTypeStandardZRS, - } -} - -// FileShareType - Share type -type FileShareType string - -const ( - FileShareTypeAzureFiles FileShareType = "AzureFiles" - FileShareTypeNfsOnController FileShareType = "NfsOnController" -) - -// PossibleFileShareTypeValues returns the possible values for the FileShareType const type. -func PossibleFileShareTypeValues() []FileShareType { - return []FileShareType{ - FileShareTypeAzureFiles, - FileShareTypeNfsOnController, - } -} - -// HAEnabled - Whether to enable HA for the server -type HAEnabled string - -const ( - HAEnabledDisabled HAEnabled = "Disabled" - HAEnabledEnabled HAEnabled = "Enabled" -) - -// PossibleHAEnabledValues returns the possible values for the HAEnabled const type. -func PossibleHAEnabledValues() []HAEnabled { - return []HAEnabled{ - HAEnabledDisabled, - HAEnabledEnabled, - } -} - -// LoadBalancerType - Load balancer type -type LoadBalancerType string - -const ( - LoadBalancerTypeApplicationGateway LoadBalancerType = "ApplicationGateway" - LoadBalancerTypeLoadBalancer LoadBalancerType = "LoadBalancer" -) - -// PossibleLoadBalancerTypeValues returns the possible values for the LoadBalancerType const type. -func PossibleLoadBalancerTypeValues() []LoadBalancerType { - return []LoadBalancerType{ - LoadBalancerTypeApplicationGateway, - LoadBalancerTypeLoadBalancer, - } -} - -// LocationType - Type of the extended location. -type LocationType string - -const ( - LocationTypeEdgeZone LocationType = "EdgeZone" - LocationTypeRegion LocationType = "Region" -) - -// PossibleLocationTypeValues returns the possible values for the LocationType const type. -func PossibleLocationTypeValues() []LocationType { - return []LocationType{ - LocationTypeEdgeZone, - LocationTypeRegion, - } -} - // ManagedServiceIdentityType - Type of managed service identity (only None, UserAssigned types are allowed). type ManagedServiceIdentityType string @@ -314,61 +168,17 @@ func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { } } -// OSImageOffer - OS image offer -type OSImageOffer string +// NamingPatternType - The pattern type to be used for resource naming. +type NamingPatternType string const ( - OSImageOfferUbuntuServer OSImageOffer = "UbuntuServer" + NamingPatternTypeFullResourceName NamingPatternType = "FullResourceName" ) -// PossibleOSImageOfferValues returns the possible values for the OSImageOffer const type. -func PossibleOSImageOfferValues() []OSImageOffer { - return []OSImageOffer{ - OSImageOfferUbuntuServer, - } -} - -// OSImagePublisher - OS image publisher -type OSImagePublisher string - -const ( - OSImagePublisherCanonical OSImagePublisher = "Canonical" -) - -// PossibleOSImagePublisherValues returns the possible values for the OSImagePublisher const type. -func PossibleOSImagePublisherValues() []OSImagePublisher { - return []OSImagePublisher{ - OSImagePublisherCanonical, - } -} - -// OSImageSKU - OS image sku -type OSImageSKU string - -const ( - OSImageSKUEighteen04LTS OSImageSKU = "18.04-LTS" - OSImageSKUSixteen04LTS OSImageSKU = "16.04-LTS" -) - -// PossibleOSImageSKUValues returns the possible values for the OSImageSKU const type. -func PossibleOSImageSKUValues() []OSImageSKU { - return []OSImageSKU{ - OSImageSKUEighteen04LTS, - OSImageSKUSixteen04LTS, - } -} - -// OSImageVersion - OS image version -type OSImageVersion string - -const ( - OSImageVersionLatest OSImageVersion = "latest" -) - -// PossibleOSImageVersionValues returns the possible values for the OSImageVersion const type. -func PossibleOSImageVersionValues() []OSImageVersion { - return []OSImageVersion{ - OSImageVersionLatest, +// PossibleNamingPatternTypeValues returns the possible values for the NamingPatternType const type. +func PossibleNamingPatternTypeValues() []NamingPatternType { + return []NamingPatternType{ + NamingPatternTypeFullResourceName, } } @@ -425,68 +235,6 @@ func PossibleOriginValues() []Origin { } } -// PHPVersion - PHP version -type PHPVersion string - -const ( - PHPVersionSeven2 PHPVersion = "7.2" - PHPVersionSeven3 PHPVersion = "7.3" - PHPVersionSeven4 PHPVersion = "7.4" -) - -// PossiblePHPVersionValues returns the possible values for the PHPVersion const type. -func PossiblePHPVersionValues() []PHPVersion { - return []PHPVersion{ - PHPVersionSeven2, - PHPVersionSeven3, - PHPVersionSeven4, - } -} - -// PhpWorkloadProvisioningState - Php workload resource provisioning state -type PhpWorkloadProvisioningState string - -const ( - PhpWorkloadProvisioningStateAccepted PhpWorkloadProvisioningState = "Accepted" - PhpWorkloadProvisioningStateCanceled PhpWorkloadProvisioningState = "Canceled" - PhpWorkloadProvisioningStateCreated PhpWorkloadProvisioningState = "Created" - PhpWorkloadProvisioningStateDeleting PhpWorkloadProvisioningState = "Deleting" - PhpWorkloadProvisioningStateFailed PhpWorkloadProvisioningState = "Failed" - PhpWorkloadProvisioningStateNotSpecified PhpWorkloadProvisioningState = "NotSpecified" - PhpWorkloadProvisioningStateProvisioning PhpWorkloadProvisioningState = "Provisioning" - PhpWorkloadProvisioningStateSucceeded PhpWorkloadProvisioningState = "Succeeded" -) - -// PossiblePhpWorkloadProvisioningStateValues returns the possible values for the PhpWorkloadProvisioningState const type. -func PossiblePhpWorkloadProvisioningStateValues() []PhpWorkloadProvisioningState { - return []PhpWorkloadProvisioningState{ - PhpWorkloadProvisioningStateAccepted, - PhpWorkloadProvisioningStateCanceled, - PhpWorkloadProvisioningStateCreated, - PhpWorkloadProvisioningStateDeleting, - PhpWorkloadProvisioningStateFailed, - PhpWorkloadProvisioningStateNotSpecified, - PhpWorkloadProvisioningStateProvisioning, - PhpWorkloadProvisioningStateSucceeded, - } -} - -// RedisCacheFamily - Cache family -type RedisCacheFamily string - -const ( - RedisCacheFamilyC RedisCacheFamily = "C" - RedisCacheFamilyP RedisCacheFamily = "P" -) - -// PossibleRedisCacheFamilyValues returns the possible values for the RedisCacheFamily const type. -func PossibleRedisCacheFamilyValues() []RedisCacheFamily { - return []RedisCacheFamily{ - RedisCacheFamilyC, - RedisCacheFamilyP, - } -} - // RoutingPreference - Sets the routing preference of the SAP monitor. By default only RFC1918 traffic is routed to the customer // VNET. type RoutingPreference string @@ -552,7 +300,7 @@ func PossibleSAPDatabaseTypeValues() []SAPDatabaseType { } } -// SAPDeploymentType - The deployment Type. +// SAPDeploymentType - The type of SAP deployment, single server or Three tier. type SAPDeploymentType string const ( @@ -584,7 +332,7 @@ func PossibleSAPEnvironmentTypeValues() []SAPEnvironmentType { } } -// SAPHealthState - Defines the SAP Instance health. +// SAPHealthState - Defines the health of SAP Instances. type SAPHealthState string const ( @@ -643,6 +391,7 @@ func PossibleSAPProductTypeValues() []SAPProductType { type SAPSoftwareInstallationType string const ( + SAPSoftwareInstallationTypeExternal SAPSoftwareInstallationType = "External" SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig SAPSoftwareInstallationType = "SAPInstallWithoutOSConfig" SAPSoftwareInstallationTypeServiceInitiated SAPSoftwareInstallationType = "ServiceInitiated" ) @@ -650,6 +399,7 @@ const ( // PossibleSAPSoftwareInstallationTypeValues returns the possible values for the SAPSoftwareInstallationType const type. func PossibleSAPSoftwareInstallationTypeValues() []SAPSoftwareInstallationType { return []SAPSoftwareInstallationType{ + SAPSoftwareInstallationTypeExternal, SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig, SAPSoftwareInstallationTypeServiceInitiated, } @@ -666,6 +416,8 @@ const ( SAPVirtualInstanceStateInfrastructureDeploymentInProgress SAPVirtualInstanceState = "InfrastructureDeploymentInProgress" SAPVirtualInstanceStateInfrastructureDeploymentPending SAPVirtualInstanceState = "InfrastructureDeploymentPending" SAPVirtualInstanceStateRegistrationComplete SAPVirtualInstanceState = "RegistrationComplete" + SAPVirtualInstanceStateSoftwareDetectionFailed SAPVirtualInstanceState = "SoftwareDetectionFailed" + SAPVirtualInstanceStateSoftwareDetectionInProgress SAPVirtualInstanceState = "SoftwareDetectionInProgress" SAPVirtualInstanceStateSoftwareInstallationFailed SAPVirtualInstanceState = "SoftwareInstallationFailed" SAPVirtualInstanceStateSoftwareInstallationInProgress SAPVirtualInstanceState = "SoftwareInstallationInProgress" SAPVirtualInstanceStateSoftwareInstallationPending SAPVirtualInstanceState = "SoftwareInstallationPending" @@ -681,6 +433,8 @@ func PossibleSAPVirtualInstanceStateValues() []SAPVirtualInstanceState { SAPVirtualInstanceStateInfrastructureDeploymentInProgress, SAPVirtualInstanceStateInfrastructureDeploymentPending, SAPVirtualInstanceStateRegistrationComplete, + SAPVirtualInstanceStateSoftwareDetectionFailed, + SAPVirtualInstanceStateSoftwareDetectionInProgress, SAPVirtualInstanceStateSoftwareInstallationFailed, SAPVirtualInstanceStateSoftwareInstallationInProgress, SAPVirtualInstanceStateSoftwareInstallationPending, @@ -694,6 +448,7 @@ const ( SAPVirtualInstanceStatusOffline SAPVirtualInstanceStatus = "Offline" SAPVirtualInstanceStatusPartiallyRunning SAPVirtualInstanceStatus = "PartiallyRunning" SAPVirtualInstanceStatusRunning SAPVirtualInstanceStatus = "Running" + SAPVirtualInstanceStatusSoftShutdown SAPVirtualInstanceStatus = "SoftShutdown" SAPVirtualInstanceStatusStarting SAPVirtualInstanceStatus = "Starting" SAPVirtualInstanceStatusStopping SAPVirtualInstanceStatus = "Stopping" SAPVirtualInstanceStatusUnavailable SAPVirtualInstanceStatus = "Unavailable" @@ -705,84 +460,50 @@ func PossibleSAPVirtualInstanceStatusValues() []SAPVirtualInstanceStatus { SAPVirtualInstanceStatusOffline, SAPVirtualInstanceStatusPartiallyRunning, SAPVirtualInstanceStatusRunning, + SAPVirtualInstanceStatusSoftShutdown, SAPVirtualInstanceStatusStarting, SAPVirtualInstanceStatusStopping, SAPVirtualInstanceStatusUnavailable, } } -// SKURestrictionReasonCode - The SKU restriction reason code. -type SKURestrictionReasonCode string - -const ( - SKURestrictionReasonCodeNotAvailableForSubscription SKURestrictionReasonCode = "NotAvailableForSubscription" - SKURestrictionReasonCodeNotSpecified SKURestrictionReasonCode = "NotSpecified" - SKURestrictionReasonCodeQuotaID SKURestrictionReasonCode = "QuotaId" -) - -// PossibleSKURestrictionReasonCodeValues returns the possible values for the SKURestrictionReasonCode const type. -func PossibleSKURestrictionReasonCodeValues() []SKURestrictionReasonCode { - return []SKURestrictionReasonCode{ - SKURestrictionReasonCodeNotAvailableForSubscription, - SKURestrictionReasonCodeNotSpecified, - SKURestrictionReasonCodeQuotaID, - } -} - -// SKURestrictionType - The SKU restriction type. -type SKURestrictionType string +// SSLPreference - Gets or sets certificate preference if secure communication is enabled. +type SSLPreference string const ( - SKURestrictionTypeLocation SKURestrictionType = "Location" - SKURestrictionTypeNotSpecified SKURestrictionType = "NotSpecified" - SKURestrictionTypeZone SKURestrictionType = "Zone" + SSLPreferenceDisabled SSLPreference = "Disabled" + SSLPreferenceRootCertificate SSLPreference = "RootCertificate" + SSLPreferenceServerCertificate SSLPreference = "ServerCertificate" ) -// PossibleSKURestrictionTypeValues returns the possible values for the SKURestrictionType const type. -func PossibleSKURestrictionTypeValues() []SKURestrictionType { - return []SKURestrictionType{ - SKURestrictionTypeLocation, - SKURestrictionTypeNotSpecified, - SKURestrictionTypeZone, +// PossibleSSLPreferenceValues returns the possible values for the SSLPreference const type. +func PossibleSSLPreferenceValues() []SSLPreference { + return []SSLPreference{ + SSLPreferenceDisabled, + SSLPreferenceRootCertificate, + SSLPreferenceServerCertificate, } } -// SKUScaleType - Scale type of the SKU capacity. -type SKUScaleType string +// SapLandscapeMonitorProvisioningState - State of provisioning of the SAP monitor. +type SapLandscapeMonitorProvisioningState string const ( - SKUScaleTypeAutomatic SKUScaleType = "Automatic" - SKUScaleTypeManual SKUScaleType = "Manual" - SKUScaleTypeNone SKUScaleType = "None" + SapLandscapeMonitorProvisioningStateAccepted SapLandscapeMonitorProvisioningState = "Accepted" + SapLandscapeMonitorProvisioningStateCanceled SapLandscapeMonitorProvisioningState = "Canceled" + SapLandscapeMonitorProvisioningStateCreated SapLandscapeMonitorProvisioningState = "Created" + SapLandscapeMonitorProvisioningStateFailed SapLandscapeMonitorProvisioningState = "Failed" + SapLandscapeMonitorProvisioningStateSucceeded SapLandscapeMonitorProvisioningState = "Succeeded" ) -// PossibleSKUScaleTypeValues returns the possible values for the SKUScaleType const type. -func PossibleSKUScaleTypeValues() []SKUScaleType { - return []SKUScaleType{ - SKUScaleTypeAutomatic, - SKUScaleTypeManual, - SKUScaleTypeNone, - } -} - -// SKUTier - This field is required to be implemented by the Resource Provider if the service has more than one tier, but -// is not required on a PUT. -type SKUTier string - -const ( - SKUTierFree SKUTier = "Free" - SKUTierBasic SKUTier = "Basic" - SKUTierStandard SKUTier = "Standard" - SKUTierPremium SKUTier = "Premium" -) - -// PossibleSKUTierValues returns the possible values for the SKUTier const type. -func PossibleSKUTierValues() []SKUTier { - return []SKUTier{ - SKUTierFree, - SKUTierBasic, - SKUTierStandard, - SKUTierPremium, +// PossibleSapLandscapeMonitorProvisioningStateValues returns the possible values for the SapLandscapeMonitorProvisioningState const type. +func PossibleSapLandscapeMonitorProvisioningStateValues() []SapLandscapeMonitorProvisioningState { + return []SapLandscapeMonitorProvisioningState{ + SapLandscapeMonitorProvisioningStateAccepted, + SapLandscapeMonitorProvisioningStateCanceled, + SapLandscapeMonitorProvisioningStateCreated, + SapLandscapeMonitorProvisioningStateFailed, + SapLandscapeMonitorProvisioningStateSucceeded, } } @@ -808,54 +529,6 @@ func PossibleSapVirtualInstanceProvisioningStateValues() []SapVirtualInstancePro } } -// SearchType - Search type -type SearchType string - -const ( - SearchTypeElastic SearchType = "Elastic" -) - -// PossibleSearchTypeValues returns the possible values for the SearchType const type. -func PossibleSearchTypeValues() []SearchType { - return []SearchType{ - SearchTypeElastic, - } -} - -// WordpressVersions - Application version -type WordpressVersions string - -const ( - WordpressVersionsFive4 WordpressVersions = "5.4" - WordpressVersionsFive41 WordpressVersions = "5.4.1" - WordpressVersionsFive42 WordpressVersions = "5.4.2" - WordpressVersionsFive43 WordpressVersions = "5.4.3" -) - -// PossibleWordpressVersionsValues returns the possible values for the WordpressVersions const type. -func PossibleWordpressVersionsValues() []WordpressVersions { - return []WordpressVersions{ - WordpressVersionsFive4, - WordpressVersionsFive41, - WordpressVersionsFive42, - WordpressVersionsFive43, - } -} - -// WorkloadKind - Indicates which kind of php workload this resource represent e.g WordPress -type WorkloadKind string - -const ( - WorkloadKindWordPress WorkloadKind = "WordPress" -) - -// PossibleWorkloadKindValues returns the possible values for the WorkloadKind const type. -func PossibleWorkloadKindValues() []WorkloadKind { - return []WorkloadKind{ - WorkloadKindWordPress, - } -} - // WorkloadMonitorActionType - Defines the action type of workload operation. type WorkloadMonitorActionType string diff --git a/sdk/resourcemanager/workloads/armworkloads/go.mod b/sdk/resourcemanager/workloads/armworkloads/go.mod index 9e65349ccb34..e0313be1193b 100644 --- a/sdk/resourcemanager/workloads/armworkloads/go.mod +++ b/sdk/resourcemanager/workloads/armworkloads/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloads/armworklo go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/workloads/armworkloads/go.sum b/sdk/resourcemanager/workloads/armworkloads/go.sum index 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/workloads/armworkloads/go.sum +++ b/sdk/resourcemanager/workloads/armworkloads/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/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/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/workloads/armworkloads/models.go b/sdk/resourcemanager/workloads/armworkloads/models.go index b9d24276bc67..01925765a0b9 100644 --- a/sdk/resourcemanager/workloads/armworkloads/models.go +++ b/sdk/resourcemanager/workloads/armworkloads/models.go @@ -23,31 +23,27 @@ type ApplicationServerConfiguration struct { VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` } -// BackupProfile - Backup profile -type BackupProfile struct { - // REQUIRED; Whether to enable Azure backup for the workload - BackupEnabled *EnableBackup `json:"backupEnabled,omitempty"` +// ApplicationServerFullResourceNames - The full resource names object for application layer resources. The number of entries +// in this list should be equal to the number VMs to be created for application layer. +type ApplicationServerFullResourceNames struct { + // The full name for availability set. In case name is not provided, it will be defaulted to {SID}-App-AvSet. + AvailabilitySetName *string `json:"availabilitySetName,omitempty"` - // READ-ONLY; Backup vault resource Id - VaultResourceID *string `json:"vaultResourceId,omitempty" azure:"ro"` + // The list of virtual machine naming details. + VirtualMachines []*VirtualMachineResourceNames `json:"virtualMachines,omitempty"` } -// CacheProfile - Cache profile -type CacheProfile struct { - // REQUIRED; Cache capacity - Capacity *int64 `json:"capacity,omitempty"` +// ApplicationServerVMDetails - The Application Server VM Details. +type ApplicationServerVMDetails struct { + // READ-ONLY; Storage details of all the Storage Accounts attached to the App Virtual Machine. For e.g. NFS on AFS Shared + // Storage. + StorageDetails []*StorageInformation `json:"storageDetails,omitempty" azure:"ro"` - // REQUIRED; Cache family - Family *RedisCacheFamily `json:"family,omitempty"` + // READ-ONLY; Defines the type of application server VM. + Type *ApplicationServerVirtualMachineType `json:"type,omitempty" azure:"ro"` - // REQUIRED; Cache SKU name - SKUName *string `json:"skuName,omitempty"` - - // Cache name - Name *string `json:"name,omitempty"` - - // READ-ONLY; Cache resource Id - CacheResourceID *string `json:"cacheResourceId,omitempty" azure:"ro"` + // READ-ONLY + VirtualMachineID *string `json:"virtualMachineId,omitempty" azure:"ro"` } // CentralServerConfiguration - Gets or sets the central server configuration. @@ -62,8 +58,26 @@ type CentralServerConfiguration struct { VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` } -// CentralServerVMDetails - The Central Server VM Details. +// CentralServerFullResourceNames - The full resource names object for central server layer resources. +type CentralServerFullResourceNames struct { + // The full name for availability set. In case name is not provided, it will be defaulted to {SID}-ASCS-AvSet. + AvailabilitySetName *string `json:"availabilitySetName,omitempty"` + + // The resource names object for load balancer and related resources. + LoadBalancer *LoadBalancerResourceNames `json:"loadBalancer,omitempty"` + + // The list of names for all ASCS virtual machines to be deployed. The number of entries in this list should be equal to the + // number VMs to be created for ASCS layer. At maximum, there can be two virtual + // machines at this layer: ASCS and ERS. + VirtualMachines []*VirtualMachineResourceNames `json:"virtualMachines,omitempty"` +} + +// CentralServerVMDetails - The SAP Central Services Instance VM details. type CentralServerVMDetails struct { + // READ-ONLY; Storage details of all the Storage Accounts attached to the ASCS Virtual Machine. For e.g. NFS on AFS Shared + // Storage. + StorageDetails []*StorageInformation `json:"storageDetails,omitempty" azure:"ro"` + // READ-ONLY; Defines the type of central server VM. Type *CentralServerVirtualMachineType `json:"type,omitempty" azure:"ro"` @@ -95,6 +109,25 @@ type ClientSAPSupportedSKUOptions struct { SAPSupportedSKU *SAPSupportedSKUsRequest } +// CreateAndMountFileShareConfiguration - Gets or sets the file share configuration for file share created with the VIS case. +type CreateAndMountFileShareConfiguration struct { + // REQUIRED; The type of file share config. + ConfigurationType *ConfigurationType `json:"configurationType,omitempty"` + + // The name of file share resource group. The app rg is used in case of missing input. + ResourceGroup *string `json:"resourceGroup,omitempty"` + + // The name of file share storage account name . A custom name is used in case of missing input. + StorageAccountName *string `json:"storageAccountName,omitempty"` +} + +// GetFileShareConfiguration implements the FileShareConfigurationClassification interface for type CreateAndMountFileShareConfiguration. +func (c *CreateAndMountFileShareConfiguration) GetFileShareConfiguration() *FileShareConfiguration { + return &FileShareConfiguration{ + ConfigurationType: c.ConfigurationType, + } +} + // DB2ProviderInstanceProperties - Gets or sets the DB2 provider properties. type DB2ProviderInstanceProperties struct { // REQUIRED; The provider type. For example, the value can be SapHana. @@ -118,6 +151,12 @@ type DB2ProviderInstanceProperties struct { // Gets or sets the target virtual machine name. Hostname *string `json:"hostname,omitempty"` + // Gets or sets the blob URI to SSL certificate for the DB2 Database. + SSLCertificateURI *string `json:"sslCertificateUri,omitempty"` + + // Gets or sets certificate preference if secure communication is enabled. + SSLPreference *SSLPreference `json:"sslPreference,omitempty"` + // Gets or sets the SAP System Identifier SapSid *string `json:"sapSid,omitempty"` } @@ -142,52 +181,33 @@ type DatabaseConfiguration struct { // The database type. DatabaseType *SAPDatabaseType `json:"databaseType,omitempty"` -} - -// DatabaseProfile - Workload database profile -type DatabaseProfile struct { - // REQUIRED; The name of the server SKU, e.g. StandardD32sv4 - SKU *string `json:"sku,omitempty"` - - // REQUIRED; Tier of the server SKU - Tier *DatabaseTier `json:"tier,omitempty"` - - // REQUIRED; Database type - Type *DatabaseType `json:"type,omitempty"` - - // Backup retention days for the server - BackupRetentionDays *int32 `json:"backupRetentionDays,omitempty"` - - // Whether to enable HA for the server - HaEnabled *HAEnabled `json:"haEnabled,omitempty"` - - // Whether to enable SSL enforcement on the database - SSLEnforcementEnabled *EnableSSLEnforcement `json:"sslEnforcementEnabled,omitempty"` - - // Database server name - ServerName *string `json:"serverName,omitempty"` - // Database storage size in GB - StorageInGB *int64 `json:"storageInGB,omitempty"` - - // Storage IOPS for the server - StorageIops *int64 `json:"storageIops,omitempty"` + // Gets or sets the disk configuration. + DiskConfiguration *DiskConfiguration `json:"diskConfiguration,omitempty"` +} - // SKU name for database storage - StorageSKU *string `json:"storageSku,omitempty"` +// DatabaseServerFullResourceNames - The full resource names object for database layer resources. The number of entries in +// this list should be equal to the number VMs to be created for database layer. +type DatabaseServerFullResourceNames struct { + // The full name for availability set. In case name is not provided, it will be defaulted to {SID}-DB-AvSet. + AvailabilitySetName *string `json:"availabilitySetName,omitempty"` - // Database version - Version *string `json:"version,omitempty"` + // The resource names object for load balancer and related resources. + LoadBalancer *LoadBalancerResourceNames `json:"loadBalancer,omitempty"` - // READ-ONLY; Azure Database Server resource Id - ServerResourceID *string `json:"serverResourceId,omitempty" azure:"ro"` + // The list of virtual machine naming details. + VirtualMachines []*VirtualMachineResourceNames `json:"virtualMachines,omitempty"` } -// DatabaseVMDetails - The Database VM Details. +// DatabaseVMDetails - Database VM details. type DatabaseVMDetails struct { // READ-ONLY; Defines the SAP Instance status. Status *SAPVirtualInstanceStatus `json:"status,omitempty" azure:"ro"` + // READ-ONLY; Storage details of all the Storage Accounts attached to the Database Virtual Machine. For e.g. NFS on AFS Shared + // Storage. + StorageDetails []*StorageInformation `json:"storageDetails,omitempty" azure:"ro"` + // READ-ONLY VirtualMachineID *string `json:"virtualMachineId,omitempty" azure:"ro"` } @@ -267,51 +287,91 @@ func (d *DiscoveryConfiguration) GetSAPConfiguration() *SAPConfiguration { } } -// DiskInfo - Disk resource creation details -type DiskInfo struct { - // REQUIRED; Storage type - StorageType *DiskStorageType `json:"storageType,omitempty"` +// DiskConfiguration - The Disk Configuration Details. +type DiskConfiguration struct { + // The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', + // 'os'], Optional volume : ['backup']. + DiskVolumeConfigurations map[string]*DiskVolumeConfiguration `json:"diskVolumeConfigurations,omitempty"` +} + +// DiskDetails - The supported disk size details for a disk type. +type DiskDetails struct { + // The disk tier, e.g. P10, E10. + DiskTier *string `json:"diskTier,omitempty"` + + // The disk Iops. + IopsReadWrite *int64 `json:"iopsReadWrite,omitempty"` + + // The maximum supported disk count. + MaximumSupportedDiskCount *int64 `json:"maximumSupportedDiskCount,omitempty"` + + // The disk provisioned throughput in MBps. + MbpsReadWrite *int64 `json:"mbpsReadWrite,omitempty"` + + // The minimum supported disk count. + MinimumSupportedDiskCount *int64 `json:"minimumSupportedDiskCount,omitempty"` + + // The disk sku. + SKU *DiskSKU `json:"sku,omitempty"` + + // The disk size in GB. + SizeGB *int64 `json:"sizeGB,omitempty"` +} + +// DiskSKU - The disk sku. +type DiskSKU struct { + // Defines the disk sku name. + Name *DiskSKUName `json:"name,omitempty"` +} - // Disk size in GB - SizeInGB *int64 `json:"sizeInGB,omitempty"` +// DiskVolumeConfiguration - The disk configuration required for the selected volume. +type DiskVolumeConfiguration struct { + // The total number of disks required for the concerned volume. + Count *int64 `json:"count,omitempty"` + + // The disk SKU details. + SKU *DiskSKU `json:"sku,omitempty"` + + // The disk size in GB. + SizeGB *int64 `json:"sizeGB,omitempty"` } -// EnqueueReplicationServerProperties - Defines the SAP ERS Server properties. +// EnqueueReplicationServerProperties - Defines the SAP Enqueue Replication Server (ERS) properties. type EnqueueReplicationServerProperties struct { // READ-ONLY; Defines the type of Enqueue Replication Server. ErsVersion *EnqueueReplicationServerType `json:"ersVersion,omitempty" azure:"ro"` - // READ-ONLY; Defines the SAP Instance health. + // READ-ONLY; Defines the health of SAP Instances. Health *SAPHealthState `json:"health,omitempty" azure:"ro"` - // READ-ONLY; The ERS server SAP host name. + // READ-ONLY; ERS SAP Hostname. Hostname *string `json:"hostname,omitempty" azure:"ro"` - // READ-ONLY; The ERS server SAP IP Address. + // READ-ONLY; ERS SAP IP Address. IPAddress *string `json:"ipAddress,omitempty" azure:"ro"` - // READ-ONLY; The ERS server instance id. + // READ-ONLY; ERS Instance Number. InstanceNo *string `json:"instanceNo,omitempty" azure:"ro"` - // READ-ONLY; The ERS server SAP kernel patch. + // READ-ONLY; ERS SAP Kernel Patch level. KernelPatch *string `json:"kernelPatch,omitempty" azure:"ro"` - // READ-ONLY; The ERS server SAP kernel version. + // READ-ONLY; ERS SAP Kernel Version. KernelVersion *string `json:"kernelVersion,omitempty" azure:"ro"` } -// EnqueueServerProperties - Defines the SAP enqueue server properties. +// EnqueueServerProperties - Defines the SAP Enqueue Server properties. type EnqueueServerProperties struct { - // READ-ONLY; Defines the SAP Instance health. + // READ-ONLY; Defines the health of SAP Instances. Health *SAPHealthState `json:"health,omitempty" azure:"ro"` - // READ-ONLY; The enqueue server SAP host name. + // READ-ONLY; Enqueue Server SAP Hostname. Hostname *string `json:"hostname,omitempty" azure:"ro"` - // READ-ONLY; The enqueue server SAP IP Address. + // READ-ONLY; Enqueue Server SAP IP Address. IPAddress *string `json:"ipAddress,omitempty" azure:"ro"` - // READ-ONLY; The enqueue server Port. + // READ-ONLY; Enqueue Server Port. Port *int64 `json:"port,omitempty" azure:"ro"` } @@ -336,7 +396,7 @@ type Error struct { // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty" azure:"ro"` + Info any `json:"info,omitempty" azure:"ro"` // READ-ONLY; The additional info type. Type *string `json:"type,omitempty" azure:"ro"` @@ -385,30 +445,48 @@ type ErrorResponse struct { Error *ErrorDetail `json:"error,omitempty"` } -// FileshareProfile - File share profile -type FileshareProfile struct { - // REQUIRED; Share type - ShareType *FileShareType `json:"shareType,omitempty"` +// ExternalInstallationSoftwareConfiguration - The SAP Software configuration Input when the software is installed externally +// outside the service. +type ExternalInstallationSoftwareConfiguration struct { + // REQUIRED; The SAP software installation Type. + SoftwareInstallationType *SAPSoftwareInstallationType `json:"softwareInstallationType,omitempty"` - // REQUIRED; File share backing storage type - StorageType *FileShareStorageType `json:"storageType,omitempty"` + // The resource ID of the virtual machine containing the central server instance. + CentralServerVMID *string `json:"centralServerVmId,omitempty"` +} - // File share size in GB - ShareSizeInGB *int64 `json:"shareSizeInGB,omitempty"` +// GetSoftwareConfiguration implements the SoftwareConfigurationClassification interface for type ExternalInstallationSoftwareConfiguration. +func (e *ExternalInstallationSoftwareConfiguration) GetSoftwareConfiguration() *SoftwareConfiguration { + return &SoftwareConfiguration{ + SoftwareInstallationType: e.SoftwareInstallationType, + } +} - // READ-ONLY; File share name - ShareName *string `json:"shareName,omitempty" azure:"ro"` +// FileShareConfigurationClassification provides polymorphic access to related types. +// Call the interface's GetFileShareConfiguration() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CreateAndMountFileShareConfiguration, *FileShareConfiguration, *MountFileShareConfiguration, *SkipFileShareConfiguration +type FileShareConfigurationClassification interface { + // GetFileShareConfiguration returns the FileShareConfiguration content of the underlying type. + GetFileShareConfiguration() *FileShareConfiguration +} - // READ-ONLY; File share storage resource id - StorageResourceID *string `json:"storageResourceId,omitempty" azure:"ro"` +// FileShareConfiguration - File Share configuration details, populated with information on storage configuration mounted +// on the VIS. The createAndMount option is selected in case of missing input. +type FileShareConfiguration struct { + // REQUIRED; The type of file share config. + ConfigurationType *ConfigurationType `json:"configurationType,omitempty"` } +// GetFileShareConfiguration implements the FileShareConfigurationClassification interface for type FileShareConfiguration. +func (f *FileShareConfiguration) GetFileShareConfiguration() *FileShareConfiguration { return f } + // GatewayServerProperties - Defines the SAP Gateway Server properties. type GatewayServerProperties struct { - // READ-ONLY; Defines the SAP Instance health. + // READ-ONLY; Defines the health of SAP Instances. Health *SAPHealthState `json:"health,omitempty" azure:"ro"` - // READ-ONLY; The gateway Port. + // READ-ONLY; Gateway Port. Port *int64 `json:"port,omitempty" azure:"ro"` } @@ -426,9 +504,6 @@ type HanaDbProviderInstanceProperties struct { // Gets or sets the key vault URI to secret with the database password. DbPasswordURI *string `json:"dbPasswordUri,omitempty"` - // Gets or sets the blob URI to SSL certificate for the DB. - DbSSLCertificateURI *string `json:"dbSslCertificateUri,omitempty"` - // Gets or sets the database user name. DbUsername *string `json:"dbUsername,omitempty"` @@ -441,8 +516,17 @@ type HanaDbProviderInstanceProperties struct { // Gets or sets the database sql port. SQLPort *string `json:"sqlPort,omitempty"` + // Gets or sets the blob URI to SSL certificate for the DB. + SSLCertificateURI *string `json:"sslCertificateUri,omitempty"` + // Gets or sets the hostname(s) in the SSL certificate. SSLHostNameInCertificate *string `json:"sslHostNameInCertificate,omitempty"` + + // Gets or sets certificate preference if secure communication is enabled. + SSLPreference *SSLPreference `json:"sslPreference,omitempty"` + + // Gets or sets the SAP System Identifier. + SapSid *string `json:"sapSid,omitempty"` } // GetProviderSpecificProperties implements the ProviderSpecificPropertiesClassification interface for type HanaDbProviderInstanceProperties. @@ -512,7 +596,7 @@ type InfrastructureConfiguration struct { // REQUIRED; The application resource group where SAP system resources will be deployed. AppResourceGroup *string `json:"appResourceGroup,omitempty"` - // REQUIRED; The deployment Type. + // REQUIRED; The type of SAP deployment, single server or Three tier. DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` } @@ -544,33 +628,56 @@ func (l *LinuxConfiguration) GetOSConfiguration() *OSConfiguration { } } +// LoadBalancerDetails - The Load Balancer details such as Load Balancer ID. +type LoadBalancerDetails struct { + // READ-ONLY + ID *string `json:"id,omitempty" azure:"ro"` +} + +// LoadBalancerResourceNames - The resource names object for load balancer and related resources. +type LoadBalancerResourceNames struct { + // The list of backend pool names. Currently, ACSS deploys only one backend pool and hence, size of this list should be 1 + BackendPoolNames []*string `json:"backendPoolNames,omitempty"` + + // The list of frontend IP configuration names. If provided as input, size of this list should be 2 for cs layer and should + // be 1 for database layer. + FrontendIPConfigurationNames []*string `json:"frontendIpConfigurationNames,omitempty"` + + // The list of health probe names. If provided as input, size of this list should be 2 for cs layer and should be 1 for database + // layer. + HealthProbeNames []*string `json:"healthProbeNames,omitempty"` + + // The full resource name for load balancer. If this value is not provided, load balancer will be name as {ASCS/DB}-loadBalancer. + LoadBalancerName *string `json:"loadBalancerName,omitempty"` +} + // ManagedRGConfiguration - Managed resource group configuration type ManagedRGConfiguration struct { // Managed resource group name Name *string `json:"name,omitempty"` } -// MessageServerProperties - Defines the SAP message server properties. +// MessageServerProperties - Defines the SAP Message Server properties. type MessageServerProperties struct { - // READ-ONLY; The message server http port. + // READ-ONLY; Message Server HTTP Port. HTTPPort *int64 `json:"httpPort,omitempty" azure:"ro"` - // READ-ONLY; The message server https port. + // READ-ONLY; Message Server HTTPS Port. HTTPSPort *int64 `json:"httpsPort,omitempty" azure:"ro"` - // READ-ONLY; Defines the SAP Instance health. + // READ-ONLY; Defines the health of SAP Instances. Health *SAPHealthState `json:"health,omitempty" azure:"ro"` - // READ-ONLY; The message server SAP host name. + // READ-ONLY; Message Server SAP Hostname. Hostname *string `json:"hostname,omitempty" azure:"ro"` - // READ-ONLY; The message server IP Address. + // READ-ONLY; Message server IP Address. IPAddress *string `json:"ipAddress,omitempty" azure:"ro"` - // READ-ONLY; The message server internal MS port. + // READ-ONLY; Message Server internal MS port. InternalMsPort *int64 `json:"internalMsPort,omitempty" azure:"ro"` - // READ-ONLY; The message server port. + // READ-ONLY; Message Server port. MSPort *int64 `json:"msPort,omitempty" azure:"ro"` } @@ -628,6 +735,10 @@ type MonitorProperties struct { // Sets the routing preference of the SAP monitor. By default only RFC1918 traffic is routed to the customer VNET. RoutingPreference *RoutingPreference `json:"routingPreference,omitempty"` + // Sets the preference for zone redundancy on resources created for the SAP monitor. By default resources will be created + // which do not support zone redundancy. + ZoneRedundancyPreference *string `json:"zoneRedundancyPreference,omitempty"` + // READ-ONLY; Defines the SAP monitor errors. Errors *MonitorPropertiesErrors `json:"errors,omitempty" azure:"ro"` @@ -636,6 +747,9 @@ type MonitorProperties struct { // READ-ONLY; State of provisioning of the SAP monitor. ProvisioningState *WorkloadMonitorProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; The ARM ID of the Storage account used for SAP monitoring. + StorageAccountArmID *string `json:"storageAccountArmId,omitempty" azure:"ro"` } // MonitorPropertiesErrors - Defines the SAP monitor errors. @@ -673,12 +787,13 @@ type MonitorsClientGetOptions struct { // placeholder for future optional parameters } -// MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.ListByResourceGroup method. +// MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.NewListByResourceGroupPager +// method. type MonitorsClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// MonitorsClientListOptions contains the optional parameters for the MonitorsClient.List method. +// MonitorsClientListOptions contains the optional parameters for the MonitorsClient.NewListPager method. type MonitorsClientListOptions struct { // placeholder for future optional parameters } @@ -688,6 +803,25 @@ type MonitorsClientUpdateOptions struct { // placeholder for future optional parameters } +// MountFileShareConfiguration - Gets or sets the file share configuration for externally mounted cases. +type MountFileShareConfiguration struct { + // REQUIRED; The type of file share config. + ConfigurationType *ConfigurationType `json:"configurationType,omitempty"` + + // REQUIRED; The fileshare resource ID + ID *string `json:"id,omitempty"` + + // REQUIRED; The private endpoint resource ID + PrivateEndpointID *string `json:"privateEndpointId,omitempty"` +} + +// GetFileShareConfiguration implements the FileShareConfigurationClassification interface for type MountFileShareConfiguration. +func (m *MountFileShareConfiguration) GetFileShareConfiguration() *FileShareConfiguration { + return &FileShareConfiguration{ + ConfigurationType: m.ConfigurationType, + } +} + // MsSQLServerProviderInstanceProperties - Gets or sets the SQL server provider properties. type MsSQLServerProviderInstanceProperties struct { // REQUIRED; The provider type. For example, the value can be SapHana. @@ -708,6 +842,12 @@ type MsSQLServerProviderInstanceProperties struct { // Gets or sets the SQL server host name. Hostname *string `json:"hostname,omitempty"` + // Gets or sets the blob URI to SSL certificate for the SQL Database. + SSLCertificateURI *string `json:"sslCertificateUri,omitempty"` + + // Gets or sets certificate preference if secure communication is enabled. + SSLPreference *SSLPreference `json:"sslPreference,omitempty"` + // Gets or sets the SAP System Identifier SapSid *string `json:"sapSid,omitempty"` } @@ -719,64 +859,20 @@ func (m *MsSQLServerProviderInstanceProperties) GetProviderSpecificProperties() } } -// NetworkConfiguration - Defines the network configuration for SAP infrastructure +// NetworkConfiguration - Defines the network configuration type for SAP system infrastructure that is being deployed type NetworkConfiguration struct { - // Specifies whether a secondary IP address should be added to the network interface on all VMs + // Specifies whether a secondary IP address should be added to the network interface on all VMs of the SAP system being deployed IsSecondaryIPEnabled *bool `json:"isSecondaryIpEnabled,omitempty"` } -// NetworkProfile - Network profile -type NetworkProfile struct { - // REQUIRED; Load balancer type - LoadBalancerType *LoadBalancerType `json:"loadBalancerType,omitempty"` - - // Whether to enable Azure front door - AzureFrontDoorEnabled *AzureFrontDoorEnabled `json:"azureFrontDoorEnabled,omitempty"` - - // Capacity, applicable only for Application Gateway - Capacity *int32 `json:"capacity,omitempty"` - - // Load balancer SKU - LoadBalancerSKU *string `json:"loadBalancerSku,omitempty"` - - // Load balancer tier - LoadBalancerTier *string `json:"loadBalancerTier,omitempty"` - - // READ-ONLY; Azure front door resource id - AzureFrontDoorResourceID *string `json:"azureFrontDoorResourceId,omitempty" azure:"ro"` - - // READ-ONLY; Loadbalancer front-end IP address resource Id - FrontEndPublicIPResourceID *string `json:"frontEndPublicIpResourceId,omitempty" azure:"ro"` - - // READ-ONLY; Azure Loadbalancer or ApplicationGateway resource Id - LoadBalancerResourceID *string `json:"loadBalancerResourceId,omitempty" azure:"ro"` - - // READ-ONLY; List of outbound public IP resource IDs - OutboundPublicIPResourceIDs []*string `json:"outboundPublicIpResourceIds,omitempty" azure:"ro"` - - // READ-ONLY; Virtual network resource Id - VNetResourceID *string `json:"vNetResourceId,omitempty" azure:"ro"` -} - -// NodeProfile - VM or VMSS node profile -type NodeProfile struct { - // REQUIRED; VM SKU for node(s) - NodeSKU *string `json:"nodeSku,omitempty"` - - // REQUIRED; OS disk details - OSDisk *DiskInfo `json:"osDisk,omitempty"` - - // REQUIRED; OS image used for creating the nodes - OSImage *OsImageProfile `json:"osImage,omitempty"` - - // Data disks details. This property is not in use right now - DataDisks []*DiskInfo `json:"dataDisks,omitempty"` - - // VM or VMSS name - Name *string `json:"name,omitempty"` - - // READ-ONLY; VM/VMSS resource ARM Ids - NodeResourceIDs []*string `json:"nodeResourceIds,omitempty" azure:"ro"` +// NetworkInterfaceResourceNames - The resource names object for network interface and related resources. +type NetworkInterfaceResourceNames struct { + // The full name for network interface. If name is not provided, service uses a default name based on the deployment type. + // For SingleServer, default name is {SID}-Nic. In case of HA-AvZone systems, + // default name will be {SID}-{App/ASCS/DB}-Zone{A/B}-Nic with an incrementor at the end in case of more than 1 instance per + // layer. For distributed and HA-AvSet systems, default name will be + // {SID}-{App/ASCS/DB}-Nic with an incrementor at the end in case of more than 1 instance per layer. + NetworkInterfaceName *string `json:"networkInterfaceName,omitempty"` } // OSConfigurationClassification provides polymorphic access to related types. @@ -908,7 +1004,7 @@ type OperationStatusResult struct { StartTime *time.Time `json:"startTime,omitempty"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } @@ -949,7 +1045,7 @@ type OperationsDefinition struct { Origin *OperationProperties `json:"origin,omitempty"` // Defines the workload operation properties. - Properties interface{} `json:"properties,omitempty"` + Properties any `json:"properties,omitempty"` } // OperationsDefinitionArrayResponseWithContinuation - Defines the workload operation definition response. @@ -991,21 +1087,6 @@ type OperationsDisplayDefinition struct { Resource *string `json:"resource,omitempty"` } -// OsImageProfile - OS image profile -type OsImageProfile struct { - // OS image offer - Offer *OSImageOffer `json:"offer,omitempty"` - - // OS image publisher - Publisher *OSImagePublisher `json:"publisher,omitempty"` - - // OS image sku - SKU *OSImageSKU `json:"sku,omitempty"` - - // OS image version - Version *OSImageVersion `json:"version,omitempty"` -} - // OsSapConfiguration - Defines the OS and SAP Configurations for Deployment type OsSapConfiguration struct { // The url and storage account ID where deployer VM packages are uploaded @@ -1015,161 +1096,6 @@ type OsSapConfiguration struct { SapFqdn *string `json:"sapFqdn,omitempty"` } -// PatchResourceRequestBody - Resource patch request body -type PatchResourceRequestBody struct { - Identity *PatchResourceRequestBodyIdentity `json:"identity,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -type PatchResourceRequestBodyIdentity struct { - // REQUIRED; Type of manage identity - Type *ManagedServiceIdentityType `json:"type,omitempty"` - - // User assigned identities dictionary - UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities,omitempty"` -} - -// PhpProfile - PHP profile -type PhpProfile struct { - // REQUIRED; PHP version - Version *PHPVersion `json:"version,omitempty"` -} - -// PhpWorkloadResource - Php workload resource -type PhpWorkloadResource struct { - // REQUIRED; Indicates which kind of php workload this resource represent e.g WordPress - Kind *WorkloadKind `json:"kind,omitempty"` - - // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` - - // Identity for the resource. Currently not supported - Identity *PhpWorkloadResourceIdentity `json:"identity,omitempty"` - - // Resource properties - Properties *PhpWorkloadResourceProperties `json:"properties,omitempty"` - - // Php workloads SKU - SKU *SKU `json:"sku,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PhpWorkloadResourceIdentity - Identity for the resource. Currently not supported -type PhpWorkloadResourceIdentity struct { - // REQUIRED; Type of manage identity - Type *ManagedServiceIdentityType `json:"type,omitempty"` - - // User assigned identities dictionary - UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities,omitempty"` -} - -// PhpWorkloadResourceList - Php workload resource list -type PhpWorkloadResourceList struct { - // Link to next page of resources - NextLink *string `json:"nextLink,omitempty"` - - // List of resources in current page - Value []*PhpWorkloadResource `json:"value,omitempty"` -} - -// PhpWorkloadResourceProperties - PHP workload resource properties -type PhpWorkloadResourceProperties struct { - // REQUIRED; Admin user profile used for VM and VMSS - AdminUserProfile *UserProfile `json:"adminUserProfile,omitempty"` - - // REQUIRED; The infra resources for PHP workload will be created in this location - AppLocation *string `json:"appLocation,omitempty"` - - // REQUIRED; Controller VM profile - ControllerProfile *NodeProfile `json:"controllerProfile,omitempty"` - - // REQUIRED; Database profile - DatabaseProfile *DatabaseProfile `json:"databaseProfile,omitempty"` - - // REQUIRED; VMSS web nodes profile - WebNodesProfile *VmssNodesProfile `json:"webNodesProfile,omitempty"` - - // Backup profile - BackupProfile *BackupProfile `json:"backupProfile,omitempty"` - - // Cache profile - CacheProfile *CacheProfile `json:"cacheProfile,omitempty"` - - // File share profile - FileshareProfile *FileshareProfile `json:"fileshareProfile,omitempty"` - - // Managed resource group configuration of the workload - ManagedResourceGroupConfiguration *ManagedRGConfiguration `json:"managedResourceGroupConfiguration,omitempty"` - - // Network profile - NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` - - // PHP profile - PhpProfile *PhpProfile `json:"phpProfile,omitempty"` - - // Search profile - SearchProfile *SearchProfile `json:"searchProfile,omitempty"` - - // Site profile - SiteProfile *SiteProfile `json:"siteProfile,omitempty"` - - // READ-ONLY; Php workload resource provisioning state - ProvisioningState *PhpWorkloadProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// PhpWorkloadsClientBeginCreateOrUpdateOptions contains the optional parameters for the PhpWorkloadsClient.BeginCreateOrUpdate -// method. -type PhpWorkloadsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PhpWorkloadsClientBeginDeleteOptions contains the optional parameters for the PhpWorkloadsClient.BeginDelete method. -type PhpWorkloadsClientBeginDeleteOptions struct { - // Whether to delete infra along with workload resource. - DeleteInfra *string - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PhpWorkloadsClientGetOptions contains the optional parameters for the PhpWorkloadsClient.Get method. -type PhpWorkloadsClientGetOptions struct { - // placeholder for future optional parameters -} - -// PhpWorkloadsClientListByResourceGroupOptions contains the optional parameters for the PhpWorkloadsClient.ListByResourceGroup -// method. -type PhpWorkloadsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// PhpWorkloadsClientListBySubscriptionOptions contains the optional parameters for the PhpWorkloadsClient.ListBySubscription -// method. -type PhpWorkloadsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// PhpWorkloadsClientUpdateOptions contains the optional parameters for the PhpWorkloadsClient.Update method. -type PhpWorkloadsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // PrometheusHaClusterProviderInstanceProperties - Gets or sets the PrometheusHaCluster provider properties. type PrometheusHaClusterProviderInstanceProperties struct { // REQUIRED; The provider type. For example, the value can be SapHana. @@ -1184,6 +1110,12 @@ type PrometheusHaClusterProviderInstanceProperties struct { // URL of the Node Exporter endpoint. PrometheusURL *string `json:"prometheusUrl,omitempty"` + // Gets or sets the blob URI to SSL certificate for the HA cluster exporter. + SSLCertificateURI *string `json:"sslCertificateUri,omitempty"` + + // Gets or sets certificate preference if secure communication is enabled. + SSLPreference *SSLPreference `json:"sslPreference,omitempty"` + // Gets or sets the cluster sid. Sid *string `json:"sid,omitempty"` } @@ -1202,6 +1134,15 @@ type PrometheusOSProviderInstanceProperties struct { // URL of the Node Exporter endpoint PrometheusURL *string `json:"prometheusUrl,omitempty"` + + // Gets or sets the blob URI to SSL certificate for the prometheus node exporter. + SSLCertificateURI *string `json:"sslCertificateUri,omitempty"` + + // Gets or sets certificate preference if secure communication is enabled. + SSLPreference *SSLPreference `json:"sslPreference,omitempty"` + + // Gets or sets the SAP System Identifier + SapSid *string `json:"sapSid,omitempty"` } // GetProviderSpecificProperties implements the ProviderSpecificPropertiesClassification interface for type PrometheusOSProviderInstanceProperties. @@ -1290,7 +1231,7 @@ type ProviderInstancesClientGetOptions struct { // placeholder for future optional parameters } -// ProviderInstancesClientListOptions contains the optional parameters for the ProviderInstancesClient.List method. +// ProviderInstancesClientListOptions contains the optional parameters for the ProviderInstancesClient.NewListPager method. type ProviderInstancesClientListOptions struct { // placeholder for future optional parameters } @@ -1347,21 +1288,12 @@ type Resource struct { Type *string `json:"type,omitempty" azure:"ro"` } -// RestrictionInfo - The SKU restriction information. -type RestrictionInfo struct { - // The restriction locations. - Locations []*string `json:"locations,omitempty"` - - // The restriction zones. - Zones []*string `json:"zones,omitempty"` -} - -// SAPApplicationServerInstance - Define the SAP Application Server Instance. +// SAPApplicationServerInstance - Define the SAP Application Server Instance resource. type SAPApplicationServerInstance struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Defines the SAP Application Server properties. + // Defines the SAP Application Server instance properties. Properties *SAPApplicationServerProperties `json:"properties,omitempty"` // Resource tags. @@ -1380,18 +1312,20 @@ type SAPApplicationServerInstance struct { Type *string `json:"type,omitempty" azure:"ro"` } -// SAPApplicationServerInstanceList - Defines the collection of SAP Application Server Instances. +// SAPApplicationServerInstanceList - Defines the collection of SAP Application Server Instance resources. type SAPApplicationServerInstanceList struct { // Gets the value of next link. NextLink *string `json:"nextLink,omitempty"` - // Gets the list of SAP Application Server instances. + // Gets the list of SAP Application Server instance resources. Value []*SAPApplicationServerInstance `json:"value,omitempty"` } // SAPApplicationServerInstancesClientBeginCreateOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginCreate // method. type SAPApplicationServerInstancesClientBeginCreateOptions struct { + // The SAP Application Server Instance resource request body. + Body *SAPApplicationServerInstance // Resumes the LRO from the provided token. ResumeToken string } @@ -1403,9 +1337,27 @@ type SAPApplicationServerInstancesClientBeginDeleteOptions struct { ResumeToken string } +// SAPApplicationServerInstancesClientBeginStartInstanceOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginStartInstance +// method. +type SAPApplicationServerInstancesClientBeginStartInstanceOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SAPApplicationServerInstancesClientBeginStopInstanceOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginStopInstance +// method. +type SAPApplicationServerInstancesClientBeginStopInstanceOptions struct { + // SAP Application server instance stop request body. + Body *StopRequest + // Resumes the LRO from the provided token. + ResumeToken string +} + // SAPApplicationServerInstancesClientBeginUpdateOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginUpdate // method. type SAPApplicationServerInstancesClientBeginUpdateOptions struct { + // The SAP Application Server Instance resource request body. + Body *UpdateSAPApplicationInstanceRequest // Resumes the LRO from the provided token. ResumeToken string } @@ -1416,55 +1368,58 @@ type SAPApplicationServerInstancesClientGetOptions struct { // placeholder for future optional parameters } -// SAPApplicationServerInstancesClientListOptions contains the optional parameters for the SAPApplicationServerInstancesClient.List +// SAPApplicationServerInstancesClientListOptions contains the optional parameters for the SAPApplicationServerInstancesClient.NewListPager // method. type SAPApplicationServerInstancesClientListOptions struct { // placeholder for future optional parameters } -// SAPApplicationServerProperties - Defines the SAP Application Server properties. +// SAPApplicationServerProperties - Defines the SAP Application Server instance properties. type SAPApplicationServerProperties struct { // READ-ONLY; Defines the Application Instance errors. Errors *SAPVirtualInstanceError `json:"errors,omitempty" azure:"ro"` - // READ-ONLY; The application server gateway Port. + // READ-ONLY; Application server instance gateway Port. GatewayPort *int64 `json:"gatewayPort,omitempty" azure:"ro"` - // READ-ONLY; Defines the SAP Instance health. + // READ-ONLY; Defines the health of SAP Instances. Health *SAPHealthState `json:"health,omitempty" azure:"ro"` - // READ-ONLY; The application server SAP host name. + // READ-ONLY; Application server instance SAP hostname. Hostname *string `json:"hostname,omitempty" azure:"ro"` - // READ-ONLY; The application server SAP IP Address. + // READ-ONLY; Application server instance SAP IP Address. IPAddress *string `json:"ipAddress,omitempty" azure:"ro"` - // READ-ONLY; The application server ICM HTTP Port. + // READ-ONLY; Application server instance ICM HTTP Port. IcmHTTPPort *int64 `json:"icmHttpPort,omitempty" azure:"ro"` - // READ-ONLY; The application server ICM HTTPS Port. + // READ-ONLY; Application server instance ICM HTTPS Port. IcmHTTPSPort *int64 `json:"icmHttpsPort,omitempty" azure:"ro"` - // READ-ONLY; The application server instance id. + // READ-ONLY; Application server Instance Number. InstanceNo *string `json:"instanceNo,omitempty" azure:"ro"` - // READ-ONLY; The application server SAP kernel patch. + // READ-ONLY; Application server instance SAP Kernel Patch level. KernelPatch *string `json:"kernelPatch,omitempty" azure:"ro"` - // READ-ONLY; The application server SAP kernel version. + // READ-ONLY; Application server instance SAP Kernel Version. KernelVersion *string `json:"kernelVersion,omitempty" azure:"ro"` + // READ-ONLY; The Load Balancer details such as LoadBalancer ID attached to Application Server Virtual Machines + LoadBalancerDetails *LoadBalancerDetails `json:"loadBalancerDetails,omitempty" azure:"ro"` + // READ-ONLY; Defines the provisioning states. ProvisioningState *SapVirtualInstanceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Defines the SAP Instance status. Status *SAPVirtualInstanceStatus `json:"status,omitempty" azure:"ro"` - // READ-ONLY; The application server subnet. + // READ-ONLY; Application server Subnet. Subnet *string `json:"subnet,omitempty" azure:"ro"` - // READ-ONLY; The virtual machine. - VirtualMachineID *string `json:"virtualMachineId,omitempty" azure:"ro"` + // READ-ONLY; The list of virtual machines. + VMDetails []*ApplicationServerVMDetails `json:"vmDetails,omitempty" azure:"ro"` } // SAPAvailabilityZoneDetailsRequest - The SAP request to get list of availability zones. @@ -1494,18 +1449,20 @@ type SAPAvailabilityZonePair struct { ZoneB *int64 `json:"zoneB,omitempty"` } -// SAPCentralInstanceList - Defines the collection of SAP Central Instances. +// SAPCentralInstanceList - Defines the collection of SAP Central Services Instance resources. type SAPCentralInstanceList struct { // Gets the value of next link. NextLink *string `json:"nextLink,omitempty"` - // Gets the list of SAP central instances. + // Gets the list of SAP central services instance resources. Value []*SAPCentralServerInstance `json:"value,omitempty"` } // SAPCentralInstancesClientBeginCreateOptions contains the optional parameters for the SAPCentralInstancesClient.BeginCreate // method. type SAPCentralInstancesClientBeginCreateOptions struct { + // The SAP Central Services Instance request body. + Body *SAPCentralServerInstance // Resumes the LRO from the provided token. ResumeToken string } @@ -1517,9 +1474,27 @@ type SAPCentralInstancesClientBeginDeleteOptions struct { ResumeToken string } +// SAPCentralInstancesClientBeginStartInstanceOptions contains the optional parameters for the SAPCentralInstancesClient.BeginStartInstance +// method. +type SAPCentralInstancesClientBeginStartInstanceOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SAPCentralInstancesClientBeginStopInstanceOptions contains the optional parameters for the SAPCentralInstancesClient.BeginStopInstance +// method. +type SAPCentralInstancesClientBeginStopInstanceOptions struct { + // SAP Central Services instance stop request body. + Body *StopRequest + // Resumes the LRO from the provided token. + ResumeToken string +} + // SAPCentralInstancesClientBeginUpdateOptions contains the optional parameters for the SAPCentralInstancesClient.BeginUpdate // method. type SAPCentralInstancesClientBeginUpdateOptions struct { + // The SAP Central Services Instance resource request body. + Body *UpdateSAPCentralInstanceRequest // Resumes the LRO from the provided token. ResumeToken string } @@ -1529,17 +1504,17 @@ type SAPCentralInstancesClientGetOptions struct { // placeholder for future optional parameters } -// SAPCentralInstancesClientListOptions contains the optional parameters for the SAPCentralInstancesClient.List method. +// SAPCentralInstancesClientListOptions contains the optional parameters for the SAPCentralInstancesClient.NewListPager method. type SAPCentralInstancesClientListOptions struct { // placeholder for future optional parameters } -// SAPCentralServerInstance - Define the SAP Central Server Instance. +// SAPCentralServerInstance - Define the SAP Central Services Instance resource. type SAPCentralServerInstance struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Defines the SAP Central Server properties. + // Defines the SAP Central Services Instance properties. Properties *SAPCentralServerProperties `json:"properties,omitempty"` // Resource tags. @@ -1558,45 +1533,48 @@ type SAPCentralServerInstance struct { Type *string `json:"type,omitempty" azure:"ro"` } -// SAPCentralServerProperties - Defines the SAP Central Server properties. +// SAPCentralServerProperties - Defines the SAP Central Services Instance properties. type SAPCentralServerProperties struct { - // Defines the SAP ERS Server properties. + // Defines the SAP Enqueue Replication Server (ERS) properties. EnqueueReplicationServerProperties *EnqueueReplicationServerProperties `json:"enqueueReplicationServerProperties,omitempty"` - // Defines the SAP enqueue server properties. + // Defines the SAP Enqueue Server properties. EnqueueServerProperties *EnqueueServerProperties `json:"enqueueServerProperties,omitempty"` // Defines the SAP Gateway Server properties. GatewayServerProperties *GatewayServerProperties `json:"gatewayServerProperties,omitempty"` - // Defines the SAP message server properties. + // Defines the SAP Message Server properties. MessageServerProperties *MessageServerProperties `json:"messageServerProperties,omitempty"` - // READ-ONLY; Defines the Central Instance errors. + // READ-ONLY; Defines the errors related to SAP Central Services Instance resource. Errors *SAPVirtualInstanceError `json:"errors,omitempty" azure:"ro"` - // READ-ONLY; Defines the SAP Instance health. + // READ-ONLY; Defines the health of SAP Instances. Health *SAPHealthState `json:"health,omitempty" azure:"ro"` - // READ-ONLY; The central server instance id. + // READ-ONLY; The central services instance number. InstanceNo *string `json:"instanceNo,omitempty" azure:"ro"` - // READ-ONLY; The central server kernel patch. + // READ-ONLY; The central services instance Kernel Patch level. KernelPatch *string `json:"kernelPatch,omitempty" azure:"ro"` - // READ-ONLY; The central server kernel version. + // READ-ONLY; The central services instance Kernel Version. KernelVersion *string `json:"kernelVersion,omitempty" azure:"ro"` + // READ-ONLY; The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual Machines + LoadBalancerDetails *LoadBalancerDetails `json:"loadBalancerDetails,omitempty" azure:"ro"` + // READ-ONLY; Defines the provisioning states. ProvisioningState *SapVirtualInstanceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Defines the SAP Instance status. Status *SAPVirtualInstanceStatus `json:"status,omitempty" azure:"ro"` - // READ-ONLY; The central server subnet. + // READ-ONLY; The central services instance subnet. Subnet *string `json:"subnet,omitempty" azure:"ro"` - // READ-ONLY; The list of virtual machines. + // READ-ONLY; The list of virtual machines corresponding to the Central Services instance. VMDetails []*CentralServerVMDetails `json:"vmDetails,omitempty" azure:"ro"` } @@ -1618,12 +1596,12 @@ type SAPConfiguration struct { // GetSAPConfiguration implements the SAPConfigurationClassification interface for type SAPConfiguration. func (s *SAPConfiguration) GetSAPConfiguration() *SAPConfiguration { return s } -// SAPDatabaseInstance - Define the SAP Database Instance. +// SAPDatabaseInstance - Define the Database resource. type SAPDatabaseInstance struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Defines the SAP Database properties. + // Defines the Database properties. Properties *SAPDatabaseProperties `json:"properties,omitempty"` // Resource tags. @@ -1654,6 +1632,8 @@ type SAPDatabaseInstanceList struct { // SAPDatabaseInstancesClientBeginCreateOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginCreate // method. type SAPDatabaseInstancesClientBeginCreateOptions struct { + // Request body of Database resource of a SAP system. + Body *SAPDatabaseInstance // Resumes the LRO from the provided token. ResumeToken string } @@ -1665,9 +1645,27 @@ type SAPDatabaseInstancesClientBeginDeleteOptions struct { ResumeToken string } +// SAPDatabaseInstancesClientBeginStartInstanceOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginStartInstance +// method. +type SAPDatabaseInstancesClientBeginStartInstanceOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SAPDatabaseInstancesClientBeginStopInstanceOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginStopInstance +// method. +type SAPDatabaseInstancesClientBeginStopInstanceOptions struct { + // Stop request for the database instance of the SAP system. + Body *StopRequest + // Resumes the LRO from the provided token. + ResumeToken string +} + // SAPDatabaseInstancesClientBeginUpdateOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginUpdate // method. type SAPDatabaseInstancesClientBeginUpdateOptions struct { + // Database resource update request body. + Body *UpdateSAPDatabaseInstanceRequest // Resumes the LRO from the provided token. ResumeToken string } @@ -1677,60 +1675,50 @@ type SAPDatabaseInstancesClientGetOptions struct { // placeholder for future optional parameters } -// SAPDatabaseInstancesClientListOptions contains the optional parameters for the SAPDatabaseInstancesClient.List method. +// SAPDatabaseInstancesClientListOptions contains the optional parameters for the SAPDatabaseInstancesClient.NewListPager +// method. type SAPDatabaseInstancesClientListOptions struct { // placeholder for future optional parameters } -// SAPDatabaseProperties - Defines the SAP Database properties. +// SAPDatabaseProperties - Defines the Database properties. type SAPDatabaseProperties struct { - // READ-ONLY; The database SID. + // READ-ONLY; Database SID name. DatabaseSid *string `json:"databaseSid,omitempty" azure:"ro"` - // READ-ONLY; The SAP database type. + // READ-ONLY; Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL Server. DatabaseType *string `json:"databaseType,omitempty" azure:"ro"` - // READ-ONLY; Defines the Database Instance errors. + // READ-ONLY; Defines the errors related to Database resource. Errors *SAPVirtualInstanceError `json:"errors,omitempty" azure:"ro"` - // READ-ONLY; The database IP Address. + // READ-ONLY; Database IP Address. IPAddress *string `json:"ipAddress,omitempty" azure:"ro"` + // READ-ONLY; The Load Balancer details such as LoadBalancer ID attached to Database Virtual Machines + LoadBalancerDetails *LoadBalancerDetails `json:"loadBalancerDetails,omitempty" azure:"ro"` + // READ-ONLY; Defines the provisioning states. ProvisioningState *SapVirtualInstanceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Defines the SAP Instance status. Status *SAPVirtualInstanceStatus `json:"status,omitempty" azure:"ro"` - // READ-ONLY; The database subnet. + // READ-ONLY; Database subnet. Subnet *string `json:"subnet,omitempty" azure:"ro"` - // READ-ONLY; The list of virtual machines. + // READ-ONLY; The list of virtual machines corresponding to the Database resource. VMDetails []*DatabaseVMDetails `json:"vmDetails,omitempty" azure:"ro"` } -// SAPDiskConfiguration - The SAP Disk Configuration. +// SAPDiskConfiguration - The SAP Disk Configuration contains 'recommended disk' details and list of supported disks detail +// for a volume type. type SAPDiskConfiguration struct { - // The disk count. - DiskCount *int64 `json:"diskCount,omitempty"` - - // The disk Iops. - DiskIopsReadWrite *int64 `json:"diskIopsReadWrite,omitempty"` - - // The disk provisioned throughput in MBps. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` + // The recommended disk details for a given VM Sku. + RecommendedConfiguration *DiskVolumeConfiguration `json:"recommendedConfiguration,omitempty"` - // The disk size in GB. - DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` - - // The disk storage type - DiskStorageType *string `json:"diskStorageType,omitempty"` - - // The disk type. - DiskType *string `json:"diskType,omitempty"` - - // The volume name. - Volume *string `json:"volume,omitempty"` + // The list of supported disks for a given VM Sku. + SupportedConfigurations []*DiskDetails `json:"supportedConfigurations,omitempty"` } // SAPDiskConfigurationsRequest - The SAP request to get list of disk configurations. @@ -1756,8 +1744,9 @@ type SAPDiskConfigurationsRequest struct { // SAPDiskConfigurationsResult - The list of disk configuration for vmSku which are part of SAP deployment. type SAPDiskConfigurationsResult struct { - // Gets the list of Disk Configurations. - DiskConfigurations []*SAPDiskConfiguration `json:"diskConfigurations,omitempty"` + // The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', + // 'os'], Optional volume : ['backup']. + VolumeConfigurations map[string]*SAPDiskConfiguration `json:"volumeConfigurations,omitempty"` } // SAPInstallWithoutOSConfigSoftwareConfiguration - The SAP Software configuration Input when the software is to be installed @@ -1827,7 +1816,7 @@ type SAPSizingRecommendationResultClassification interface { // SAPSizingRecommendationResult - The SAP sizing recommendation result. type SAPSizingRecommendationResult struct { - // REQUIRED; The deployment Type. + // REQUIRED; The type of SAP deployment, single server or Three tier. DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` } @@ -1875,12 +1864,12 @@ type SAPSupportedSKUsRequest struct { HighAvailabilityType *SAPHighAvailabilityType `json:"highAvailabilityType,omitempty"` } -// SAPVirtualInstance - Define the Virtual Instance for SAP. +// SAPVirtualInstance - Define the Virtual Instance for SAP solutions resource. type SAPVirtualInstance struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // REQUIRED; Defines the Virtual Instance for SAP properties. + // REQUIRED; Defines the Virtual Instance for SAP solutions resource properties. Properties *SAPVirtualInstanceProperties `json:"properties,omitempty"` // Managed service identity (user assigned identities) @@ -1908,18 +1897,19 @@ type SAPVirtualInstanceError struct { Properties *ErrorDefinition `json:"properties,omitempty"` } -// SAPVirtualInstanceList - Defines the collection of Virtual Instance for SAP. +// SAPVirtualInstanceList - Defines the collection of Virtual Instance for SAP solutions resources. type SAPVirtualInstanceList struct { // Gets the value of next link. NextLink *string `json:"nextLink,omitempty"` - // Gets the list of Virtual Instances for SAP. + // Gets the list of Virtual Instances for SAP solutions resources. Value []*SAPVirtualInstance `json:"value,omitempty"` } -// SAPVirtualInstanceProperties - Defines the Virtual Instance for SAP properties. +// SAPVirtualInstanceProperties - Defines the Virtual Instance for SAP solutions resource properties. type SAPVirtualInstanceProperties struct { - // REQUIRED; Defines if an existing SAP system is being registered or a new SAP system is being created + // REQUIRED; Defines if the SAP system is being created using Azure Center for SAP solutions (ACSS) or if an existing SAP + // system is being registered with ACSS Configuration SAPConfigurationClassification `json:"configuration,omitempty"` // REQUIRED; Defines the environment type - Production/Non Production. @@ -1931,10 +1921,10 @@ type SAPVirtualInstanceProperties struct { // Managed resource group configuration ManagedResourceGroupConfiguration *ManagedRGConfiguration `json:"managedResourceGroupConfiguration,omitempty"` - // READ-ONLY; Defines the Virtual Instance for SAP errors. + // READ-ONLY; Indicates any errors on the Virtual Instance for SAP solutions resource. Errors *SAPVirtualInstanceError `json:"errors,omitempty" azure:"ro"` - // READ-ONLY; Defines the SAP Instance health. + // READ-ONLY; Defines the health of SAP Instances. Health *SAPHealthState `json:"health,omitempty" azure:"ro"` // READ-ONLY; Defines the provisioning states. @@ -1950,6 +1940,8 @@ type SAPVirtualInstanceProperties struct { // SAPVirtualInstancesClientBeginCreateOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginCreate // method. type SAPVirtualInstancesClientBeginCreateOptions struct { + // Virtual Instance for SAP solutions resource request body. + Body *SAPVirtualInstance // Resumes the LRO from the provided token. ResumeToken string } @@ -1971,7 +1963,7 @@ type SAPVirtualInstancesClientBeginStartOptions struct { // SAPVirtualInstancesClientBeginStopOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginStop // method. type SAPVirtualInstancesClientBeginStopOptions struct { - // The Virtual Instances for SAP stop request body. + // The Virtual Instance for SAP solutions resource stop request body. Body *StopRequest // Resumes the LRO from the provided token. ResumeToken string @@ -1982,13 +1974,13 @@ type SAPVirtualInstancesClientGetOptions struct { // placeholder for future optional parameters } -// SAPVirtualInstancesClientListByResourceGroupOptions contains the optional parameters for the SAPVirtualInstancesClient.ListByResourceGroup +// SAPVirtualInstancesClientListByResourceGroupOptions contains the optional parameters for the SAPVirtualInstancesClient.NewListByResourceGroupPager // method. type SAPVirtualInstancesClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// SAPVirtualInstancesClientListBySubscriptionOptions contains the optional parameters for the SAPVirtualInstancesClient.ListBySubscription +// SAPVirtualInstancesClientListBySubscriptionOptions contains the optional parameters for the SAPVirtualInstancesClient.NewListBySubscriptionPager // method. type SAPVirtualInstancesClientListBySubscriptionOptions struct { // placeholder for future optional parameters @@ -1996,185 +1988,130 @@ type SAPVirtualInstancesClientListBySubscriptionOptions struct { // SAPVirtualInstancesClientUpdateOptions contains the optional parameters for the SAPVirtualInstancesClient.Update method. type SAPVirtualInstancesClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// SKU - The resource model definition representing SKU -type SKU struct { - // REQUIRED; The name of the SKU. Ex - P3. It is typically a letter+number code - Name *string `json:"name,omitempty"` - - // If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the - // resource this may be omitted. - Capacity *int32 `json:"capacity,omitempty"` - - // If the service has different generations of hardware, for the same SKU, then that can be captured here. - Family *string `json:"family,omitempty"` - - // The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. - Size *string `json:"size,omitempty"` - - // This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required - // on a PUT. - Tier *SKUTier `json:"tier,omitempty"` + // Request body to update a Virtual Instance for SAP solutions resource. + Body *UpdateSAPVirtualInstanceRequest } -// SKUCapability - The SKU capability definition. -type SKUCapability struct { - // The capability name. - Name *string `json:"name,omitempty"` - - // The capability value. - Value *string `json:"value,omitempty"` +// SSHConfiguration - SSH configuration for Linux based VMs running on Azure +type SSHConfiguration struct { + // The list of SSH public keys used to authenticate with linux based VMs. + PublicKeys []*SSHPublicKey `json:"publicKeys,omitempty"` } -// SKUCapacity - The SKU capacity. -type SKUCapacity struct { - // Default capacity value. - Default *int32 `json:"default,omitempty"` - - // Maximum capacity value. - Maximum *int32 `json:"maximum,omitempty"` - - // Minimum capacity value. - Minimum *int32 `json:"minimum,omitempty"` +// SSHKeyPair - The SSH Key-pair used to authenticate with the VM. 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]. +type SSHKeyPair struct { + // SSH private key. + PrivateKey *string `json:"privateKey,omitempty"` - // Scale type of the SKU capacity. - ScaleType *SKUScaleType `json:"scaleType,omitempty"` + // SSH public key + PublicKey *string `json:"publicKey,omitempty"` } -// SKUCost - The SKU cost definition. -type SKUCost struct { - // The extended unit. - ExtendedUnit *string `json:"extendedUnit,omitempty"` - - // Billing meter id. - MeterID *string `json:"meterId,omitempty"` - - // The quantity. - Quantity *int32 `json:"quantity,omitempty"` +// SSHPublicKey - Contains information about SSH certificate public key and the path on the Linux VM where the public key +// is placed. +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]. + KeyData *string `json:"keyData,omitempty"` } -// SKUDefinition - The SKU definition. -type SKUDefinition struct { - // REQUIRED; The name of the SKU. - Name *string `json:"name,omitempty"` - - // The SKU capabilities. - Capabilities []*SKUCapability `json:"capabilities,omitempty"` - - // If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the - // resource this may be omitted. - Capacity interface{} `json:"capacity,omitempty"` - - // The SKU costs. - Costs []*SKUCost `json:"costs,omitempty"` - - // If the service has different generations of hardware, for the same SKU, then that can be captured here. - Family *string `json:"family,omitempty"` - - // If the service has different kinds of hardware, for the same SKU, then that can be captured here. - Kind *string `json:"kind,omitempty"` +// SapLandscapeMonitor - configuration associated with SAP Landscape Monitor Dashboard. +type SapLandscapeMonitor struct { + // Sap Landscape Monitor properties + Properties *SapLandscapeMonitorProperties `json:"properties,omitempty"` - // List of locations where this SKU is available. - LocationInfo []*SKULocationAndZones `json:"locationInfo,omitempty"` + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` - // List of locations where this SKU is available. - Locations []*string `json:"locations,omitempty"` + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` - // Resource type the SKU applicable for. - ResourceType *string `json:"resourceType,omitempty"` + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - // The SKU restrictions. - Restrictions []*SKURestriction `json:"restrictions,omitempty"` + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} - // The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. - Size *string `json:"size,omitempty"` +// SapLandscapeMonitorClientCreateOptions contains the optional parameters for the SapLandscapeMonitorClient.Create method. +type SapLandscapeMonitorClientCreateOptions struct { + // placeholder for future optional parameters +} - // This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required - // on a PUT. - Tier *string `json:"tier,omitempty"` +// SapLandscapeMonitorClientDeleteOptions contains the optional parameters for the SapLandscapeMonitorClient.Delete method. +type SapLandscapeMonitorClientDeleteOptions struct { + // placeholder for future optional parameters } -// SKULocationAndZones - The SKU location and zone. -type SKULocationAndZones struct { - // The extended locations of SKU. - ExtendedLocations []*string `json:"extendedLocations,omitempty"` +// SapLandscapeMonitorClientGetOptions contains the optional parameters for the SapLandscapeMonitorClient.Get method. +type SapLandscapeMonitorClientGetOptions struct { + // placeholder for future optional parameters +} - // The location of the SKU. - Location *string `json:"location,omitempty"` +// SapLandscapeMonitorClientListOptions contains the optional parameters for the SapLandscapeMonitorClient.List method. +type SapLandscapeMonitorClientListOptions struct { + // placeholder for future optional parameters +} - // Type of the extended location. - Type *LocationType `json:"type,omitempty"` +// SapLandscapeMonitorClientUpdateOptions contains the optional parameters for the SapLandscapeMonitorClient.Update method. +type SapLandscapeMonitorClientUpdateOptions struct { + // placeholder for future optional parameters +} - // The availability zone details of the SKU location. - ZoneDetails []*SKUZoneDetail `json:"zoneDetails,omitempty"` +// SapLandscapeMonitorListResult - The response from the List SAP Landscape Monitor Dashboard operation. +type SapLandscapeMonitorListResult struct { + // The URL to get the next set of SAP Landscape Monitor Dashboard. + NextLink *string `json:"nextLink,omitempty"` - // The availability zones of SKU location. - Zones []*string `json:"zones,omitempty"` + // The list of Sap Landscape Monitor configuration. + Value []*SapLandscapeMonitor `json:"value,omitempty"` } -// SKURestriction - The SKU restriction definition. -type SKURestriction struct { - // The SKU restriction reason code. - ReasonCode *SKURestrictionReasonCode `json:"reasonCode,omitempty"` +// SapLandscapeMonitorMetricThresholds - Gets or sets the Threshold Values for Top Metrics Health. +type SapLandscapeMonitorMetricThresholds struct { + // Gets or sets the threshold value for Green. + Green *float32 `json:"green,omitempty"` - // The restriction information. - RestrictionInfo interface{} `json:"restrictionInfo,omitempty"` + // Gets or sets the name of the threshold. + Name *string `json:"name,omitempty"` - // The SKU restriction type. - Type *SKURestrictionType `json:"type,omitempty"` + // Gets or sets the threshold value for Red. + Red *float32 `json:"red,omitempty"` - // Restriction values. - Values []*string `json:"values,omitempty"` + // Gets or sets the threshold value for Yellow. + Yellow *float32 `json:"yellow,omitempty"` } -// SKUZoneDetail - The SKU zone details. -type SKUZoneDetail struct { - // The capabilities. - Capabilities []*SKUCapability `json:"capabilities,omitempty"` +// SapLandscapeMonitorProperties - Gets or sets the properties for Sap Landscape Monitor Dashboard. +type SapLandscapeMonitorProperties struct { + // Gets or sets the SID groupings by landscape and Environment. + Grouping *SapLandscapeMonitorPropertiesGrouping `json:"grouping,omitempty"` - // The physical zones. - Zones []*string `json:"zones,omitempty"` -} + // Gets or sets the list Top Metric Thresholds for SAP Landscape Monitor Dashboard + TopMetricsThresholds []*SapLandscapeMonitorMetricThresholds `json:"topMetricsThresholds,omitempty"` -// SKUsClientListOptions contains the optional parameters for the SKUsClient.List method. -type SKUsClientListOptions struct { - // placeholder for future optional parameters + // READ-ONLY; State of provisioning of the SAP monitor. + ProvisioningState *SapLandscapeMonitorProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } -// SKUsListResult - A list of SKUs supported by an Azure Resource Provider. -type SKUsListResult struct { - // READ-ONLY; URL to get the next set of SKU list results (if there are any). - NextLink *string `json:"nextLink,omitempty" azure:"ro"` +// SapLandscapeMonitorPropertiesGrouping - Gets or sets the SID groupings by landscape and Environment. +type SapLandscapeMonitorPropertiesGrouping struct { + // Gets or sets the list of landscape to SID mappings. + Landscape []*SapLandscapeMonitorSidMapping `json:"landscape,omitempty"` - // READ-ONLY; List of SKUs supported by the resource provider - Value []*SKUDefinition `json:"value,omitempty" azure:"ro"` -} - -// SSHConfiguration - SSH configuration for Linux based VMs running on Azure -type SSHConfiguration struct { - // The list of SSH public keys used to authenticate with linux based VMs. - PublicKeys []*SSHPublicKey `json:"publicKeys,omitempty"` + // Gets or sets the list of Sap Applications to SID mappings. + SapApplication []*SapLandscapeMonitorSidMapping `json:"sapApplication,omitempty"` } -// SSHKeyPair - The SSH Key-pair used to authenticate with the VM. 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]. -type SSHKeyPair struct { - // SSH private key. - PrivateKey *string `json:"privateKey,omitempty"` +// SapLandscapeMonitorSidMapping - Gets or sets the mapping for SID to Environment/Applications. +type SapLandscapeMonitorSidMapping struct { + // Gets or sets the name of the grouping. + Name *string `json:"name,omitempty"` - // SSH public key - PublicKey *string `json:"publicKey,omitempty"` -} - -// SSHPublicKey - Contains information about SSH certificate public key and the path on the Linux VM where the public key -// is placed. -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]. - KeyData *string `json:"keyData,omitempty"` + // Gets or sets the list of SID's. + TopSid []*string `json:"topSid,omitempty"` } // SapNetWeaverProviderInstanceProperties - Gets or sets the provider properties. @@ -2182,6 +2119,12 @@ type SapNetWeaverProviderInstanceProperties struct { // REQUIRED; The provider type. For example, the value can be SapHana. ProviderType *string `json:"providerType,omitempty"` + // Gets or sets the blob URI to SSL certificate for the SAP system. + SSLCertificateURI *string `json:"sslCertificateUri,omitempty"` + + // Gets or sets certificate preference if secure communication is enabled. + SSLPreference *SSLPreference `json:"sslPreference,omitempty"` + // Gets or sets the SAP Client ID. SapClientID *string `json:"sapClientId,omitempty"` @@ -2203,9 +2146,6 @@ type SapNetWeaverProviderInstanceProperties struct { // Gets or sets the SAP HTTP port number. SapPortNumber *string `json:"sapPortNumber,omitempty"` - // Gets or sets the blob URI to SSL certificate for the SAP system. - SapSSLCertificateURI *string `json:"sapSslCertificateUri,omitempty"` - // Gets or sets the SAP System Identifier SapSid *string `json:"sapSid,omitempty"` @@ -2220,30 +2160,6 @@ func (s *SapNetWeaverProviderInstanceProperties) GetProviderSpecificProperties() } } -// SearchProfile - Search profile -type SearchProfile struct { - // REQUIRED; VM SKU for node(s) - NodeSKU *string `json:"nodeSku,omitempty"` - - // REQUIRED; OS disk details - OSDisk *DiskInfo `json:"osDisk,omitempty"` - - // REQUIRED; OS image used for creating the nodes - OSImage *OsImageProfile `json:"osImage,omitempty"` - - // REQUIRED; Search type - SearchType *SearchType `json:"searchType,omitempty"` - - // Data disks details. This property is not in use right now - DataDisks []*DiskInfo `json:"dataDisks,omitempty"` - - // VM or VMSS name - Name *string `json:"name,omitempty"` - - // READ-ONLY; VM/VMSS resource ARM Ids - NodeResourceIDs []*string `json:"nodeResourceIds,omitempty" azure:"ro"` -} - // ServiceInitiatedSoftwareConfiguration - The SAP Software configuration Input when the software is to be installed by service. type ServiceInitiatedSoftwareConfiguration struct { // REQUIRED; The URL to the SAP Build of Materials(BOM) file. @@ -2275,12 +2191,21 @@ func (s *ServiceInitiatedSoftwareConfiguration) GetSoftwareConfiguration() *Soft } } +// SharedStorageResourceNames - The resource names object for shared storage. +type SharedStorageResourceNames struct { + // The full name of the shared storage account. If it is not provided, it will be defaulted to {SID}nfs{guid of 15 chars}. + SharedStorageAccountName *string `json:"sharedStorageAccountName,omitempty"` + + // The full name of private end point for the shared storage account. If it is not provided, it will be defaulted to {storageAccountName}_pe + SharedStorageAccountPrivateEndPointName *string `json:"sharedStorageAccountPrivateEndPointName,omitempty"` +} + // SingleServerConfiguration - Gets or sets the single server configuration. type SingleServerConfiguration struct { // REQUIRED; The application resource group where SAP system resources will be deployed. AppResourceGroup *string `json:"appResourceGroup,omitempty"` - // REQUIRED; The deployment Type. + // REQUIRED; The type of SAP deployment, single server or Three tier. DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` // REQUIRED; The subnet id. @@ -2289,9 +2214,15 @@ type SingleServerConfiguration struct { // REQUIRED; Gets or sets the virtual machine configuration. VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` + // The set of custom names to be used for underlying azure resources that are part of the SAP system. + CustomResourceNames SingleServerCustomResourceNamesClassification `json:"customResourceNames,omitempty"` + // The database type. DatabaseType *SAPDatabaseType `json:"databaseType,omitempty"` + // Gets or sets the disk configuration. + DbDiskConfiguration *DiskConfiguration `json:"dbDiskConfiguration,omitempty"` + // Network configuration for the server NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` } @@ -2304,9 +2235,47 @@ func (s *SingleServerConfiguration) GetInfrastructureConfiguration() *Infrastruc } } +// SingleServerCustomResourceNamesClassification provides polymorphic access to related types. +// Call the interface's GetSingleServerCustomResourceNames() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *SingleServerCustomResourceNames, *SingleServerFullResourceNames +type SingleServerCustomResourceNamesClassification interface { + // GetSingleServerCustomResourceNames returns the SingleServerCustomResourceNames content of the underlying type. + GetSingleServerCustomResourceNames() *SingleServerCustomResourceNames +} + +// SingleServerCustomResourceNames - The resource-names input to specify custom names for underlying azure resources that +// are part of a single server SAP system. +type SingleServerCustomResourceNames struct { + // REQUIRED; The pattern type to be used for resource naming. + NamingPatternType *NamingPatternType `json:"namingPatternType,omitempty"` +} + +// GetSingleServerCustomResourceNames implements the SingleServerCustomResourceNamesClassification interface for type SingleServerCustomResourceNames. +func (s *SingleServerCustomResourceNames) GetSingleServerCustomResourceNames() *SingleServerCustomResourceNames { + return s +} + +// SingleServerFullResourceNames - The resource name object where the specified values will be full resource names of the +// corresponding resources in a single server SAP system. +type SingleServerFullResourceNames struct { + // REQUIRED; The pattern type to be used for resource naming. + NamingPatternType *NamingPatternType `json:"namingPatternType,omitempty"` + + // The resource names object for virtual machine and related resources. + VirtualMachine *VirtualMachineResourceNames `json:"virtualMachine,omitempty"` +} + +// GetSingleServerCustomResourceNames implements the SingleServerCustomResourceNamesClassification interface for type SingleServerFullResourceNames. +func (s *SingleServerFullResourceNames) GetSingleServerCustomResourceNames() *SingleServerCustomResourceNames { + return &SingleServerCustomResourceNames{ + NamingPatternType: s.NamingPatternType, + } +} + // SingleServerRecommendationResult - The recommended configuration for a single server SAP system. type SingleServerRecommendationResult struct { - // REQUIRED; The deployment Type. + // REQUIRED; The type of SAP deployment, single server or Three tier. DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` // The recommended VM SKU for single server. @@ -2320,16 +2289,24 @@ func (s *SingleServerRecommendationResult) GetSAPSizingRecommendationResult() *S } } -// SiteProfile - Workload website profile -type SiteProfile struct { - // Domain name for the application site URL - DomainName *string `json:"domainName,omitempty"` +// SkipFileShareConfiguration - Gets or sets the skip file share configuration +type SkipFileShareConfiguration struct { + // REQUIRED; The type of file share config. + ConfigurationType *ConfigurationType `json:"configurationType,omitempty"` +} + +// GetFileShareConfiguration implements the FileShareConfigurationClassification interface for type SkipFileShareConfiguration. +func (s *SkipFileShareConfiguration) GetFileShareConfiguration() *FileShareConfiguration { + return &FileShareConfiguration{ + ConfigurationType: s.ConfigurationType, + } } // SoftwareConfigurationClassification provides polymorphic access to related types. // Call the interface's GetSoftwareConfiguration() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *SAPInstallWithoutOSConfigSoftwareConfiguration, *ServiceInitiatedSoftwareConfiguration, *SoftwareConfiguration +// - *ExternalInstallationSoftwareConfiguration, *SAPInstallWithoutOSConfigSoftwareConfiguration, *ServiceInitiatedSoftwareConfiguration, +// - *SoftwareConfiguration type SoftwareConfigurationClassification interface { // GetSoftwareConfiguration returns the SoftwareConfiguration content of the underlying type. GetSoftwareConfiguration() *SoftwareConfiguration @@ -2344,10 +2321,25 @@ type SoftwareConfiguration struct { // GetSoftwareConfiguration implements the SoftwareConfigurationClassification interface for type SoftwareConfiguration. func (s *SoftwareConfiguration) GetSoftwareConfiguration() *SoftwareConfiguration { return s } -// StopRequest - Stop SAP Request. +// StopRequest - Stop SAP instance(s) request body. type StopRequest struct { - // A boolean to specify if the SAP system should be hard-stopped. - HardStop *bool `json:"hardStop,omitempty"` + // This parameter defines how long (in seconds) the soft shutdown waits until the RFC/HTTP clients no longer consider the + // server for calls with load balancing. Value 0 means that the kernel does not + // wait, but goes directly into the next shutdown state, i.e. hard stop. + SoftStopTimeoutSeconds *int64 `json:"softStopTimeoutSeconds,omitempty"` +} + +// StorageConfiguration - Gets or sets the storage configuration. +type StorageConfiguration struct { + // The properties of the transport directory attached to the VIS. The default for transportFileShareConfiguration is the createAndMount + // flow if storage configuration is missing. + TransportFileShareConfiguration FileShareConfigurationClassification `json:"transportFileShareConfiguration,omitempty"` +} + +// StorageInformation - Storage details of all the Storage accounts attached to the VM. For e.g. NFS on AFS Shared Storage. +type StorageInformation struct { + // READ-ONLY + ID *string `json:"id,omitempty" azure:"ro"` } // SystemData - Metadata pertaining to creation and last modification of the resource. @@ -2391,14 +2383,20 @@ type ThreeTierConfiguration struct { // REQUIRED; The database configuration. DatabaseServer *DatabaseConfiguration `json:"databaseServer,omitempty"` - // REQUIRED; The deployment Type. + // REQUIRED; The type of SAP deployment, single server or Three tier. DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` + // The set of custom names to be used for underlying azure resources that are part of the SAP system. + CustomResourceNames ThreeTierCustomResourceNamesClassification `json:"customResourceNames,omitempty"` + // The high availability configuration. HighAvailabilityConfig *HighAvailabilityConfiguration `json:"highAvailabilityConfig,omitempty"` // Network configuration common to all servers NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` + + // The storage configuration. + StorageConfiguration *StorageConfiguration `json:"storageConfiguration,omitempty"` } // GetInfrastructureConfiguration implements the InfrastructureConfigurationClassification interface for type ThreeTierConfiguration. @@ -2409,9 +2407,58 @@ func (t *ThreeTierConfiguration) GetInfrastructureConfiguration() *Infrastructur } } +// ThreeTierCustomResourceNamesClassification provides polymorphic access to related types. +// Call the interface's GetThreeTierCustomResourceNames() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ThreeTierCustomResourceNames, *ThreeTierFullResourceNames +type ThreeTierCustomResourceNamesClassification interface { + // GetThreeTierCustomResourceNames returns the ThreeTierCustomResourceNames content of the underlying type. + GetThreeTierCustomResourceNames() *ThreeTierCustomResourceNames +} + +// ThreeTierCustomResourceNames - The resource-names input to specify custom names for underlying azure resources that are +// part of a three tier SAP system. +type ThreeTierCustomResourceNames struct { + // REQUIRED; The pattern type to be used for resource naming. + NamingPatternType *NamingPatternType `json:"namingPatternType,omitempty"` +} + +// GetThreeTierCustomResourceNames implements the ThreeTierCustomResourceNamesClassification interface for type ThreeTierCustomResourceNames. +func (t *ThreeTierCustomResourceNames) GetThreeTierCustomResourceNames() *ThreeTierCustomResourceNames { + return t +} + +// ThreeTierFullResourceNames - The resource name object where the specified values will be full resource names of the corresponding +// resources in a three tier SAP system. +type ThreeTierFullResourceNames struct { + // REQUIRED; The pattern type to be used for resource naming. + NamingPatternType *NamingPatternType `json:"namingPatternType,omitempty"` + + // The full resource names object for application layer resources. The number of entries in this list should be equal to the + // number VMs to be created for application layer. + ApplicationServer *ApplicationServerFullResourceNames `json:"applicationServer,omitempty"` + + // The full resource names object for central server layer resources. + CentralServer *CentralServerFullResourceNames `json:"centralServer,omitempty"` + + // The full resource names object for database layer resources. The number of entries in this list should be equal to the + // number VMs to be created for database layer. + DatabaseServer *DatabaseServerFullResourceNames `json:"databaseServer,omitempty"` + + // The resource names object for shared storage. + SharedStorage *SharedStorageResourceNames `json:"sharedStorage,omitempty"` +} + +// GetThreeTierCustomResourceNames implements the ThreeTierCustomResourceNamesClassification interface for type ThreeTierFullResourceNames. +func (t *ThreeTierFullResourceNames) GetThreeTierCustomResourceNames() *ThreeTierCustomResourceNames { + return &ThreeTierCustomResourceNames{ + NamingPatternType: t.NamingPatternType, + } +} + // ThreeTierRecommendationResult - The recommended configuration for a three tier SAP system. type ThreeTierRecommendationResult struct { - // REQUIRED; The deployment Type. + // REQUIRED; The type of SAP deployment, single server or Three tier. DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` // The application server instance count. @@ -2516,15 +2563,6 @@ type UserAssignedServiceIdentity struct { UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities,omitempty"` } -// UserProfile - User profile to configure on a compute resources such as VM, VMSS -type UserProfile struct { - // REQUIRED; SSH public key data - SSHPublicKey *string `json:"sshPublicKey,omitempty"` - - // REQUIRED; User name - UserName *string `json:"userName,omitempty"` -} - // VirtualMachineConfiguration - Defines the virtual machine configuration. type VirtualMachineConfiguration struct { // REQUIRED; The image reference. @@ -2537,31 +2575,33 @@ type VirtualMachineConfiguration struct { VMSize *string `json:"vmSize,omitempty"` } -// VmssNodesProfile - VMSS profile -type VmssNodesProfile struct { - // REQUIRED; VM SKU for node(s) - NodeSKU *string `json:"nodeSku,omitempty"` - - // REQUIRED; OS disk details - OSDisk *DiskInfo `json:"osDisk,omitempty"` +// VirtualMachineResourceNames - The resource names object for virtual machine and related resources. +type VirtualMachineResourceNames struct { + // The full resource names for virtual machine data disks. This is a dictionary containing list of names of data disks per + // volume. Currently supported volumes for database layer are ['hana/data', + // 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. For application and cs layers, only 'default' volume is supported + DataDiskNames map[string][]*string `json:"dataDiskNames,omitempty"` - // REQUIRED; OS image used for creating the nodes - OSImage *OsImageProfile `json:"osImage,omitempty"` + // The full name for virtual-machine's host (computer name). Currently, ACSS only supports host names which are less than + // or equal to 13 characters long. If this value is not provided, vmName will be + // used as host name. + HostName *string `json:"hostName,omitempty"` - // Maximum number of nodes for autoscale - AutoScaleMaxCount *int32 `json:"autoScaleMaxCount,omitempty"` + // The list of network interface name objects for the selected virtual machine. Currently, only one network interface is supported + // per virtual machine. + NetworkInterfaces []*NetworkInterfaceResourceNames `json:"networkInterfaces,omitempty"` - // Minimum number of nodes for autoscale - AutoScaleMinCount *int32 `json:"autoScaleMinCount,omitempty"` + // The full name for OS disk attached to the VM. If this value is not provided, it will be named by ARM as per its default + // naming standards (prefixed with vm name). There is only one OS disk attached per + // Virtual Machine. + OSDiskName *string `json:"osDiskName,omitempty"` - // Data disks details. This property is not in use right now - DataDisks []*DiskInfo `json:"dataDisks,omitempty"` - - // VM or VMSS name - Name *string `json:"name,omitempty"` - - // READ-ONLY; VM/VMSS resource ARM Ids - NodeResourceIDs []*string `json:"nodeResourceIds,omitempty" azure:"ro"` + // The full name for virtual machine. The length of this field can be upto 64 characters. If name is not provided, service + // uses a default name based on the deployment type. For SingleServer, default name + // is {SID}vm. In case of HA-AvZone systems, default name will be {SID}{app/ascs/db}z{a/b}vm with an incrementor at the end + // in case of more than 1 vm per layer. For distributed and HA-AvSet systems, + // default name will be {SID}{app/ascs/db}vm with an incrementor at the end in case of more than 1 vm per layer. + VMName *string `json:"vmName,omitempty"` } // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. @@ -2576,70 +2616,3 @@ func (w *WindowsConfiguration) GetOSConfiguration() *OSConfiguration { OSType: w.OSType, } } - -// WordpressInstanceResource - WordPress instance resource -type WordpressInstanceResource struct { - // Resource properties - Properties *WordpressInstanceResourceProperties `json:"properties,omitempty"` - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` -} - -// WordpressInstanceResourceList - WordPress instance resource list -type WordpressInstanceResourceList struct { - // Link to next page of resources - NextLink *string `json:"nextLink,omitempty"` - - // List of resources in current page - Value []*WordpressInstanceResource `json:"value,omitempty"` -} - -// WordpressInstanceResourceProperties - WordPress instance properties -type WordpressInstanceResourceProperties struct { - // REQUIRED; Application version - Version *WordpressVersions `json:"version,omitempty"` - - // Database name used by the application - DatabaseName *string `json:"databaseName,omitempty"` - - // User name used by the application to connect to database - DatabaseUser *string `json:"databaseUser,omitempty"` - - // READ-ONLY; WordPress instance provisioning state - ProvisioningState *ApplicationProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; Site Url to access the WordPress application - SiteURL *string `json:"siteUrl,omitempty" azure:"ro"` -} - -// WordpressInstancesClientBeginCreateOrUpdateOptions contains the optional parameters for the WordpressInstancesClient.BeginCreateOrUpdate -// method. -type WordpressInstancesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WordpressInstancesClientDeleteOptions contains the optional parameters for the WordpressInstancesClient.Delete method. -type WordpressInstancesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// WordpressInstancesClientGetOptions contains the optional parameters for the WordpressInstancesClient.Get method. -type WordpressInstancesClientGetOptions struct { - // placeholder for future optional parameters -} - -// WordpressInstancesClientListOptions contains the optional parameters for the WordpressInstancesClient.List method. -type WordpressInstancesClientListOptions struct { - // placeholder for future optional parameters -} diff --git a/sdk/resourcemanager/workloads/armworkloads/models_serde.go b/sdk/resourcemanager/workloads/armworkloads/models_serde.go index 239c731b9e51..e7337686db0e 100644 --- a/sdk/resourcemanager/workloads/armworkloads/models_serde.go +++ b/sdk/resourcemanager/workloads/armworkloads/models_serde.go @@ -18,7 +18,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type ApplicationServerConfiguration. func (a ApplicationServerConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "instanceCount", a.InstanceCount) populate(objectMap, "subnetId", a.SubnetID) populate(objectMap, "virtualMachineConfiguration", a.VirtualMachineConfiguration) @@ -51,75 +51,67 @@ func (a *ApplicationServerConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BackupProfile. -func (b BackupProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupEnabled", b.BackupEnabled) - populate(objectMap, "vaultResourceId", b.VaultResourceID) +// MarshalJSON implements the json.Marshaller interface for type ApplicationServerFullResourceNames. +func (a ApplicationServerFullResourceNames) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "availabilitySetName", a.AvailabilitySetName) + populate(objectMap, "virtualMachines", a.VirtualMachines) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupProfile. -func (b *BackupProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationServerFullResourceNames. +func (a *ApplicationServerFullResourceNames) 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", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "backupEnabled": - err = unpopulate(val, "BackupEnabled", &b.BackupEnabled) + case "availabilitySetName": + err = unpopulate(val, "AvailabilitySetName", &a.AvailabilitySetName) delete(rawMsg, key) - case "vaultResourceId": - err = unpopulate(val, "VaultResourceID", &b.VaultResourceID) + case "virtualMachines": + err = unpopulate(val, "VirtualMachines", &a.VirtualMachines) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CacheProfile. -func (c CacheProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cacheResourceId", c.CacheResourceID) - populate(objectMap, "capacity", c.Capacity) - populate(objectMap, "family", c.Family) - populate(objectMap, "name", c.Name) - populate(objectMap, "skuName", c.SKUName) +// MarshalJSON implements the json.Marshaller interface for type ApplicationServerVMDetails. +func (a ApplicationServerVMDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "storageDetails", a.StorageDetails) + populate(objectMap, "type", a.Type) + populate(objectMap, "virtualMachineId", a.VirtualMachineID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CacheProfile. -func (c *CacheProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationServerVMDetails. +func (a *ApplicationServerVMDetails) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "cacheResourceId": - err = unpopulate(val, "CacheResourceID", &c.CacheResourceID) + case "storageDetails": + err = unpopulate(val, "StorageDetails", &a.StorageDetails) delete(rawMsg, key) - case "capacity": - err = unpopulate(val, "Capacity", &c.Capacity) - delete(rawMsg, key) - case "family": - err = unpopulate(val, "Family", &c.Family) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) - case "skuName": - err = unpopulate(val, "SKUName", &c.SKUName) + case "virtualMachineId": + err = unpopulate(val, "VirtualMachineID", &a.VirtualMachineID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil @@ -127,7 +119,7 @@ func (c *CacheProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CentralServerConfiguration. func (c CentralServerConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "instanceCount", c.InstanceCount) populate(objectMap, "subnetId", c.SubnetID) populate(objectMap, "virtualMachineConfiguration", c.VirtualMachineConfiguration) @@ -160,9 +152,45 @@ func (c *CentralServerConfiguration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CentralServerFullResourceNames. +func (c CentralServerFullResourceNames) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "availabilitySetName", c.AvailabilitySetName) + populate(objectMap, "loadBalancer", c.LoadBalancer) + populate(objectMap, "virtualMachines", c.VirtualMachines) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CentralServerFullResourceNames. +func (c *CentralServerFullResourceNames) 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 "availabilitySetName": + err = unpopulate(val, "AvailabilitySetName", &c.AvailabilitySetName) + delete(rawMsg, key) + case "loadBalancer": + err = unpopulate(val, "LoadBalancer", &c.LoadBalancer) + delete(rawMsg, key) + case "virtualMachines": + err = unpopulate(val, "VirtualMachines", &c.VirtualMachines) + 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 CentralServerVMDetails. func (c CentralServerVMDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) + populate(objectMap, "storageDetails", c.StorageDetails) populate(objectMap, "type", c.Type) populate(objectMap, "virtualMachineId", c.VirtualMachineID) return json.Marshal(objectMap) @@ -177,6 +205,9 @@ func (c *CentralServerVMDetails) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "storageDetails": + err = unpopulate(val, "StorageDetails", &c.StorageDetails) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) @@ -191,9 +222,44 @@ func (c *CentralServerVMDetails) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CreateAndMountFileShareConfiguration. +func (c CreateAndMountFileShareConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["configurationType"] = ConfigurationTypeCreateAndMount + populate(objectMap, "resourceGroup", c.ResourceGroup) + populate(objectMap, "storageAccountName", c.StorageAccountName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CreateAndMountFileShareConfiguration. +func (c *CreateAndMountFileShareConfiguration) 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 "configurationType": + err = unpopulate(val, "ConfigurationType", &c.ConfigurationType) + delete(rawMsg, key) + case "resourceGroup": + err = unpopulate(val, "ResourceGroup", &c.ResourceGroup) + delete(rawMsg, key) + case "storageAccountName": + err = unpopulate(val, "StorageAccountName", &c.StorageAccountName) + 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 DB2ProviderInstanceProperties. func (d DB2ProviderInstanceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dbName", d.DbName) populate(objectMap, "dbPassword", d.DbPassword) populate(objectMap, "dbPasswordUri", d.DbPasswordURI) @@ -201,6 +267,8 @@ func (d DB2ProviderInstanceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "dbUsername", d.DbUsername) populate(objectMap, "hostname", d.Hostname) objectMap["providerType"] = "Db2" + populate(objectMap, "sslCertificateUri", d.SSLCertificateURI) + populate(objectMap, "sslPreference", d.SSLPreference) populate(objectMap, "sapSid", d.SapSid) return json.Marshal(objectMap) } @@ -235,6 +303,12 @@ func (d *DB2ProviderInstanceProperties) UnmarshalJSON(data []byte) error { case "providerType": err = unpopulate(val, "ProviderType", &d.ProviderType) delete(rawMsg, key) + case "sslCertificateUri": + err = unpopulate(val, "SSLCertificateURI", &d.SSLCertificateURI) + delete(rawMsg, key) + case "sslPreference": + err = unpopulate(val, "SSLPreference", &d.SSLPreference) + delete(rawMsg, key) case "sapSid": err = unpopulate(val, "SapSid", &d.SapSid) delete(rawMsg, key) @@ -248,8 +322,9 @@ func (d *DB2ProviderInstanceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DatabaseConfiguration. func (d DatabaseConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "databaseType", d.DatabaseType) + populate(objectMap, "diskConfiguration", d.DiskConfiguration) populate(objectMap, "instanceCount", d.InstanceCount) populate(objectMap, "subnetId", d.SubnetID) populate(objectMap, "virtualMachineConfiguration", d.VirtualMachineConfiguration) @@ -268,6 +343,9 @@ func (d *DatabaseConfiguration) UnmarshalJSON(data []byte) error { case "databaseType": err = unpopulate(val, "DatabaseType", &d.DatabaseType) delete(rawMsg, key) + case "diskConfiguration": + err = unpopulate(val, "DiskConfiguration", &d.DiskConfiguration) + delete(rawMsg, key) case "instanceCount": err = unpopulate(val, "InstanceCount", &d.InstanceCount) delete(rawMsg, key) @@ -285,26 +363,17 @@ func (d *DatabaseConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseProfile. -func (d DatabaseProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupRetentionDays", d.BackupRetentionDays) - populate(objectMap, "haEnabled", d.HaEnabled) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "sslEnforcementEnabled", d.SSLEnforcementEnabled) - populate(objectMap, "serverName", d.ServerName) - populate(objectMap, "serverResourceId", d.ServerResourceID) - populate(objectMap, "storageInGB", d.StorageInGB) - populate(objectMap, "storageIops", d.StorageIops) - populate(objectMap, "storageSku", d.StorageSKU) - populate(objectMap, "tier", d.Tier) - populate(objectMap, "type", d.Type) - populate(objectMap, "version", d.Version) +// MarshalJSON implements the json.Marshaller interface for type DatabaseServerFullResourceNames. +func (d DatabaseServerFullResourceNames) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "availabilitySetName", d.AvailabilitySetName) + populate(objectMap, "loadBalancer", d.LoadBalancer) + populate(objectMap, "virtualMachines", d.VirtualMachines) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseProfile. -func (d *DatabaseProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseServerFullResourceNames. +func (d *DatabaseServerFullResourceNames) 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) @@ -312,41 +381,14 @@ func (d *DatabaseProfile) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "backupRetentionDays": - err = unpopulate(val, "BackupRetentionDays", &d.BackupRetentionDays) - delete(rawMsg, key) - case "haEnabled": - err = unpopulate(val, "HaEnabled", &d.HaEnabled) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &d.SKU) - delete(rawMsg, key) - case "sslEnforcementEnabled": - err = unpopulate(val, "SSLEnforcementEnabled", &d.SSLEnforcementEnabled) + case "availabilitySetName": + err = unpopulate(val, "AvailabilitySetName", &d.AvailabilitySetName) delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &d.ServerName) + case "loadBalancer": + err = unpopulate(val, "LoadBalancer", &d.LoadBalancer) delete(rawMsg, key) - case "serverResourceId": - err = unpopulate(val, "ServerResourceID", &d.ServerResourceID) - delete(rawMsg, key) - case "storageInGB": - err = unpopulate(val, "StorageInGB", &d.StorageInGB) - delete(rawMsg, key) - case "storageIops": - err = unpopulate(val, "StorageIops", &d.StorageIops) - delete(rawMsg, key) - case "storageSku": - err = unpopulate(val, "StorageSKU", &d.StorageSKU) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &d.Tier) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &d.Version) + case "virtualMachines": + err = unpopulate(val, "VirtualMachines", &d.VirtualMachines) delete(rawMsg, key) } if err != nil { @@ -358,8 +400,9 @@ func (d *DatabaseProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DatabaseVMDetails. func (d DatabaseVMDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "status", d.Status) + populate(objectMap, "storageDetails", d.StorageDetails) populate(objectMap, "virtualMachineId", d.VirtualMachineID) return json.Marshal(objectMap) } @@ -376,6 +419,9 @@ func (d *DatabaseVMDetails) UnmarshalJSON(data []byte) error { case "status": err = unpopulate(val, "Status", &d.Status) delete(rawMsg, key) + case "storageDetails": + err = unpopulate(val, "StorageDetails", &d.StorageDetails) + delete(rawMsg, key) case "virtualMachineId": err = unpopulate(val, "VirtualMachineID", &d.VirtualMachineID) delete(rawMsg, key) @@ -389,7 +435,7 @@ func (d *DatabaseVMDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DeployerVMPackages. func (d DeployerVMPackages) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "storageAccountId", d.StorageAccountID) populate(objectMap, "url", d.URL) return json.Marshal(objectMap) @@ -420,7 +466,7 @@ func (d *DeployerVMPackages) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DeploymentConfiguration. func (d DeploymentConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "appLocation", d.AppLocation) objectMap["configurationType"] = SAPConfigurationTypeDeployment populate(objectMap, "infrastructureConfiguration", d.InfrastructureConfiguration) @@ -459,7 +505,7 @@ func (d *DeploymentConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DeploymentWithOSConfiguration. func (d DeploymentWithOSConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "appLocation", d.AppLocation) objectMap["configurationType"] = SAPConfigurationTypeDeploymentWithOSConfig populate(objectMap, "infrastructureConfiguration", d.InfrastructureConfiguration) @@ -502,7 +548,7 @@ func (d *DeploymentWithOSConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DiscoveryConfiguration. func (d DiscoveryConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "appLocation", d.AppLocation) populate(objectMap, "centralServerVmId", d.CentralServerVMID) objectMap["configurationType"] = SAPConfigurationTypeDiscovery @@ -535,16 +581,122 @@ func (d *DiscoveryConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DiskInfo. -func (d DiskInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "sizeInGB", d.SizeInGB) - populate(objectMap, "storageType", d.StorageType) +// MarshalJSON implements the json.Marshaller interface for type DiskConfiguration. +func (d DiskConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "diskVolumeConfigurations", d.DiskVolumeConfigurations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskConfiguration. +func (d *DiskConfiguration) 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 "diskVolumeConfigurations": + err = unpopulate(val, "DiskVolumeConfigurations", &d.DiskVolumeConfigurations) + 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 DiskDetails. +func (d DiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "diskTier", d.DiskTier) + populate(objectMap, "iopsReadWrite", d.IopsReadWrite) + populate(objectMap, "maximumSupportedDiskCount", d.MaximumSupportedDiskCount) + populate(objectMap, "mbpsReadWrite", d.MbpsReadWrite) + populate(objectMap, "minimumSupportedDiskCount", d.MinimumSupportedDiskCount) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "sizeGB", d.SizeGB) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskDetails. +func (d *DiskDetails) 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 "diskTier": + err = unpopulate(val, "DiskTier", &d.DiskTier) + delete(rawMsg, key) + case "iopsReadWrite": + err = unpopulate(val, "IopsReadWrite", &d.IopsReadWrite) + delete(rawMsg, key) + case "maximumSupportedDiskCount": + err = unpopulate(val, "MaximumSupportedDiskCount", &d.MaximumSupportedDiskCount) + delete(rawMsg, key) + case "mbpsReadWrite": + err = unpopulate(val, "MbpsReadWrite", &d.MbpsReadWrite) + delete(rawMsg, key) + case "minimumSupportedDiskCount": + err = unpopulate(val, "MinimumSupportedDiskCount", &d.MinimumSupportedDiskCount) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) + case "sizeGB": + err = unpopulate(val, "SizeGB", &d.SizeGB) + 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 DiskSKU. +func (d DiskSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", d.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskSKU. +func (d *DiskSKU) 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 "name": + err = unpopulate(val, "Name", &d.Name) + 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 DiskVolumeConfiguration. +func (d DiskVolumeConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", d.Count) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "sizeGB", d.SizeGB) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskInfo. -func (d *DiskInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskVolumeConfiguration. +func (d *DiskVolumeConfiguration) 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) @@ -552,11 +704,14 @@ func (d *DiskInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "sizeInGB": - err = unpopulate(val, "SizeInGB", &d.SizeInGB) + case "count": + err = unpopulate(val, "Count", &d.Count) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) delete(rawMsg, key) - case "storageType": - err = unpopulate(val, "StorageType", &d.StorageType) + case "sizeGB": + err = unpopulate(val, "SizeGB", &d.SizeGB) delete(rawMsg, key) } if err != nil { @@ -568,7 +723,7 @@ func (d *DiskInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EnqueueReplicationServerProperties. func (e EnqueueReplicationServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "ersVersion", e.ErsVersion) populate(objectMap, "health", e.Health) populate(objectMap, "hostname", e.Hostname) @@ -619,7 +774,7 @@ func (e *EnqueueReplicationServerProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EnqueueServerProperties. func (e EnqueueServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "health", e.Health) populate(objectMap, "hostname", e.Hostname) populate(objectMap, "ipAddress", e.IPAddress) @@ -658,7 +813,7 @@ func (e *EnqueueServerProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Error. func (e Error) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", e.Code) populate(objectMap, "details", e.Details) populate(objectMap, "innerError", e.InnerError) @@ -701,7 +856,7 @@ func (e *Error) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "info", &e.Info) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) @@ -732,7 +887,7 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorDefinition. func (e ErrorDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", e.Code) populate(objectMap, "details", e.Details) populate(objectMap, "message", e.Message) @@ -767,7 +922,7 @@ func (e *ErrorDefinition) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorDetail. func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalInfo", e.AdditionalInfo) populate(objectMap, "code", e.Code) populate(objectMap, "details", e.Details) @@ -810,7 +965,7 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorInnerError. func (e ErrorInnerError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "innerError", e.InnerError) return json.Marshal(objectMap) } @@ -837,7 +992,7 @@ func (e *ErrorInnerError) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorResponse. func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } @@ -862,40 +1017,55 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type FileshareProfile. -func (f FileshareProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "shareName", f.ShareName) - populate(objectMap, "shareSizeInGB", f.ShareSizeInGB) - populate(objectMap, "shareType", f.ShareType) - populate(objectMap, "storageResourceId", f.StorageResourceID) - populate(objectMap, "storageType", f.StorageType) +// MarshalJSON implements the json.Marshaller interface for type ExternalInstallationSoftwareConfiguration. +func (e ExternalInstallationSoftwareConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "centralServerVmId", e.CentralServerVMID) + objectMap["softwareInstallationType"] = SAPSoftwareInstallationTypeExternal return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FileshareProfile. -func (f *FileshareProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalInstallationSoftwareConfiguration. +func (e *ExternalInstallationSoftwareConfiguration) 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) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "shareName": - err = unpopulate(val, "ShareName", &f.ShareName) - delete(rawMsg, key) - case "shareSizeInGB": - err = unpopulate(val, "ShareSizeInGB", &f.ShareSizeInGB) - delete(rawMsg, key) - case "shareType": - err = unpopulate(val, "ShareType", &f.ShareType) + case "centralServerVmId": + err = unpopulate(val, "CentralServerVMID", &e.CentralServerVMID) delete(rawMsg, key) - case "storageResourceId": - err = unpopulate(val, "StorageResourceID", &f.StorageResourceID) + case "softwareInstallationType": + err = unpopulate(val, "SoftwareInstallationType", &e.SoftwareInstallationType) delete(rawMsg, key) - case "storageType": - err = unpopulate(val, "StorageType", &f.StorageType) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileShareConfiguration. +func (f FileShareConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["configurationType"] = f.ConfigurationType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareConfiguration. +func (f *FileShareConfiguration) 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 "configurationType": + err = unpopulate(val, "ConfigurationType", &f.ConfigurationType) delete(rawMsg, key) } if err != nil { @@ -907,7 +1077,7 @@ func (f *FileshareProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GatewayServerProperties. func (g GatewayServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "health", g.Health) populate(objectMap, "port", g.Port) return json.Marshal(objectMap) @@ -938,17 +1108,19 @@ func (g *GatewayServerProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HanaDbProviderInstanceProperties. func (h HanaDbProviderInstanceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dbName", h.DbName) populate(objectMap, "dbPassword", h.DbPassword) populate(objectMap, "dbPasswordUri", h.DbPasswordURI) - populate(objectMap, "dbSslCertificateUri", h.DbSSLCertificateURI) populate(objectMap, "dbUsername", h.DbUsername) populate(objectMap, "hostname", h.Hostname) populate(objectMap, "instanceNumber", h.InstanceNumber) objectMap["providerType"] = "SapHana" populate(objectMap, "sqlPort", h.SQLPort) + populate(objectMap, "sslCertificateUri", h.SSLCertificateURI) populate(objectMap, "sslHostNameInCertificate", h.SSLHostNameInCertificate) + populate(objectMap, "sslPreference", h.SSLPreference) + populate(objectMap, "sapSid", h.SapSid) return json.Marshal(objectMap) } @@ -970,9 +1142,6 @@ func (h *HanaDbProviderInstanceProperties) UnmarshalJSON(data []byte) error { case "dbPasswordUri": err = unpopulate(val, "DbPasswordURI", &h.DbPasswordURI) delete(rawMsg, key) - case "dbSslCertificateUri": - err = unpopulate(val, "DbSSLCertificateURI", &h.DbSSLCertificateURI) - delete(rawMsg, key) case "dbUsername": err = unpopulate(val, "DbUsername", &h.DbUsername) delete(rawMsg, key) @@ -988,9 +1157,18 @@ func (h *HanaDbProviderInstanceProperties) UnmarshalJSON(data []byte) error { case "sqlPort": err = unpopulate(val, "SQLPort", &h.SQLPort) delete(rawMsg, key) + case "sslCertificateUri": + err = unpopulate(val, "SSLCertificateURI", &h.SSLCertificateURI) + delete(rawMsg, key) case "sslHostNameInCertificate": err = unpopulate(val, "SSLHostNameInCertificate", &h.SSLHostNameInCertificate) delete(rawMsg, key) + case "sslPreference": + err = unpopulate(val, "SSLPreference", &h.SSLPreference) + delete(rawMsg, key) + case "sapSid": + err = unpopulate(val, "SapSid", &h.SapSid) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) @@ -1001,7 +1179,7 @@ func (h *HanaDbProviderInstanceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HighAvailabilityConfiguration. func (h HighAvailabilityConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "highAvailabilityType", h.HighAvailabilityType) return json.Marshal(objectMap) } @@ -1028,7 +1206,7 @@ func (h *HighAvailabilityConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HighAvailabilitySoftwareConfiguration. func (h HighAvailabilitySoftwareConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "fencingClientId", h.FencingClientID) populate(objectMap, "fencingClientPassword", h.FencingClientPassword) return json.Marshal(objectMap) @@ -1059,7 +1237,7 @@ func (h *HighAvailabilitySoftwareConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ImageReference. func (i ImageReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "exactVersion", i.ExactVersion) populate(objectMap, "offer", i.Offer) populate(objectMap, "publisher", i.Publisher) @@ -1106,7 +1284,7 @@ func (i *ImageReference) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InfrastructureConfiguration. func (i InfrastructureConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "appResourceGroup", i.AppResourceGroup) objectMap["deploymentType"] = i.DeploymentType return json.Marshal(objectMap) @@ -1137,7 +1315,7 @@ func (i *InfrastructureConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LinuxConfiguration. func (l LinuxConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "disablePasswordAuthentication", l.DisablePasswordAuthentication) objectMap["osType"] = OSTypeLinux populate(objectMap, "ssh", l.SSH) @@ -1174,9 +1352,75 @@ func (l *LinuxConfiguration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type LoadBalancerDetails. +func (l LoadBalancerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", l.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerDetails. +func (l *LoadBalancerDetails) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LoadBalancerResourceNames. +func (l LoadBalancerResourceNames) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendPoolNames", l.BackendPoolNames) + populate(objectMap, "frontendIpConfigurationNames", l.FrontendIPConfigurationNames) + populate(objectMap, "healthProbeNames", l.HealthProbeNames) + populate(objectMap, "loadBalancerName", l.LoadBalancerName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerResourceNames. +func (l *LoadBalancerResourceNames) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backendPoolNames": + err = unpopulate(val, "BackendPoolNames", &l.BackendPoolNames) + delete(rawMsg, key) + case "frontendIpConfigurationNames": + err = unpopulate(val, "FrontendIPConfigurationNames", &l.FrontendIPConfigurationNames) + delete(rawMsg, key) + case "healthProbeNames": + err = unpopulate(val, "HealthProbeNames", &l.HealthProbeNames) + delete(rawMsg, key) + case "loadBalancerName": + err = unpopulate(val, "LoadBalancerName", &l.LoadBalancerName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ManagedRGConfiguration. func (m ManagedRGConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", m.Name) return json.Marshal(objectMap) } @@ -1203,7 +1447,7 @@ func (m *ManagedRGConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MessageServerProperties. func (m MessageServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "httpPort", m.HTTPPort) populate(objectMap, "httpsPort", m.HTTPSPort) populate(objectMap, "health", m.Health) @@ -1254,7 +1498,7 @@ func (m *MessageServerProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Monitor. func (m Monitor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "identity", m.Identity) populate(objectMap, "location", m.Location) @@ -1309,7 +1553,7 @@ func (m *Monitor) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitorListResult. func (m MonitorListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", m.NextLink) populate(objectMap, "value", m.Value) return json.Marshal(objectMap) @@ -1340,7 +1584,7 @@ func (m *MonitorListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitorProperties. func (m MonitorProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "appLocation", m.AppLocation) populate(objectMap, "errors", m.Errors) populate(objectMap, "logAnalyticsWorkspaceArmId", m.LogAnalyticsWorkspaceArmID) @@ -1349,6 +1593,8 @@ func (m MonitorProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "msiArmId", m.MsiArmID) populate(objectMap, "provisioningState", m.ProvisioningState) populate(objectMap, "routingPreference", m.RoutingPreference) + populate(objectMap, "storageAccountArmId", m.StorageAccountArmID) + populate(objectMap, "zoneRedundancyPreference", m.ZoneRedundancyPreference) return json.Marshal(objectMap) } @@ -1385,6 +1631,12 @@ func (m *MonitorProperties) UnmarshalJSON(data []byte) error { case "routingPreference": err = unpopulate(val, "RoutingPreference", &m.RoutingPreference) delete(rawMsg, key) + case "storageAccountArmId": + err = unpopulate(val, "StorageAccountArmID", &m.StorageAccountArmID) + delete(rawMsg, key) + case "zoneRedundancyPreference": + err = unpopulate(val, "ZoneRedundancyPreference", &m.ZoneRedundancyPreference) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -1395,7 +1647,7 @@ func (m *MonitorProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitorPropertiesErrors. func (m MonitorPropertiesErrors) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", m.Code) populate(objectMap, "details", m.Details) populate(objectMap, "innerError", m.InnerError) @@ -1436,15 +1688,52 @@ func (m *MonitorPropertiesErrors) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type MountFileShareConfiguration. +func (m MountFileShareConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["configurationType"] = ConfigurationTypeMount + populate(objectMap, "id", m.ID) + populate(objectMap, "privateEndpointId", m.PrivateEndpointID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MountFileShareConfiguration. +func (m *MountFileShareConfiguration) 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 "configurationType": + err = unpopulate(val, "ConfigurationType", &m.ConfigurationType) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "privateEndpointId": + err = unpopulate(val, "PrivateEndpointID", &m.PrivateEndpointID) + 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 MsSQLServerProviderInstanceProperties. func (m MsSQLServerProviderInstanceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dbPassword", m.DbPassword) populate(objectMap, "dbPasswordUri", m.DbPasswordURI) populate(objectMap, "dbPort", m.DbPort) populate(objectMap, "dbUsername", m.DbUsername) populate(objectMap, "hostname", m.Hostname) objectMap["providerType"] = "MsSqlServer" + populate(objectMap, "sslCertificateUri", m.SSLCertificateURI) + populate(objectMap, "sslPreference", m.SSLPreference) populate(objectMap, "sapSid", m.SapSid) return json.Marshal(objectMap) } @@ -1476,6 +1765,12 @@ func (m *MsSQLServerProviderInstanceProperties) UnmarshalJSON(data []byte) error case "providerType": err = unpopulate(val, "ProviderType", &m.ProviderType) delete(rawMsg, key) + case "sslCertificateUri": + err = unpopulate(val, "SSLCertificateURI", &m.SSLCertificateURI) + delete(rawMsg, key) + case "sslPreference": + err = unpopulate(val, "SSLPreference", &m.SSLPreference) + delete(rawMsg, key) case "sapSid": err = unpopulate(val, "SapSid", &m.SapSid) delete(rawMsg, key) @@ -1489,7 +1784,7 @@ func (m *MsSQLServerProviderInstanceProperties) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type NetworkConfiguration. func (n NetworkConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "isSecondaryIpEnabled", n.IsSecondaryIPEnabled) return json.Marshal(objectMap) } @@ -1514,24 +1809,15 @@ func (n *NetworkConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkProfile. -func (n NetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "azureFrontDoorEnabled", n.AzureFrontDoorEnabled) - populate(objectMap, "azureFrontDoorResourceId", n.AzureFrontDoorResourceID) - populate(objectMap, "capacity", n.Capacity) - populate(objectMap, "frontEndPublicIpResourceId", n.FrontEndPublicIPResourceID) - populate(objectMap, "loadBalancerResourceId", n.LoadBalancerResourceID) - populate(objectMap, "loadBalancerSku", n.LoadBalancerSKU) - populate(objectMap, "loadBalancerTier", n.LoadBalancerTier) - populate(objectMap, "loadBalancerType", n.LoadBalancerType) - populate(objectMap, "outboundPublicIpResourceIds", n.OutboundPublicIPResourceIDs) - populate(objectMap, "vNetResourceId", n.VNetResourceID) +// MarshalJSON implements the json.Marshaller interface for type NetworkInterfaceResourceNames. +func (n NetworkInterfaceResourceNames) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkInterfaceName", n.NetworkInterfaceName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfile. -func (n *NetworkProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceResourceNames. +func (n *NetworkInterfaceResourceNames) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -1539,82 +1825,8 @@ func (n *NetworkProfile) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "azureFrontDoorEnabled": - err = unpopulate(val, "AzureFrontDoorEnabled", &n.AzureFrontDoorEnabled) - delete(rawMsg, key) - case "azureFrontDoorResourceId": - err = unpopulate(val, "AzureFrontDoorResourceID", &n.AzureFrontDoorResourceID) - delete(rawMsg, key) - case "capacity": - err = unpopulate(val, "Capacity", &n.Capacity) - delete(rawMsg, key) - case "frontEndPublicIpResourceId": - err = unpopulate(val, "FrontEndPublicIPResourceID", &n.FrontEndPublicIPResourceID) - delete(rawMsg, key) - case "loadBalancerResourceId": - err = unpopulate(val, "LoadBalancerResourceID", &n.LoadBalancerResourceID) - delete(rawMsg, key) - case "loadBalancerSku": - err = unpopulate(val, "LoadBalancerSKU", &n.LoadBalancerSKU) - delete(rawMsg, key) - case "loadBalancerTier": - err = unpopulate(val, "LoadBalancerTier", &n.LoadBalancerTier) - delete(rawMsg, key) - case "loadBalancerType": - err = unpopulate(val, "LoadBalancerType", &n.LoadBalancerType) - delete(rawMsg, key) - case "outboundPublicIpResourceIds": - err = unpopulate(val, "OutboundPublicIPResourceIDs", &n.OutboundPublicIPResourceIDs) - delete(rawMsg, key) - case "vNetResourceId": - err = unpopulate(val, "VNetResourceID", &n.VNetResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NodeProfile. -func (n NodeProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataDisks", n.DataDisks) - populate(objectMap, "name", n.Name) - populate(objectMap, "nodeResourceIds", n.NodeResourceIDs) - populate(objectMap, "nodeSku", n.NodeSKU) - populate(objectMap, "osDisk", n.OSDisk) - populate(objectMap, "osImage", n.OSImage) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NodeProfile. -func (n *NodeProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDisks": - err = unpopulate(val, "DataDisks", &n.DataDisks) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &n.Name) - delete(rawMsg, key) - case "nodeResourceIds": - err = unpopulate(val, "NodeResourceIDs", &n.NodeResourceIDs) - delete(rawMsg, key) - case "nodeSku": - err = unpopulate(val, "NodeSKU", &n.NodeSKU) - delete(rawMsg, key) - case "osDisk": - err = unpopulate(val, "OSDisk", &n.OSDisk) - delete(rawMsg, key) - case "osImage": - err = unpopulate(val, "OSImage", &n.OSImage) + case "networkInterfaceName": + err = unpopulate(val, "NetworkInterfaceName", &n.NetworkInterfaceName) delete(rawMsg, key) } if err != nil { @@ -1626,7 +1838,7 @@ func (n *NodeProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OSConfiguration. func (o OSConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["osType"] = o.OSType return json.Marshal(objectMap) } @@ -1653,7 +1865,7 @@ func (o *OSConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OSProfile. func (o OSProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "adminPassword", o.AdminPassword) populate(objectMap, "adminUsername", o.AdminUsername) populate(objectMap, "osConfiguration", o.OSConfiguration) @@ -1688,7 +1900,7 @@ func (o *OSProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionType", o.ActionType) populate(objectMap, "display", o.Display) populate(objectMap, "isDataAction", o.IsDataAction) @@ -1731,7 +1943,7 @@ func (o *Operation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationDisplay. func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) @@ -1770,7 +1982,7 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationListResult. func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) @@ -1801,7 +2013,7 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationStatusResult. func (o OperationStatusResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "endTime", o.EndTime) populate(objectMap, "error", o.Error) populate(objectMap, "id", o.ID) @@ -1856,7 +2068,7 @@ func (o *OperationStatusResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationsContent. func (o OperationsContent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", o.ID) populate(objectMap, "name", o.Name) populate(objectMap, "properties", o.Properties) @@ -1899,7 +2111,7 @@ func (o *OperationsContent) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationsDefinition. func (o OperationsDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionType", o.ActionType) populate(objectMap, "display", o.Display) populate(objectMap, "isDataAction", o.IsDataAction) @@ -1946,7 +2158,7 @@ func (o *OperationsDefinition) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationsDefinitionArrayResponseWithContinuation. func (o OperationsDefinitionArrayResponseWithContinuation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) @@ -1977,7 +2189,7 @@ func (o *OperationsDefinitionArrayResponseWithContinuation) UnmarshalJSON(data [ // MarshalJSON implements the json.Marshaller interface for type OperationsDefinitionDisplay. func (o OperationsDefinitionDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) @@ -2016,7 +2228,7 @@ func (o *OperationsDefinitionDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationsDisplayDefinition. func (o OperationsDisplayDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) @@ -2053,48 +2265,9 @@ func (o *OperationsDisplayDefinition) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type OsImageProfile. -func (o OsImageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "offer", o.Offer) - populate(objectMap, "publisher", o.Publisher) - populate(objectMap, "sku", o.SKU) - populate(objectMap, "version", o.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OsImageProfile. -func (o *OsImageProfile) 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 "offer": - err = unpopulate(val, "Offer", &o.Offer) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &o.Publisher) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &o.SKU) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &o.Version) - 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 OsSapConfiguration. func (o OsSapConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "deployerVmPackages", o.DeployerVMPackages) populate(objectMap, "sapFqdn", o.SapFqdn) return json.Marshal(objectMap) @@ -2123,306 +2296,15 @@ func (o *OsSapConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PatchResourceRequestBody. -func (p PatchResourceRequestBody) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", p.Identity) - populate(objectMap, "tags", p.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchResourceRequestBody. -func (p *PatchResourceRequestBody) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identity": - err = unpopulate(val, "Identity", &p.Identity) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PatchResourceRequestBodyIdentity. -func (p PatchResourceRequestBodyIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "type", p.Type) - populate(objectMap, "userAssignedIdentities", p.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchResourceRequestBodyIdentity. -func (p *PatchResourceRequestBodyIdentity) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &p.UserAssignedIdentities) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PhpProfile. -func (p PhpProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "version", p.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PhpProfile. -func (p *PhpProfile) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "version": - err = unpopulate(val, "Version", &p.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PhpWorkloadResource. -func (p PhpWorkloadResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - populate(objectMap, "identity", p.Identity) - populate(objectMap, "kind", p.Kind) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "sku", p.SKU) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PhpWorkloadResource. -func (p *PhpWorkloadResource) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &p.Identity) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &p.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &p.SKU) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PhpWorkloadResourceIdentity. -func (p PhpWorkloadResourceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "type", p.Type) - populate(objectMap, "userAssignedIdentities", p.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PhpWorkloadResourceIdentity. -func (p *PhpWorkloadResourceIdentity) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &p.UserAssignedIdentities) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PhpWorkloadResourceList. -func (p PhpWorkloadResourceList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PhpWorkloadResourceList. -func (p *PhpWorkloadResourceList) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PhpWorkloadResourceProperties. -func (p PhpWorkloadResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "adminUserProfile", p.AdminUserProfile) - populate(objectMap, "appLocation", p.AppLocation) - populate(objectMap, "backupProfile", p.BackupProfile) - populate(objectMap, "cacheProfile", p.CacheProfile) - populate(objectMap, "controllerProfile", p.ControllerProfile) - populate(objectMap, "databaseProfile", p.DatabaseProfile) - populate(objectMap, "fileshareProfile", p.FileshareProfile) - populate(objectMap, "managedResourceGroupConfiguration", p.ManagedResourceGroupConfiguration) - populate(objectMap, "networkProfile", p.NetworkProfile) - populate(objectMap, "phpProfile", p.PhpProfile) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "searchProfile", p.SearchProfile) - populate(objectMap, "siteProfile", p.SiteProfile) - populate(objectMap, "webNodesProfile", p.WebNodesProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PhpWorkloadResourceProperties. -func (p *PhpWorkloadResourceProperties) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "adminUserProfile": - err = unpopulate(val, "AdminUserProfile", &p.AdminUserProfile) - delete(rawMsg, key) - case "appLocation": - err = unpopulate(val, "AppLocation", &p.AppLocation) - delete(rawMsg, key) - case "backupProfile": - err = unpopulate(val, "BackupProfile", &p.BackupProfile) - delete(rawMsg, key) - case "cacheProfile": - err = unpopulate(val, "CacheProfile", &p.CacheProfile) - delete(rawMsg, key) - case "controllerProfile": - err = unpopulate(val, "ControllerProfile", &p.ControllerProfile) - delete(rawMsg, key) - case "databaseProfile": - err = unpopulate(val, "DatabaseProfile", &p.DatabaseProfile) - delete(rawMsg, key) - case "fileshareProfile": - err = unpopulate(val, "FileshareProfile", &p.FileshareProfile) - delete(rawMsg, key) - case "managedResourceGroupConfiguration": - err = unpopulate(val, "ManagedResourceGroupConfiguration", &p.ManagedResourceGroupConfiguration) - delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &p.NetworkProfile) - delete(rawMsg, key) - case "phpProfile": - err = unpopulate(val, "PhpProfile", &p.PhpProfile) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "searchProfile": - err = unpopulate(val, "SearchProfile", &p.SearchProfile) - delete(rawMsg, key) - case "siteProfile": - err = unpopulate(val, "SiteProfile", &p.SiteProfile) - delete(rawMsg, key) - case "webNodesProfile": - err = unpopulate(val, "WebNodesProfile", &p.WebNodesProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type PrometheusHaClusterProviderInstanceProperties. func (p PrometheusHaClusterProviderInstanceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clusterName", p.ClusterName) populate(objectMap, "hostname", p.Hostname) populate(objectMap, "prometheusUrl", p.PrometheusURL) objectMap["providerType"] = "PrometheusHaCluster" + populate(objectMap, "sslCertificateUri", p.SSLCertificateURI) + populate(objectMap, "sslPreference", p.SSLPreference) populate(objectMap, "sid", p.Sid) return json.Marshal(objectMap) } @@ -2448,6 +2330,12 @@ func (p *PrometheusHaClusterProviderInstanceProperties) UnmarshalJSON(data []byt case "providerType": err = unpopulate(val, "ProviderType", &p.ProviderType) delete(rawMsg, key) + case "sslCertificateUri": + err = unpopulate(val, "SSLCertificateURI", &p.SSLCertificateURI) + delete(rawMsg, key) + case "sslPreference": + err = unpopulate(val, "SSLPreference", &p.SSLPreference) + delete(rawMsg, key) case "sid": err = unpopulate(val, "Sid", &p.Sid) delete(rawMsg, key) @@ -2461,9 +2349,12 @@ func (p *PrometheusHaClusterProviderInstanceProperties) UnmarshalJSON(data []byt // MarshalJSON implements the json.Marshaller interface for type PrometheusOSProviderInstanceProperties. func (p PrometheusOSProviderInstanceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "prometheusUrl", p.PrometheusURL) objectMap["providerType"] = "PrometheusOS" + populate(objectMap, "sslCertificateUri", p.SSLCertificateURI) + populate(objectMap, "sslPreference", p.SSLPreference) + populate(objectMap, "sapSid", p.SapSid) return json.Marshal(objectMap) } @@ -2482,6 +2373,15 @@ func (p *PrometheusOSProviderInstanceProperties) UnmarshalJSON(data []byte) erro case "providerType": err = unpopulate(val, "ProviderType", &p.ProviderType) delete(rawMsg, key) + case "sslCertificateUri": + err = unpopulate(val, "SSLCertificateURI", &p.SSLCertificateURI) + delete(rawMsg, key) + case "sslPreference": + err = unpopulate(val, "SSLPreference", &p.SSLPreference) + delete(rawMsg, key) + case "sapSid": + err = unpopulate(val, "SapSid", &p.SapSid) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -2492,7 +2392,7 @@ func (p *PrometheusOSProviderInstanceProperties) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type ProviderInstance. func (p ProviderInstance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "identity", p.Identity) populate(objectMap, "name", p.Name) @@ -2539,7 +2439,7 @@ func (p *ProviderInstance) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProviderInstanceListResult. func (p ProviderInstanceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) @@ -2570,7 +2470,7 @@ func (p *ProviderInstanceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProviderInstanceProperties. func (p ProviderInstanceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "errors", p.Errors) populate(objectMap, "providerSettings", p.ProviderSettings) populate(objectMap, "provisioningState", p.ProvisioningState) @@ -2605,7 +2505,7 @@ func (p *ProviderInstanceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProviderInstancePropertiesErrors. func (p ProviderInstancePropertiesErrors) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", p.Code) populate(objectMap, "details", p.Details) populate(objectMap, "innerError", p.InnerError) @@ -2648,7 +2548,7 @@ func (p *ProviderInstancePropertiesErrors) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProviderSpecificProperties. func (p ProviderSpecificProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["providerType"] = p.ProviderType return json.Marshal(objectMap) } @@ -2675,7 +2575,7 @@ func (p *ProviderSpecificProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProxyResource. func (p ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "systemData", p.SystemData) @@ -2714,7 +2614,7 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "systemData", r.SystemData) @@ -2751,40 +2651,9 @@ func (r *Resource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestrictionInfo. -func (r RestrictionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "locations", r.Locations) - populate(objectMap, "zones", r.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestrictionInfo. -func (r *RestrictionInfo) 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 "locations": - err = unpopulate(val, "Locations", &r.Locations) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &r.Zones) - 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 SAPApplicationServerInstance. func (s SAPApplicationServerInstance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) @@ -2835,7 +2704,7 @@ func (s *SAPApplicationServerInstance) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPApplicationServerInstanceList. func (s SAPApplicationServerInstanceList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -2866,7 +2735,7 @@ func (s *SAPApplicationServerInstanceList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPApplicationServerProperties. func (s SAPApplicationServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "errors", s.Errors) populate(objectMap, "gatewayPort", s.GatewayPort) populate(objectMap, "health", s.Health) @@ -2877,10 +2746,11 @@ func (s SAPApplicationServerProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "instanceNo", s.InstanceNo) populate(objectMap, "kernelPatch", s.KernelPatch) populate(objectMap, "kernelVersion", s.KernelVersion) + populate(objectMap, "loadBalancerDetails", s.LoadBalancerDetails) populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "status", s.Status) populate(objectMap, "subnet", s.Subnet) - populate(objectMap, "virtualMachineId", s.VirtualMachineID) + populate(objectMap, "vmDetails", s.VMDetails) return json.Marshal(objectMap) } @@ -2923,6 +2793,9 @@ func (s *SAPApplicationServerProperties) UnmarshalJSON(data []byte) error { case "kernelVersion": err = unpopulate(val, "KernelVersion", &s.KernelVersion) delete(rawMsg, key) + case "loadBalancerDetails": + err = unpopulate(val, "LoadBalancerDetails", &s.LoadBalancerDetails) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) @@ -2932,8 +2805,8 @@ func (s *SAPApplicationServerProperties) UnmarshalJSON(data []byte) error { case "subnet": err = unpopulate(val, "Subnet", &s.Subnet) delete(rawMsg, key) - case "virtualMachineId": - err = unpopulate(val, "VirtualMachineID", &s.VirtualMachineID) + case "vmDetails": + err = unpopulate(val, "VMDetails", &s.VMDetails) delete(rawMsg, key) } if err != nil { @@ -2945,7 +2818,7 @@ func (s *SAPApplicationServerProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPAvailabilityZoneDetailsRequest. func (s SAPAvailabilityZoneDetailsRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "appLocation", s.AppLocation) populate(objectMap, "databaseType", s.DatabaseType) populate(objectMap, "sapProduct", s.SapProduct) @@ -2980,7 +2853,7 @@ func (s *SAPAvailabilityZoneDetailsRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPAvailabilityZoneDetailsResult. func (s SAPAvailabilityZoneDetailsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "availabilityZonePairs", s.AvailabilityZonePairs) return json.Marshal(objectMap) } @@ -3007,7 +2880,7 @@ func (s *SAPAvailabilityZoneDetailsResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPAvailabilityZonePair. func (s SAPAvailabilityZonePair) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "zoneA", s.ZoneA) populate(objectMap, "zoneB", s.ZoneB) return json.Marshal(objectMap) @@ -3038,7 +2911,7 @@ func (s *SAPAvailabilityZonePair) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPCentralInstanceList. func (s SAPCentralInstanceList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -3069,7 +2942,7 @@ func (s *SAPCentralInstanceList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPCentralServerInstance. func (s SAPCentralServerInstance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) @@ -3120,7 +2993,7 @@ func (s *SAPCentralServerInstance) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPCentralServerProperties. func (s SAPCentralServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enqueueReplicationServerProperties", s.EnqueueReplicationServerProperties) populate(objectMap, "enqueueServerProperties", s.EnqueueServerProperties) populate(objectMap, "errors", s.Errors) @@ -3129,6 +3002,7 @@ func (s SAPCentralServerProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "instanceNo", s.InstanceNo) populate(objectMap, "kernelPatch", s.KernelPatch) populate(objectMap, "kernelVersion", s.KernelVersion) + populate(objectMap, "loadBalancerDetails", s.LoadBalancerDetails) populate(objectMap, "messageServerProperties", s.MessageServerProperties) populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "status", s.Status) @@ -3170,6 +3044,9 @@ func (s *SAPCentralServerProperties) UnmarshalJSON(data []byte) error { case "kernelVersion": err = unpopulate(val, "KernelVersion", &s.KernelVersion) delete(rawMsg, key) + case "loadBalancerDetails": + err = unpopulate(val, "LoadBalancerDetails", &s.LoadBalancerDetails) + delete(rawMsg, key) case "messageServerProperties": err = unpopulate(val, "MessageServerProperties", &s.MessageServerProperties) delete(rawMsg, key) @@ -3195,7 +3072,7 @@ func (s *SAPCentralServerProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPConfiguration. func (s SAPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["configurationType"] = s.ConfigurationType return json.Marshal(objectMap) } @@ -3222,7 +3099,7 @@ func (s *SAPConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPDatabaseInstance. func (s SAPDatabaseInstance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) @@ -3273,7 +3150,7 @@ func (s *SAPDatabaseInstance) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPDatabaseInstanceList. func (s SAPDatabaseInstanceList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -3304,11 +3181,12 @@ func (s *SAPDatabaseInstanceList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPDatabaseProperties. func (s SAPDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "databaseSid", s.DatabaseSid) populate(objectMap, "databaseType", s.DatabaseType) populate(objectMap, "errors", s.Errors) populate(objectMap, "ipAddress", s.IPAddress) + populate(objectMap, "loadBalancerDetails", s.LoadBalancerDetails) populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "status", s.Status) populate(objectMap, "subnet", s.Subnet) @@ -3337,6 +3215,9 @@ func (s *SAPDatabaseProperties) UnmarshalJSON(data []byte) error { case "ipAddress": err = unpopulate(val, "IPAddress", &s.IPAddress) delete(rawMsg, key) + case "loadBalancerDetails": + err = unpopulate(val, "LoadBalancerDetails", &s.LoadBalancerDetails) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) @@ -3359,14 +3240,9 @@ func (s *SAPDatabaseProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPDiskConfiguration. func (s SAPDiskConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "diskCount", s.DiskCount) - populate(objectMap, "diskIopsReadWrite", s.DiskIopsReadWrite) - populate(objectMap, "diskMBpsReadWrite", s.DiskMBpsReadWrite) - populate(objectMap, "diskSizeGB", s.DiskSizeGB) - populate(objectMap, "diskStorageType", s.DiskStorageType) - populate(objectMap, "diskType", s.DiskType) - populate(objectMap, "volume", s.Volume) + objectMap := make(map[string]any) + populate(objectMap, "recommendedConfiguration", s.RecommendedConfiguration) + populate(objectMap, "supportedConfigurations", s.SupportedConfigurations) return json.Marshal(objectMap) } @@ -3379,26 +3255,11 @@ func (s *SAPDiskConfiguration) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "diskCount": - err = unpopulate(val, "DiskCount", &s.DiskCount) - delete(rawMsg, key) - case "diskIopsReadWrite": - err = unpopulate(val, "DiskIopsReadWrite", &s.DiskIopsReadWrite) - delete(rawMsg, key) - case "diskMBpsReadWrite": - err = unpopulate(val, "DiskMBpsReadWrite", &s.DiskMBpsReadWrite) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB) + case "recommendedConfiguration": + err = unpopulate(val, "RecommendedConfiguration", &s.RecommendedConfiguration) delete(rawMsg, key) - case "diskStorageType": - err = unpopulate(val, "DiskStorageType", &s.DiskStorageType) - delete(rawMsg, key) - case "diskType": - err = unpopulate(val, "DiskType", &s.DiskType) - delete(rawMsg, key) - case "volume": - err = unpopulate(val, "Volume", &s.Volume) + case "supportedConfigurations": + err = unpopulate(val, "SupportedConfigurations", &s.SupportedConfigurations) delete(rawMsg, key) } if err != nil { @@ -3410,7 +3271,7 @@ func (s *SAPDiskConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPDiskConfigurationsRequest. func (s SAPDiskConfigurationsRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "appLocation", s.AppLocation) populate(objectMap, "databaseType", s.DatabaseType) populate(objectMap, "dbVmSku", s.DbVMSKU) @@ -3457,8 +3318,8 @@ func (s *SAPDiskConfigurationsRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPDiskConfigurationsResult. func (s SAPDiskConfigurationsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "diskConfigurations", s.DiskConfigurations) + objectMap := make(map[string]any) + populate(objectMap, "volumeConfigurations", s.VolumeConfigurations) return json.Marshal(objectMap) } @@ -3471,8 +3332,8 @@ func (s *SAPDiskConfigurationsResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "diskConfigurations": - err = unpopulate(val, "DiskConfigurations", &s.DiskConfigurations) + case "volumeConfigurations": + err = unpopulate(val, "VolumeConfigurations", &s.VolumeConfigurations) delete(rawMsg, key) } if err != nil { @@ -3484,7 +3345,7 @@ func (s *SAPDiskConfigurationsResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPInstallWithoutOSConfigSoftwareConfiguration. func (s SAPInstallWithoutOSConfigSoftwareConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "bomUrl", s.BomURL) populate(objectMap, "highAvailabilitySoftwareConfiguration", s.HighAvailabilitySoftwareConfiguration) populate(objectMap, "sapBitsStorageAccountId", s.SapBitsStorageAccountID) @@ -3527,7 +3388,7 @@ func (s *SAPInstallWithoutOSConfigSoftwareConfiguration) UnmarshalJSON(data []by // MarshalJSON implements the json.Marshaller interface for type SAPSizingRecommendationRequest. func (s SAPSizingRecommendationRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "appLocation", s.AppLocation) populate(objectMap, "databaseType", s.DatabaseType) populate(objectMap, "dbMemory", s.DbMemory) @@ -3586,7 +3447,7 @@ func (s *SAPSizingRecommendationRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPSizingRecommendationResult. func (s SAPSizingRecommendationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["deploymentType"] = s.DeploymentType return json.Marshal(objectMap) } @@ -3613,7 +3474,7 @@ func (s *SAPSizingRecommendationResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPSupportedResourceSKUsResult. func (s SAPSupportedResourceSKUsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "supportedSkus", s.SupportedSKUs) return json.Marshal(objectMap) } @@ -3640,7 +3501,7 @@ func (s *SAPSupportedResourceSKUsResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPSupportedSKU. func (s SAPSupportedSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "isAppServerCertified", s.IsAppServerCertified) populate(objectMap, "isDatabaseCertified", s.IsDatabaseCertified) populate(objectMap, "vmSku", s.VMSKU) @@ -3675,7 +3536,7 @@ func (s *SAPSupportedSKU) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPSupportedSKUsRequest. func (s SAPSupportedSKUsRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "appLocation", s.AppLocation) populate(objectMap, "databaseType", s.DatabaseType) populate(objectMap, "deploymentType", s.DeploymentType) @@ -3722,7 +3583,7 @@ func (s *SAPSupportedSKUsRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPVirtualInstance. func (s SAPVirtualInstance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) @@ -3777,7 +3638,7 @@ func (s *SAPVirtualInstance) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPVirtualInstanceError. func (s SAPVirtualInstanceError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } @@ -3804,7 +3665,7 @@ func (s *SAPVirtualInstanceError) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPVirtualInstanceList. func (s SAPVirtualInstanceList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -3835,7 +3696,7 @@ func (s *SAPVirtualInstanceList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SAPVirtualInstanceProperties. func (s SAPVirtualInstanceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "configuration", s.Configuration) populate(objectMap, "environment", s.Environment) populate(objectMap, "errors", s.Errors) @@ -3892,59 +3753,15 @@ func (s *SAPVirtualInstanceProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SKU. -func (s SKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "capacity", s.Capacity) - populate(objectMap, "family", s.Family) - populate(objectMap, "name", s.Name) - populate(objectMap, "size", s.Size) - populate(objectMap, "tier", s.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. -func (s *SKU) 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 "capacity": - err = unpopulate(val, "Capacity", &s.Capacity) - delete(rawMsg, key) - case "family": - err = unpopulate(val, "Family", &s.Family) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &s.Size) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &s.Tier) - 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 SKUCapability. -func (s SKUCapability) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", s.Name) - populate(objectMap, "value", s.Value) +// MarshalJSON implements the json.Marshaller interface for type SSHConfiguration. +func (s SSHConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "publicKeys", s.PublicKeys) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapability. -func (s *SKUCapability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SSHConfiguration. +func (s *SSHConfiguration) 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) @@ -3952,11 +3769,8 @@ func (s *SKUCapability) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "publicKeys": + err = unpopulate(val, "PublicKeys", &s.PublicKeys) delete(rawMsg, key) } if err != nil { @@ -3966,18 +3780,16 @@ func (s *SKUCapability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SKUCapacity. -func (s SKUCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "default", s.Default) - populate(objectMap, "maximum", s.Maximum) - populate(objectMap, "minimum", s.Minimum) - populate(objectMap, "scaleType", s.ScaleType) +// MarshalJSON implements the json.Marshaller interface for type SSHKeyPair. +func (s SSHKeyPair) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateKey", s.PrivateKey) + populate(objectMap, "publicKey", s.PublicKey) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapacity. -func (s *SKUCapacity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SSHKeyPair. +func (s *SSHKeyPair) 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) @@ -3985,17 +3797,11 @@ func (s *SKUCapacity) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "default": - err = unpopulate(val, "Default", &s.Default) - delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &s.Maximum) - delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &s.Minimum) + case "privateKey": + err = unpopulate(val, "PrivateKey", &s.PrivateKey) delete(rawMsg, key) - case "scaleType": - err = unpopulate(val, "ScaleType", &s.ScaleType) + case "publicKey": + err = unpopulate(val, "PublicKey", &s.PublicKey) delete(rawMsg, key) } if err != nil { @@ -4005,17 +3811,15 @@ func (s *SKUCapacity) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SKUCost. -func (s SKUCost) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedUnit", s.ExtendedUnit) - populate(objectMap, "meterId", s.MeterID) - populate(objectMap, "quantity", s.Quantity) +// MarshalJSON implements the json.Marshaller interface for type SSHPublicKey. +func (s SSHPublicKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyData", s.KeyData) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCost. -func (s *SKUCost) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKey. +func (s *SSHPublicKey) 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) @@ -4023,14 +3827,8 @@ func (s *SKUCost) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "extendedUnit": - err = unpopulate(val, "ExtendedUnit", &s.ExtendedUnit) - delete(rawMsg, key) - case "meterId": - err = unpopulate(val, "MeterID", &s.MeterID) - delete(rawMsg, key) - case "quantity": - err = unpopulate(val, "Quantity", &s.Quantity) + case "keyData": + err = unpopulate(val, "KeyData", &s.KeyData) delete(rawMsg, key) } if err != nil { @@ -4040,26 +3838,19 @@ func (s *SKUCost) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SKUDefinition. -func (s SKUDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "capabilities", s.Capabilities) - populate(objectMap, "capacity", &s.Capacity) - populate(objectMap, "costs", s.Costs) - populate(objectMap, "family", s.Family) - populate(objectMap, "kind", s.Kind) - populate(objectMap, "locationInfo", s.LocationInfo) - populate(objectMap, "locations", s.Locations) +// MarshalJSON implements the json.Marshaller interface for type SapLandscapeMonitor. +func (s SapLandscapeMonitor) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) - populate(objectMap, "resourceType", s.ResourceType) - populate(objectMap, "restrictions", s.Restrictions) - populate(objectMap, "size", s.Size) - populate(objectMap, "tier", s.Tier) + 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 SKUDefinition. -func (s *SKUDefinition) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SapLandscapeMonitor. +func (s *SapLandscapeMonitor) 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) @@ -4067,85 +3858,21 @@ func (s *SKUDefinition) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "capabilities": - err = unpopulate(val, "Capabilities", &s.Capabilities) - delete(rawMsg, key) - case "capacity": - err = unpopulate(val, "Capacity", &s.Capacity) - delete(rawMsg, key) - case "costs": - err = unpopulate(val, "Costs", &s.Costs) - delete(rawMsg, key) - case "family": - err = unpopulate(val, "Family", &s.Family) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &s.Kind) - delete(rawMsg, key) - case "locationInfo": - err = unpopulate(val, "LocationInfo", &s.LocationInfo) - delete(rawMsg, key) - case "locations": - err = unpopulate(val, "Locations", &s.Locations) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "resourceType": - err = unpopulate(val, "ResourceType", &s.ResourceType) - delete(rawMsg, key) - case "restrictions": - err = unpopulate(val, "Restrictions", &s.Restrictions) - delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &s.Size) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &s.Tier) - 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 SKULocationAndZones. -func (s SKULocationAndZones) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedLocations", s.ExtendedLocations) - populate(objectMap, "location", s.Location) - populate(objectMap, "type", s.Type) - populate(objectMap, "zoneDetails", s.ZoneDetails) - populate(objectMap, "zones", s.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SKULocationAndZones. -func (s *SKULocationAndZones) 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 "extendedLocations": - err = unpopulate(val, "ExtendedLocations", &s.ExtendedLocations) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) - case "zoneDetails": - err = unpopulate(val, "ZoneDetails", &s.ZoneDetails) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &s.Zones) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -4154,18 +3881,16 @@ func (s *SKULocationAndZones) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SKURestriction. -func (s SKURestriction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "reasonCode", s.ReasonCode) - populate(objectMap, "restrictionInfo", &s.RestrictionInfo) - populate(objectMap, "type", s.Type) - populate(objectMap, "values", s.Values) +// MarshalJSON implements the json.Marshaller interface for type SapLandscapeMonitorListResult. +func (s SapLandscapeMonitorListResult) 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 SKURestriction. -func (s *SKURestriction) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SapLandscapeMonitorListResult. +func (s *SapLandscapeMonitorListResult) 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) @@ -4173,17 +3898,11 @@ func (s *SKURestriction) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "reasonCode": - err = unpopulate(val, "ReasonCode", &s.ReasonCode) - delete(rawMsg, key) - case "restrictionInfo": - err = unpopulate(val, "RestrictionInfo", &s.RestrictionInfo) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &s.Values) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -4193,16 +3912,18 @@ func (s *SKURestriction) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SKUZoneDetail. -func (s SKUZoneDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "capabilities", s.Capabilities) - populate(objectMap, "zones", s.Zones) +// MarshalJSON implements the json.Marshaller interface for type SapLandscapeMonitorMetricThresholds. +func (s SapLandscapeMonitorMetricThresholds) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "green", s.Green) + populate(objectMap, "name", s.Name) + populate(objectMap, "red", s.Red) + populate(objectMap, "yellow", s.Yellow) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SKUZoneDetail. -func (s *SKUZoneDetail) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SapLandscapeMonitorMetricThresholds. +func (s *SapLandscapeMonitorMetricThresholds) 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) @@ -4210,42 +3931,17 @@ func (s *SKUZoneDetail) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "capabilities": - err = unpopulate(val, "Capabilities", &s.Capabilities) + case "green": + err = unpopulate(val, "Green", &s.Green) delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &s.Zones) + case "name": + err = unpopulate(val, "Name", &s.Name) 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 SKUsListResult. -func (s SKUsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SKUsListResult. -func (s *SKUsListResult) 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) + case "red": + err = unpopulate(val, "Red", &s.Red) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "yellow": + err = unpopulate(val, "Yellow", &s.Yellow) delete(rawMsg, key) } if err != nil { @@ -4255,15 +3951,17 @@ func (s *SKUsListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SSHConfiguration. -func (s SSHConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "publicKeys", s.PublicKeys) +// MarshalJSON implements the json.Marshaller interface for type SapLandscapeMonitorProperties. +func (s SapLandscapeMonitorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "grouping", s.Grouping) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "topMetricsThresholds", s.TopMetricsThresholds) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHConfiguration. -func (s *SSHConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SapLandscapeMonitorProperties. +func (s *SapLandscapeMonitorProperties) 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) @@ -4271,8 +3969,14 @@ func (s *SSHConfiguration) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "publicKeys": - err = unpopulate(val, "PublicKeys", &s.PublicKeys) + case "grouping": + err = unpopulate(val, "Grouping", &s.Grouping) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "topMetricsThresholds": + err = unpopulate(val, "TopMetricsThresholds", &s.TopMetricsThresholds) delete(rawMsg, key) } if err != nil { @@ -4282,16 +3986,16 @@ func (s *SSHConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SSHKeyPair. -func (s SSHKeyPair) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "privateKey", s.PrivateKey) - populate(objectMap, "publicKey", s.PublicKey) +// MarshalJSON implements the json.Marshaller interface for type SapLandscapeMonitorPropertiesGrouping. +func (s SapLandscapeMonitorPropertiesGrouping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "landscape", s.Landscape) + populate(objectMap, "sapApplication", s.SapApplication) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHKeyPair. -func (s *SSHKeyPair) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SapLandscapeMonitorPropertiesGrouping. +func (s *SapLandscapeMonitorPropertiesGrouping) 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) @@ -4299,11 +4003,11 @@ func (s *SSHKeyPair) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "privateKey": - err = unpopulate(val, "PrivateKey", &s.PrivateKey) + case "landscape": + err = unpopulate(val, "Landscape", &s.Landscape) delete(rawMsg, key) - case "publicKey": - err = unpopulate(val, "PublicKey", &s.PublicKey) + case "sapApplication": + err = unpopulate(val, "SapApplication", &s.SapApplication) delete(rawMsg, key) } if err != nil { @@ -4313,15 +4017,16 @@ func (s *SSHKeyPair) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKey. -func (s SSHPublicKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "keyData", s.KeyData) +// MarshalJSON implements the json.Marshaller interface for type SapLandscapeMonitorSidMapping. +func (s SapLandscapeMonitorSidMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", s.Name) + populate(objectMap, "topSid", s.TopSid) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKey. -func (s *SSHPublicKey) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SapLandscapeMonitorSidMapping. +func (s *SapLandscapeMonitorSidMapping) 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) @@ -4329,8 +4034,11 @@ func (s *SSHPublicKey) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "keyData": - err = unpopulate(val, "KeyData", &s.KeyData) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "topSid": + err = unpopulate(val, "TopSid", &s.TopSid) delete(rawMsg, key) } if err != nil { @@ -4342,8 +4050,10 @@ func (s *SSHPublicKey) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SapNetWeaverProviderInstanceProperties. func (s SapNetWeaverProviderInstanceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["providerType"] = "SapNetWeaver" + populate(objectMap, "sslCertificateUri", s.SSLCertificateURI) + populate(objectMap, "sslPreference", s.SSLPreference) populate(objectMap, "sapClientId", s.SapClientID) populate(objectMap, "sapHostFileEntries", s.SapHostFileEntries) populate(objectMap, "sapHostname", s.SapHostname) @@ -4351,7 +4061,6 @@ func (s SapNetWeaverProviderInstanceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "sapPassword", s.SapPassword) populate(objectMap, "sapPasswordUri", s.SapPasswordURI) populate(objectMap, "sapPortNumber", s.SapPortNumber) - populate(objectMap, "sapSslCertificateUri", s.SapSSLCertificateURI) populate(objectMap, "sapSid", s.SapSid) populate(objectMap, "sapUsername", s.SapUsername) return json.Marshal(objectMap) @@ -4369,6 +4078,12 @@ func (s *SapNetWeaverProviderInstanceProperties) UnmarshalJSON(data []byte) erro case "providerType": err = unpopulate(val, "ProviderType", &s.ProviderType) delete(rawMsg, key) + case "sslCertificateUri": + err = unpopulate(val, "SSLCertificateURI", &s.SSLCertificateURI) + delete(rawMsg, key) + case "sslPreference": + err = unpopulate(val, "SSLPreference", &s.SSLPreference) + delete(rawMsg, key) case "sapClientId": err = unpopulate(val, "SapClientID", &s.SapClientID) delete(rawMsg, key) @@ -4390,9 +4105,6 @@ func (s *SapNetWeaverProviderInstanceProperties) UnmarshalJSON(data []byte) erro case "sapPortNumber": err = unpopulate(val, "SapPortNumber", &s.SapPortNumber) delete(rawMsg, key) - case "sapSslCertificateUri": - err = unpopulate(val, "SapSSLCertificateURI", &s.SapSSLCertificateURI) - delete(rawMsg, key) case "sapSid": err = unpopulate(val, "SapSid", &s.SapSid) delete(rawMsg, key) @@ -4407,60 +4119,9 @@ func (s *SapNetWeaverProviderInstanceProperties) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type SearchProfile. -func (s SearchProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataDisks", s.DataDisks) - populate(objectMap, "name", s.Name) - populate(objectMap, "nodeResourceIds", s.NodeResourceIDs) - populate(objectMap, "nodeSku", s.NodeSKU) - populate(objectMap, "osDisk", s.OSDisk) - populate(objectMap, "osImage", s.OSImage) - populate(objectMap, "searchType", s.SearchType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SearchProfile. -func (s *SearchProfile) 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 "dataDisks": - err = unpopulate(val, "DataDisks", &s.DataDisks) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "nodeResourceIds": - err = unpopulate(val, "NodeResourceIDs", &s.NodeResourceIDs) - delete(rawMsg, key) - case "nodeSku": - err = unpopulate(val, "NodeSKU", &s.NodeSKU) - delete(rawMsg, key) - case "osDisk": - err = unpopulate(val, "OSDisk", &s.OSDisk) - delete(rawMsg, key) - case "osImage": - err = unpopulate(val, "OSImage", &s.OSImage) - delete(rawMsg, key) - case "searchType": - err = unpopulate(val, "SearchType", &s.SearchType) - 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 ServiceInitiatedSoftwareConfiguration. func (s ServiceInitiatedSoftwareConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "bomUrl", s.BomURL) populate(objectMap, "highAvailabilitySoftwareConfiguration", s.HighAvailabilitySoftwareConfiguration) populate(objectMap, "sshPrivateKey", s.SSHPrivateKey) @@ -4509,11 +4170,44 @@ func (s *ServiceInitiatedSoftwareConfiguration) UnmarshalJSON(data []byte) error return nil } +// MarshalJSON implements the json.Marshaller interface for type SharedStorageResourceNames. +func (s SharedStorageResourceNames) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sharedStorageAccountName", s.SharedStorageAccountName) + populate(objectMap, "sharedStorageAccountPrivateEndPointName", s.SharedStorageAccountPrivateEndPointName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedStorageResourceNames. +func (s *SharedStorageResourceNames) 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 "sharedStorageAccountName": + err = unpopulate(val, "SharedStorageAccountName", &s.SharedStorageAccountName) + delete(rawMsg, key) + case "sharedStorageAccountPrivateEndPointName": + err = unpopulate(val, "SharedStorageAccountPrivateEndPointName", &s.SharedStorageAccountPrivateEndPointName) + 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 SingleServerConfiguration. func (s SingleServerConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "appResourceGroup", s.AppResourceGroup) + populate(objectMap, "customResourceNames", s.CustomResourceNames) populate(objectMap, "databaseType", s.DatabaseType) + populate(objectMap, "dbDiskConfiguration", s.DbDiskConfiguration) objectMap["deploymentType"] = SAPDeploymentTypeSingleServer populate(objectMap, "networkConfiguration", s.NetworkConfiguration) populate(objectMap, "subnetId", s.SubnetID) @@ -4533,9 +4227,15 @@ func (s *SingleServerConfiguration) UnmarshalJSON(data []byte) error { case "appResourceGroup": err = unpopulate(val, "AppResourceGroup", &s.AppResourceGroup) delete(rawMsg, key) + case "customResourceNames": + s.CustomResourceNames, err = unmarshalSingleServerCustomResourceNamesClassification(val) + delete(rawMsg, key) case "databaseType": err = unpopulate(val, "DatabaseType", &s.DatabaseType) delete(rawMsg, key) + case "dbDiskConfiguration": + err = unpopulate(val, "DbDiskConfiguration", &s.DbDiskConfiguration) + delete(rawMsg, key) case "deploymentType": err = unpopulate(val, "DeploymentType", &s.DeploymentType) delete(rawMsg, key) @@ -4556,9 +4256,67 @@ func (s *SingleServerConfiguration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SingleServerCustomResourceNames. +func (s SingleServerCustomResourceNames) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["namingPatternType"] = s.NamingPatternType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SingleServerCustomResourceNames. +func (s *SingleServerCustomResourceNames) 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 "namingPatternType": + err = unpopulate(val, "NamingPatternType", &s.NamingPatternType) + 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 SingleServerFullResourceNames. +func (s SingleServerFullResourceNames) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["namingPatternType"] = NamingPatternTypeFullResourceName + populate(objectMap, "virtualMachine", s.VirtualMachine) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SingleServerFullResourceNames. +func (s *SingleServerFullResourceNames) 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 "namingPatternType": + err = unpopulate(val, "NamingPatternType", &s.NamingPatternType) + delete(rawMsg, key) + case "virtualMachine": + err = unpopulate(val, "VirtualMachine", &s.VirtualMachine) + 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 SingleServerRecommendationResult. func (s SingleServerRecommendationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["deploymentType"] = SAPDeploymentTypeSingleServer populate(objectMap, "vmSku", s.VMSKU) return json.Marshal(objectMap) @@ -4587,15 +4345,15 @@ func (s *SingleServerRecommendationResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SiteProfile. -func (s SiteProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "domainName", s.DomainName) +// MarshalJSON implements the json.Marshaller interface for type SkipFileShareConfiguration. +func (s SkipFileShareConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["configurationType"] = ConfigurationTypeSkip return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SiteProfile. -func (s *SiteProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SkipFileShareConfiguration. +func (s *SkipFileShareConfiguration) 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) @@ -4603,8 +4361,8 @@ func (s *SiteProfile) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "domainName": - err = unpopulate(val, "DomainName", &s.DomainName) + case "configurationType": + err = unpopulate(val, "ConfigurationType", &s.ConfigurationType) delete(rawMsg, key) } if err != nil { @@ -4616,7 +4374,7 @@ func (s *SiteProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SoftwareConfiguration. func (s SoftwareConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["softwareInstallationType"] = s.SoftwareInstallationType return json.Marshal(objectMap) } @@ -4643,8 +4401,8 @@ func (s *SoftwareConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StopRequest. func (s StopRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "hardStop", s.HardStop) + objectMap := make(map[string]any) + populate(objectMap, "softStopTimeoutSeconds", s.SoftStopTimeoutSeconds) return json.Marshal(objectMap) } @@ -4657,8 +4415,62 @@ func (s *StopRequest) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "hardStop": - err = unpopulate(val, "HardStop", &s.HardStop) + case "softStopTimeoutSeconds": + err = unpopulate(val, "SoftStopTimeoutSeconds", &s.SoftStopTimeoutSeconds) + 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 StorageConfiguration. +func (s StorageConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "transportFileShareConfiguration", s.TransportFileShareConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageConfiguration. +func (s *StorageConfiguration) 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 "transportFileShareConfiguration": + s.TransportFileShareConfiguration, err = unmarshalFileShareConfigurationClassification(val) + 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 StorageInformation. +func (s StorageInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageInformation. +func (s *StorageInformation) 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) } if err != nil { @@ -4670,7 +4482,7 @@ func (s *StopRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -4717,7 +4529,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Tags. func (t Tags) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "tags", t.Tags) return json.Marshal(objectMap) } @@ -4744,14 +4556,16 @@ func (t *Tags) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ThreeTierConfiguration. func (t ThreeTierConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "appResourceGroup", t.AppResourceGroup) populate(objectMap, "applicationServer", t.ApplicationServer) populate(objectMap, "centralServer", t.CentralServer) + populate(objectMap, "customResourceNames", t.CustomResourceNames) populate(objectMap, "databaseServer", t.DatabaseServer) objectMap["deploymentType"] = SAPDeploymentTypeThreeTier populate(objectMap, "highAvailabilityConfig", t.HighAvailabilityConfig) populate(objectMap, "networkConfiguration", t.NetworkConfiguration) + populate(objectMap, "storageConfiguration", t.StorageConfiguration) return json.Marshal(objectMap) } @@ -4773,6 +4587,9 @@ func (t *ThreeTierConfiguration) UnmarshalJSON(data []byte) error { case "centralServer": err = unpopulate(val, "CentralServer", &t.CentralServer) delete(rawMsg, key) + case "customResourceNames": + t.CustomResourceNames, err = unmarshalThreeTierCustomResourceNamesClassification(val) + delete(rawMsg, key) case "databaseServer": err = unpopulate(val, "DatabaseServer", &t.DatabaseServer) delete(rawMsg, key) @@ -4785,6 +4602,79 @@ func (t *ThreeTierConfiguration) UnmarshalJSON(data []byte) error { case "networkConfiguration": err = unpopulate(val, "NetworkConfiguration", &t.NetworkConfiguration) delete(rawMsg, key) + case "storageConfiguration": + err = unpopulate(val, "StorageConfiguration", &t.StorageConfiguration) + 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 ThreeTierCustomResourceNames. +func (t ThreeTierCustomResourceNames) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["namingPatternType"] = t.NamingPatternType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ThreeTierCustomResourceNames. +func (t *ThreeTierCustomResourceNames) 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 "namingPatternType": + err = unpopulate(val, "NamingPatternType", &t.NamingPatternType) + 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 ThreeTierFullResourceNames. +func (t ThreeTierFullResourceNames) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationServer", t.ApplicationServer) + populate(objectMap, "centralServer", t.CentralServer) + populate(objectMap, "databaseServer", t.DatabaseServer) + objectMap["namingPatternType"] = NamingPatternTypeFullResourceName + populate(objectMap, "sharedStorage", t.SharedStorage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ThreeTierFullResourceNames. +func (t *ThreeTierFullResourceNames) 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 "applicationServer": + err = unpopulate(val, "ApplicationServer", &t.ApplicationServer) + delete(rawMsg, key) + case "centralServer": + err = unpopulate(val, "CentralServer", &t.CentralServer) + delete(rawMsg, key) + case "databaseServer": + err = unpopulate(val, "DatabaseServer", &t.DatabaseServer) + delete(rawMsg, key) + case "namingPatternType": + err = unpopulate(val, "NamingPatternType", &t.NamingPatternType) + delete(rawMsg, key) + case "sharedStorage": + err = unpopulate(val, "SharedStorage", &t.SharedStorage) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) @@ -4795,7 +4685,7 @@ func (t *ThreeTierConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ThreeTierRecommendationResult. func (t ThreeTierRecommendationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "applicationServerInstanceCount", t.ApplicationServerInstanceCount) populate(objectMap, "applicationServerVmSku", t.ApplicationServerVMSKU) populate(objectMap, "centralServerInstanceCount", t.CentralServerInstanceCount) @@ -4846,7 +4736,7 @@ func (t *ThreeTierRecommendationResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) @@ -4893,7 +4783,7 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UpdateMonitorRequest. func (u UpdateMonitorRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "identity", u.Identity) populate(objectMap, "tags", u.Tags) return json.Marshal(objectMap) @@ -4924,7 +4814,7 @@ func (u *UpdateMonitorRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UpdateSAPApplicationInstanceRequest. func (u UpdateSAPApplicationInstanceRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "tags", u.Tags) return json.Marshal(objectMap) } @@ -4951,7 +4841,7 @@ func (u *UpdateSAPApplicationInstanceRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UpdateSAPCentralInstanceRequest. func (u UpdateSAPCentralInstanceRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "tags", u.Tags) return json.Marshal(objectMap) } @@ -4978,7 +4868,7 @@ func (u *UpdateSAPCentralInstanceRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UpdateSAPDatabaseInstanceRequest. func (u UpdateSAPDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "tags", u.Tags) return json.Marshal(objectMap) } @@ -5005,7 +4895,7 @@ func (u *UpdateSAPDatabaseInstanceRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UpdateSAPVirtualInstanceRequest. func (u UpdateSAPVirtualInstanceRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "identity", u.Identity) populate(objectMap, "tags", u.Tags) return json.Marshal(objectMap) @@ -5036,7 +4926,7 @@ func (u *UpdateSAPVirtualInstanceRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientId", u.ClientID) populate(objectMap, "principalId", u.PrincipalID) return json.Marshal(objectMap) @@ -5067,7 +4957,7 @@ func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UserAssignedServiceIdentity. func (u UserAssignedServiceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "type", u.Type) populate(objectMap, "userAssignedIdentities", u.UserAssignedIdentities) return json.Marshal(objectMap) @@ -5096,40 +4986,9 @@ func (u *UserAssignedServiceIdentity) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type UserProfile. -func (u UserProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "sshPublicKey", u.SSHPublicKey) - populate(objectMap, "userName", u.UserName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserProfile. -func (u *UserProfile) 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 "sshPublicKey": - err = unpopulate(val, "SSHPublicKey", &u.SSHPublicKey) - delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &u.UserName) - 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 VirtualMachineConfiguration. func (v VirtualMachineConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "imageReference", v.ImageReference) populate(objectMap, "osProfile", v.OSProfile) populate(objectMap, "vmSize", v.VMSize) @@ -5162,22 +5021,19 @@ func (v *VirtualMachineConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VmssNodesProfile. -func (v VmssNodesProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoScaleMaxCount", v.AutoScaleMaxCount) - populate(objectMap, "autoScaleMinCount", v.AutoScaleMinCount) - populate(objectMap, "dataDisks", v.DataDisks) - populate(objectMap, "name", v.Name) - populate(objectMap, "nodeResourceIds", v.NodeResourceIDs) - populate(objectMap, "nodeSku", v.NodeSKU) - populate(objectMap, "osDisk", v.OSDisk) - populate(objectMap, "osImage", v.OSImage) +// MarshalJSON implements the json.Marshaller interface for type VirtualMachineResourceNames. +func (v VirtualMachineResourceNames) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataDiskNames", v.DataDiskNames) + populate(objectMap, "hostName", v.HostName) + populate(objectMap, "networkInterfaces", v.NetworkInterfaces) + populate(objectMap, "osDiskName", v.OSDiskName) + populate(objectMap, "vmName", v.VMName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VmssNodesProfile. -func (v *VmssNodesProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineResourceNames. +func (v *VirtualMachineResourceNames) 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) @@ -5185,29 +5041,20 @@ func (v *VmssNodesProfile) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "autoScaleMaxCount": - err = unpopulate(val, "AutoScaleMaxCount", &v.AutoScaleMaxCount) - delete(rawMsg, key) - case "autoScaleMinCount": - err = unpopulate(val, "AutoScaleMinCount", &v.AutoScaleMinCount) - delete(rawMsg, key) - case "dataDisks": - err = unpopulate(val, "DataDisks", &v.DataDisks) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) + case "dataDiskNames": + err = unpopulate(val, "DataDiskNames", &v.DataDiskNames) delete(rawMsg, key) - case "nodeResourceIds": - err = unpopulate(val, "NodeResourceIDs", &v.NodeResourceIDs) + case "hostName": + err = unpopulate(val, "HostName", &v.HostName) delete(rawMsg, key) - case "nodeSku": - err = unpopulate(val, "NodeSKU", &v.NodeSKU) + case "networkInterfaces": + err = unpopulate(val, "NetworkInterfaces", &v.NetworkInterfaces) delete(rawMsg, key) - case "osDisk": - err = unpopulate(val, "OSDisk", &v.OSDisk) + case "osDiskName": + err = unpopulate(val, "OSDiskName", &v.OSDiskName) delete(rawMsg, key) - case "osImage": - err = unpopulate(val, "OSImage", &v.OSImage) + case "vmName": + err = unpopulate(val, "VMName", &v.VMName) delete(rawMsg, key) } if err != nil { @@ -5219,7 +5066,7 @@ func (v *VmssNodesProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type WindowsConfiguration. func (w WindowsConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["osType"] = OSTypeWindows return json.Marshal(objectMap) } @@ -5244,124 +5091,7 @@ func (w *WindowsConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type WordpressInstanceResource. -func (w WordpressInstanceResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", w.ID) - populate(objectMap, "name", w.Name) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "systemData", w.SystemData) - populate(objectMap, "type", w.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WordpressInstanceResource. -func (w *WordpressInstanceResource) 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 "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 "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 WordpressInstanceResourceList. -func (w WordpressInstanceResourceList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", w.NextLink) - populate(objectMap, "value", w.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WordpressInstanceResourceList. -func (w *WordpressInstanceResourceList) 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 WordpressInstanceResourceProperties. -func (w WordpressInstanceResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databaseName", w.DatabaseName) - populate(objectMap, "databaseUser", w.DatabaseUser) - populate(objectMap, "provisioningState", w.ProvisioningState) - populate(objectMap, "siteUrl", w.SiteURL) - populate(objectMap, "version", w.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WordpressInstanceResourceProperties. -func (w *WordpressInstanceResourceProperties) 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 "databaseName": - err = unpopulate(val, "DatabaseName", &w.DatabaseName) - delete(rawMsg, key) - case "databaseUser": - err = unpopulate(val, "DatabaseUser", &w.DatabaseUser) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) - delete(rawMsg, key) - case "siteUrl": - err = unpopulate(val, "SiteURL", &w.SiteURL) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &w.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -5371,7 +5101,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/sdk/resourcemanager/workloads/armworkloads/monitors_client.go b/sdk/resourcemanager/workloads/armworkloads/monitors_client.go index c60d2be7eea7..54966f777a06 100644 --- a/sdk/resourcemanager/workloads/armworkloads/monitors_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/monitors_client.go @@ -32,9 +32,9 @@ type MonitorsClient struct { } // NewMonitorsClient creates a new instance of MonitorsClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewMonitorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MonitorsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewMonitorsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a SAP monitor for the specified subscription, resource group, and resource name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// monitorName - Name of the SAP monitor resource. -// monitorParameter - Request body representing a SAP monitor -// options - MonitorsClientBeginCreateOptions contains the optional parameters for the MonitorsClient.BeginCreate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Name of the SAP monitor resource. +// - monitorParameter - Request body representing a SAP monitor +// - options - MonitorsClientBeginCreateOptions contains the optional parameters for the MonitorsClient.BeginCreate method. func (client *MonitorsClient) BeginCreate(ctx context.Context, resourceGroupName string, monitorName string, monitorParameter Monitor, options *MonitorsClientBeginCreateOptions) (*runtime.Poller[MonitorsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, monitorName, monitorParameter, options) @@ -78,7 +79,8 @@ func (client *MonitorsClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a SAP monitor for the specified subscription, resource group, and resource name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview +// +// Generated from API version 2022-11-01-preview func (client *MonitorsClient) create(ctx context.Context, resourceGroupName string, monitorName string, monitorParameter Monitor, options *MonitorsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, monitorName, monitorParameter, options) if err != nil { @@ -114,7 +116,7 @@ func (client *MonitorsClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, monitorParameter) @@ -122,17 +124,20 @@ func (client *MonitorsClient) createCreateRequest(ctx context.Context, resourceG // BeginDelete - Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// monitorName - Name of the SAP monitor resource. -// options - MonitorsClientBeginDeleteOptions contains the optional parameters for the MonitorsClient.BeginDelete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Name of the SAP monitor resource. +// - options - MonitorsClientBeginDeleteOptions contains the optional parameters for the MonitorsClient.BeginDelete method. func (client *MonitorsClient) BeginDelete(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginDeleteOptions) (*runtime.Poller[MonitorsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, monitorName, options) if err != nil { return nil, err } - return runtime.NewPoller[MonitorsClientDeleteResponse](resp, client.pl, nil) + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MonitorsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) } else { return runtime.NewPollerFromResumeToken[MonitorsClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -140,7 +145,8 @@ func (client *MonitorsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview +// +// Generated from API version 2022-11-01-preview func (client *MonitorsClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -176,7 +182,7 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,10 +190,11 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// monitorName - Name of the SAP monitor resource. -// options - MonitorsClientGetOptions contains the optional parameters for the MonitorsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Name of the SAP monitor resource. +// - options - MonitorsClientGetOptions contains the optional parameters for the MonitorsClient.Get method. func (client *MonitorsClient) Get(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientGetOptions) (MonitorsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -223,7 +230,7 @@ func (client *MonitorsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,9 +247,9 @@ func (client *MonitorsClient) getHandleResponse(resp *http.Response) (MonitorsCl // NewListPager - Gets a list of SAP monitors in the specified subscription. The operations returns various properties of // each SAP monitor. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// options - MonitorsClientListOptions contains the optional parameters for the MonitorsClient.List method. +// +// Generated from API version 2022-11-01-preview +// - options - MonitorsClientListOptions contains the optional parameters for the MonitorsClient.NewListPager method. func (client *MonitorsClient) NewListPager(options *MonitorsClientListOptions) *runtime.Pager[MonitorsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[MonitorsClientListResponse]{ More: func(page MonitorsClientListResponse) bool { @@ -283,7 +290,7 @@ func (client *MonitorsClient) listCreateRequest(ctx context.Context, options *Mo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -299,11 +306,11 @@ func (client *MonitorsClient) listHandleResponse(resp *http.Response) (MonitorsC } // NewListByResourceGroupPager - Gets a list of SAP monitors in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// options - MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.NewListByResourceGroupPager +// method. func (client *MonitorsClient) NewListByResourceGroupPager(resourceGroupName string, options *MonitorsClientListByResourceGroupOptions) *runtime.Pager[MonitorsClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[MonitorsClientListByResourceGroupResponse]{ More: func(page MonitorsClientListByResourceGroupResponse) bool { @@ -348,7 +355,7 @@ func (client *MonitorsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,11 +372,12 @@ func (client *MonitorsClient) listByResourceGroupHandleResponse(resp *http.Respo // Update - Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// monitorName - Name of the SAP monitor resource. -// body - The Update SAP workload monitor request body. -// options - MonitorsClientUpdateOptions contains the optional parameters for the MonitorsClient.Update method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Name of the SAP monitor resource. +// - body - The Update SAP workload monitor request body. +// - options - MonitorsClientUpdateOptions contains the optional parameters for the MonitorsClient.Update method. func (client *MonitorsClient) Update(ctx context.Context, resourceGroupName string, monitorName string, body UpdateMonitorRequest, options *MonitorsClientUpdateOptions) (MonitorsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, monitorName, body, options) if err != nil { @@ -405,7 +413,7 @@ func (client *MonitorsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/workloads/armworkloads/monitors_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/monitors_client_example_test.go deleted file mode 100644 index 113b95c9de9f..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/monitors_client_example_test.go +++ /dev/null @@ -1,184 +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. - -package armworkloads_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/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_List.json -func ExampleMonitorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_ListByRG.json -func ExampleMonitorsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("example-rg", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_Get.json -func ExampleMonitorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "mySapMonitor", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_Create.json -func ExampleMonitorsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "myResourceGroup", - "mySapMonitor", - armworkloads.Monitor{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - Properties: &armworkloads.MonitorProperties{ - AppLocation: to.Ptr("westus"), - LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace"), - ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - Name: to.Ptr("myManagedRg"), - }, - MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - RoutingPreference: to.Ptr(armworkloads.RoutingPreferenceRouteAll), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_Delete.json -func ExampleMonitorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "mySapMonitor", - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_PatchTags_Delete.json -func ExampleMonitorsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "myResourceGroup", - "mySapMonitor", - armworkloads.UpdateMonitorRequest{ - Identity: &armworkloads.UserAssignedServiceIdentity{ - Type: to.Ptr(armworkloads.ManagedServiceIdentityTypeNone), - }, - Tags: map[string]*string{}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/workloads/armworkloads/operations_client.go b/sdk/resourcemanager/workloads/armworkloads/operations_client.go index 1d9139eae17f..0c5a58e3e09c 100644 --- a/sdk/resourcemanager/workloads/armworkloads/operations_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/operations_client.go @@ -28,8 +28,8 @@ type OperationsClient struct { } // 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -50,9 +50,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all the available API operations under this PR -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// +// Generated from API version 2022-11-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 { @@ -89,7 +89,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/workloads/armworkloads/operations_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/operations_client_example_test.go deleted file mode 100644 index ff7705d5c349..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/operations_client_example_test.go +++ /dev/null @@ -1,41 +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. - -package armworkloads_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/phpworkloads_client.go b/sdk/resourcemanager/workloads/armworkloads/phpworkloads_client.go deleted file mode 100644 index b7cd69fd3f96..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/phpworkloads_client.go +++ /dev/null @@ -1,428 +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 armworkloads - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "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" -) - -// PhpWorkloadsClient contains the methods for the PhpWorkloads group. -// Don't use this type directly, use NewPhpWorkloadsClient() instead. -type PhpWorkloadsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewPhpWorkloadsClient creates a new instance of PhpWorkloadsClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewPhpWorkloadsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PhpWorkloadsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &PhpWorkloadsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or updated PHP workload resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// phpWorkloadName - Php workload name -// phpWorkloadResource - Resource create or update request payload -// options - PhpWorkloadsClientBeginCreateOrUpdateOptions contains the optional parameters for the PhpWorkloadsClient.BeginCreateOrUpdate -// method. -func (client *PhpWorkloadsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, phpWorkloadName string, phpWorkloadResource PhpWorkloadResource, options *PhpWorkloadsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PhpWorkloadsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, phpWorkloadName, phpWorkloadResource, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PhpWorkloadsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[PhpWorkloadsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Create or updated PHP workload resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -func (client *PhpWorkloadsClient) createOrUpdate(ctx context.Context, resourceGroupName string, phpWorkloadName string, phpWorkloadResource PhpWorkloadResource, options *PhpWorkloadsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, phpWorkloadName, phpWorkloadResource, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *PhpWorkloadsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, phpWorkloadName string, phpWorkloadResource PhpWorkloadResource, options *PhpWorkloadsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - 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 phpWorkloadName == "" { - return nil, errors.New("parameter phpWorkloadName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{phpWorkloadName}", url.PathEscape(phpWorkloadName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, phpWorkloadResource) -} - -// BeginDelete - Delete PHP workload resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// phpWorkloadName - Php workload name -// options - PhpWorkloadsClientBeginDeleteOptions contains the optional parameters for the PhpWorkloadsClient.BeginDelete -// method. -func (client *PhpWorkloadsClient) BeginDelete(ctx context.Context, resourceGroupName string, phpWorkloadName string, options *PhpWorkloadsClientBeginDeleteOptions) (*runtime.Poller[PhpWorkloadsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, phpWorkloadName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PhpWorkloadsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[PhpWorkloadsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Delete PHP workload resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -func (client *PhpWorkloadsClient) deleteOperation(ctx context.Context, resourceGroupName string, phpWorkloadName string, options *PhpWorkloadsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, phpWorkloadName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *PhpWorkloadsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, phpWorkloadName string, options *PhpWorkloadsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - 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 phpWorkloadName == "" { - return nil, errors.New("parameter phpWorkloadName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{phpWorkloadName}", url.PathEscape(phpWorkloadName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") - if options != nil && options.DeleteInfra != nil { - reqQP.Set("delete-infra", *options.DeleteInfra) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the PHP workload resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// phpWorkloadName - Php workload name -// options - PhpWorkloadsClientGetOptions contains the optional parameters for the PhpWorkloadsClient.Get method. -func (client *PhpWorkloadsClient) Get(ctx context.Context, resourceGroupName string, phpWorkloadName string, options *PhpWorkloadsClientGetOptions) (PhpWorkloadsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, phpWorkloadName, options) - if err != nil { - return PhpWorkloadsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PhpWorkloadsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PhpWorkloadsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *PhpWorkloadsClient) getCreateRequest(ctx context.Context, resourceGroupName string, phpWorkloadName string, options *PhpWorkloadsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - 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 phpWorkloadName == "" { - return nil, errors.New("parameter phpWorkloadName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{phpWorkloadName}", url.PathEscape(phpWorkloadName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-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 *PhpWorkloadsClient) getHandleResponse(resp *http.Response) (PhpWorkloadsClientGetResponse, error) { - result := PhpWorkloadsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PhpWorkloadResource); err != nil { - return PhpWorkloadsClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists PHP workload resources in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// options - PhpWorkloadsClientListByResourceGroupOptions contains the optional parameters for the PhpWorkloadsClient.ListByResourceGroup -// method. -func (client *PhpWorkloadsClient) NewListByResourceGroupPager(resourceGroupName string, options *PhpWorkloadsClientListByResourceGroupOptions) *runtime.Pager[PhpWorkloadsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[PhpWorkloadsClientListByResourceGroupResponse]{ - More: func(page PhpWorkloadsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PhpWorkloadsClientListByResourceGroupResponse) (PhpWorkloadsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PhpWorkloadsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PhpWorkloadsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PhpWorkloadsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *PhpWorkloadsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *PhpWorkloadsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads" - 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.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-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 *PhpWorkloadsClient) listByResourceGroupHandleResponse(resp *http.Response) (PhpWorkloadsClientListByResourceGroupResponse, error) { - result := PhpWorkloadsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PhpWorkloadResourceList); err != nil { - return PhpWorkloadsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists PHP workload resources for a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// options - PhpWorkloadsClientListBySubscriptionOptions contains the optional parameters for the PhpWorkloadsClient.ListBySubscription -// method. -func (client *PhpWorkloadsClient) NewListBySubscriptionPager(options *PhpWorkloadsClientListBySubscriptionOptions) *runtime.Pager[PhpWorkloadsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[PhpWorkloadsClientListBySubscriptionResponse]{ - More: func(page PhpWorkloadsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PhpWorkloadsClientListBySubscriptionResponse) (PhpWorkloadsClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PhpWorkloadsClientListBySubscriptionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PhpWorkloadsClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PhpWorkloadsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *PhpWorkloadsClient) listBySubscriptionCreateRequest(ctx context.Context, options *PhpWorkloadsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/phpWorkloads" - 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.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *PhpWorkloadsClient) listBySubscriptionHandleResponse(resp *http.Response) (PhpWorkloadsClientListBySubscriptionResponse, error) { - result := PhpWorkloadsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PhpWorkloadResourceList); err != nil { - return PhpWorkloadsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Update PHP workload resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// phpWorkloadName - Php workload name -// resourcePatchRequestBody - Workload resource update data -// options - PhpWorkloadsClientUpdateOptions contains the optional parameters for the PhpWorkloadsClient.Update method. -func (client *PhpWorkloadsClient) Update(ctx context.Context, resourceGroupName string, phpWorkloadName string, resourcePatchRequestBody PatchResourceRequestBody, options *PhpWorkloadsClientUpdateOptions) (PhpWorkloadsClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, phpWorkloadName, resourcePatchRequestBody, options) - if err != nil { - return PhpWorkloadsClientUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PhpWorkloadsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PhpWorkloadsClientUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.updateHandleResponse(resp) -} - -// updateCreateRequest creates the Update request. -func (client *PhpWorkloadsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, phpWorkloadName string, resourcePatchRequestBody PatchResourceRequestBody, options *PhpWorkloadsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - 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 phpWorkloadName == "" { - return nil, errors.New("parameter phpWorkloadName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{phpWorkloadName}", url.PathEscape(phpWorkloadName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resourcePatchRequestBody) -} - -// updateHandleResponse handles the Update response. -func (client *PhpWorkloadsClient) updateHandleResponse(resp *http.Response) (PhpWorkloadsClientUpdateResponse, error) { - result := PhpWorkloadsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PhpWorkloadResource); err != nil { - return PhpWorkloadsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/workloads/armworkloads/phpworkloads_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/phpworkloads_client_example_test.go deleted file mode 100644 index 613c8a642ef4..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/phpworkloads_client_example_test.go +++ /dev/null @@ -1,271 +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. - -package armworkloads_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/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_ListBySubscription.json -func ExamplePhpWorkloadsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewPhpWorkloadsClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_ListByResourceGroup.json -func ExamplePhpWorkloadsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewPhpWorkloadsClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("test-rg", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_Get.json -func ExamplePhpWorkloadsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewPhpWorkloadsClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "test-rg", - "wp39", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_CreateOrUpdate.json -func ExamplePhpWorkloadsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewPhpWorkloadsClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "test-rg", - "wp39", - armworkloads.PhpWorkloadResource{ - Location: to.Ptr("eastus2"), - Tags: map[string]*string{}, - Kind: to.Ptr(armworkloads.WorkloadKindWordPress), - Properties: &armworkloads.PhpWorkloadResourceProperties{ - AdminUserProfile: &armworkloads.UserProfile{ - SSHPublicKey: to.Ptr("===SSH=PUBLIC=KEY==="), - UserName: to.Ptr("wpadmin"), - }, - AppLocation: to.Ptr("eastus"), - BackupProfile: &armworkloads.BackupProfile{ - BackupEnabled: to.Ptr(armworkloads.EnableBackupDisabled), - }, - CacheProfile: &armworkloads.CacheProfile{ - Name: to.Ptr("wp-cache"), - Capacity: to.Ptr[int64](0), - Family: to.Ptr(armworkloads.RedisCacheFamilyC), - SKUName: to.Ptr("Basic"), - }, - ControllerProfile: &armworkloads.NodeProfile{ - Name: to.Ptr("contoller-vm"), - DataDisks: []*armworkloads.DiskInfo{ - { - SizeInGB: to.Ptr[int64](100), - StorageType: to.Ptr(armworkloads.DiskStorageTypePremiumLRS), - }}, - NodeSKU: to.Ptr("Standard_DS2_v2"), - OSDisk: &armworkloads.DiskInfo{ - StorageType: to.Ptr(armworkloads.DiskStorageTypePremiumLRS), - }, - OSImage: &armworkloads.OsImageProfile{ - Offer: to.Ptr(armworkloads.OSImageOfferUbuntuServer), - Publisher: to.Ptr(armworkloads.OSImagePublisherCanonical), - SKU: to.Ptr(armworkloads.OSImageSKU("18.0-LTS")), - Version: to.Ptr(armworkloads.OSImageVersionLatest), - }, - }, - DatabaseProfile: &armworkloads.DatabaseProfile{ - Type: to.Ptr(armworkloads.DatabaseTypeMySQL), - BackupRetentionDays: to.Ptr[int32](7), - HaEnabled: to.Ptr(armworkloads.HAEnabledDisabled), - ServerName: to.Ptr("wp-db-server"), - SKU: to.Ptr("Standard_D32s_v4"), - SSLEnforcementEnabled: to.Ptr(armworkloads.EnableSSLEnforcementEnabled), - StorageInGB: to.Ptr[int64](128), - StorageIops: to.Ptr[int64](200), - StorageSKU: to.Ptr("Premium_LRS"), - Tier: to.Ptr(armworkloads.DatabaseTierGeneralPurpose), - Version: to.Ptr("5.7"), - }, - FileshareProfile: &armworkloads.FileshareProfile{ - ShareSizeInGB: to.Ptr[int64](100), - ShareType: to.Ptr(armworkloads.FileShareTypeAzureFiles), - StorageType: to.Ptr(armworkloads.FileShareStorageTypePremiumLRS), - }, - ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - Name: to.Ptr("php-mrg-wp39"), - }, - NetworkProfile: &armworkloads.NetworkProfile{ - AzureFrontDoorEnabled: to.Ptr(armworkloads.AzureFrontDoorEnabledEnabled), - LoadBalancerSKU: to.Ptr("Standard"), - LoadBalancerType: to.Ptr(armworkloads.LoadBalancerTypeLoadBalancer), - }, - PhpProfile: &armworkloads.PhpProfile{ - Version: to.Ptr(armworkloads.PHPVersionSeven3), - }, - SearchProfile: &armworkloads.SearchProfile{ - NodeSKU: to.Ptr("Standard_DS2_v2"), - OSDisk: &armworkloads.DiskInfo{ - StorageType: to.Ptr(armworkloads.DiskStorageTypePremiumLRS), - }, - OSImage: &armworkloads.OsImageProfile{ - Offer: to.Ptr(armworkloads.OSImageOfferUbuntuServer), - Publisher: to.Ptr(armworkloads.OSImagePublisherCanonical), - SKU: to.Ptr(armworkloads.OSImageSKU("18.0-LTS")), - Version: to.Ptr(armworkloads.OSImageVersionLatest), - }, - SearchType: to.Ptr(armworkloads.SearchTypeElastic), - }, - SiteProfile: &armworkloads.SiteProfile{ - DomainName: to.Ptr("www.example.com"), - }, - WebNodesProfile: &armworkloads.VmssNodesProfile{ - Name: to.Ptr("web-server"), - NodeSKU: to.Ptr("Standard_DS2_v2"), - OSDisk: &armworkloads.DiskInfo{ - StorageType: to.Ptr(armworkloads.DiskStorageTypePremiumLRS), - }, - OSImage: &armworkloads.OsImageProfile{ - Offer: to.Ptr(armworkloads.OSImageOfferUbuntuServer), - Publisher: to.Ptr(armworkloads.OSImagePublisherCanonical), - SKU: to.Ptr(armworkloads.OSImageSKU("18.0-LTS")), - Version: to.Ptr(armworkloads.OSImageVersionLatest), - }, - AutoScaleMaxCount: to.Ptr[int32](1), - AutoScaleMinCount: to.Ptr[int32](1), - }, - }, - SKU: &armworkloads.SKU{ - Name: to.Ptr("Large"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_Update.json -func ExamplePhpWorkloadsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewPhpWorkloadsClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "test-rg", - "wp39", - armworkloads.PatchResourceRequestBody{ - Identity: &armworkloads.PatchResourceRequestBodyIdentity{ - Type: to.Ptr(armworkloads.ManagedServiceIdentityTypeNone), - }, - Tags: map[string]*string{ - "tag_name": to.Ptr("tag_value"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_Delete.json -func ExamplePhpWorkloadsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewPhpWorkloadsClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "test-rg", - "wp39", - &armworkloads.PhpWorkloadsClientBeginDeleteOptions{DeleteInfra: to.Ptr("false")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/polymorphic_helpers.go b/sdk/resourcemanager/workloads/armworkloads/polymorphic_helpers.go index 147d91511eeb..b61f7ff5b706 100644 --- a/sdk/resourcemanager/workloads/armworkloads/polymorphic_helpers.go +++ b/sdk/resourcemanager/workloads/armworkloads/polymorphic_helpers.go @@ -11,11 +11,33 @@ package armworkloads import "encoding/json" +func unmarshalFileShareConfigurationClassification(rawMsg json.RawMessage) (FileShareConfigurationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b FileShareConfigurationClassification + switch m["configurationType"] { + case string(ConfigurationTypeCreateAndMount): + b = &CreateAndMountFileShareConfiguration{} + case string(ConfigurationTypeMount): + b = &MountFileShareConfiguration{} + case string(ConfigurationTypeSkip): + b = &SkipFileShareConfiguration{} + default: + b = &FileShareConfiguration{} + } + return b, json.Unmarshal(rawMsg, b) +} + func unmarshalInfrastructureConfigurationClassification(rawMsg json.RawMessage) (InfrastructureConfigurationClassification, error) { if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -35,7 +57,7 @@ func unmarshalOSConfigurationClassification(rawMsg json.RawMessage) (OSConfigura if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -55,7 +77,7 @@ func unmarshalProviderSpecificPropertiesClassification(rawMsg json.RawMessage) ( if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -83,7 +105,7 @@ func unmarshalSAPConfigurationClassification(rawMsg json.RawMessage) (SAPConfigu if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -105,7 +127,7 @@ func unmarshalSAPSizingRecommendationResultClassification(rawMsg json.RawMessage if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -121,16 +143,36 @@ func unmarshalSAPSizingRecommendationResultClassification(rawMsg json.RawMessage return b, json.Unmarshal(rawMsg, b) } +func unmarshalSingleServerCustomResourceNamesClassification(rawMsg json.RawMessage) (SingleServerCustomResourceNamesClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b SingleServerCustomResourceNamesClassification + switch m["namingPatternType"] { + case string(NamingPatternTypeFullResourceName): + b = &SingleServerFullResourceNames{} + default: + b = &SingleServerCustomResourceNames{} + } + return b, json.Unmarshal(rawMsg, b) +} + func unmarshalSoftwareConfigurationClassification(rawMsg json.RawMessage) (SoftwareConfigurationClassification, error) { if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } var b SoftwareConfigurationClassification switch m["softwareInstallationType"] { + case string(SAPSoftwareInstallationTypeExternal): + b = &ExternalInstallationSoftwareConfiguration{} case string(SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig): b = &SAPInstallWithoutOSConfigSoftwareConfiguration{} case string(SAPSoftwareInstallationTypeServiceInitiated): @@ -140,3 +182,21 @@ func unmarshalSoftwareConfigurationClassification(rawMsg json.RawMessage) (Softw } return b, json.Unmarshal(rawMsg, b) } + +func unmarshalThreeTierCustomResourceNamesClassification(rawMsg json.RawMessage) (ThreeTierCustomResourceNamesClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ThreeTierCustomResourceNamesClassification + switch m["namingPatternType"] { + case string(NamingPatternTypeFullResourceName): + b = &ThreeTierFullResourceNames{} + default: + b = &ThreeTierCustomResourceNames{} + } + return b, json.Unmarshal(rawMsg, b) +} diff --git a/sdk/resourcemanager/workloads/armworkloads/providerinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/providerinstances_client.go index 55eed2586fde..ae930dbc8b08 100644 --- a/sdk/resourcemanager/workloads/armworkloads/providerinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/providerinstances_client.go @@ -32,9 +32,9 @@ type ProviderInstancesClient struct { } // NewProviderInstancesClient creates a new instance of ProviderInstancesClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProviderInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProviderInstancesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewProviderInstancesClient(subscriptionID string, credential azcore.TokenCr // BeginCreate - Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource // name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// monitorName - Name of the SAP monitor resource. -// providerInstanceName - Name of the provider instance. -// providerInstanceParameter - Request body representing a provider instance -// options - ProviderInstancesClientBeginCreateOptions contains the optional parameters for the ProviderInstancesClient.BeginCreate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Name of the SAP monitor resource. +// - providerInstanceName - Name of the provider instance. +// - providerInstanceParameter - Request body representing a provider instance +// - options - ProviderInstancesClientBeginCreateOptions contains the optional parameters for the ProviderInstancesClient.BeginCreate +// method. func (client *ProviderInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, monitorName string, providerInstanceName string, providerInstanceParameter ProviderInstance, options *ProviderInstancesClientBeginCreateOptions) (*runtime.Poller[ProviderInstancesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter, options) @@ -81,7 +82,8 @@ func (client *ProviderInstancesClient) BeginCreate(ctx context.Context, resource // Create - Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ProviderInstancesClient) create(ctx context.Context, resourceGroupName string, monitorName string, providerInstanceName string, providerInstanceParameter ProviderInstance, options *ProviderInstancesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter, options) if err != nil { @@ -121,7 +123,7 @@ func (client *ProviderInstancesClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, providerInstanceParameter) @@ -130,19 +132,22 @@ func (client *ProviderInstancesClient) createCreateRequest(ctx context.Context, // BeginDelete - Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource // name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// monitorName - Name of the SAP monitor resource. -// providerInstanceName - Name of the provider instance. -// options - ProviderInstancesClientBeginDeleteOptions contains the optional parameters for the ProviderInstancesClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Name of the SAP monitor resource. +// - providerInstanceName - Name of the provider instance. +// - options - ProviderInstancesClientBeginDeleteOptions contains the optional parameters for the ProviderInstancesClient.BeginDelete +// method. func (client *ProviderInstancesClient) BeginDelete(ctx context.Context, resourceGroupName string, monitorName string, providerInstanceName string, options *ProviderInstancesClientBeginDeleteOptions) (*runtime.Poller[ProviderInstancesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, monitorName, providerInstanceName, options) if err != nil { return nil, err } - return runtime.NewPoller[ProviderInstancesClientDeleteResponse](resp, client.pl, nil) + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ProviderInstancesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) } else { return runtime.NewPollerFromResumeToken[ProviderInstancesClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -150,7 +155,8 @@ func (client *ProviderInstancesClient) BeginDelete(ctx context.Context, resource // Delete - Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ProviderInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, providerInstanceName string, options *ProviderInstancesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, providerInstanceName, options) if err != nil { @@ -190,7 +196,7 @@ func (client *ProviderInstancesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,11 +205,12 @@ func (client *ProviderInstancesClient) deleteCreateRequest(ctx context.Context, // Get - Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource // name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// monitorName - Name of the SAP monitor resource. -// providerInstanceName - Name of the provider instance. -// options - ProviderInstancesClientGetOptions contains the optional parameters for the ProviderInstancesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Name of the SAP monitor resource. +// - providerInstanceName - Name of the provider instance. +// - options - ProviderInstancesClientGetOptions contains the optional parameters for the ProviderInstancesClient.Get method. func (client *ProviderInstancesClient) Get(ctx context.Context, resourceGroupName string, monitorName string, providerInstanceName string, options *ProviderInstancesClientGetOptions) (ProviderInstancesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, monitorName, providerInstanceName, options) if err != nil { @@ -243,7 +250,7 @@ func (client *ProviderInstancesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,11 +267,12 @@ func (client *ProviderInstancesClient) getHandleResponse(resp *http.Response) (P // NewListPager - Gets a list of provider instances in the specified SAP monitor. The operations returns various properties // of each provider instances. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// monitorName - Name of the SAP monitor resource. -// options - ProviderInstancesClientListOptions contains the optional parameters for the ProviderInstancesClient.List method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Name of the SAP monitor resource. +// - options - ProviderInstancesClientListOptions contains the optional parameters for the ProviderInstancesClient.NewListPager +// method. func (client *ProviderInstancesClient) NewListPager(resourceGroupName string, monitorName string, options *ProviderInstancesClientListOptions) *runtime.Pager[ProviderInstancesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ProviderInstancesClientListResponse]{ More: func(page ProviderInstancesClientListResponse) bool { @@ -313,7 +321,7 @@ func (client *ProviderInstancesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/workloads/armworkloads/providerinstances_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/providerinstances_client_example_test.go deleted file mode 100644 index eafb312e2c07..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/providerinstances_client_example_test.go +++ /dev/null @@ -1,135 +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. - -package armworkloads_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/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/ProviderInstances_List.json -func ExampleProviderInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", - "mySapMonitor", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/Db2ProviderInstances_Get.json -func ExampleProviderInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "mySapMonitor", - "myProviderInstance", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/Db2ProviderInstances_Create.json -func ExampleProviderInstancesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "myResourceGroup", - "mySapMonitor", - "myProviderInstance", - armworkloads.ProviderInstance{ - Properties: &armworkloads.ProviderInstanceProperties{ - ProviderSettings: &armworkloads.DB2ProviderInstanceProperties{ - ProviderType: to.Ptr("Db2"), - DbName: to.Ptr("dbName"), - DbPassword: to.Ptr("password"), - DbPasswordURI: to.Ptr(""), - DbPort: to.Ptr("dbPort"), - DbUsername: to.Ptr("username"), - Hostname: to.Ptr("hostname"), - SapSid: to.Ptr("SID"), - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/ProviderInstances_Delete.json -func ExampleProviderInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "mySapMonitor", - "myProviderInstance", - 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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/workloads/armworkloads/response_types.go b/sdk/resourcemanager/workloads/armworkloads/response_types.go index 2ba9585ecf0d..a178330ae198 100644 --- a/sdk/resourcemanager/workloads/armworkloads/response_types.go +++ b/sdk/resourcemanager/workloads/armworkloads/response_types.go @@ -39,12 +39,12 @@ type ClientSAPSupportedSKUResponse struct { SAPSupportedResourceSKUsResult } -// MonitorsClientCreateResponse contains the response from method MonitorsClient.Create. +// MonitorsClientCreateResponse contains the response from method MonitorsClient.BeginCreate. type MonitorsClientCreateResponse struct { Monitor } -// MonitorsClientDeleteResponse contains the response from method MonitorsClient.Delete. +// MonitorsClientDeleteResponse contains the response from method MonitorsClient.BeginDelete. type MonitorsClientDeleteResponse struct { OperationStatusResult } @@ -54,12 +54,12 @@ type MonitorsClientGetResponse struct { Monitor } -// MonitorsClientListByResourceGroupResponse contains the response from method MonitorsClient.ListByResourceGroup. +// MonitorsClientListByResourceGroupResponse contains the response from method MonitorsClient.NewListByResourceGroupPager. type MonitorsClientListByResourceGroupResponse struct { MonitorListResult } -// MonitorsClientListResponse contains the response from method MonitorsClient.List. +// MonitorsClientListResponse contains the response from method MonitorsClient.NewListPager. type MonitorsClientListResponse struct { MonitorListResult } @@ -69,47 +69,17 @@ type MonitorsClientUpdateResponse struct { Monitor } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationListResult } -// PhpWorkloadsClientCreateOrUpdateResponse contains the response from method PhpWorkloadsClient.CreateOrUpdate. -type PhpWorkloadsClientCreateOrUpdateResponse struct { - PhpWorkloadResource -} - -// PhpWorkloadsClientDeleteResponse contains the response from method PhpWorkloadsClient.Delete. -type PhpWorkloadsClientDeleteResponse struct { - // placeholder for future response values -} - -// PhpWorkloadsClientGetResponse contains the response from method PhpWorkloadsClient.Get. -type PhpWorkloadsClientGetResponse struct { - PhpWorkloadResource -} - -// PhpWorkloadsClientListByResourceGroupResponse contains the response from method PhpWorkloadsClient.ListByResourceGroup. -type PhpWorkloadsClientListByResourceGroupResponse struct { - PhpWorkloadResourceList -} - -// PhpWorkloadsClientListBySubscriptionResponse contains the response from method PhpWorkloadsClient.ListBySubscription. -type PhpWorkloadsClientListBySubscriptionResponse struct { - PhpWorkloadResourceList -} - -// PhpWorkloadsClientUpdateResponse contains the response from method PhpWorkloadsClient.Update. -type PhpWorkloadsClientUpdateResponse struct { - PhpWorkloadResource -} - -// ProviderInstancesClientCreateResponse contains the response from method ProviderInstancesClient.Create. +// ProviderInstancesClientCreateResponse contains the response from method ProviderInstancesClient.BeginCreate. type ProviderInstancesClientCreateResponse struct { ProviderInstance } -// ProviderInstancesClientDeleteResponse contains the response from method ProviderInstancesClient.Delete. +// ProviderInstancesClientDeleteResponse contains the response from method ProviderInstancesClient.BeginDelete. type ProviderInstancesClientDeleteResponse struct { OperationStatusResult } @@ -119,17 +89,17 @@ type ProviderInstancesClientGetResponse struct { ProviderInstance } -// ProviderInstancesClientListResponse contains the response from method ProviderInstancesClient.List. +// ProviderInstancesClientListResponse contains the response from method ProviderInstancesClient.NewListPager. type ProviderInstancesClientListResponse struct { ProviderInstanceListResult } -// SAPApplicationServerInstancesClientCreateResponse contains the response from method SAPApplicationServerInstancesClient.Create. +// SAPApplicationServerInstancesClientCreateResponse contains the response from method SAPApplicationServerInstancesClient.BeginCreate. type SAPApplicationServerInstancesClientCreateResponse struct { SAPApplicationServerInstance } -// SAPApplicationServerInstancesClientDeleteResponse contains the response from method SAPApplicationServerInstancesClient.Delete. +// SAPApplicationServerInstancesClientDeleteResponse contains the response from method SAPApplicationServerInstancesClient.BeginDelete. type SAPApplicationServerInstancesClientDeleteResponse struct { OperationStatusResult } @@ -139,22 +109,32 @@ type SAPApplicationServerInstancesClientGetResponse struct { SAPApplicationServerInstance } -// SAPApplicationServerInstancesClientListResponse contains the response from method SAPApplicationServerInstancesClient.List. +// SAPApplicationServerInstancesClientListResponse contains the response from method SAPApplicationServerInstancesClient.NewListPager. type SAPApplicationServerInstancesClientListResponse struct { SAPApplicationServerInstanceList } -// SAPApplicationServerInstancesClientUpdateResponse contains the response from method SAPApplicationServerInstancesClient.Update. +// SAPApplicationServerInstancesClientStartInstanceResponse contains the response from method SAPApplicationServerInstancesClient.BeginStartInstance. +type SAPApplicationServerInstancesClientStartInstanceResponse struct { + OperationStatusResult +} + +// SAPApplicationServerInstancesClientStopInstanceResponse contains the response from method SAPApplicationServerInstancesClient.BeginStopInstance. +type SAPApplicationServerInstancesClientStopInstanceResponse struct { + OperationStatusResult +} + +// SAPApplicationServerInstancesClientUpdateResponse contains the response from method SAPApplicationServerInstancesClient.BeginUpdate. type SAPApplicationServerInstancesClientUpdateResponse struct { SAPApplicationServerInstance } -// SAPCentralInstancesClientCreateResponse contains the response from method SAPCentralInstancesClient.Create. +// SAPCentralInstancesClientCreateResponse contains the response from method SAPCentralInstancesClient.BeginCreate. type SAPCentralInstancesClientCreateResponse struct { SAPCentralServerInstance } -// SAPCentralInstancesClientDeleteResponse contains the response from method SAPCentralInstancesClient.Delete. +// SAPCentralInstancesClientDeleteResponse contains the response from method SAPCentralInstancesClient.BeginDelete. type SAPCentralInstancesClientDeleteResponse struct { OperationStatusResult } @@ -164,22 +144,32 @@ type SAPCentralInstancesClientGetResponse struct { SAPCentralServerInstance } -// SAPCentralInstancesClientListResponse contains the response from method SAPCentralInstancesClient.List. +// SAPCentralInstancesClientListResponse contains the response from method SAPCentralInstancesClient.NewListPager. type SAPCentralInstancesClientListResponse struct { SAPCentralInstanceList } -// SAPCentralInstancesClientUpdateResponse contains the response from method SAPCentralInstancesClient.Update. +// SAPCentralInstancesClientStartInstanceResponse contains the response from method SAPCentralInstancesClient.BeginStartInstance. +type SAPCentralInstancesClientStartInstanceResponse struct { + OperationStatusResult +} + +// SAPCentralInstancesClientStopInstanceResponse contains the response from method SAPCentralInstancesClient.BeginStopInstance. +type SAPCentralInstancesClientStopInstanceResponse struct { + OperationStatusResult +} + +// SAPCentralInstancesClientUpdateResponse contains the response from method SAPCentralInstancesClient.BeginUpdate. type SAPCentralInstancesClientUpdateResponse struct { SAPCentralServerInstance } -// SAPDatabaseInstancesClientCreateResponse contains the response from method SAPDatabaseInstancesClient.Create. +// SAPDatabaseInstancesClientCreateResponse contains the response from method SAPDatabaseInstancesClient.BeginCreate. type SAPDatabaseInstancesClientCreateResponse struct { SAPDatabaseInstance } -// SAPDatabaseInstancesClientDeleteResponse contains the response from method SAPDatabaseInstancesClient.Delete. +// SAPDatabaseInstancesClientDeleteResponse contains the response from method SAPDatabaseInstancesClient.BeginDelete. type SAPDatabaseInstancesClientDeleteResponse struct { OperationStatusResult } @@ -189,22 +179,32 @@ type SAPDatabaseInstancesClientGetResponse struct { SAPDatabaseInstance } -// SAPDatabaseInstancesClientListResponse contains the response from method SAPDatabaseInstancesClient.List. +// SAPDatabaseInstancesClientListResponse contains the response from method SAPDatabaseInstancesClient.NewListPager. type SAPDatabaseInstancesClientListResponse struct { SAPDatabaseInstanceList } -// SAPDatabaseInstancesClientUpdateResponse contains the response from method SAPDatabaseInstancesClient.Update. +// SAPDatabaseInstancesClientStartInstanceResponse contains the response from method SAPDatabaseInstancesClient.BeginStartInstance. +type SAPDatabaseInstancesClientStartInstanceResponse struct { + OperationStatusResult +} + +// SAPDatabaseInstancesClientStopInstanceResponse contains the response from method SAPDatabaseInstancesClient.BeginStopInstance. +type SAPDatabaseInstancesClientStopInstanceResponse struct { + OperationStatusResult +} + +// SAPDatabaseInstancesClientUpdateResponse contains the response from method SAPDatabaseInstancesClient.BeginUpdate. type SAPDatabaseInstancesClientUpdateResponse struct { SAPDatabaseInstance } -// SAPVirtualInstancesClientCreateResponse contains the response from method SAPVirtualInstancesClient.Create. +// SAPVirtualInstancesClientCreateResponse contains the response from method SAPVirtualInstancesClient.BeginCreate. type SAPVirtualInstancesClientCreateResponse struct { SAPVirtualInstance } -// SAPVirtualInstancesClientDeleteResponse contains the response from method SAPVirtualInstancesClient.Delete. +// SAPVirtualInstancesClientDeleteResponse contains the response from method SAPVirtualInstancesClient.BeginDelete. type SAPVirtualInstancesClientDeleteResponse struct { OperationStatusResult } @@ -214,22 +214,22 @@ type SAPVirtualInstancesClientGetResponse struct { SAPVirtualInstance } -// SAPVirtualInstancesClientListByResourceGroupResponse contains the response from method SAPVirtualInstancesClient.ListByResourceGroup. +// SAPVirtualInstancesClientListByResourceGroupResponse contains the response from method SAPVirtualInstancesClient.NewListByResourceGroupPager. type SAPVirtualInstancesClientListByResourceGroupResponse struct { SAPVirtualInstanceList } -// SAPVirtualInstancesClientListBySubscriptionResponse contains the response from method SAPVirtualInstancesClient.ListBySubscription. +// SAPVirtualInstancesClientListBySubscriptionResponse contains the response from method SAPVirtualInstancesClient.NewListBySubscriptionPager. type SAPVirtualInstancesClientListBySubscriptionResponse struct { SAPVirtualInstanceList } -// SAPVirtualInstancesClientStartResponse contains the response from method SAPVirtualInstancesClient.Start. +// SAPVirtualInstancesClientStartResponse contains the response from method SAPVirtualInstancesClient.BeginStart. type SAPVirtualInstancesClientStartResponse struct { OperationStatusResult } -// SAPVirtualInstancesClientStopResponse contains the response from method SAPVirtualInstancesClient.Stop. +// SAPVirtualInstancesClientStopResponse contains the response from method SAPVirtualInstancesClient.BeginStop. type SAPVirtualInstancesClientStopResponse struct { OperationStatusResult } @@ -239,27 +239,27 @@ type SAPVirtualInstancesClientUpdateResponse struct { SAPVirtualInstance } -// SKUsClientListResponse contains the response from method SKUsClient.List. -type SKUsClientListResponse struct { - SKUsListResult +// SapLandscapeMonitorClientCreateResponse contains the response from method SapLandscapeMonitorClient.Create. +type SapLandscapeMonitorClientCreateResponse struct { + SapLandscapeMonitor } -// WordpressInstancesClientCreateOrUpdateResponse contains the response from method WordpressInstancesClient.CreateOrUpdate. -type WordpressInstancesClientCreateOrUpdateResponse struct { - WordpressInstanceResource +// SapLandscapeMonitorClientDeleteResponse contains the response from method SapLandscapeMonitorClient.Delete. +type SapLandscapeMonitorClientDeleteResponse struct { + // placeholder for future response values } -// WordpressInstancesClientDeleteResponse contains the response from method WordpressInstancesClient.Delete. -type WordpressInstancesClientDeleteResponse struct { - // placeholder for future response values +// SapLandscapeMonitorClientGetResponse contains the response from method SapLandscapeMonitorClient.Get. +type SapLandscapeMonitorClientGetResponse struct { + SapLandscapeMonitor } -// WordpressInstancesClientGetResponse contains the response from method WordpressInstancesClient.Get. -type WordpressInstancesClientGetResponse struct { - WordpressInstanceResource +// SapLandscapeMonitorClientListResponse contains the response from method SapLandscapeMonitorClient.List. +type SapLandscapeMonitorClientListResponse struct { + SapLandscapeMonitorListResult } -// WordpressInstancesClientListResponse contains the response from method WordpressInstancesClient.List. -type WordpressInstancesClientListResponse struct { - WordpressInstanceResourceList +// SapLandscapeMonitorClientUpdateResponse contains the response from method SapLandscapeMonitorClient.Update. +type SapLandscapeMonitorClientUpdateResponse struct { + SapLandscapeMonitor } diff --git a/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client.go index b447b9ba13a7..e36743bdf915 100644 --- a/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client.go @@ -32,9 +32,9 @@ type SAPApplicationServerInstancesClient struct { } // NewSAPApplicationServerInstancesClient creates a new instance of SAPApplicationServerInstancesClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSAPApplicationServerInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SAPApplicationServerInstancesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,19 +55,19 @@ func NewSAPApplicationServerInstancesClient(subscriptionID string, credential az return client, nil } -// BeginCreate - Puts the SAP Application Server Instance. +// BeginCreate - Puts the SAP Application Server Instance resource. // This will be used by service only. PUT by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// applicationInstanceName - The name of SAP Application Server instance. -// body - The SAP Application Server instance request body. -// options - SAPApplicationServerInstancesClientBeginCreateOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginCreate -// method. -func (client *SAPApplicationServerInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, body SAPApplicationServerInstance, options *SAPApplicationServerInstancesClientBeginCreateOptions) (*runtime.Poller[SAPApplicationServerInstancesClientCreateResponse], error) { +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - applicationInstanceName - The name of SAP Application Server instance resource. +// - options - SAPApplicationServerInstancesClientBeginCreateOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginCreate +// method. +func (client *SAPApplicationServerInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginCreateOptions) (*runtime.Poller[SAPApplicationServerInstancesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, options) + resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) if err != nil { return nil, err } @@ -79,12 +79,13 @@ func (client *SAPApplicationServerInstancesClient) BeginCreate(ctx context.Conte } } -// Create - Puts the SAP Application Server Instance. +// Create - Puts the SAP Application Server Instance resource. // This will be used by service only. PUT by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -func (client *SAPApplicationServerInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, body SAPApplicationServerInstance, options *SAPApplicationServerInstancesClientBeginCreateOptions) (*http.Response, error) { - req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, options) +// +// Generated from API version 2022-11-01-preview +func (client *SAPApplicationServerInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) if err != nil { return nil, err } @@ -99,7 +100,7 @@ func (client *SAPApplicationServerInstancesClient) create(ctx context.Context, r } // createCreateRequest creates the Create request. -func (client *SAPApplicationServerInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, body SAPApplicationServerInstance, options *SAPApplicationServerInstancesClientBeginCreateOptions) (*policy.Request, error) { +func (client *SAPApplicationServerInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -122,21 +123,25 @@ func (client *SAPApplicationServerInstancesClient) createCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } -// BeginDelete - Deletes the SAP Application Server Instance. +// BeginDelete - Deletes the SAP Application Server Instance resource. // This operation will be used by service only. Delete by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// applicationInstanceName - The name of SAP Application Server instance. -// options - SAPApplicationServerInstancesClientBeginDeleteOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - applicationInstanceName - The name of SAP Application Server instance resource. +// - options - SAPApplicationServerInstancesClientBeginDeleteOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginDelete +// method. func (client *SAPApplicationServerInstancesClient) BeginDelete(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginDeleteOptions) (*runtime.Poller[SAPApplicationServerInstancesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) @@ -151,10 +156,11 @@ func (client *SAPApplicationServerInstancesClient) BeginDelete(ctx context.Conte } } -// Delete - Deletes the SAP Application Server Instance. +// Delete - Deletes the SAP Application Server Instance resource. // This operation will be used by service only. Delete by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SAPApplicationServerInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) if err != nil { @@ -194,20 +200,21 @@ func (client *SAPApplicationServerInstancesClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Gets the SAP Application Server Instance. +// Get - Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// applicationInstanceName - The name of SAP Application Server instance. -// options - SAPApplicationServerInstancesClientGetOptions contains the optional parameters for the SAPApplicationServerInstancesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - applicationInstanceName - The name of SAP Application Server instance resource. +// - options - SAPApplicationServerInstancesClientGetOptions contains the optional parameters for the SAPApplicationServerInstancesClient.Get +// method. func (client *SAPApplicationServerInstancesClient) Get(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientGetOptions) (SAPApplicationServerInstancesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) if err != nil { @@ -247,7 +254,7 @@ func (client *SAPApplicationServerInstancesClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,13 +269,13 @@ func (client *SAPApplicationServerInstancesClient) getHandleResponse(resp *http. return result, nil } -// NewListPager - Lists the SAP Application server Instances in an SVI. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// options - SAPApplicationServerInstancesClientListOptions contains the optional parameters for the SAPApplicationServerInstancesClient.List -// method. +// NewListPager - Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - options - SAPApplicationServerInstancesClientListOptions contains the optional parameters for the SAPApplicationServerInstancesClient.NewListPager +// method. func (client *SAPApplicationServerInstancesClient) NewListPager(resourceGroupName string, sapVirtualInstanceName string, options *SAPApplicationServerInstancesClientListOptions) *runtime.Pager[SAPApplicationServerInstancesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SAPApplicationServerInstancesClientListResponse]{ More: func(page SAPApplicationServerInstancesClientListResponse) bool { @@ -317,7 +324,7 @@ func (client *SAPApplicationServerInstancesClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,18 +339,165 @@ func (client *SAPApplicationServerInstancesClient) listHandleResponse(resp *http return result, nil } -// BeginUpdate - Puts the SAP Application Server Instance. +// BeginStartInstance - Starts the SAP Application Server Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - applicationInstanceName - The name of SAP Application Server instance resource. +// - options - SAPApplicationServerInstancesClientBeginStartInstanceOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginStartInstance +// method. +func (client *SAPApplicationServerInstancesClient) BeginStartInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginStartInstanceOptions) (*runtime.Poller[SAPApplicationServerInstancesClientStartInstanceResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.startInstance(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPApplicationServerInstancesClientStartInstanceResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPApplicationServerInstancesClientStartInstanceResponse](options.ResumeToken, client.pl, nil) + } +} + +// StartInstance - Starts the SAP Application Server Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *SAPApplicationServerInstancesClient) startInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginStartInstanceOptions) (*http.Response, error) { + req, err := client.startInstanceCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// startInstanceCreateRequest creates the StartInstance request. +func (client *SAPApplicationServerInstancesClient) startInstanceCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginStartInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/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 sapVirtualInstanceName == "" { + return nil, errors.New("parameter sapVirtualInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sapVirtualInstanceName}", url.PathEscape(sapVirtualInstanceName)) + if applicationInstanceName == "" { + return nil, errors.New("parameter applicationInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationInstanceName}", url.PathEscape(applicationInstanceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginStopInstance - Stops the SAP Application Server Instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// applicationInstanceName - The name of SAP Application Server instance. -// body - The SAP Application Server instance request body. -// options - SAPApplicationServerInstancesClientBeginUpdateOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginUpdate -// method. -func (client *SAPApplicationServerInstancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, body UpdateSAPApplicationInstanceRequest, options *SAPApplicationServerInstancesClientBeginUpdateOptions) (*runtime.Poller[SAPApplicationServerInstancesClientUpdateResponse], error) { +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - applicationInstanceName - The name of SAP Application Server instance resource. +// - options - SAPApplicationServerInstancesClientBeginStopInstanceOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginStopInstance +// method. +func (client *SAPApplicationServerInstancesClient) BeginStopInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginStopInstanceOptions) (*runtime.Poller[SAPApplicationServerInstancesClientStopInstanceResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, options) + resp, err := client.stopInstance(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPApplicationServerInstancesClientStopInstanceResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPApplicationServerInstancesClientStopInstanceResponse](options.ResumeToken, client.pl, nil) + } +} + +// StopInstance - Stops the SAP Application Server Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *SAPApplicationServerInstancesClient) stopInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginStopInstanceOptions) (*http.Response, error) { + req, err := client.stopInstanceCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopInstanceCreateRequest creates the StopInstance request. +func (client *SAPApplicationServerInstancesClient) stopInstanceCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginStopInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/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 sapVirtualInstanceName == "" { + return nil, errors.New("parameter sapVirtualInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sapVirtualInstanceName}", url.PathEscape(sapVirtualInstanceName)) + if applicationInstanceName == "" { + return nil, errors.New("parameter applicationInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationInstanceName}", url.PathEscape(applicationInstanceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil +} + +// BeginUpdate - Puts the SAP Application Server Instance resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - applicationInstanceName - The name of SAP Application Server instance resource. +// - options - SAPApplicationServerInstancesClientBeginUpdateOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginUpdate +// method. +func (client *SAPApplicationServerInstancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginUpdateOptions) (*runtime.Poller[SAPApplicationServerInstancesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) if err != nil { return nil, err } @@ -355,11 +509,12 @@ func (client *SAPApplicationServerInstancesClient) BeginUpdate(ctx context.Conte } } -// Update - Puts the SAP Application Server Instance. +// Update - Puts the SAP Application Server Instance resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -func (client *SAPApplicationServerInstancesClient) update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, body UpdateSAPApplicationInstanceRequest, options *SAPApplicationServerInstancesClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, options) +// +// Generated from API version 2022-11-01-preview +func (client *SAPApplicationServerInstancesClient) update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) if err != nil { return nil, err } @@ -374,7 +529,7 @@ func (client *SAPApplicationServerInstancesClient) update(ctx context.Context, r } // updateCreateRequest creates the Update request. -func (client *SAPApplicationServerInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, body UpdateSAPApplicationInstanceRequest, options *SAPApplicationServerInstancesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *SAPApplicationServerInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -397,8 +552,11 @@ func (client *SAPApplicationServerInstancesClient) updateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } diff --git a/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client_example_test.go deleted file mode 100644 index 62d64d7abda8..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client_example_test.go +++ /dev/null @@ -1,158 +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. - -package armworkloads_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/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Get.json -func ExampleSAPApplicationServerInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPApplicationServerInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "test-rg", - "X00", - "app01", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Create.json -func ExampleSAPApplicationServerInstancesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPApplicationServerInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "test-rg", - "X00", - "app01", - armworkloads.SAPApplicationServerInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPApplicationServerProperties{}, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Update.json -func ExampleSAPApplicationServerInstancesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPApplicationServerInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "test-rg", - "X00", - "app01", - armworkloads.UpdateSAPApplicationInstanceRequest{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Delete.json -func ExampleSAPApplicationServerInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPApplicationServerInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "test-rg", - "X00", - "app01", - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_List.json -func ExampleSAPApplicationServerInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPApplicationServerInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("test-rg", - "X00", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client.go index 30f73802d398..b4e421349dc1 100644 --- a/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client.go @@ -32,9 +32,9 @@ type SAPCentralInstancesClient struct { } // NewSAPCentralInstancesClient creates a new instance of SAPCentralInstancesClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSAPCentralInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SAPCentralInstancesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,19 +55,19 @@ func NewSAPCentralInstancesClient(subscriptionID string, credential azcore.Token return client, nil } -// BeginCreate - Puts the SAP Central Instance. -// This will be used by service only. PUT by end user will return a Bad Request error. +// BeginCreate - Creates the SAP Central Services Instance resource. +// This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// centralInstanceName - Central Instance name string modeled as parameter for auto generation to work correctly. -// body - The SAP Central Server instance request body. -// options - SAPCentralInstancesClientBeginCreateOptions contains the optional parameters for the SAPCentralInstancesClient.BeginCreate -// method. -func (client *SAPCentralInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, body SAPCentralServerInstance, options *SAPCentralInstancesClientBeginCreateOptions) (*runtime.Poller[SAPCentralInstancesClientCreateResponse], error) { +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - centralInstanceName - Central Services Instance resource name string modeled as parameter for auto generation to work correctly. +// - options - SAPCentralInstancesClientBeginCreateOptions contains the optional parameters for the SAPCentralInstancesClient.BeginCreate +// method. +func (client *SAPCentralInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginCreateOptions) (*runtime.Poller[SAPCentralInstancesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, options) + resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) if err != nil { return nil, err } @@ -79,12 +79,13 @@ func (client *SAPCentralInstancesClient) BeginCreate(ctx context.Context, resour } } -// Create - Puts the SAP Central Instance. -// This will be used by service only. PUT by end user will return a Bad Request error. +// Create - Creates the SAP Central Services Instance resource. +// This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -func (client *SAPCentralInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, body SAPCentralServerInstance, options *SAPCentralInstancesClientBeginCreateOptions) (*http.Response, error) { - req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, options) +// +// Generated from API version 2022-11-01-preview +func (client *SAPCentralInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) if err != nil { return nil, err } @@ -99,7 +100,7 @@ func (client *SAPCentralInstancesClient) create(ctx context.Context, resourceGro } // createCreateRequest creates the Create request. -func (client *SAPCentralInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, body SAPCentralServerInstance, options *SAPCentralInstancesClientBeginCreateOptions) (*policy.Request, error) { +func (client *SAPCentralInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -122,21 +123,27 @@ func (client *SAPCentralInstancesClient) createCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } -// BeginDelete - Deletes the SAP Central Instance. -// This will be used by service only. Delete by end user will return a Bad Request error. +// BeginDelete - Deletes the SAP Central Services Instance resource. +// This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can +// delete the parent resource, which is the Virtual Instance for SAP solutions +// resource, using the delete operation on it. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// centralInstanceName - Central Instance name string modeled as parameter for auto generation to work correctly. -// options - SAPCentralInstancesClientBeginDeleteOptions contains the optional parameters for the SAPCentralInstancesClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - centralInstanceName - Central Services Instance resource name string modeled as parameter for auto generation to work correctly. +// - options - SAPCentralInstancesClientBeginDeleteOptions contains the optional parameters for the SAPCentralInstancesClient.BeginDelete +// method. func (client *SAPCentralInstancesClient) BeginDelete(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginDeleteOptions) (*runtime.Poller[SAPCentralInstancesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) @@ -151,10 +158,13 @@ func (client *SAPCentralInstancesClient) BeginDelete(ctx context.Context, resour } } -// Delete - Deletes the SAP Central Instance. -// This will be used by service only. Delete by end user will return a Bad Request error. +// Delete - Deletes the SAP Central Services Instance resource. +// This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can +// delete the parent resource, which is the Virtual Instance for SAP solutions +// resource, using the delete operation on it. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SAPCentralInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) if err != nil { @@ -194,19 +204,20 @@ func (client *SAPCentralInstancesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Gets the SAP Central Instance. +// Get - Gets the SAP Central Services Instance resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// centralInstanceName - Central Instance name string modeled as parameter for auto generation to work correctly. -// options - SAPCentralInstancesClientGetOptions contains the optional parameters for the SAPCentralInstancesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - centralInstanceName - Central Services Instance resource name string modeled as parameter for auto generation to work correctly. +// - options - SAPCentralInstancesClientGetOptions contains the optional parameters for the SAPCentralInstancesClient.Get method. func (client *SAPCentralInstancesClient) Get(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientGetOptions) (SAPCentralInstancesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) if err != nil { @@ -246,7 +257,7 @@ func (client *SAPCentralInstancesClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -261,13 +272,13 @@ func (client *SAPCentralInstancesClient) getHandleResponse(resp *http.Response) return result, nil } -// NewListPager - Lists the SAP Central Instances in an SVI. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// options - SAPCentralInstancesClientListOptions contains the optional parameters for the SAPCentralInstancesClient.List -// method. +// NewListPager - Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - options - SAPCentralInstancesClientListOptions contains the optional parameters for the SAPCentralInstancesClient.NewListPager +// method. func (client *SAPCentralInstancesClient) NewListPager(resourceGroupName string, sapVirtualInstanceName string, options *SAPCentralInstancesClientListOptions) *runtime.Pager[SAPCentralInstancesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SAPCentralInstancesClientListResponse]{ More: func(page SAPCentralInstancesClientListResponse) bool { @@ -316,7 +327,7 @@ func (client *SAPCentralInstancesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,19 +342,166 @@ func (client *SAPCentralInstancesClient) listHandleResponse(resp *http.Response) return result, nil } -// BeginUpdate - Updates the SAP Central Instance. -// This can be used to update tags. +// BeginStartInstance - Starts the SAP Central Services Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - centralInstanceName - Central Services Instance resource name string modeled as parameter for auto generation to work correctly. +// - options - SAPCentralInstancesClientBeginStartInstanceOptions contains the optional parameters for the SAPCentralInstancesClient.BeginStartInstance +// method. +func (client *SAPCentralInstancesClient) BeginStartInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginStartInstanceOptions) (*runtime.Poller[SAPCentralInstancesClientStartInstanceResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.startInstance(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPCentralInstancesClientStartInstanceResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPCentralInstancesClientStartInstanceResponse](options.ResumeToken, client.pl, nil) + } +} + +// StartInstance - Starts the SAP Central Services Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *SAPCentralInstancesClient) startInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginStartInstanceOptions) (*http.Response, error) { + req, err := client.startInstanceCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// startInstanceCreateRequest creates the StartInstance request. +func (client *SAPCentralInstancesClient) startInstanceCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginStartInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/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 sapVirtualInstanceName == "" { + return nil, errors.New("parameter sapVirtualInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sapVirtualInstanceName}", url.PathEscape(sapVirtualInstanceName)) + if centralInstanceName == "" { + return nil, errors.New("parameter centralInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{centralInstanceName}", url.PathEscape(centralInstanceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginStopInstance - Stops the SAP Central Services Instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// centralInstanceName - Central Instance name string modeled as parameter for auto generation to work correctly. -// body - The SAP Central Server instance request body. -// options - SAPCentralInstancesClientBeginUpdateOptions contains the optional parameters for the SAPCentralInstancesClient.BeginUpdate -// method. -func (client *SAPCentralInstancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, body UpdateSAPCentralInstanceRequest, options *SAPCentralInstancesClientBeginUpdateOptions) (*runtime.Poller[SAPCentralInstancesClientUpdateResponse], error) { +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - centralInstanceName - Central Services Instance resource name string modeled as parameter for auto generation to work correctly. +// - options - SAPCentralInstancesClientBeginStopInstanceOptions contains the optional parameters for the SAPCentralInstancesClient.BeginStopInstance +// method. +func (client *SAPCentralInstancesClient) BeginStopInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginStopInstanceOptions) (*runtime.Poller[SAPCentralInstancesClientStopInstanceResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, options) + resp, err := client.stopInstance(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPCentralInstancesClientStopInstanceResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPCentralInstancesClientStopInstanceResponse](options.ResumeToken, client.pl, nil) + } +} + +// StopInstance - Stops the SAP Central Services Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *SAPCentralInstancesClient) stopInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginStopInstanceOptions) (*http.Response, error) { + req, err := client.stopInstanceCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopInstanceCreateRequest creates the StopInstance request. +func (client *SAPCentralInstancesClient) stopInstanceCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginStopInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/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 sapVirtualInstanceName == "" { + return nil, errors.New("parameter sapVirtualInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sapVirtualInstanceName}", url.PathEscape(sapVirtualInstanceName)) + if centralInstanceName == "" { + return nil, errors.New("parameter centralInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{centralInstanceName}", url.PathEscape(centralInstanceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil +} + +// BeginUpdate - Updates the SAP Central Services Instance resource. +// This can be used to update tags on the resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - centralInstanceName - Central Services Instance resource name string modeled as parameter for auto generation to work correctly. +// - options - SAPCentralInstancesClientBeginUpdateOptions contains the optional parameters for the SAPCentralInstancesClient.BeginUpdate +// method. +func (client *SAPCentralInstancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginUpdateOptions) (*runtime.Poller[SAPCentralInstancesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) if err != nil { return nil, err } @@ -355,12 +513,13 @@ func (client *SAPCentralInstancesClient) BeginUpdate(ctx context.Context, resour } } -// Update - Updates the SAP Central Instance. -// This can be used to update tags. +// Update - Updates the SAP Central Services Instance resource. +// This can be used to update tags on the resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -func (client *SAPCentralInstancesClient) update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, body UpdateSAPCentralInstanceRequest, options *SAPCentralInstancesClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, options) +// +// Generated from API version 2022-11-01-preview +func (client *SAPCentralInstancesClient) update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) if err != nil { return nil, err } @@ -375,7 +534,7 @@ func (client *SAPCentralInstancesClient) update(ctx context.Context, resourceGro } // updateCreateRequest creates the Update request. -func (client *SAPCentralInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, body UpdateSAPCentralInstanceRequest, options *SAPCentralInstancesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *SAPCentralInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -398,8 +557,11 @@ func (client *SAPCentralInstancesClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } diff --git a/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client_example_test.go deleted file mode 100644 index 90a0f52b96b7..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client_example_test.go +++ /dev/null @@ -1,158 +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. - -package armworkloads_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/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Get.json -func ExampleSAPCentralInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPCentralInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "test-rg", - "X00", - "centralServer", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Create.json -func ExampleSAPCentralInstancesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPCentralInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "test-rg", - "X00", - "centralServer", - armworkloads.SAPCentralServerInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPCentralServerProperties{}, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Update.json -func ExampleSAPCentralInstancesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPCentralInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "test-rg", - "X00", - "centralServer", - armworkloads.UpdateSAPCentralInstanceRequest{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Delete.json -func ExampleSAPCentralInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPCentralInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "test-rg", - "X00", - "centralServer", - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPCentralInstances_List.json -func ExampleSAPCentralInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPCentralInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("test-rg", - "X00", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client.go index a2ef7e5a4e81..0145ad3bdf22 100644 --- a/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client.go @@ -32,9 +32,9 @@ type SAPDatabaseInstancesClient struct { } // NewSAPDatabaseInstancesClient creates a new instance of SAPDatabaseInstancesClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSAPDatabaseInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SAPDatabaseInstancesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,19 +55,19 @@ func NewSAPDatabaseInstancesClient(subscriptionID string, credential azcore.Toke return client, nil } -// BeginCreate - Puts the SAP Database Instance. +// BeginCreate - Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. // This will be used by service only. PUT by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// databaseInstanceName - Database Instance string modeled as parameter for auto generation to work correctly. -// body - The SAP Database Server instance request body. -// options - SAPDatabaseInstancesClientBeginCreateOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginCreate -// method. -func (client *SAPDatabaseInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, body SAPDatabaseInstance, options *SAPDatabaseInstancesClientBeginCreateOptions) (*runtime.Poller[SAPDatabaseInstancesClientCreateResponse], error) { +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - databaseInstanceName - Database resource name string modeled as parameter for auto generation to work correctly. +// - options - SAPDatabaseInstancesClientBeginCreateOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginCreate +// method. +func (client *SAPDatabaseInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginCreateOptions) (*runtime.Poller[SAPDatabaseInstancesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, options) + resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) if err != nil { return nil, err } @@ -79,12 +79,13 @@ func (client *SAPDatabaseInstancesClient) BeginCreate(ctx context.Context, resou } } -// Create - Puts the SAP Database Instance. +// Create - Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. // This will be used by service only. PUT by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -func (client *SAPDatabaseInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, body SAPDatabaseInstance, options *SAPDatabaseInstancesClientBeginCreateOptions) (*http.Response, error) { - req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, options) +// +// Generated from API version 2022-11-01-preview +func (client *SAPDatabaseInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) if err != nil { return nil, err } @@ -99,7 +100,7 @@ func (client *SAPDatabaseInstancesClient) create(ctx context.Context, resourceGr } // createCreateRequest creates the Create request. -func (client *SAPDatabaseInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, body SAPDatabaseInstance, options *SAPDatabaseInstancesClientBeginCreateOptions) (*policy.Request, error) { +func (client *SAPDatabaseInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -122,21 +123,25 @@ func (client *SAPDatabaseInstancesClient) createCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } -// BeginDelete - Deletes the SAP Database Instance. +// BeginDelete - Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. // This will be used by service only. Delete by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// databaseInstanceName - Database Instance string modeled as parameter for auto generation to work correctly. -// options - SAPDatabaseInstancesClientBeginDeleteOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - databaseInstanceName - Database resource name string modeled as parameter for auto generation to work correctly. +// - options - SAPDatabaseInstancesClientBeginDeleteOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginDelete +// method. func (client *SAPDatabaseInstancesClient) BeginDelete(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginDeleteOptions) (*runtime.Poller[SAPDatabaseInstancesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) @@ -151,10 +156,11 @@ func (client *SAPDatabaseInstancesClient) BeginDelete(ctx context.Context, resou } } -// Delete - Deletes the SAP Database Instance. +// Delete - Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. // This will be used by service only. Delete by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SAPDatabaseInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) if err != nil { @@ -194,20 +200,21 @@ func (client *SAPDatabaseInstancesClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Gets the SAP Database Instance. +// Get - Gets the SAP Database Instance resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// databaseInstanceName - Database Instance string modeled as parameter for auto generation to work correctly. -// options - SAPDatabaseInstancesClientGetOptions contains the optional parameters for the SAPDatabaseInstancesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - databaseInstanceName - Database resource name string modeled as parameter for auto generation to work correctly. +// - options - SAPDatabaseInstancesClientGetOptions contains the optional parameters for the SAPDatabaseInstancesClient.Get +// method. func (client *SAPDatabaseInstancesClient) Get(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientGetOptions) (SAPDatabaseInstancesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) if err != nil { @@ -247,7 +254,7 @@ func (client *SAPDatabaseInstancesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,13 +269,13 @@ func (client *SAPDatabaseInstancesClient) getHandleResponse(resp *http.Response) return result, nil } -// NewListPager - Lists the SAP Database Instances in an SVI. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// options - SAPDatabaseInstancesClientListOptions contains the optional parameters for the SAPDatabaseInstancesClient.List -// method. +// NewListPager - Lists the Database resources associated with a Virtual Instance for SAP solutions resource. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - options - SAPDatabaseInstancesClientListOptions contains the optional parameters for the SAPDatabaseInstancesClient.NewListPager +// method. func (client *SAPDatabaseInstancesClient) NewListPager(resourceGroupName string, sapVirtualInstanceName string, options *SAPDatabaseInstancesClientListOptions) *runtime.Pager[SAPDatabaseInstancesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SAPDatabaseInstancesClientListResponse]{ More: func(page SAPDatabaseInstancesClientListResponse) bool { @@ -317,7 +324,7 @@ func (client *SAPDatabaseInstancesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,18 +339,165 @@ func (client *SAPDatabaseInstancesClient) listHandleResponse(resp *http.Response return result, nil } -// BeginUpdate - Puts the SAP Database Instance. +// BeginStartInstance - Starts the database instance of the SAP system. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - databaseInstanceName - Database resource name string modeled as parameter for auto generation to work correctly. +// - options - SAPDatabaseInstancesClientBeginStartInstanceOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginStartInstance +// method. +func (client *SAPDatabaseInstancesClient) BeginStartInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginStartInstanceOptions) (*runtime.Poller[SAPDatabaseInstancesClientStartInstanceResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.startInstance(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPDatabaseInstancesClientStartInstanceResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPDatabaseInstancesClientStartInstanceResponse](options.ResumeToken, client.pl, nil) + } +} + +// StartInstance - Starts the database instance of the SAP system. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *SAPDatabaseInstancesClient) startInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginStartInstanceOptions) (*http.Response, error) { + req, err := client.startInstanceCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// startInstanceCreateRequest creates the StartInstance request. +func (client *SAPDatabaseInstancesClient) startInstanceCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginStartInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/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 sapVirtualInstanceName == "" { + return nil, errors.New("parameter sapVirtualInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sapVirtualInstanceName}", url.PathEscape(sapVirtualInstanceName)) + if databaseInstanceName == "" { + return nil, errors.New("parameter databaseInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseInstanceName}", url.PathEscape(databaseInstanceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginStopInstance - Stops the database instance of the SAP system. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// databaseInstanceName - Database Instance string modeled as parameter for auto generation to work correctly. -// body - The SAP Database Server instance request body. -// options - SAPDatabaseInstancesClientBeginUpdateOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginUpdate -// method. -func (client *SAPDatabaseInstancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, body UpdateSAPDatabaseInstanceRequest, options *SAPDatabaseInstancesClientBeginUpdateOptions) (*runtime.Poller[SAPDatabaseInstancesClientUpdateResponse], error) { +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - databaseInstanceName - Database resource name string modeled as parameter for auto generation to work correctly. +// - options - SAPDatabaseInstancesClientBeginStopInstanceOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginStopInstance +// method. +func (client *SAPDatabaseInstancesClient) BeginStopInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginStopInstanceOptions) (*runtime.Poller[SAPDatabaseInstancesClientStopInstanceResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, options) + resp, err := client.stopInstance(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPDatabaseInstancesClientStopInstanceResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPDatabaseInstancesClientStopInstanceResponse](options.ResumeToken, client.pl, nil) + } +} + +// StopInstance - Stops the database instance of the SAP system. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *SAPDatabaseInstancesClient) stopInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginStopInstanceOptions) (*http.Response, error) { + req, err := client.stopInstanceCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopInstanceCreateRequest creates the StopInstance request. +func (client *SAPDatabaseInstancesClient) stopInstanceCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginStopInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/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 sapVirtualInstanceName == "" { + return nil, errors.New("parameter sapVirtualInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sapVirtualInstanceName}", url.PathEscape(sapVirtualInstanceName)) + if databaseInstanceName == "" { + return nil, errors.New("parameter databaseInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseInstanceName}", url.PathEscape(databaseInstanceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil +} + +// BeginUpdate - Updates the Database resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - databaseInstanceName - Database resource name string modeled as parameter for auto generation to work correctly. +// - options - SAPDatabaseInstancesClientBeginUpdateOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginUpdate +// method. +func (client *SAPDatabaseInstancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginUpdateOptions) (*runtime.Poller[SAPDatabaseInstancesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) if err != nil { return nil, err } @@ -355,11 +509,12 @@ func (client *SAPDatabaseInstancesClient) BeginUpdate(ctx context.Context, resou } } -// Update - Puts the SAP Database Instance. +// Update - Updates the Database resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -func (client *SAPDatabaseInstancesClient) update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, body UpdateSAPDatabaseInstanceRequest, options *SAPDatabaseInstancesClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, options) +// +// Generated from API version 2022-11-01-preview +func (client *SAPDatabaseInstancesClient) update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) if err != nil { return nil, err } @@ -374,7 +529,7 @@ func (client *SAPDatabaseInstancesClient) update(ctx context.Context, resourceGr } // updateCreateRequest creates the Update request. -func (client *SAPDatabaseInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, body UpdateSAPDatabaseInstanceRequest, options *SAPDatabaseInstancesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *SAPDatabaseInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -397,8 +552,11 @@ func (client *SAPDatabaseInstancesClient) updateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } diff --git a/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client_example_test.go deleted file mode 100644 index 6d2c02371e5c..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client_example_test.go +++ /dev/null @@ -1,158 +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. - -package armworkloads_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/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Get.json -func ExampleSAPDatabaseInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPDatabaseInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "test-rg", - "X00", - "databaseServer", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Create.json -func ExampleSAPDatabaseInstancesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPDatabaseInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "test-rg", - "X00", - "databaseServer", - armworkloads.SAPDatabaseInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPDatabaseProperties{}, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Update.json -func ExampleSAPDatabaseInstancesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPDatabaseInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "test-rg", - "X00", - "databaseServer", - armworkloads.UpdateSAPDatabaseInstanceRequest{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Delete.json -func ExampleSAPDatabaseInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPDatabaseInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "test-rg", - "X00", - "databaseServer", - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_List.json -func ExampleSAPDatabaseInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPDatabaseInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("test-rg", - "X00", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/saplandscapemonitor_client.go b/sdk/resourcemanager/workloads/armworkloads/saplandscapemonitor_client.go new file mode 100644 index 000000000000..7836aa4bf5a9 --- /dev/null +++ b/sdk/resourcemanager/workloads/armworkloads/saplandscapemonitor_client.go @@ -0,0 +1,340 @@ +//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 armworkloads + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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" +) + +// SapLandscapeMonitorClient contains the methods for the SapLandscapeMonitor group. +// Don't use this type directly, use NewSapLandscapeMonitorClient() instead. +type SapLandscapeMonitorClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewSapLandscapeMonitorClient creates a new instance of SapLandscapeMonitorClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSapLandscapeMonitorClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SapLandscapeMonitorClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &SapLandscapeMonitorClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Create - Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Name of the SAP monitor resource. +// - sapLandscapeMonitorParameter - Request body representing a configuration for Sap Landscape Monitor Dashboard +// - options - SapLandscapeMonitorClientCreateOptions contains the optional parameters for the SapLandscapeMonitorClient.Create +// method. +func (client *SapLandscapeMonitorClient) Create(ctx context.Context, resourceGroupName string, monitorName string, sapLandscapeMonitorParameter SapLandscapeMonitor, options *SapLandscapeMonitorClientCreateOptions) (SapLandscapeMonitorClientCreateResponse, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, monitorName, sapLandscapeMonitorParameter, options) + if err != nil { + return SapLandscapeMonitorClientCreateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SapLandscapeMonitorClientCreateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return SapLandscapeMonitorClientCreateResponse{}, runtime.NewResponseError(resp) + } + return client.createHandleResponse(resp) +} + +// createCreateRequest creates the Create request. +func (client *SapLandscapeMonitorClient) createCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, sapLandscapeMonitorParameter SapLandscapeMonitor, options *SapLandscapeMonitorClientCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default" + 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 monitorName == "" { + return nil, errors.New("parameter monitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{monitorName}", url.PathEscape(monitorName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, sapLandscapeMonitorParameter) +} + +// createHandleResponse handles the Create response. +func (client *SapLandscapeMonitorClient) createHandleResponse(resp *http.Response) (SapLandscapeMonitorClientCreateResponse, error) { + result := SapLandscapeMonitorClientCreateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SapLandscapeMonitor); err != nil { + return SapLandscapeMonitorClientCreateResponse{}, err + } + return result, nil +} + +// Delete - Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Name of the SAP monitor resource. +// - options - SapLandscapeMonitorClientDeleteOptions contains the optional parameters for the SapLandscapeMonitorClient.Delete +// method. +func (client *SapLandscapeMonitorClient) Delete(ctx context.Context, resourceGroupName string, monitorName string, options *SapLandscapeMonitorClientDeleteOptions) (SapLandscapeMonitorClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, options) + if err != nil { + return SapLandscapeMonitorClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SapLandscapeMonitorClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return SapLandscapeMonitorClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return SapLandscapeMonitorClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SapLandscapeMonitorClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, options *SapLandscapeMonitorClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default" + 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 monitorName == "" { + return nil, errors.New("parameter monitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{monitorName}", url.PathEscape(monitorName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, +// and resource name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Name of the SAP monitor resource. +// - options - SapLandscapeMonitorClientGetOptions contains the optional parameters for the SapLandscapeMonitorClient.Get method. +func (client *SapLandscapeMonitorClient) Get(ctx context.Context, resourceGroupName string, monitorName string, options *SapLandscapeMonitorClientGetOptions) (SapLandscapeMonitorClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, monitorName, options) + if err != nil { + return SapLandscapeMonitorClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SapLandscapeMonitorClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SapLandscapeMonitorClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SapLandscapeMonitorClient) getCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, options *SapLandscapeMonitorClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default" + 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 monitorName == "" { + return nil, errors.New("parameter monitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{monitorName}", url.PathEscape(monitorName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-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 *SapLandscapeMonitorClient) getHandleResponse(resp *http.Response) (SapLandscapeMonitorClientGetResponse, error) { + result := SapLandscapeMonitorClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SapLandscapeMonitor); err != nil { + return SapLandscapeMonitorClientGetResponse{}, err + } + return result, nil +} + +// List - Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, +// and resource name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Name of the SAP monitor resource. +// - options - SapLandscapeMonitorClientListOptions contains the optional parameters for the SapLandscapeMonitorClient.List +// method. +func (client *SapLandscapeMonitorClient) List(ctx context.Context, resourceGroupName string, monitorName string, options *SapLandscapeMonitorClientListOptions) (SapLandscapeMonitorClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, monitorName, options) + if err != nil { + return SapLandscapeMonitorClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SapLandscapeMonitorClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SapLandscapeMonitorClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *SapLandscapeMonitorClient) listCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, options *SapLandscapeMonitorClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor" + 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 monitorName == "" { + return nil, errors.New("parameter monitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{monitorName}", url.PathEscape(monitorName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-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 *SapLandscapeMonitorClient) listHandleResponse(resp *http.Response) (SapLandscapeMonitorClientListResponse, error) { + result := SapLandscapeMonitorClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SapLandscapeMonitorListResult); err != nil { + return SapLandscapeMonitorClientListResponse{}, err + } + return result, nil +} + +// Update - Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Name of the SAP monitor resource. +// - sapLandscapeMonitorParameter - Request body representing a configuration for Sap Landscape Monitor Dashboard +// - options - SapLandscapeMonitorClientUpdateOptions contains the optional parameters for the SapLandscapeMonitorClient.Update +// method. +func (client *SapLandscapeMonitorClient) Update(ctx context.Context, resourceGroupName string, monitorName string, sapLandscapeMonitorParameter SapLandscapeMonitor, options *SapLandscapeMonitorClientUpdateOptions) (SapLandscapeMonitorClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, monitorName, sapLandscapeMonitorParameter, options) + if err != nil { + return SapLandscapeMonitorClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SapLandscapeMonitorClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SapLandscapeMonitorClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *SapLandscapeMonitorClient) updateCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, sapLandscapeMonitorParameter SapLandscapeMonitor, options *SapLandscapeMonitorClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default" + 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 monitorName == "" { + return nil, errors.New("parameter monitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{monitorName}", url.PathEscape(monitorName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, sapLandscapeMonitorParameter) +} + +// updateHandleResponse handles the Update response. +func (client *SapLandscapeMonitorClient) updateHandleResponse(resp *http.Response) (SapLandscapeMonitorClientUpdateResponse, error) { + result := SapLandscapeMonitorClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SapLandscapeMonitor); err != nil { + return SapLandscapeMonitorClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client.go index 0c9e43dbf3f9..ce17c2b6e21b 100644 --- a/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client.go @@ -32,9 +32,9 @@ type SAPVirtualInstancesClient struct { } // NewSAPVirtualInstancesClient creates a new instance of SAPVirtualInstancesClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSAPVirtualInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SAPVirtualInstancesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,17 +55,17 @@ func NewSAPVirtualInstancesClient(subscriptionID string, credential azcore.Token return client, nil } -// BeginCreate - Creates an Virtual Instance for SAP. +// BeginCreate - Creates a Virtual Instance for SAP solutions (VIS) resource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// body - The Virtual Instance for SAP request body. -// options - SAPVirtualInstancesClientBeginCreateOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginCreate -// method. -func (client *SAPVirtualInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, body SAPVirtualInstance, options *SAPVirtualInstancesClientBeginCreateOptions) (*runtime.Poller[SAPVirtualInstancesClientCreateResponse], error) { +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - options - SAPVirtualInstancesClientBeginCreateOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginCreate +// method. +func (client *SAPVirtualInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginCreateOptions) (*runtime.Poller[SAPVirtualInstancesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, body, options) + resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, options) if err != nil { return nil, err } @@ -77,11 +77,12 @@ func (client *SAPVirtualInstancesClient) BeginCreate(ctx context.Context, resour } } -// Create - Creates an Virtual Instance for SAP. +// Create - Creates a Virtual Instance for SAP solutions (VIS) resource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -func (client *SAPVirtualInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, body SAPVirtualInstance, options *SAPVirtualInstancesClientBeginCreateOptions) (*http.Response, error) { - req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, body, options) +// +// Generated from API version 2022-11-01-preview +func (client *SAPVirtualInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, options) if err != nil { return nil, err } @@ -96,7 +97,7 @@ func (client *SAPVirtualInstancesClient) create(ctx context.Context, resourceGro } // createCreateRequest creates the Create request. -func (client *SAPVirtualInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, body SAPVirtualInstance, options *SAPVirtualInstancesClientBeginCreateOptions) (*policy.Request, error) { +func (client *SAPVirtualInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -115,19 +116,24 @@ func (client *SAPVirtualInstancesClient) createCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } -// BeginDelete - Deletes an Virtual Instance for SAP. +// BeginDelete - Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central +// Services Instance, Application Server Instances and Database Instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// options - SAPVirtualInstancesClientBeginDeleteOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - options - SAPVirtualInstancesClientBeginDeleteOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginDelete +// method. func (client *SAPVirtualInstancesClient) BeginDelete(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginDeleteOptions) (*runtime.Poller[SAPVirtualInstancesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, sapVirtualInstanceName, options) @@ -142,9 +148,11 @@ func (client *SAPVirtualInstancesClient) BeginDelete(ctx context.Context, resour } } -// Delete - Deletes an Virtual Instance for SAP. +// Delete - Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central +// Services Instance, Application Server Instances and Database Instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SAPVirtualInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, options) if err != nil { @@ -180,18 +188,19 @@ func (client *SAPVirtualInstancesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Gets an Virtual Instance for SAP. +// Get - Gets a Virtual Instance for SAP solutions resource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// options - SAPVirtualInstancesClientGetOptions contains the optional parameters for the SAPVirtualInstancesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - options - SAPVirtualInstancesClientGetOptions contains the optional parameters for the SAPVirtualInstancesClient.Get method. func (client *SAPVirtualInstancesClient) Get(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientGetOptions) (SAPVirtualInstancesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, options) if err != nil { @@ -227,7 +236,7 @@ func (client *SAPVirtualInstancesClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,12 +251,12 @@ func (client *SAPVirtualInstancesClient) getHandleResponse(resp *http.Response) return result, nil } -// NewListByResourceGroupPager - Gets all Virtual Instances for SAP in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// options - SAPVirtualInstancesClientListByResourceGroupOptions contains the optional parameters for the SAPVirtualInstancesClient.ListByResourceGroup -// method. +// NewListByResourceGroupPager - Gets all Virtual Instances for SAP solutions resources in a Resource Group. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - SAPVirtualInstancesClientListByResourceGroupOptions contains the optional parameters for the SAPVirtualInstancesClient.NewListByResourceGroupPager +// method. func (client *SAPVirtualInstancesClient) NewListByResourceGroupPager(resourceGroupName string, options *SAPVirtualInstancesClientListByResourceGroupOptions) *runtime.Pager[SAPVirtualInstancesClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[SAPVirtualInstancesClientListByResourceGroupResponse]{ More: func(page SAPVirtualInstancesClientListByResourceGroupResponse) bool { @@ -292,7 +301,7 @@ func (client *SAPVirtualInstancesClient) listByResourceGroupCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,11 +316,11 @@ func (client *SAPVirtualInstancesClient) listByResourceGroupHandleResponse(resp return result, nil } -// NewListBySubscriptionPager - Gets all Virtual Instances for SAP in the subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// options - SAPVirtualInstancesClientListBySubscriptionOptions contains the optional parameters for the SAPVirtualInstancesClient.ListBySubscription -// method. +// NewListBySubscriptionPager - Gets all Virtual Instances for SAP solutions resources in a Subscription. +// +// Generated from API version 2022-11-01-preview +// - options - SAPVirtualInstancesClientListBySubscriptionOptions contains the optional parameters for the SAPVirtualInstancesClient.NewListBySubscriptionPager +// method. func (client *SAPVirtualInstancesClient) NewListBySubscriptionPager(options *SAPVirtualInstancesClientListBySubscriptionOptions) *runtime.Pager[SAPVirtualInstancesClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[SAPVirtualInstancesClientListBySubscriptionResponse]{ More: func(page SAPVirtualInstancesClientListBySubscriptionResponse) bool { @@ -352,7 +361,7 @@ func (client *SAPVirtualInstancesClient) listBySubscriptionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -367,13 +376,14 @@ func (client *SAPVirtualInstancesClient) listBySubscriptionHandleResponse(resp * return result, nil } -// BeginStart - Starts the SAP System. +// BeginStart - Starts the SAP application, that is the Central Services instance and Application server instances. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// options - SAPVirtualInstancesClientBeginStartOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginStart -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - options - SAPVirtualInstancesClientBeginStartOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginStart +// method. func (client *SAPVirtualInstancesClient) BeginStart(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginStartOptions) (*runtime.Poller[SAPVirtualInstancesClientStartResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.start(ctx, resourceGroupName, sapVirtualInstanceName, options) @@ -388,9 +398,10 @@ func (client *SAPVirtualInstancesClient) BeginStart(ctx context.Context, resourc } } -// Start - Starts the SAP System. +// Start - Starts the SAP application, that is the Central Services instance and Application server instances. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SAPVirtualInstancesClient) start(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, options) if err != nil { @@ -426,19 +437,20 @@ func (client *SAPVirtualInstancesClient) startCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginStop - Stops the SAP System. +// BeginStop - Stops the SAP Application, that is the Application server instances and Central Services instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// options - SAPVirtualInstancesClientBeginStopOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginStop -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - options - SAPVirtualInstancesClientBeginStopOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginStop +// method. func (client *SAPVirtualInstancesClient) BeginStop(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginStopOptions) (*runtime.Poller[SAPVirtualInstancesClientStopResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.stop(ctx, resourceGroupName, sapVirtualInstanceName, options) @@ -453,9 +465,10 @@ func (client *SAPVirtualInstancesClient) BeginStop(ctx context.Context, resource } } -// Stop - Stops the SAP System. +// Stop - Stops the SAP Application, that is the Application server instances and Central Services instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SAPVirtualInstancesClient) stop(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, options) if err != nil { @@ -491,7 +504,7 @@ func (client *SAPVirtualInstancesClient) stopCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -500,16 +513,16 @@ func (client *SAPVirtualInstancesClient) stopCreateRequest(ctx context.Context, return req, nil } -// Update - Updates an Virtual Instance for SAP. +// Update - Updates a Virtual Instance for SAP solutions resource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// body - The Update Virtual Instance for SAP request body. -// options - SAPVirtualInstancesClientUpdateOptions contains the optional parameters for the SAPVirtualInstancesClient.Update -// method. -func (client *SAPVirtualInstancesClient) Update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, body UpdateSAPVirtualInstanceRequest, options *SAPVirtualInstancesClientUpdateOptions) (SAPVirtualInstancesClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, body, options) +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// - options - SAPVirtualInstancesClientUpdateOptions contains the optional parameters for the SAPVirtualInstancesClient.Update +// method. +func (client *SAPVirtualInstancesClient) Update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientUpdateOptions) (SAPVirtualInstancesClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, options) if err != nil { return SAPVirtualInstancesClientUpdateResponse{}, err } @@ -524,7 +537,7 @@ func (client *SAPVirtualInstancesClient) Update(ctx context.Context, resourceGro } // updateCreateRequest creates the Update request. -func (client *SAPVirtualInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, body UpdateSAPVirtualInstanceRequest, options *SAPVirtualInstancesClientUpdateOptions) (*policy.Request, error) { +func (client *SAPVirtualInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -543,10 +556,13 @@ func (client *SAPVirtualInstancesClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client_example_test.go deleted file mode 100644 index d24c73aa4fe5..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client_example_test.go +++ /dev/null @@ -1,321 +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. - -package armworkloads_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/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed.json -func ExampleSAPVirtualInstancesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "test-rg", - "X00", - armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeployment), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSH: &armworkloads.SSHConfiguration{ - PublicKeys: []*armworkloads.SSHPublicKey{ - { - KeyData: to.Ptr("ssh-rsa public key"), - }}, - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSH: &armworkloads.SSHConfiguration{ - PublicKeys: []*armworkloads.SSHPublicKey{ - { - KeyData: to.Ptr("ssh-rsa public key"), - }}, - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSH: &armworkloads.SSHConfiguration{ - PublicKeys: []*armworkloads.SSHPublicKey{ - { - KeyData: to.Ptr("ssh-rsa public key"), - }}, - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Get.json -func ExampleSAPVirtualInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "test-rg", - "X00", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Update.json -func ExampleSAPVirtualInstancesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "test-rg", - "X00", - armworkloads.UpdateSAPVirtualInstanceRequest{ - Identity: &armworkloads.UserAssignedServiceIdentity{ - Type: to.Ptr(armworkloads.ManagedServiceIdentityTypeNone), - }, - Tags: map[string]*string{ - "key1": to.Ptr("svi1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Delete.json -func ExampleSAPVirtualInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "test-rg", - "X00", - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_ListByResourceGroup.json -func ExampleSAPVirtualInstancesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("test-rg", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_ListBySubscription.json -func ExampleSAPVirtualInstancesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Start.json -func ExampleSAPVirtualInstancesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "test-rg", - "X00", - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Stop.json -func ExampleSAPVirtualInstancesClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStop(ctx, - "test-rg", - "X00", - &armworkloads.SAPVirtualInstancesClientBeginStopOptions{Body: &armworkloads.StopRequest{ - HardStop: to.Ptr(false), - }, - }) - 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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/workloads/armworkloads/skus_client.go b/sdk/resourcemanager/workloads/armworkloads/skus_client.go deleted file mode 100644 index 1ba17d81bf0b..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/skus_client.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armworkloads - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "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" -) - -// SKUsClient contains the methods for the SKUs group. -// Don't use this type directly, use NewSKUsClient() instead. -type SKUsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewSKUsClient creates a new instance of SKUsClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SKUsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &SKUsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Lists all the available SKUs under this PR -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// options - SKUsClientListOptions contains the optional parameters for the SKUsClient.List method. -func (client *SKUsClient) NewListPager(options *SKUsClientListOptions) *runtime.Pager[SKUsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SKUsClientListResponse]{ - More: func(page SKUsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SKUsClientListResponse) (SKUsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SKUsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SKUsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SKUsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *SKUsClient) listCreateRequest(ctx context.Context, options *SKUsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/skus" - 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.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-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 *SKUsClient) listHandleResponse(resp *http.Response) (SKUsClientListResponse, error) { - result := SKUsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SKUsListResult); err != nil { - return SKUsClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/workloads/armworkloads/skus_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/skus_client_example_test.go deleted file mode 100644 index 8b49e1928f00..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/skus_client_example_test.go +++ /dev/null @@ -1,41 +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. - -package armworkloads_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/Skus_List.json -func ExampleSKUsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSKUsClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/time_rfc3339.go b/sdk/resourcemanager/workloads/armworkloads/time_rfc3339.go index 4fae121f637d..f3cacd79264f 100644 --- a/sdk/resourcemanager/workloads/armworkloads/time_rfc3339.go +++ b/sdk/resourcemanager/workloads/armworkloads/time_rfc3339.go @@ -62,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/workloads/armworkloads/wordpressinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/wordpressinstances_client.go deleted file mode 100644 index 1f58ad86c78e..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/wordpressinstances_client.go +++ /dev/null @@ -1,295 +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 armworkloads - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "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" -) - -// WordpressInstancesClient contains the methods for the WordpressInstances group. -// Don't use this type directly, use NewWordpressInstancesClient() instead. -type WordpressInstancesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewWordpressInstancesClient creates a new instance of WordpressInstancesClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewWordpressInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WordpressInstancesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &WordpressInstancesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or updated WordPress instance resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// phpWorkloadName - Php workload name -// wordpressInstanceResource - Resource create or update request payload -// options - WordpressInstancesClientBeginCreateOrUpdateOptions contains the optional parameters for the WordpressInstancesClient.BeginCreateOrUpdate -// method. -func (client *WordpressInstancesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, phpWorkloadName string, wordpressInstanceResource WordpressInstanceResource, options *WordpressInstancesClientBeginCreateOrUpdateOptions) (*runtime.Poller[WordpressInstancesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, phpWorkloadName, wordpressInstanceResource, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WordpressInstancesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[WordpressInstancesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Create or updated WordPress instance resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -func (client *WordpressInstancesClient) createOrUpdate(ctx context.Context, resourceGroupName string, phpWorkloadName string, wordpressInstanceResource WordpressInstanceResource, options *WordpressInstancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, phpWorkloadName, wordpressInstanceResource, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *WordpressInstancesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, phpWorkloadName string, wordpressInstanceResource WordpressInstanceResource, options *WordpressInstancesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances/default" - 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 phpWorkloadName == "" { - return nil, errors.New("parameter phpWorkloadName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{phpWorkloadName}", url.PathEscape(phpWorkloadName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, wordpressInstanceResource) -} - -// Delete - Delete WordPress instance resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// phpWorkloadName - Php workload name -// options - WordpressInstancesClientDeleteOptions contains the optional parameters for the WordpressInstancesClient.Delete -// method. -func (client *WordpressInstancesClient) Delete(ctx context.Context, resourceGroupName string, phpWorkloadName string, options *WordpressInstancesClientDeleteOptions) (WordpressInstancesClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, phpWorkloadName, options) - if err != nil { - return WordpressInstancesClientDeleteResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return WordpressInstancesClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return WordpressInstancesClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return WordpressInstancesClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *WordpressInstancesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, phpWorkloadName string, options *WordpressInstancesClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances/default" - 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 phpWorkloadName == "" { - return nil, errors.New("parameter phpWorkloadName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{phpWorkloadName}", url.PathEscape(phpWorkloadName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the WordPress instance resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// phpWorkloadName - Php workload name -// options - WordpressInstancesClientGetOptions contains the optional parameters for the WordpressInstancesClient.Get method. -func (client *WordpressInstancesClient) Get(ctx context.Context, resourceGroupName string, phpWorkloadName string, options *WordpressInstancesClientGetOptions) (WordpressInstancesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, phpWorkloadName, options) - if err != nil { - return WordpressInstancesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return WordpressInstancesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WordpressInstancesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *WordpressInstancesClient) getCreateRequest(ctx context.Context, resourceGroupName string, phpWorkloadName string, options *WordpressInstancesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances/default" - 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 phpWorkloadName == "" { - return nil, errors.New("parameter phpWorkloadName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{phpWorkloadName}", url.PathEscape(phpWorkloadName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-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 *WordpressInstancesClient) getHandleResponse(resp *http.Response) (WordpressInstancesClientGetResponse, error) { - result := WordpressInstancesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WordpressInstanceResource); err != nil { - return WordpressInstancesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists WordPress instance resources under a phpWorkload resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// phpWorkloadName - Php workload name -// options - WordpressInstancesClientListOptions contains the optional parameters for the WordpressInstancesClient.List method. -func (client *WordpressInstancesClient) NewListPager(resourceGroupName string, phpWorkloadName string, options *WordpressInstancesClientListOptions) *runtime.Pager[WordpressInstancesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[WordpressInstancesClientListResponse]{ - More: func(page WordpressInstancesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *WordpressInstancesClientListResponse) (WordpressInstancesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, phpWorkloadName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return WordpressInstancesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return WordpressInstancesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WordpressInstancesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *WordpressInstancesClient) listCreateRequest(ctx context.Context, resourceGroupName string, phpWorkloadName string, options *WordpressInstancesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances" - 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 phpWorkloadName == "" { - return nil, errors.New("parameter phpWorkloadName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{phpWorkloadName}", url.PathEscape(phpWorkloadName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-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 *WordpressInstancesClient) listHandleResponse(resp *http.Response) (WordpressInstancesClientListResponse, error) { - result := WordpressInstancesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WordpressInstanceResourceList); err != nil { - return WordpressInstancesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/workloads/armworkloads/wordpressinstances_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/wordpressinstances_client_example_test.go deleted file mode 100644 index f199a5780ad7..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/wordpressinstances_client_example_test.go +++ /dev/null @@ -1,119 +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. - -package armworkloads_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/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_List.json -func ExampleWordpressInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewWordpressInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("test-rg", - "wp39", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_Get.json -func ExampleWordpressInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewWordpressInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "test-rg", - "wp39", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_CreateOrUpdate.json -func ExampleWordpressInstancesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewWordpressInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "test-rg", - "wp39", - armworkloads.WordpressInstanceResource{ - Properties: &armworkloads.WordpressInstanceResourceProperties{ - DatabaseName: to.Ptr("wpdb"), - DatabaseUser: to.Ptr("wpuser"), - Version: to.Ptr(armworkloads.WordpressVersionsFive42), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_Delete.json -func ExampleWordpressInstancesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewWordpressInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "test-rg", - "wp39", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/workloadsclient_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/workloadsclient_client_example_test.go deleted file mode 100644 index bec1160442ec..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/workloadsclient_client_example_test.go +++ /dev/null @@ -1,80 +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. - -package armworkloads_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_Distributed.json -func ExampleClient_SAPSizingRecommendations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SAPSizingRecommendations(ctx, - "centralus", - &armworkloads.ClientSAPSizingRecommendationsOptions{SAPSizingRecommendation: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPDiskConfigurations_NonProd.json -func ExampleClient_SAPDiskConfigurations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SAPDiskConfigurations(ctx, - "centralus", - &armworkloads.ClientSAPDiskConfigurationsOptions{SAPDiskConfigurations: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json -func ExampleClient_SAPAvailabilityZoneDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SAPAvailabilityZoneDetails(ctx, - "centralus", - &armworkloads.ClientSAPAvailabilityZoneDetailsOptions{SAPAvailabilityZoneDetails: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -}