diff --git a/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md b/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md index 88593d01815d..61364ac5b204 100644 --- a/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md +++ b/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md @@ -1,5 +1,374 @@ # Release History +## 0.2.0 (2022-05-31) +### Breaking Changes + +- Function `*MonitorsClient.Update` parameter(s) have been changed from `(context.Context, string, string, Tags, *MonitorsClientUpdateOptions)` to `(context.Context, string, string, UpdateMonitorRequest, *MonitorsClientUpdateOptions)` + +### Features Added + +- New const `SKUTierPremium` +- New const `PHPVersionSeven2` +- New const `FileShareTypeNfsOnController` +- New const `SKUScaleTypeManual` +- New const `SAPVirtualInstanceStateDiscoveryInProgress` +- New const `SKUScaleTypeNone` +- New const `SAPVirtualInstanceStateInfrastructureDeploymentFailed` +- New const `SapVirtualInstanceProvisioningStateSucceeded` +- New const `CentralServerVirtualMachineTypeStandby` +- New const `EnableBackupEnabled` +- New const `SAPVirtualInstanceStateSoftwareInstallationPending` +- New const `EnqueueReplicationServerTypeEnqueueReplicator1` +- New const `LoadBalancerTypeApplicationGateway` +- New const `SAPConfigurationTypeDeploymentWithOSConfig` +- New const `EnqueueReplicationServerTypeEnqueueReplicator2` +- New const `SapVirtualInstanceProvisioningStateUpdating` +- New const `SKUTierBasic` +- New const `PHPVersionSeven4` +- New const `EnableSSLEnforcementEnabled` +- New const `SAPEnvironmentTypeProd` +- New const `ManagedServiceIdentityTypeUserAssigned` +- New const `SKURestrictionTypeLocation` +- New const `SAPVirtualInstanceStatusUnavailable` +- New const `SAPDatabaseScaleMethodScaleUp` +- New const `SapVirtualInstanceProvisioningStateFailed` +- New const `DatabaseTierBurstable` +- New const `SAPVirtualInstanceStatusOffline` +- New const `SAPSoftwareInstallationTypeServiceInitiated` +- New const `DiskStorageTypeStandardLRS` +- New const `SAPHealthStateUnknown` +- New const `SAPVirtualInstanceStatusStopping` +- New const `CentralServerVirtualMachineTypePrimary` +- New const `ApplicationProvisioningStateFailed` +- New const `SAPDeploymentTypeSingleServer` +- New const `PhpWorkloadProvisioningStateSucceeded` +- New const `SAPHealthStateDegraded` +- New const `CentralServerVirtualMachineTypeERS` +- New const `PhpWorkloadProvisioningStateFailed` +- New const `SKUTierStandard` +- New const `SAPDatabaseTypeHANA` +- New const `DatabaseTierMemoryOptimized` +- New const `CentralServerVirtualMachineTypeSecondary` +- New const `SAPVirtualInstanceStateSoftwareInstallationFailed` +- New const `SAPDatabaseTypeDB2` +- New const `FileShareStorageTypeStandardGRS` +- New const `OSImagePublisherCanonical` +- New const `SAPVirtualInstanceStateRegistrationComplete` +- New const `SAPVirtualInstanceStateInfrastructureDeploymentInProgress` +- New const `SAPConfigurationTypeDiscovery` +- New const `EnableBackupDisabled` +- New const `SAPVirtualInstanceStateInfrastructureDeploymentPending` +- New const `FileShareStorageTypePremiumLRS` +- New const `SKURestrictionReasonCodeQuotaID` +- New const `AzureFrontDoorEnabledDisabled` +- New const `RedisCacheFamilyC` +- New const `PhpWorkloadProvisioningStateNotSpecified` +- New const `PhpWorkloadProvisioningStateProvisioning` +- New const `SAPDeploymentTypeThreeTier` +- New const `EnableSSLEnforcementDisabled` +- New const `SAPProductTypeOther` +- New const `SKURestrictionTypeZone` +- New const `SAPProductTypeECC` +- New const `LoadBalancerTypeLoadBalancer` +- New const `SKURestrictionReasonCodeNotSpecified` +- New const `CentralServerVirtualMachineTypeASCS` +- New const `ApplicationProvisioningStateInstalling` +- New const `SAPVirtualInstanceStateDiscoveryPending` +- New const `SAPVirtualInstanceStatusStarting` +- New const `SKUScaleTypeAutomatic` +- New const `SKURestrictionTypeNotSpecified` +- New const `FileShareTypeAzureFiles` +- New const `CentralServerVirtualMachineTypeERSInactive` +- New const `PHPVersionSeven3` +- New const `DiskStorageTypeStandardSSDLRS` +- New const `CentralServerVirtualMachineTypeUnknown` +- New const `SAPHealthStateUnhealthy` +- New const `SAPVirtualInstanceStatusPartiallyRunning` +- New const `SAPConfigurationTypeDeployment` +- New const `OSImageSKUSixteen04LTS` +- New const `PhpWorkloadProvisioningStateCreated` +- New const `FileShareStorageTypeStandardLRS` +- New const `WordpressVersionsFive42` +- New const `OSImageOfferUbuntuServer` +- New const `RedisCacheFamilyP` +- New const `HAEnabledDisabled` +- New const `SapVirtualInstanceProvisioningStateDeleting` +- New const `PhpWorkloadProvisioningStateAccepted` +- New const `SAPEnvironmentTypeNonProd` +- New const `SAPProductTypeS4HANA` +- New const `WordpressVersionsFive4` +- New const `SKURestrictionReasonCodeNotAvailableForSubscription` +- New const `ApplicationProvisioningStateSucceeded` +- New const `LocationTypeEdgeZone` +- New const `ApplicationProvisioningStateCanceled` +- New const `SearchTypeElastic` +- New const `PhpWorkloadProvisioningStateCanceled` +- New const `ManagedServiceIdentityTypeNone` +- New const `SAPHighAvailabilityTypeAvailabilitySet` +- New const `ApplicationProvisioningStateAccepted` +- New const `DatabaseTypeMySQL` +- New const `OSImageVersionLatest` +- New const `SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig` +- New const `SAPVirtualInstanceStatusRunning` +- New const `DiskStorageTypePremiumLRS` +- New const `SapVirtualInstanceProvisioningStateCreating` +- New const `LocationTypeRegion` +- New const `SAPHighAvailabilityTypeAvailabilityZone` +- New const `SKUTierFree` +- New const `PhpWorkloadProvisioningStateDeleting` +- New const `SAPVirtualInstanceStateDiscoveryFailed` +- New const `SAPHealthStateHealthy` +- New const `FileShareStorageTypeStandardZRS` +- New const `WordpressVersionsFive43` +- New const `OSImageSKUEighteen04LTS` +- New const `SAPVirtualInstanceStateSoftwareInstallationInProgress` +- New const `AzureFrontDoorEnabledEnabled` +- New const `OSTypeLinux` +- New const `WorkloadKindWordPress` +- New const `ApplicationProvisioningStateCreated` +- New const `OSTypeWindows` +- New const `WordpressVersionsFive41` +- New const `HAEnabledEnabled` +- New const `ApplicationProvisioningStateNotSpecified` +- New const `DatabaseTierGeneralPurpose` +- New function `PossibleSAPVirtualInstanceStateValues() []SAPVirtualInstanceState` +- New function `PossibleEnableBackupValues() []EnableBackup` +- New function `PossibleSAPSoftwareInstallationTypeValues() []SAPSoftwareInstallationType` +- New function `*SAPSizingRecommendationResult.GetSAPSizingRecommendationResult() *SAPSizingRecommendationResult` +- New function `*DiscoveryConfiguration.GetSAPConfiguration() *SAPConfiguration` +- New function `PossibleLocationTypeValues() []LocationType` +- New function `PossibleSAPEnvironmentTypeValues() []SAPEnvironmentType` +- New function `PossibleSAPConfigurationTypeValues() []SAPConfigurationType` +- New function `PossibleWorkloadKindValues() []WorkloadKind` +- New function `PossibleSKUTierValues() []SKUTier` +- New function `*DeploymentConfiguration.GetSAPConfiguration() *SAPConfiguration` +- New function `*DeploymentWithOSConfiguration.GetSAPConfiguration() *SAPConfiguration` +- New function `PossibleSapVirtualInstanceProvisioningStateValues() []SapVirtualInstanceProvisioningState` +- New function `PossibleOSTypeValues() []OSType` +- New function `PossibleOSImageOfferValues() []OSImageOffer` +- New function `PossibleSAPDatabaseScaleMethodValues() []SAPDatabaseScaleMethod` +- New function `PossibleApplicationProvisioningStateValues() []ApplicationProvisioningState` +- New function `PossibleWordpressVersionsValues() []WordpressVersions` +- New function `PossibleLoadBalancerTypeValues() []LoadBalancerType` +- New function `PossiblePHPVersionValues() []PHPVersion` +- New function `PossibleSKURestrictionReasonCodeValues() []SKURestrictionReasonCode` +- New function `*SingleServerConfiguration.GetInfrastructureConfiguration() *InfrastructureConfiguration` +- New function `*SAPInstallWithoutOSConfigSoftwareConfiguration.GetSoftwareConfiguration() *SoftwareConfiguration` +- New function `*WindowsConfiguration.GetOSConfiguration() *OSConfiguration` +- New function `PossibleSAPDatabaseTypeValues() []SAPDatabaseType` +- New function `*LinuxConfiguration.GetOSConfiguration() *OSConfiguration` +- New function `PossibleEnqueueReplicationServerTypeValues() []EnqueueReplicationServerType` +- New function `PossibleHAEnabledValues() []HAEnabled` +- New function `PossibleOSImageSKUValues() []OSImageSKU` +- New function `PossibleSAPDeploymentTypeValues() []SAPDeploymentType` +- New function `PossibleDatabaseTypeValues() []DatabaseType` +- New function `PossibleFileShareStorageTypeValues() []FileShareStorageType` +- New function `*ServiceInitiatedSoftwareConfiguration.GetSoftwareConfiguration() *SoftwareConfiguration` +- New function `PossibleSearchTypeValues() []SearchType` +- New function `*InfrastructureConfiguration.GetInfrastructureConfiguration() *InfrastructureConfiguration` +- New function `PossiblePhpWorkloadProvisioningStateValues() []PhpWorkloadProvisioningState` +- New function `*SAPConfiguration.GetSAPConfiguration() *SAPConfiguration` +- New function `PossibleOSImageVersionValues() []OSImageVersion` +- New function `PossibleSAPProductTypeValues() []SAPProductType` +- New function `PossibleCentralServerVirtualMachineTypeValues() []CentralServerVirtualMachineType` +- New function `PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType` +- New function `PossibleEnableSSLEnforcementValues() []EnableSSLEnforcement` +- New function `*SoftwareConfiguration.GetSoftwareConfiguration() *SoftwareConfiguration` +- New function `PossibleFileShareTypeValues() []FileShareType` +- New function `PossibleSAPVirtualInstanceStatusValues() []SAPVirtualInstanceStatus` +- New function `PossibleSKUScaleTypeValues() []SKUScaleType` +- New function `PossibleSAPHealthStateValues() []SAPHealthState` +- New function `PossibleDatabaseTierValues() []DatabaseTier` +- New function `*ThreeTierRecommendationResult.GetSAPSizingRecommendationResult() *SAPSizingRecommendationResult` +- New function `PossibleSKURestrictionTypeValues() []SKURestrictionType` +- New function `*SingleServerRecommendationResult.GetSAPSizingRecommendationResult() *SAPSizingRecommendationResult` +- New function `PossibleRedisCacheFamilyValues() []RedisCacheFamily` +- New function `PossibleAzureFrontDoorEnabledValues() []AzureFrontDoorEnabled` +- New function `PossibleSAPHighAvailabilityTypeValues() []SAPHighAvailabilityType` +- New function `PossibleOSImagePublisherValues() []OSImagePublisher` +- New function `PossibleDiskStorageTypeValues() []DiskStorageType` +- New function `*OSConfiguration.GetOSConfiguration() *OSConfiguration` +- New function `*ThreeTierConfiguration.GetInfrastructureConfiguration() *InfrastructureConfiguration` +- New struct `ApplicationServerConfiguration` +- New struct `BackupProfile` +- New struct `CacheProfile` +- New struct `CentralServerConfiguration` +- New struct `CentralServerVMDetails` +- New struct `ClientSAPAvailabilityZoneDetailsOptions` +- New struct `ClientSAPAvailabilityZoneDetailsResponse` +- New struct `ClientSAPDiskConfigurationsOptions` +- New struct `ClientSAPDiskConfigurationsResponse` +- New struct `ClientSAPSizingRecommendationsOptions` +- New struct `ClientSAPSizingRecommendationsResponse` +- New struct `ClientSAPSupportedSKUOptions` +- New struct `ClientSAPSupportedSKUResponse` +- New struct `DatabaseConfiguration` +- New struct `DatabaseProfile` +- New struct `DatabaseVMDetails` +- New struct `DeployerVMPackages` +- New struct `DeploymentConfiguration` +- New struct `DeploymentWithOSConfiguration` +- New struct `DiscoveryConfiguration` +- New struct `DiskInfo` +- New struct `EnqueueReplicationServerProperties` +- New struct `EnqueueServerProperties` +- New struct `ErrorDefinition` +- New struct `FileshareProfile` +- New struct `GatewayServerProperties` +- New struct `HighAvailabilityConfiguration` +- New struct `HighAvailabilitySoftwareConfiguration` +- New struct `ImageReference` +- New struct `InfrastructureConfiguration` +- New struct `LinuxConfiguration` +- New struct `MessageServerProperties` +- New struct `NetworkConfiguration` +- New struct `NetworkProfile` +- New struct `NodeProfile` +- New struct `OSConfiguration` +- New struct `OSProfile` +- New struct `OsImageProfile` +- New struct `OsSapConfiguration` +- New struct `PatchResourceRequestBody` +- New struct `PatchResourceRequestBodyIdentity` +- New struct `PhpProfile` +- New struct `PhpWorkloadResource` +- New struct `PhpWorkloadResourceIdentity` +- New struct `PhpWorkloadResourceList` +- New struct `PhpWorkloadResourceProperties` +- New struct `PhpWorkloadsClientBeginCreateOrUpdateOptions` +- New struct `PhpWorkloadsClientBeginDeleteOptions` +- New struct `PhpWorkloadsClientCreateOrUpdateResponse` +- New struct `PhpWorkloadsClientDeleteResponse` +- New struct `PhpWorkloadsClientGetOptions` +- New struct `PhpWorkloadsClientGetResponse` +- New struct `PhpWorkloadsClientListByResourceGroupOptions` +- New struct `PhpWorkloadsClientListByResourceGroupResponse` +- New struct `PhpWorkloadsClientListBySubscriptionOptions` +- New struct `PhpWorkloadsClientListBySubscriptionResponse` +- New struct `PhpWorkloadsClientUpdateOptions` +- New struct `PhpWorkloadsClientUpdateResponse` +- New struct `RestrictionInfo` +- New struct `SAPApplicationServerInstance` +- New struct `SAPApplicationServerInstanceList` +- New struct `SAPApplicationServerInstancesClientBeginCreateOptions` +- New struct `SAPApplicationServerInstancesClientBeginDeleteOptions` +- New struct `SAPApplicationServerInstancesClientBeginUpdateOptions` +- New struct `SAPApplicationServerInstancesClientCreateResponse` +- New struct `SAPApplicationServerInstancesClientDeleteResponse` +- New struct `SAPApplicationServerInstancesClientGetOptions` +- New struct `SAPApplicationServerInstancesClientGetResponse` +- New struct `SAPApplicationServerInstancesClientListOptions` +- New struct `SAPApplicationServerInstancesClientListResponse` +- New struct `SAPApplicationServerInstancesClientUpdateResponse` +- New struct `SAPApplicationServerProperties` +- New struct `SAPAvailabilityZoneDetailsRequest` +- New struct `SAPAvailabilityZoneDetailsResult` +- New struct `SAPAvailabilityZonePair` +- New struct `SAPCentralInstanceList` +- New struct `SAPCentralInstancesClientBeginCreateOptions` +- New struct `SAPCentralInstancesClientBeginDeleteOptions` +- New struct `SAPCentralInstancesClientBeginUpdateOptions` +- New struct `SAPCentralInstancesClientCreateResponse` +- New struct `SAPCentralInstancesClientDeleteResponse` +- New struct `SAPCentralInstancesClientGetOptions` +- New struct `SAPCentralInstancesClientGetResponse` +- New struct `SAPCentralInstancesClientListOptions` +- New struct `SAPCentralInstancesClientListResponse` +- New struct `SAPCentralInstancesClientUpdateResponse` +- New struct `SAPCentralServerInstance` +- New struct `SAPCentralServerProperties` +- New struct `SAPConfiguration` +- New struct `SAPDatabaseInstance` +- New struct `SAPDatabaseInstanceList` +- New struct `SAPDatabaseInstancesClientBeginCreateOptions` +- New struct `SAPDatabaseInstancesClientBeginDeleteOptions` +- New struct `SAPDatabaseInstancesClientBeginUpdateOptions` +- New struct `SAPDatabaseInstancesClientCreateResponse` +- New struct `SAPDatabaseInstancesClientDeleteResponse` +- New struct `SAPDatabaseInstancesClientGetOptions` +- New struct `SAPDatabaseInstancesClientGetResponse` +- New struct `SAPDatabaseInstancesClientListOptions` +- New struct `SAPDatabaseInstancesClientListResponse` +- New struct `SAPDatabaseInstancesClientUpdateResponse` +- New struct `SAPDatabaseProperties` +- New struct `SAPDiskConfiguration` +- New struct `SAPDiskConfigurationsRequest` +- New struct `SAPDiskConfigurationsResult` +- New struct `SAPInstallWithoutOSConfigSoftwareConfiguration` +- New struct `SAPSizingRecommendationRequest` +- New struct `SAPSizingRecommendationResult` +- New struct `SAPSupportedResourceSKUsResult` +- New struct `SAPSupportedSKU` +- New struct `SAPSupportedSKUsRequest` +- New struct `SAPVirtualInstance` +- New struct `SAPVirtualInstanceError` +- New struct `SAPVirtualInstanceList` +- New struct `SAPVirtualInstanceProperties` +- New struct `SAPVirtualInstancesClientBeginCreateOptions` +- New struct `SAPVirtualInstancesClientBeginDeleteOptions` +- New struct `SAPVirtualInstancesClientBeginStartOptions` +- New struct `SAPVirtualInstancesClientBeginStopOptions` +- New struct `SAPVirtualInstancesClientCreateResponse` +- New struct `SAPVirtualInstancesClientDeleteResponse` +- New struct `SAPVirtualInstancesClientGetOptions` +- New struct `SAPVirtualInstancesClientGetResponse` +- New struct `SAPVirtualInstancesClientListByResourceGroupOptions` +- New struct `SAPVirtualInstancesClientListByResourceGroupResponse` +- New struct `SAPVirtualInstancesClientListBySubscriptionOptions` +- New struct `SAPVirtualInstancesClientListBySubscriptionResponse` +- New struct `SAPVirtualInstancesClientStartResponse` +- New struct `SAPVirtualInstancesClientStopResponse` +- New struct `SAPVirtualInstancesClientUpdateOptions` +- New struct `SAPVirtualInstancesClientUpdateResponse` +- New struct `SKU` +- New struct `SKUCapability` +- New struct `SKUCapacity` +- New struct `SKUCost` +- New struct `SKUDefinition` +- New struct `SKULocationAndZones` +- New struct `SKURestriction` +- New struct `SKUZoneDetail` +- New struct `SKUsClientListOptions` +- New struct `SKUsClientListResponse` +- New struct `SKUsListResult` +- New struct `SSHConfiguration` +- New struct `SSHKeyPair` +- New struct `SSHPublicKey` +- New struct `SearchProfile` +- New struct `ServiceInitiatedSoftwareConfiguration` +- New struct `SingleServerConfiguration` +- New struct `SingleServerRecommendationResult` +- New struct `SiteProfile` +- New struct `SoftwareConfiguration` +- New struct `StopRequest` +- New struct `ThreeTierConfiguration` +- New struct `ThreeTierRecommendationResult` +- New struct `UpdateMonitorRequest` +- New struct `UpdateSAPApplicationInstanceRequest` +- New struct `UpdateSAPCentralInstanceRequest` +- New struct `UpdateSAPDatabaseInstanceRequest` +- New struct `UpdateSAPVirtualInstanceRequest` +- New struct `UserAssignedIdentity` +- New struct `UserAssignedServiceIdentity` +- New struct `UserProfile` +- New struct `VirtualMachineConfiguration` +- New struct `VmssNodesProfile` +- New struct `WindowsConfiguration` +- New struct `WordpressInstanceResource` +- New struct `WordpressInstanceResourceList` +- New struct `WordpressInstanceResourceProperties` +- New struct `WordpressInstancesClientBeginCreateOrUpdateOptions` +- New struct `WordpressInstancesClientCreateOrUpdateResponse` +- New struct `WordpressInstancesClientDeleteOptions` +- New struct `WordpressInstancesClientDeleteResponse` +- New struct `WordpressInstancesClientGetOptions` +- New struct `WordpressInstancesClientGetResponse` +- New struct `WordpressInstancesClientListOptions` +- New struct `WordpressInstancesClientListResponse` +- New field `Identity` in struct `ProviderInstance` +- New field `Identity` in struct `Monitor` + + ## 0.1.0 (2022-05-16) - Init release. \ No newline at end of file diff --git a/sdk/resourcemanager/workloads/armworkloads/autorest.md b/sdk/resourcemanager/workloads/armworkloads/autorest.md index d366c70fd461..10d242d97c7e 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/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/workloads/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/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.1.0 +module-version: 0.2.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/workloads/armworkloads/go.mod b/sdk/resourcemanager/workloads/armworkloads/go.mod index db4055207f43..e3fc07330568 100644 --- a/sdk/resourcemanager/workloads/armworkloads/go.mod +++ b/sdk/resourcemanager/workloads/armworkloads/go.mod @@ -2,20 +2,10 @@ 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.0.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.4.0 // 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 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 ) diff --git a/sdk/resourcemanager/workloads/armworkloads/go.sum b/sdk/resourcemanager/workloads/armworkloads/go.sum index ed5b814680ee..3f874a3bc5a6 100644 --- a/sdk/resourcemanager/workloads/armworkloads/go.sum +++ b/sdk/resourcemanager/workloads/armworkloads/go.sum @@ -1,33 +1,12 @@ 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.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= 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.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/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.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 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/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= diff --git a/sdk/resourcemanager/workloads/armworkloads/ze_generated_example_monitors_client_test.go b/sdk/resourcemanager/workloads/armworkloads/ze_generated_example_monitors_client_test.go deleted file mode 100644 index f3ab1e3ce05a..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/ze_generated_example_monitors_client_test.go +++ /dev/null @@ -1,181 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// 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.Tags{ - 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/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/workloads/armworkloads/ze_generated_example_operations_client_test.go deleted file mode 100644 index ff7705d5c349..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/ze_generated_example_operations_client_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/ze_generated_example_providerinstances_client_test.go b/sdk/resourcemanager/workloads/armworkloads/ze_generated_example_providerinstances_client_test.go deleted file mode 100644 index eafb312e2c07..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/ze_generated_example_providerinstances_client_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/zz_generated_client.go b/sdk/resourcemanager/workloads/armworkloads/zz_generated_client.go new file mode 100644 index 000000000000..0ccd212bc974 --- /dev/null +++ b/sdk/resourcemanager/workloads/armworkloads/zz_generated_client.go @@ -0,0 +1,273 @@ +//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 + +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" +) + +// Client contains the methods for the WorkloadsClient group. +// Don't use this type directly, use NewClient() instead. +type Client struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// 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. +func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, 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 := &Client{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// SAPAvailabilityZoneDetails - Get SAP Availability Zone Details. +// 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. +func (client *Client) SAPAvailabilityZoneDetails(ctx context.Context, location string, options *ClientSAPAvailabilityZoneDetailsOptions) (ClientSAPAvailabilityZoneDetailsResponse, error) { + req, err := client.sapAvailabilityZoneDetailsCreateRequest(ctx, location, options) + if err != nil { + return ClientSAPAvailabilityZoneDetailsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ClientSAPAvailabilityZoneDetailsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ClientSAPAvailabilityZoneDetailsResponse{}, runtime.NewResponseError(resp) + } + return client.sapAvailabilityZoneDetailsHandleResponse(resp) +} + +// sapAvailabilityZoneDetailsCreateRequest creates the SAPAvailabilityZoneDetails request. +func (client *Client) sapAvailabilityZoneDetailsCreateRequest(ctx context.Context, location string, options *ClientSAPAvailabilityZoneDetailsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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"} + if options != nil && options.SAPAvailabilityZoneDetails != nil { + return req, runtime.MarshalAsJSON(req, *options.SAPAvailabilityZoneDetails) + } + return req, nil +} + +// sapAvailabilityZoneDetailsHandleResponse handles the SAPAvailabilityZoneDetails response. +func (client *Client) sapAvailabilityZoneDetailsHandleResponse(resp *http.Response) (ClientSAPAvailabilityZoneDetailsResponse, error) { + result := ClientSAPAvailabilityZoneDetailsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SAPAvailabilityZoneDetailsResult); err != nil { + return ClientSAPAvailabilityZoneDetailsResponse{}, err + } + return result, nil +} + +// SAPDiskConfigurations - Get SAP Disk Configurations. +// 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. +func (client *Client) SAPDiskConfigurations(ctx context.Context, location string, options *ClientSAPDiskConfigurationsOptions) (ClientSAPDiskConfigurationsResponse, error) { + req, err := client.sapDiskConfigurationsCreateRequest(ctx, location, options) + if err != nil { + return ClientSAPDiskConfigurationsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ClientSAPDiskConfigurationsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ClientSAPDiskConfigurationsResponse{}, runtime.NewResponseError(resp) + } + return client.sapDiskConfigurationsHandleResponse(resp) +} + +// sapDiskConfigurationsCreateRequest creates the SAPDiskConfigurations request. +func (client *Client) sapDiskConfigurationsCreateRequest(ctx context.Context, location string, options *ClientSAPDiskConfigurationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getDiskConfigurations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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"} + if options != nil && options.SAPDiskConfigurations != nil { + return req, runtime.MarshalAsJSON(req, *options.SAPDiskConfigurations) + } + return req, nil +} + +// sapDiskConfigurationsHandleResponse handles the SAPDiskConfigurations response. +func (client *Client) sapDiskConfigurationsHandleResponse(resp *http.Response) (ClientSAPDiskConfigurationsResponse, error) { + result := ClientSAPDiskConfigurationsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SAPDiskConfigurationsResult); err != nil { + return ClientSAPDiskConfigurationsResponse{}, err + } + return result, nil +} + +// SAPSizingRecommendations - Get SAP sizing recommendations. +// 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. +func (client *Client) SAPSizingRecommendations(ctx context.Context, location string, options *ClientSAPSizingRecommendationsOptions) (ClientSAPSizingRecommendationsResponse, error) { + req, err := client.sapSizingRecommendationsCreateRequest(ctx, location, options) + if err != nil { + return ClientSAPSizingRecommendationsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ClientSAPSizingRecommendationsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ClientSAPSizingRecommendationsResponse{}, runtime.NewResponseError(resp) + } + return client.sapSizingRecommendationsHandleResponse(resp) +} + +// sapSizingRecommendationsCreateRequest creates the SAPSizingRecommendations request. +func (client *Client) sapSizingRecommendationsCreateRequest(ctx context.Context, location string, options *ClientSAPSizingRecommendationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSizingRecommendations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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"} + if options != nil && options.SAPSizingRecommendation != nil { + return req, runtime.MarshalAsJSON(req, *options.SAPSizingRecommendation) + } + return req, nil +} + +// sapSizingRecommendationsHandleResponse handles the SAPSizingRecommendations response. +func (client *Client) sapSizingRecommendationsHandleResponse(resp *http.Response) (ClientSAPSizingRecommendationsResponse, error) { + result := ClientSAPSizingRecommendationsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return ClientSAPSizingRecommendationsResponse{}, err + } + return result, nil +} + +// SAPSupportedSKU - Get SAP supported SKUs. +// 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. +func (client *Client) SAPSupportedSKU(ctx context.Context, location string, options *ClientSAPSupportedSKUOptions) (ClientSAPSupportedSKUResponse, error) { + req, err := client.sapSupportedSKUCreateRequest(ctx, location, options) + if err != nil { + return ClientSAPSupportedSKUResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ClientSAPSupportedSKUResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ClientSAPSupportedSKUResponse{}, runtime.NewResponseError(resp) + } + return client.sapSupportedSKUHandleResponse(resp) +} + +// sapSupportedSKUCreateRequest creates the SAPSupportedSKU request. +func (client *Client) sapSupportedSKUCreateRequest(ctx context.Context, location string, options *ClientSAPSupportedSKUOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSapSupportedSku" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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"} + if options != nil && options.SAPSupportedSKU != nil { + return req, runtime.MarshalAsJSON(req, *options.SAPSupportedSKU) + } + return req, nil +} + +// sapSupportedSKUHandleResponse handles the SAPSupportedSKU response. +func (client *Client) sapSupportedSKUHandleResponse(resp *http.Response) (ClientSAPSupportedSKUResponse, error) { + result := ClientSAPSupportedSKUResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SAPSupportedResourceSKUsResult); err != nil { + return ClientSAPSupportedSKUResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/workloads/armworkloads/zz_generated_constants.go b/sdk/resourcemanager/workloads/armworkloads/zz_generated_constants.go index 6c615eebe398..ff6d732081be 100644 --- a/sdk/resourcemanager/workloads/armworkloads/zz_generated_constants.go +++ b/sdk/resourcemanager/workloads/armworkloads/zz_generated_constants.go @@ -10,7 +10,7 @@ package armworkloads const ( moduleName = "armworkloads" - moduleVersion = "v0.1.0" + moduleVersion = "v0.2.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -27,6 +27,74 @@ func PossibleActionTypeValues() []ActionType { } } +// ApplicationProvisioningState - WordPress instance provisioning state +type ApplicationProvisioningState string + +const ( + ApplicationProvisioningStateAccepted ApplicationProvisioningState = "Accepted" + ApplicationProvisioningStateCanceled ApplicationProvisioningState = "Canceled" + ApplicationProvisioningStateCreated ApplicationProvisioningState = "Created" + ApplicationProvisioningStateFailed ApplicationProvisioningState = "Failed" + ApplicationProvisioningStateInstalling ApplicationProvisioningState = "Installing" + ApplicationProvisioningStateNotSpecified ApplicationProvisioningState = "NotSpecified" + ApplicationProvisioningStateSucceeded ApplicationProvisioningState = "Succeeded" +) + +// 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, + } +} + +// CentralServerVirtualMachineType - Defines the type of central server VM. +type CentralServerVirtualMachineType string + +const ( + CentralServerVirtualMachineTypeASCS CentralServerVirtualMachineType = "ASCS" + CentralServerVirtualMachineTypeERS CentralServerVirtualMachineType = "ERS" + CentralServerVirtualMachineTypeERSInactive CentralServerVirtualMachineType = "ERSInactive" + CentralServerVirtualMachineTypePrimary CentralServerVirtualMachineType = "Primary" + CentralServerVirtualMachineTypeSecondary CentralServerVirtualMachineType = "Secondary" + CentralServerVirtualMachineTypeStandby CentralServerVirtualMachineType = "Standby" + CentralServerVirtualMachineTypeUnknown CentralServerVirtualMachineType = "Unknown" +) + +// PossibleCentralServerVirtualMachineTypeValues returns the possible values for the CentralServerVirtualMachineType const type. +func PossibleCentralServerVirtualMachineTypeValues() []CentralServerVirtualMachineType { + return []CentralServerVirtualMachineType{ + CentralServerVirtualMachineTypeASCS, + CentralServerVirtualMachineTypeERS, + CentralServerVirtualMachineTypeERSInactive, + CentralServerVirtualMachineTypePrimary, + CentralServerVirtualMachineTypeSecondary, + CentralServerVirtualMachineTypeStandby, + CentralServerVirtualMachineTypeUnknown, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -47,6 +115,278 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } +// DatabaseTier - Tier of the server SKU +type DatabaseTier string + +const ( + DatabaseTierBurstable DatabaseTier = "Burstable" + DatabaseTierGeneralPurpose DatabaseTier = "GeneralPurpose" + DatabaseTierMemoryOptimized DatabaseTier = "MemoryOptimized" +) + +// 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, + } +} + +// EnqueueReplicationServerType - Defines the type of Enqueue Replication Server. +type EnqueueReplicationServerType string + +const ( + EnqueueReplicationServerTypeEnqueueReplicator1 EnqueueReplicationServerType = "EnqueueReplicator1" + EnqueueReplicationServerTypeEnqueueReplicator2 EnqueueReplicationServerType = "EnqueueReplicator2" +) + +// PossibleEnqueueReplicationServerTypeValues returns the possible values for the EnqueueReplicationServerType const type. +func PossibleEnqueueReplicationServerTypeValues() []EnqueueReplicationServerType { + return []EnqueueReplicationServerType{ + EnqueueReplicationServerTypeEnqueueReplicator1, + EnqueueReplicationServerTypeEnqueueReplicator2, + } +} + +// 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 + +const ( + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" +) + +// PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type. +func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { + return []ManagedServiceIdentityType{ + ManagedServiceIdentityTypeNone, + ManagedServiceIdentityTypeUserAssigned, + } +} + +// OSImageOffer - OS image offer +type OSImageOffer string + +const ( + OSImageOfferUbuntuServer OSImageOffer = "UbuntuServer" +) + +// 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, + } +} + +// OSType - The OS Type +type OSType string + +const ( + OSTypeLinux OSType = "Linux" + OSTypeWindows OSType = "Windows" +) + +// PossibleOSTypeValues returns the possible values for the OSType const type. +func PossibleOSTypeValues() []OSType { + return []OSType{ + OSTypeLinux, + OSTypeWindows, + } +} + // OperationProperties - Defines the workload operation origin. type OperationProperties string @@ -84,7 +424,69 @@ func PossibleOriginValues() []Origin { } } -// RoutingPreference - Sets the routing preference of the monitor. By default only RFC1918 traffic is routed to the customer +// 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 @@ -101,6 +503,358 @@ func PossibleRoutingPreferenceValues() []RoutingPreference { } } +// SAPConfigurationType - The configuration Type. +type SAPConfigurationType string + +const ( + SAPConfigurationTypeDeployment SAPConfigurationType = "Deployment" + SAPConfigurationTypeDeploymentWithOSConfig SAPConfigurationType = "DeploymentWithOSConfig" + SAPConfigurationTypeDiscovery SAPConfigurationType = "Discovery" +) + +// PossibleSAPConfigurationTypeValues returns the possible values for the SAPConfigurationType const type. +func PossibleSAPConfigurationTypeValues() []SAPConfigurationType { + return []SAPConfigurationType{ + SAPConfigurationTypeDeployment, + SAPConfigurationTypeDeploymentWithOSConfig, + SAPConfigurationTypeDiscovery, + } +} + +// SAPDatabaseScaleMethod - The database scale method. +type SAPDatabaseScaleMethod string + +const ( + SAPDatabaseScaleMethodScaleUp SAPDatabaseScaleMethod = "ScaleUp" +) + +// PossibleSAPDatabaseScaleMethodValues returns the possible values for the SAPDatabaseScaleMethod const type. +func PossibleSAPDatabaseScaleMethodValues() []SAPDatabaseScaleMethod { + return []SAPDatabaseScaleMethod{ + SAPDatabaseScaleMethodScaleUp, + } +} + +// SAPDatabaseType - Defines the supported SAP Database types. +type SAPDatabaseType string + +const ( + SAPDatabaseTypeDB2 SAPDatabaseType = "DB2" + SAPDatabaseTypeHANA SAPDatabaseType = "HANA" +) + +// PossibleSAPDatabaseTypeValues returns the possible values for the SAPDatabaseType const type. +func PossibleSAPDatabaseTypeValues() []SAPDatabaseType { + return []SAPDatabaseType{ + SAPDatabaseTypeDB2, + SAPDatabaseTypeHANA, + } +} + +// SAPDeploymentType - The deployment Type. +type SAPDeploymentType string + +const ( + SAPDeploymentTypeSingleServer SAPDeploymentType = "SingleServer" + SAPDeploymentTypeThreeTier SAPDeploymentType = "ThreeTier" +) + +// PossibleSAPDeploymentTypeValues returns the possible values for the SAPDeploymentType const type. +func PossibleSAPDeploymentTypeValues() []SAPDeploymentType { + return []SAPDeploymentType{ + SAPDeploymentTypeSingleServer, + SAPDeploymentTypeThreeTier, + } +} + +// SAPEnvironmentType - Defines the environment type - Production/Non Production. +type SAPEnvironmentType string + +const ( + SAPEnvironmentTypeNonProd SAPEnvironmentType = "NonProd" + SAPEnvironmentTypeProd SAPEnvironmentType = "Prod" +) + +// PossibleSAPEnvironmentTypeValues returns the possible values for the SAPEnvironmentType const type. +func PossibleSAPEnvironmentTypeValues() []SAPEnvironmentType { + return []SAPEnvironmentType{ + SAPEnvironmentTypeNonProd, + SAPEnvironmentTypeProd, + } +} + +// SAPHealthState - Defines the SAP Instance health. +type SAPHealthState string + +const ( + SAPHealthStateDegraded SAPHealthState = "Degraded" + SAPHealthStateHealthy SAPHealthState = "Healthy" + SAPHealthStateUnhealthy SAPHealthState = "Unhealthy" + SAPHealthStateUnknown SAPHealthState = "Unknown" +) + +// PossibleSAPHealthStateValues returns the possible values for the SAPHealthState const type. +func PossibleSAPHealthStateValues() []SAPHealthState { + return []SAPHealthState{ + SAPHealthStateDegraded, + SAPHealthStateHealthy, + SAPHealthStateUnhealthy, + SAPHealthStateUnknown, + } +} + +// SAPHighAvailabilityType - The high availability Type. AvailabilitySet guarantees 99.95% availability. Availability Zone +// guarantees 99.99% availability. +type SAPHighAvailabilityType string + +const ( + SAPHighAvailabilityTypeAvailabilitySet SAPHighAvailabilityType = "AvailabilitySet" + SAPHighAvailabilityTypeAvailabilityZone SAPHighAvailabilityType = "AvailabilityZone" +) + +// PossibleSAPHighAvailabilityTypeValues returns the possible values for the SAPHighAvailabilityType const type. +func PossibleSAPHighAvailabilityTypeValues() []SAPHighAvailabilityType { + return []SAPHighAvailabilityType{ + SAPHighAvailabilityTypeAvailabilitySet, + SAPHighAvailabilityTypeAvailabilityZone, + } +} + +// SAPProductType - Defines the SAP Product type. +type SAPProductType string + +const ( + SAPProductTypeECC SAPProductType = "ECC" + SAPProductTypeOther SAPProductType = "Other" + SAPProductTypeS4HANA SAPProductType = "S4HANA" +) + +// PossibleSAPProductTypeValues returns the possible values for the SAPProductType const type. +func PossibleSAPProductTypeValues() []SAPProductType { + return []SAPProductType{ + SAPProductTypeECC, + SAPProductTypeOther, + SAPProductTypeS4HANA, + } +} + +// SAPSoftwareInstallationType - The SAP software installation Type. +type SAPSoftwareInstallationType string + +const ( + SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig SAPSoftwareInstallationType = "SAPInstallWithoutOSConfig" + SAPSoftwareInstallationTypeServiceInitiated SAPSoftwareInstallationType = "ServiceInitiated" +) + +// PossibleSAPSoftwareInstallationTypeValues returns the possible values for the SAPSoftwareInstallationType const type. +func PossibleSAPSoftwareInstallationTypeValues() []SAPSoftwareInstallationType { + return []SAPSoftwareInstallationType{ + SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig, + SAPSoftwareInstallationTypeServiceInitiated, + } +} + +// SAPVirtualInstanceState - Defines the Virtual Instance for SAP state. +type SAPVirtualInstanceState string + +const ( + SAPVirtualInstanceStateDiscoveryFailed SAPVirtualInstanceState = "DiscoveryFailed" + SAPVirtualInstanceStateDiscoveryInProgress SAPVirtualInstanceState = "DiscoveryInProgress" + SAPVirtualInstanceStateDiscoveryPending SAPVirtualInstanceState = "DiscoveryPending" + SAPVirtualInstanceStateInfrastructureDeploymentFailed SAPVirtualInstanceState = "InfrastructureDeploymentFailed" + SAPVirtualInstanceStateInfrastructureDeploymentInProgress SAPVirtualInstanceState = "InfrastructureDeploymentInProgress" + SAPVirtualInstanceStateInfrastructureDeploymentPending SAPVirtualInstanceState = "InfrastructureDeploymentPending" + SAPVirtualInstanceStateRegistrationComplete SAPVirtualInstanceState = "RegistrationComplete" + SAPVirtualInstanceStateSoftwareInstallationFailed SAPVirtualInstanceState = "SoftwareInstallationFailed" + SAPVirtualInstanceStateSoftwareInstallationInProgress SAPVirtualInstanceState = "SoftwareInstallationInProgress" + SAPVirtualInstanceStateSoftwareInstallationPending SAPVirtualInstanceState = "SoftwareInstallationPending" +) + +// PossibleSAPVirtualInstanceStateValues returns the possible values for the SAPVirtualInstanceState const type. +func PossibleSAPVirtualInstanceStateValues() []SAPVirtualInstanceState { + return []SAPVirtualInstanceState{ + SAPVirtualInstanceStateDiscoveryFailed, + SAPVirtualInstanceStateDiscoveryInProgress, + SAPVirtualInstanceStateDiscoveryPending, + SAPVirtualInstanceStateInfrastructureDeploymentFailed, + SAPVirtualInstanceStateInfrastructureDeploymentInProgress, + SAPVirtualInstanceStateInfrastructureDeploymentPending, + SAPVirtualInstanceStateRegistrationComplete, + SAPVirtualInstanceStateSoftwareInstallationFailed, + SAPVirtualInstanceStateSoftwareInstallationInProgress, + SAPVirtualInstanceStateSoftwareInstallationPending, + } +} + +// SAPVirtualInstanceStatus - Defines the SAP Instance status. +type SAPVirtualInstanceStatus string + +const ( + SAPVirtualInstanceStatusOffline SAPVirtualInstanceStatus = "Offline" + SAPVirtualInstanceStatusPartiallyRunning SAPVirtualInstanceStatus = "PartiallyRunning" + SAPVirtualInstanceStatusRunning SAPVirtualInstanceStatus = "Running" + SAPVirtualInstanceStatusStarting SAPVirtualInstanceStatus = "Starting" + SAPVirtualInstanceStatusStopping SAPVirtualInstanceStatus = "Stopping" + SAPVirtualInstanceStatusUnavailable SAPVirtualInstanceStatus = "Unavailable" +) + +// PossibleSAPVirtualInstanceStatusValues returns the possible values for the SAPVirtualInstanceStatus const type. +func PossibleSAPVirtualInstanceStatusValues() []SAPVirtualInstanceStatus { + return []SAPVirtualInstanceStatus{ + SAPVirtualInstanceStatusOffline, + SAPVirtualInstanceStatusPartiallyRunning, + SAPVirtualInstanceStatusRunning, + 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 + +const ( + SKURestrictionTypeLocation SKURestrictionType = "Location" + SKURestrictionTypeNotSpecified SKURestrictionType = "NotSpecified" + SKURestrictionTypeZone SKURestrictionType = "Zone" +) + +// PossibleSKURestrictionTypeValues returns the possible values for the SKURestrictionType const type. +func PossibleSKURestrictionTypeValues() []SKURestrictionType { + return []SKURestrictionType{ + SKURestrictionTypeLocation, + SKURestrictionTypeNotSpecified, + SKURestrictionTypeZone, + } +} + +// SKUScaleType - Scale type of the SKU capacity. +type SKUScaleType string + +const ( + SKUScaleTypeAutomatic SKUScaleType = "Automatic" + SKUScaleTypeManual SKUScaleType = "Manual" + SKUScaleTypeNone SKUScaleType = "None" +) + +// 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, + } +} + +// SapVirtualInstanceProvisioningState - Defines the provisioning states. +type SapVirtualInstanceProvisioningState string + +const ( + SapVirtualInstanceProvisioningStateCreating SapVirtualInstanceProvisioningState = "Creating" + SapVirtualInstanceProvisioningStateDeleting SapVirtualInstanceProvisioningState = "Deleting" + SapVirtualInstanceProvisioningStateFailed SapVirtualInstanceProvisioningState = "Failed" + SapVirtualInstanceProvisioningStateSucceeded SapVirtualInstanceProvisioningState = "Succeeded" + SapVirtualInstanceProvisioningStateUpdating SapVirtualInstanceProvisioningState = "Updating" +) + +// PossibleSapVirtualInstanceProvisioningStateValues returns the possible values for the SapVirtualInstanceProvisioningState const type. +func PossibleSapVirtualInstanceProvisioningStateValues() []SapVirtualInstanceProvisioningState { + return []SapVirtualInstanceProvisioningState{ + SapVirtualInstanceProvisioningStateCreating, + SapVirtualInstanceProvisioningStateDeleting, + SapVirtualInstanceProvisioningStateFailed, + SapVirtualInstanceProvisioningStateSucceeded, + SapVirtualInstanceProvisioningStateUpdating, + } +} + +// 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 @@ -117,7 +871,7 @@ func PossibleWorkloadMonitorActionTypeValues() []WorkloadMonitorActionType { } } -// WorkloadMonitorProvisioningState - State of provisioning of the monitor. +// WorkloadMonitorProvisioningState - State of provisioning of the SAP monitor. type WorkloadMonitorProvisioningState string const ( diff --git a/sdk/resourcemanager/workloads/armworkloads/zz_generated_models.go b/sdk/resourcemanager/workloads/armworkloads/zz_generated_models.go index 1a83d1c31d76..7a9a8dfb0a93 100644 --- a/sdk/resourcemanager/workloads/armworkloads/zz_generated_models.go +++ b/sdk/resourcemanager/workloads/armworkloads/zz_generated_models.go @@ -10,6 +10,90 @@ package armworkloads import "time" +// ApplicationServerConfiguration - Gets or sets the application server configuration. +type ApplicationServerConfiguration struct { + // REQUIRED; The number of app server instances. + InstanceCount *int64 `json:"instanceCount,omitempty"` + + // REQUIRED; The subnet id. + SubnetID *string `json:"subnetId,omitempty"` + + // REQUIRED; Gets or sets the virtual machine configuration. + 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"` + + // READ-ONLY; Backup vault resource Id + VaultResourceID *string `json:"vaultResourceId,omitempty" azure:"ro"` +} + +// CacheProfile - Cache profile +type CacheProfile struct { + // REQUIRED; Cache capacity + Capacity *int64 `json:"capacity,omitempty"` + + // REQUIRED; Cache family + Family *RedisCacheFamily `json:"family,omitempty"` + + // 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"` +} + +// CentralServerConfiguration - Gets or sets the central server configuration. +type CentralServerConfiguration struct { + // REQUIRED; The number of central server VMs. + InstanceCount *int64 `json:"instanceCount,omitempty"` + + // REQUIRED; The subnet id. + SubnetID *string `json:"subnetId,omitempty"` + + // REQUIRED; Gets or sets the virtual machine configuration. + VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` +} + +// CentralServerVMDetails - The Central Server VM Details. +type CentralServerVMDetails struct { + // READ-ONLY; Defines the type of central server VM. + Type *CentralServerVirtualMachineType `json:"type,omitempty" azure:"ro"` + + // READ-ONLY + VirtualMachineID *string `json:"virtualMachineId,omitempty" azure:"ro"` +} + +// ClientSAPAvailabilityZoneDetailsOptions contains the optional parameters for the Client.SAPAvailabilityZoneDetails method. +type ClientSAPAvailabilityZoneDetailsOptions struct { + // SAP Availability Zone Details Request body + SAPAvailabilityZoneDetails *SAPAvailabilityZoneDetailsRequest +} + +// ClientSAPDiskConfigurationsOptions contains the optional parameters for the Client.SAPDiskConfigurations method. +type ClientSAPDiskConfigurationsOptions struct { + // SAP Disk Configurations Request body + SAPDiskConfigurations *SAPDiskConfigurationsRequest +} + +// ClientSAPSizingRecommendationsOptions contains the optional parameters for the Client.SAPSizingRecommendations method. +type ClientSAPSizingRecommendationsOptions struct { + // SAP Sizing Recommendation Request body + SAPSizingRecommendation *SAPSizingRecommendationRequest +} + +// ClientSAPSupportedSKUOptions contains the optional parameters for the Client.SAPSupportedSKU method. +type ClientSAPSupportedSKUOptions struct { + // SAP Supported SKU Request body + SAPSupportedSKU *SAPSupportedSKUsRequest +} + // DB2ProviderInstanceProperties - Gets or sets the DB2 provider properties. type DB2ProviderInstanceProperties struct { // REQUIRED; The provider type. For example, the value can be SapHana. @@ -44,6 +128,192 @@ func (d *DB2ProviderInstanceProperties) GetProviderSpecificProperties() *Provide } } +// DatabaseConfiguration - Gets or sets the database configuration. +type DatabaseConfiguration struct { + // REQUIRED; The number of database VMs. + InstanceCount *int64 `json:"instanceCount,omitempty"` + + // REQUIRED; The subnet id. + SubnetID *string `json:"subnetId,omitempty"` + + // REQUIRED; Gets or sets the virtual machine configuration. + VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` + + // 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"` + + // SKU name for database storage + StorageSKU *string `json:"storageSku,omitempty"` + + // Database version + Version *string `json:"version,omitempty"` + + // READ-ONLY; Azure Database Server resource Id + ServerResourceID *string `json:"serverResourceId,omitempty" azure:"ro"` +} + +// DatabaseVMDetails - The Database VM Details. +type DatabaseVMDetails struct { + // READ-ONLY; Defines the SAP Instance status. + Status *SAPVirtualInstanceStatus `json:"status,omitempty" azure:"ro"` + + // READ-ONLY + VirtualMachineID *string `json:"virtualMachineId,omitempty" azure:"ro"` +} + +// DeployerVMPackages - Defines the url and storage account ID where deployer VM packages are uploaded +type DeployerVMPackages struct { + // The deployer VM packages storage account id + StorageAccountID *string `json:"storageAccountId,omitempty"` + + // The URL to the deployer VM packages file. + URL *string `json:"url,omitempty"` +} + +// DeploymentConfiguration - Deployment Configuration. +type DeploymentConfiguration struct { + // REQUIRED; The configuration Type. + ConfigurationType *SAPConfigurationType `json:"configurationType,omitempty"` + + // The geo-location where the SAP system is to be created. + AppLocation *string `json:"appLocation,omitempty"` + + // The infrastructure configuration. + InfrastructureConfiguration InfrastructureConfigurationClassification `json:"infrastructureConfiguration,omitempty"` + + // The software configuration. + SoftwareConfiguration SoftwareConfigurationClassification `json:"softwareConfiguration,omitempty"` +} + +// GetSAPConfiguration implements the SAPConfigurationClassification interface for type DeploymentConfiguration. +func (d *DeploymentConfiguration) GetSAPConfiguration() *SAPConfiguration { + return &SAPConfiguration{ + ConfigurationType: d.ConfigurationType, + } +} + +// DeploymentWithOSConfiguration - Deployment along with OS Configuration. +type DeploymentWithOSConfiguration struct { + // REQUIRED; The configuration Type. + ConfigurationType *SAPConfigurationType `json:"configurationType,omitempty"` + + // The geo-location where the SAP system is to be created. + AppLocation *string `json:"appLocation,omitempty"` + + // The infrastructure configuration. + InfrastructureConfiguration InfrastructureConfigurationClassification `json:"infrastructureConfiguration,omitempty"` + + // The OS and SAP configuration. + OSSapConfiguration *OsSapConfiguration `json:"osSapConfiguration,omitempty"` + + // The software configuration. + SoftwareConfiguration SoftwareConfigurationClassification `json:"softwareConfiguration,omitempty"` +} + +// GetSAPConfiguration implements the SAPConfigurationClassification interface for type DeploymentWithOSConfiguration. +func (d *DeploymentWithOSConfiguration) GetSAPConfiguration() *SAPConfiguration { + return &SAPConfiguration{ + ConfigurationType: d.ConfigurationType, + } +} + +// DiscoveryConfiguration - Discovery Details. +type DiscoveryConfiguration struct { + // REQUIRED; The configuration Type. + ConfigurationType *SAPConfigurationType `json:"configurationType,omitempty"` + + // The virtual machine ID of the Central Server. + CentralServerVMID *string `json:"centralServerVmId,omitempty"` + + // READ-ONLY; The geo-location where the SAP system exists. + AppLocation *string `json:"appLocation,omitempty" azure:"ro"` +} + +// GetSAPConfiguration implements the SAPConfigurationClassification interface for type DiscoveryConfiguration. +func (d *DiscoveryConfiguration) GetSAPConfiguration() *SAPConfiguration { + return &SAPConfiguration{ + ConfigurationType: d.ConfigurationType, + } +} + +// DiskInfo - Disk resource creation details +type DiskInfo struct { + // REQUIRED; Storage type + StorageType *DiskStorageType `json:"storageType,omitempty"` + + // Disk size in GB + SizeInGB *int64 `json:"sizeInGB,omitempty"` +} + +// EnqueueReplicationServerProperties - Defines the SAP ERS Server 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. + Health *SAPHealthState `json:"health,omitempty" azure:"ro"` + + // READ-ONLY; The ERS server SAP host name. + Hostname *string `json:"hostname,omitempty" azure:"ro"` + + // READ-ONLY; The ERS server SAP IP Address. + IPAddress *string `json:"ipAddress,omitempty" azure:"ro"` + + // READ-ONLY; The ERS server instance id. + InstanceNo *string `json:"instanceNo,omitempty" azure:"ro"` + + // READ-ONLY; The ERS server SAP kernel patch. + KernelPatch *string `json:"kernelPatch,omitempty" azure:"ro"` + + // READ-ONLY; The ERS server SAP kernel version. + KernelVersion *string `json:"kernelVersion,omitempty" azure:"ro"` +} + +// EnqueueServerProperties - Defines the SAP enqueue server properties. +type EnqueueServerProperties struct { + // READ-ONLY; Defines the SAP Instance health. + Health *SAPHealthState `json:"health,omitempty" azure:"ro"` + + // READ-ONLY; The enqueue server SAP host name. + Hostname *string `json:"hostname,omitempty" azure:"ro"` + + // READ-ONLY; The enqueue server SAP IP Address. + IPAddress *string `json:"ipAddress,omitempty" azure:"ro"` + + // READ-ONLY; The enqueue server Port. + Port *int64 `json:"port,omitempty" azure:"ro"` +} + // Error - Standard error object. type Error struct { // READ-ONLY; Server-defined set of error codes. @@ -71,6 +341,18 @@ type ErrorAdditionalInfo struct { Type *string `json:"type,omitempty" azure:"ro"` } +// ErrorDefinition - Error definition. +type ErrorDefinition struct { + // READ-ONLY; Service specific error code which serves as the substatus for the HTTP error code. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; Internal error details. + Details []*ErrorDefinition `json:"details,omitempty" azure:"ro"` + + // READ-ONLY; Description of the error. + Message *string `json:"message,omitempty" azure:"ro"` +} + // ErrorDetail - The error detail. type ErrorDetail struct { // READ-ONLY; The error additional info. @@ -102,6 +384,33 @@ type ErrorResponse struct { Error *ErrorDetail `json:"error,omitempty"` } +// FileshareProfile - File share profile +type FileshareProfile struct { + // REQUIRED; Share type + ShareType *FileShareType `json:"shareType,omitempty"` + + // REQUIRED; File share backing storage type + StorageType *FileShareStorageType `json:"storageType,omitempty"` + + // File share size in GB + ShareSizeInGB *int64 `json:"shareSizeInGB,omitempty"` + + // READ-ONLY; File share name + ShareName *string `json:"shareName,omitempty" azure:"ro"` + + // READ-ONLY; File share storage resource id + StorageResourceID *string `json:"storageResourceId,omitempty" azure:"ro"` +} + +// GatewayServerProperties - Defines the SAP Gateway Server properties. +type GatewayServerProperties struct { + // READ-ONLY; Defines the SAP Instance health. + Health *SAPHealthState `json:"health,omitempty" azure:"ro"` + + // READ-ONLY; The gateway Port. + Port *int64 `json:"port,omitempty" azure:"ro"` +} + // HanaDbProviderInstanceProperties - Gets or sets the provider properties. type HanaDbProviderInstanceProperties struct { // REQUIRED; The provider type. For example, the value can be SapHana. @@ -142,17 +451,136 @@ func (h *HanaDbProviderInstanceProperties) GetProviderSpecificProperties() *Prov } } +// HighAvailabilityConfiguration - Gets or sets the high availability configuration. +type HighAvailabilityConfiguration struct { + // REQUIRED; The high availability type. + HighAvailabilityType *SAPHighAvailabilityType `json:"highAvailabilityType,omitempty"` +} + +// HighAvailabilitySoftwareConfiguration - Gets or sets the HA software configuration. +type HighAvailabilitySoftwareConfiguration struct { + // REQUIRED; The fencing client id. + FencingClientID *string `json:"fencingClientId,omitempty"` + + // REQUIRED; The fencing client id secret/password. The secret should never expire. This will be used pacemaker to start/stop + // the cluster VMs. + FencingClientPassword *string `json:"fencingClientPassword,omitempty"` +} + +// ImageReference - Specifies information about the image to use. You can specify information about platform images, marketplace +// images, or virtual machine images. This element is required when you want to use a platform +// image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference +// publisher and offer can only be set when you create the scale set. +type ImageReference struct { + // Specifies the offer of the platform image or marketplace image used to create the virtual machine. + Offer *string `json:"offer,omitempty"` + + // The image publisher. + Publisher *string `json:"publisher,omitempty"` + + // The image SKU. + SKU *string `json:"sku,omitempty"` + + // Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call. + SharedGalleryImageID *string `json:"sharedGalleryImageId,omitempty"` + + // Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats + // are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. + // Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image + // will not automatically update after deploy time even if a new version becomes + // available. + Version *string `json:"version,omitempty"` + + // READ-ONLY; Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual + // machine. This readonly field differs from 'version', only if the value specified in + // 'version' field is 'latest'. + ExactVersion *string `json:"exactVersion,omitempty" azure:"ro"` +} + +// InfrastructureConfigurationClassification provides polymorphic access to related types. +// Call the interface's GetInfrastructureConfiguration() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *InfrastructureConfiguration, *SingleServerConfiguration, *ThreeTierConfiguration +type InfrastructureConfigurationClassification interface { + // GetInfrastructureConfiguration returns the InfrastructureConfiguration content of the underlying type. + GetInfrastructureConfiguration() *InfrastructureConfiguration +} + +// InfrastructureConfiguration - Deploy SAP Infrastructure Details. +type InfrastructureConfiguration struct { + // REQUIRED; The application resource group where SAP system resources will be deployed. + AppResourceGroup *string `json:"appResourceGroup,omitempty"` + + // REQUIRED; The deployment Type. + DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` +} + +// GetInfrastructureConfiguration implements the InfrastructureConfigurationClassification interface for type InfrastructureConfiguration. +func (i *InfrastructureConfiguration) GetInfrastructureConfiguration() *InfrastructureConfiguration { + return i +} + +// LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine. +// For a list of supported Linux distributions, see Linux on Azure-Endorsed Distributions [https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros]. +type LinuxConfiguration struct { + // REQUIRED; The OS Type + OSType *OSType `json:"osType,omitempty"` + + // Specifies whether password authentication should be disabled. + DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` + + // Specifies the ssh key configuration for a Linux OS. (This property is deprecated, please use 'sshKeyPair' instead) + SSH *SSHConfiguration `json:"ssh,omitempty"` + + // The SSH Key-pair used to authenticate with the VM's. + SSHKeyPair *SSHKeyPair `json:"sshKeyPair,omitempty"` +} + +// GetOSConfiguration implements the OSConfigurationClassification interface for type LinuxConfiguration. +func (l *LinuxConfiguration) GetOSConfiguration() *OSConfiguration { + return &OSConfiguration{ + OSType: l.OSType, + } +} + // ManagedRGConfiguration - Managed resource group configuration type ManagedRGConfiguration struct { // Managed resource group name Name *string `json:"name,omitempty"` } +// MessageServerProperties - Defines the SAP message server properties. +type MessageServerProperties struct { + // READ-ONLY; The message server http port. + HTTPPort *int64 `json:"httpPort,omitempty" azure:"ro"` + + // READ-ONLY; The message server https port. + HTTPSPort *int64 `json:"httpsPort,omitempty" azure:"ro"` + + // READ-ONLY; Defines the SAP Instance health. + Health *SAPHealthState `json:"health,omitempty" azure:"ro"` + + // READ-ONLY; The message server SAP host name. + Hostname *string `json:"hostname,omitempty" azure:"ro"` + + // READ-ONLY; The message server IP Address. + IPAddress *string `json:"ipAddress,omitempty" azure:"ro"` + + // READ-ONLY; The message server internal MS port. + InternalMsPort *int64 `json:"internalMsPort,omitempty" azure:"ro"` + + // READ-ONLY; The message server port. + MSPort *int64 `json:"msPort,omitempty" azure:"ro"` +} + // Monitor - SAP monitor info on Azure (ARM properties and SAP monitor properties) type Monitor struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` + // Managed service identity (user assigned identities) + Identity *UserAssignedServiceIdentity `json:"identity,omitempty"` + // SAP monitor properties Properties *MonitorProperties `json:"properties,omitempty"` @@ -183,10 +611,11 @@ type MonitorListResult struct { // MonitorProperties - Describes the properties of a SAP monitor. type MonitorProperties struct { - // The monitor resources will be deployed in the monitoring region. The subnet region should be same as the monitoring region. + // The SAP monitor resources will be deployed in the SAP monitoring region. The subnet region should be same as the SAP monitoring + // region. AppLocation *string `json:"appLocation,omitempty"` - // The ARM ID of the Log Analytics Workspace that is used for monitoring. + // The ARM ID of the Log Analytics Workspace that is used for SAP monitoring. LogAnalyticsWorkspaceArmID *string `json:"logAnalyticsWorkspaceArmId,omitempty"` // Managed resource group configuration @@ -195,16 +624,16 @@ type MonitorProperties struct { // The subnet which the SAP monitor will be deployed in MonitorSubnet *string `json:"monitorSubnet,omitempty"` - // Sets the routing preference of the monitor. By default only RFC1918 traffic is routed to the customer VNET. + // Sets the routing preference of the SAP monitor. By default only RFC1918 traffic is routed to the customer VNET. RoutingPreference *RoutingPreference `json:"routingPreference,omitempty"` // READ-ONLY; Defines the SAP monitor errors. Errors *MonitorPropertiesErrors `json:"errors,omitempty" azure:"ro"` - // READ-ONLY; The ARM ID of the MSI used for monitoring. + // READ-ONLY; The ARM ID of the MSI used for SAP monitoring. MsiArmID *string `json:"msiArmId,omitempty" azure:"ro"` - // READ-ONLY; State of provisioning of the monitor. + // READ-ONLY; State of provisioning of the SAP monitor. ProvisioningState *WorkloadMonitorProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } @@ -289,6 +718,119 @@ func (m *MsSQLServerProviderInstanceProperties) GetProviderSpecificProperties() } } +// NetworkConfiguration - Defines the network configuration for SAP infrastructure +type NetworkConfiguration struct { + // Specifies whether a secondary IP address should be added to the network interface on all VMs + 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"` +} + +// OSConfigurationClassification provides polymorphic access to related types. +// Call the interface's GetOSConfiguration() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *LinuxConfiguration, *OSConfiguration, *WindowsConfiguration +type OSConfigurationClassification interface { + // GetOSConfiguration returns the OSConfiguration content of the underlying type. + GetOSConfiguration() *OSConfiguration +} + +// OSConfiguration - Defines the OS configuration. +type OSConfiguration struct { + // REQUIRED; The OS Type + OSType *OSType `json:"osType,omitempty"` +} + +// GetOSConfiguration implements the OSConfigurationClassification interface for type OSConfiguration. +func (o *OSConfiguration) GetOSConfiguration() *OSConfiguration { return o } + +// OSProfile - Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once +// VM is provisioned. +type OSProfile struct { + // Specifies the password of the administrator account. + // Minimum-length (Windows): 8 characters + // Minimum-length (Linux): 6 characters + // Max-length (Windows): 123 characters + // Max-length (Linux): 72 characters + // Complexity requirements: 3 out of 4 conditions below need to be fulfilled + // Has lower characters + // Has upper characters + // Has a digit + // Has a special character (Regex match [\W_]) + // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", + // "Password22", "iloveyou!" + // For resetting the password, see How to reset the Remote Desktop service or its login password in a Windows VM [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp] + // For resetting root password, see Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension + // [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection] + AdminPassword *string `json:"adminPassword,omitempty"` + + // Specifies the name of the administrator account. + // This property cannot be updated after the VM is created. + // Windows-only restriction: Cannot end in "." + // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", + // "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + // "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". + // Minimum-length (Linux): 1 character + // Max-length (Linux): 64 characters + // Max-length (Windows): 20 characters. + AdminUsername *string `json:"adminUsername,omitempty"` + + // Specifies Windows operating system settings on the virtual machine. + OSConfiguration OSConfigurationClassification `json:"osConfiguration,omitempty"` +} + // Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. @@ -448,51 +990,71 @@ type OperationsDisplayDefinition struct { Resource *string `json:"resource,omitempty"` } -// PrometheusHaClusterProviderInstanceProperties - Gets or sets the PrometheusHaCluster provider properties. -type PrometheusHaClusterProviderInstanceProperties struct { - // REQUIRED; The provider type. For example, the value can be SapHana. - ProviderType *string `json:"providerType,omitempty"` +// OsImageProfile - OS image profile +type OsImageProfile struct { + // OS image offer + Offer *OSImageOffer `json:"offer,omitempty"` - // Gets or sets the clusterName. - ClusterName *string `json:"clusterName,omitempty"` + // OS image publisher + Publisher *OSImagePublisher `json:"publisher,omitempty"` - // Gets or sets the target machine name. - Hostname *string `json:"hostname,omitempty"` + // OS image sku + SKU *OSImageSKU `json:"sku,omitempty"` - // URL of the Node Exporter endpoint. - PrometheusURL *string `json:"prometheusUrl,omitempty"` + // OS image version + Version *OSImageVersion `json:"version,omitempty"` +} - // Gets or sets the cluster sid. - Sid *string `json:"sid,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 + DeployerVMPackages *DeployerVMPackages `json:"deployerVmPackages,omitempty"` + + // The FQDN to set for the SAP system + SapFqdn *string `json:"sapFqdn,omitempty"` } -// GetProviderSpecificProperties implements the ProviderSpecificPropertiesClassification interface for type PrometheusHaClusterProviderInstanceProperties. -func (p *PrometheusHaClusterProviderInstanceProperties) GetProviderSpecificProperties() *ProviderSpecificProperties { - return &ProviderSpecificProperties{ - ProviderType: p.ProviderType, - } +// PatchResourceRequestBody - Resource patch request body +type PatchResourceRequestBody struct { + Identity *PatchResourceRequestBodyIdentity `json:"identity,omitempty"` + + // Resource tags + Tags map[string]*string `json:"tags,omitempty"` } -// PrometheusOSProviderInstanceProperties - Gets or sets the PrometheusOS provider properties. -type PrometheusOSProviderInstanceProperties struct { - // REQUIRED; The provider type. For example, the value can be SapHana. - ProviderType *string `json:"providerType,omitempty"` +type PatchResourceRequestBodyIdentity struct { + // REQUIRED; Type of manage identity + Type *ManagedServiceIdentityType `json:"type,omitempty"` - // URL of the Node Exporter endpoint - PrometheusURL *string `json:"prometheusUrl,omitempty"` + // User assigned identities dictionary + UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities,omitempty"` } -// GetProviderSpecificProperties implements the ProviderSpecificPropertiesClassification interface for type PrometheusOSProviderInstanceProperties. -func (p *PrometheusOSProviderInstanceProperties) GetProviderSpecificProperties() *ProviderSpecificProperties { - return &ProviderSpecificProperties{ - ProviderType: p.ProviderType, - } +// PhpProfile - PHP profile +type PhpProfile struct { + // REQUIRED; PHP version + Version *PHPVersion `json:"version,omitempty"` } -// ProviderInstance - A provider instance associated with monitor. -type ProviderInstance struct { - // Provider Instance properties - Properties *ProviderInstanceProperties `json:"properties,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"` @@ -507,55 +1069,217 @@ type ProviderInstance struct { Type *string `json:"type,omitempty" azure:"ro"` } -// ProviderInstanceListResult - The response from the List provider instances operation. -type ProviderInstanceListResult struct { - // The URL to get the next set of provider instances. +// 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"` - // The list of provider instances. - Value []*ProviderInstance `json:"value,omitempty"` + // List of resources in current page + Value []*PhpWorkloadResource `json:"value,omitempty"` } -// ProviderInstanceProperties - Describes the properties of a provider instance. -type ProviderInstanceProperties struct { - // Defines the provider instance errors. - ProviderSettings ProviderSpecificPropertiesClassification `json:"providerSettings,omitempty"` +// PhpWorkloadResourceProperties - PHP workload resource properties +type PhpWorkloadResourceProperties struct { + // REQUIRED; Admin user profile used for VM and VMSS + AdminUserProfile *UserProfile `json:"adminUserProfile,omitempty"` - // READ-ONLY; Defines the provider instance errors. - Errors *ProviderInstancePropertiesErrors `json:"errors,omitempty" azure:"ro"` + // REQUIRED; The infra resources for PHP workload will be created in this location + AppLocation *string `json:"appLocation,omitempty"` - // READ-ONLY; State of provisioning of the provider instance - ProvisioningState *WorkloadMonitorProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} + // REQUIRED; Controller VM profile + ControllerProfile *NodeProfile `json:"controllerProfile,omitempty"` -// ProviderInstancePropertiesErrors - Defines the provider instance errors. -type ProviderInstancePropertiesErrors struct { - // READ-ONLY; Server-defined set of error codes. - Code *string `json:"code,omitempty" azure:"ro"` + // REQUIRED; Database profile + DatabaseProfile *DatabaseProfile `json:"databaseProfile,omitempty"` - // READ-ONLY; Array of details about specific errors that led to this reported error. - Details []*Error `json:"details,omitempty" azure:"ro"` + // REQUIRED; VMSS web nodes profile + WebNodesProfile *VmssNodesProfile `json:"webNodesProfile,omitempty"` - // READ-ONLY; Object containing more specific information than the current object about the error. - InnerError *ErrorInnerError `json:"innerError,omitempty" azure:"ro"` + // Backup profile + BackupProfile *BackupProfile `json:"backupProfile,omitempty"` - // READ-ONLY; Human-readable representation of the error. - Message *string `json:"message,omitempty" azure:"ro"` + // Cache profile + CacheProfile *CacheProfile `json:"cacheProfile,omitempty"` - // READ-ONLY; Target of the error. - Target *string `json:"target,omitempty" azure:"ro"` + // 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"` } -// ProviderInstancesClientBeginCreateOptions contains the optional parameters for the ProviderInstancesClient.BeginCreate +// PhpWorkloadsClientBeginCreateOrUpdateOptions contains the optional parameters for the PhpWorkloadsClient.BeginCreateOrUpdate // method. -type ProviderInstancesClientBeginCreateOptions struct { +type PhpWorkloadsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// ProviderInstancesClientBeginDeleteOptions contains the optional parameters for the ProviderInstancesClient.BeginDelete -// method. -type ProviderInstancesClientBeginDeleteOptions struct { +// 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. + ProviderType *string `json:"providerType,omitempty"` + + // Gets or sets the clusterName. + ClusterName *string `json:"clusterName,omitempty"` + + // Gets or sets the target machine name. + Hostname *string `json:"hostname,omitempty"` + + // URL of the Node Exporter endpoint. + PrometheusURL *string `json:"prometheusUrl,omitempty"` + + // Gets or sets the cluster sid. + Sid *string `json:"sid,omitempty"` +} + +// GetProviderSpecificProperties implements the ProviderSpecificPropertiesClassification interface for type PrometheusHaClusterProviderInstanceProperties. +func (p *PrometheusHaClusterProviderInstanceProperties) GetProviderSpecificProperties() *ProviderSpecificProperties { + return &ProviderSpecificProperties{ + ProviderType: p.ProviderType, + } +} + +// PrometheusOSProviderInstanceProperties - Gets or sets the PrometheusOS provider properties. +type PrometheusOSProviderInstanceProperties struct { + // REQUIRED; The provider type. For example, the value can be SapHana. + ProviderType *string `json:"providerType,omitempty"` + + // URL of the Node Exporter endpoint + PrometheusURL *string `json:"prometheusUrl,omitempty"` +} + +// GetProviderSpecificProperties implements the ProviderSpecificPropertiesClassification interface for type PrometheusOSProviderInstanceProperties. +func (p *PrometheusOSProviderInstanceProperties) GetProviderSpecificProperties() *ProviderSpecificProperties { + return &ProviderSpecificProperties{ + ProviderType: p.ProviderType, + } +} + +// ProviderInstance - A provider instance associated with SAP monitor. +type ProviderInstance struct { + // Managed service identity (user assigned identities) + Identity *UserAssignedServiceIdentity `json:"identity,omitempty"` + + // Provider Instance properties + Properties *ProviderInstanceProperties `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"` +} + +// ProviderInstanceListResult - The response from the List provider instances operation. +type ProviderInstanceListResult struct { + // The URL to get the next set of provider instances. + NextLink *string `json:"nextLink,omitempty"` + + // The list of provider instances. + Value []*ProviderInstance `json:"value,omitempty"` +} + +// ProviderInstanceProperties - Describes the properties of a provider instance. +type ProviderInstanceProperties struct { + // Defines the provider instance errors. + ProviderSettings ProviderSpecificPropertiesClassification `json:"providerSettings,omitempty"` + + // READ-ONLY; Defines the provider instance errors. + Errors *ProviderInstancePropertiesErrors `json:"errors,omitempty" azure:"ro"` + + // READ-ONLY; State of provisioning of the provider instance + ProvisioningState *WorkloadMonitorProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// ProviderInstancePropertiesErrors - Defines the provider instance errors. +type ProviderInstancePropertiesErrors struct { + // READ-ONLY; Server-defined set of error codes. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; Array of details about specific errors that led to this reported error. + Details []*Error `json:"details,omitempty" azure:"ro"` + + // READ-ONLY; Object containing more specific information than the current object about the error. + InnerError *ErrorInnerError `json:"innerError,omitempty" azure:"ro"` + + // READ-ONLY; Human-readable representation of the error. + Message *string `json:"message,omitempty" azure:"ro"` + + // READ-ONLY; Target of the error. + Target *string `json:"target,omitempty" azure:"ro"` +} + +// ProviderInstancesClientBeginCreateOptions contains the optional parameters for the ProviderInstancesClient.BeginCreate +// method. +type ProviderInstancesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ProviderInstancesClientBeginDeleteOptions contains the optional parameters for the ProviderInstancesClient.BeginDelete +// method. +type ProviderInstancesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string } @@ -565,61 +1289,906 @@ type ProviderInstancesClientGetOptions struct { // placeholder for future optional parameters } -// ProviderInstancesClientListOptions contains the optional parameters for the ProviderInstancesClient.List method. -type ProviderInstancesClientListOptions struct { +// ProviderInstancesClientListOptions contains the optional parameters for the ProviderInstancesClient.List method. +type ProviderInstancesClientListOptions struct { + // placeholder for future optional parameters +} + +// ProviderSpecificPropertiesClassification provides polymorphic access to related types. +// Call the interface's GetProviderSpecificProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DB2ProviderInstanceProperties, *HanaDbProviderInstanceProperties, *MsSQLServerProviderInstanceProperties, *PrometheusHaClusterProviderInstanceProperties, +// - *PrometheusOSProviderInstanceProperties, *ProviderSpecificProperties, *SapNetWeaverProviderInstanceProperties +type ProviderSpecificPropertiesClassification interface { + // GetProviderSpecificProperties returns the ProviderSpecificProperties content of the underlying type. + GetProviderSpecificProperties() *ProviderSpecificProperties +} + +// ProviderSpecificProperties - Gets or sets the provider specific properties. +type ProviderSpecificProperties struct { + // REQUIRED; The provider type. For example, the value can be SapHana. + ProviderType *string `json:"providerType,omitempty"` +} + +// GetProviderSpecificProperties implements the ProviderSpecificPropertiesClassification interface for type ProviderSpecificProperties. +func (p *ProviderSpecificProperties) GetProviderSpecificProperties() *ProviderSpecificProperties { + return p +} + +// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a +// location +type ProxyResource struct { + // 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"` +} + +// Resource - Common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // 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"` +} + +// 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. +type SAPApplicationServerInstance struct { + // REQUIRED; The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Defines the SAP Application Server properties. + Properties *SAPApplicationServerProperties `json:"properties,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"` +} + +// SAPApplicationServerInstanceList - Defines the collection of SAP Application Server Instances. +type SAPApplicationServerInstanceList struct { + // Gets the value of next link. + NextLink *string `json:"nextLink,omitempty"` + + // Gets the list of SAP Application Server instances. + Value []*SAPApplicationServerInstance `json:"value,omitempty"` +} + +// SAPApplicationServerInstancesClientBeginCreateOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginCreate +// method. +type SAPApplicationServerInstancesClientBeginCreateOptions struct { + // The SAP Application Server instance request body. + Body *SAPApplicationServerInstance + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SAPApplicationServerInstancesClientBeginDeleteOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginDelete +// method. +type SAPApplicationServerInstancesClientBeginDeleteOptions struct { + // 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 request body. + Body *UpdateSAPApplicationInstanceRequest + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SAPApplicationServerInstancesClientGetOptions contains the optional parameters for the SAPApplicationServerInstancesClient.Get +// method. +type SAPApplicationServerInstancesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SAPApplicationServerInstancesClientListOptions contains the optional parameters for the SAPApplicationServerInstancesClient.List +// method. +type SAPApplicationServerInstancesClientListOptions struct { + // placeholder for future optional parameters +} + +// SAPApplicationServerProperties - Defines the SAP Application Server 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. + GatewayPort *int64 `json:"gatewayPort,omitempty" azure:"ro"` + + // READ-ONLY; Defines the SAP Instance health. + Health *SAPHealthState `json:"health,omitempty" azure:"ro"` + + // READ-ONLY; The application server SAP host name. + Hostname *string `json:"hostname,omitempty" azure:"ro"` + + // READ-ONLY; The application server SAP IP Address. + IPAddress *string `json:"ipAddress,omitempty" azure:"ro"` + + // READ-ONLY; The application server ICM HTTP Port. + IcmHTTPPort *int64 `json:"icmHttpPort,omitempty" azure:"ro"` + + // READ-ONLY; The application server ICM HTTPS Port. + IcmHTTPSPort *int64 `json:"icmHttpsPort,omitempty" azure:"ro"` + + // READ-ONLY; The application server instance id. + InstanceNo *string `json:"instanceNo,omitempty" azure:"ro"` + + // READ-ONLY; The application server SAP kernel patch. + KernelPatch *string `json:"kernelPatch,omitempty" azure:"ro"` + + // READ-ONLY; The application server SAP kernel version. + KernelVersion *string `json:"kernelVersion,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. + Subnet *string `json:"subnet,omitempty" azure:"ro"` + + // READ-ONLY; The virtual machine. + VirtualMachineID *string `json:"virtualMachineId,omitempty" azure:"ro"` +} + +// SAPAvailabilityZoneDetailsRequest - The SAP request to get list of availability zones. +type SAPAvailabilityZoneDetailsRequest struct { + // REQUIRED; The geo-location where the SAP resources will be created. + AppLocation *string `json:"appLocation,omitempty"` + + // REQUIRED; The database type. Eg: HANA, DB2, etc + DatabaseType *SAPDatabaseType `json:"databaseType,omitempty"` + + // REQUIRED; Defines the SAP Product type. + SapProduct *SAPProductType `json:"sapProduct,omitempty"` +} + +// SAPAvailabilityZoneDetailsResult - The list of supported availability zone pairs which are part of SAP HA deployment. +type SAPAvailabilityZoneDetailsResult struct { + // Gets the list of availability zone pairs. + AvailabilityZonePairs []*SAPAvailabilityZonePair `json:"availabilityZonePairs,omitempty"` +} + +// SAPAvailabilityZonePair - The SAP Availability Zone Pair. +type SAPAvailabilityZonePair struct { + // The zone A. + ZoneA *int64 `json:"zoneA,omitempty"` + + // The zone B. + ZoneB *int64 `json:"zoneB,omitempty"` +} + +// SAPCentralInstanceList - Defines the collection of SAP Central Instances. +type SAPCentralInstanceList struct { + // Gets the value of next link. + NextLink *string `json:"nextLink,omitempty"` + + // Gets the list of SAP central instances. + Value []*SAPCentralServerInstance `json:"value,omitempty"` +} + +// SAPCentralInstancesClientBeginCreateOptions contains the optional parameters for the SAPCentralInstancesClient.BeginCreate +// method. +type SAPCentralInstancesClientBeginCreateOptions struct { + // The SAP Central Server instance request body. + Body *SAPCentralServerInstance + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SAPCentralInstancesClientBeginDeleteOptions contains the optional parameters for the SAPCentralInstancesClient.BeginDelete +// method. +type SAPCentralInstancesClientBeginDeleteOptions struct { + // 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 Server instance request body. + Body *UpdateSAPCentralInstanceRequest + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SAPCentralInstancesClientGetOptions contains the optional parameters for the SAPCentralInstancesClient.Get method. +type SAPCentralInstancesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SAPCentralInstancesClientListOptions contains the optional parameters for the SAPCentralInstancesClient.List method. +type SAPCentralInstancesClientListOptions struct { + // placeholder for future optional parameters +} + +// SAPCentralServerInstance - Define the SAP Central Server Instance. +type SAPCentralServerInstance struct { + // REQUIRED; The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Defines the SAP Central Server properties. + Properties *SAPCentralServerProperties `json:"properties,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"` +} + +// SAPCentralServerProperties - Defines the SAP Central Server properties. +type SAPCentralServerProperties struct { + // Defines the SAP ERS Server properties. + EnqueueReplicationServerProperties *EnqueueReplicationServerProperties `json:"enqueueReplicationServerProperties,omitempty"` + + // 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. + MessageServerProperties *MessageServerProperties `json:"messageServerProperties,omitempty"` + + // READ-ONLY; Defines the Central Instance errors. + Errors *SAPVirtualInstanceError `json:"errors,omitempty" azure:"ro"` + + // READ-ONLY; Defines the SAP Instance health. + Health *SAPHealthState `json:"health,omitempty" azure:"ro"` + + // READ-ONLY; The central server instance id. + InstanceNo *string `json:"instanceNo,omitempty" azure:"ro"` + + // READ-ONLY; The central server kernel patch. + KernelPatch *string `json:"kernelPatch,omitempty" azure:"ro"` + + // READ-ONLY; The central server kernel version. + KernelVersion *string `json:"kernelVersion,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. + Subnet *string `json:"subnet,omitempty" azure:"ro"` + + // READ-ONLY; The list of virtual machines. + VMDetails []*CentralServerVMDetails `json:"vmDetails,omitempty" azure:"ro"` +} + +// SAPConfigurationClassification provides polymorphic access to related types. +// Call the interface's GetSAPConfiguration() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DeploymentConfiguration, *DeploymentWithOSConfiguration, *DiscoveryConfiguration, *SAPConfiguration +type SAPConfigurationClassification interface { + // GetSAPConfiguration returns the SAPConfiguration content of the underlying type. + GetSAPConfiguration() *SAPConfiguration +} + +// SAPConfiguration - The SAP Configuration. +type SAPConfiguration struct { + // REQUIRED; The configuration Type. + ConfigurationType *SAPConfigurationType `json:"configurationType,omitempty"` +} + +// GetSAPConfiguration implements the SAPConfigurationClassification interface for type SAPConfiguration. +func (s *SAPConfiguration) GetSAPConfiguration() *SAPConfiguration { return s } + +// SAPDatabaseInstance - Define the SAP Database Instance. +type SAPDatabaseInstance struct { + // REQUIRED; The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Defines the SAP Database properties. + Properties *SAPDatabaseProperties `json:"properties,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"` +} + +// SAPDatabaseInstanceList - Defines the collection of SAP Database Instances. +type SAPDatabaseInstanceList struct { + // Gets the value of next link. + NextLink *string `json:"nextLink,omitempty"` + + // Gets the list of SAP Database instances. + Value []*SAPDatabaseInstance `json:"value,omitempty"` +} + +// SAPDatabaseInstancesClientBeginCreateOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginCreate +// method. +type SAPDatabaseInstancesClientBeginCreateOptions struct { + // The SAP Database Server instance request body. + Body *SAPDatabaseInstance + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SAPDatabaseInstancesClientBeginDeleteOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginDelete +// method. +type SAPDatabaseInstancesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SAPDatabaseInstancesClientBeginUpdateOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginUpdate +// method. +type SAPDatabaseInstancesClientBeginUpdateOptions struct { + // The SAP Database Server instance request body. + Body *UpdateSAPDatabaseInstanceRequest + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SAPDatabaseInstancesClientGetOptions contains the optional parameters for the SAPDatabaseInstancesClient.Get method. +type SAPDatabaseInstancesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SAPDatabaseInstancesClientListOptions contains the optional parameters for the SAPDatabaseInstancesClient.List method. +type SAPDatabaseInstancesClientListOptions struct { + // placeholder for future optional parameters +} + +// SAPDatabaseProperties - Defines the SAP Database properties. +type SAPDatabaseProperties struct { + // READ-ONLY; The database SID. + DatabaseSid *string `json:"databaseSid,omitempty" azure:"ro"` + + // READ-ONLY; The SAP database type. + DatabaseType *string `json:"databaseType,omitempty" azure:"ro"` + + // READ-ONLY; Defines the Database Instance errors. + Errors *SAPVirtualInstanceError `json:"errors,omitempty" azure:"ro"` + + // READ-ONLY; The database IP Address. + IPAddress *string `json:"ipAddress,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. + Subnet *string `json:"subnet,omitempty" azure:"ro"` + + // READ-ONLY; The list of virtual machines. + VMDetails []*DatabaseVMDetails `json:"vmDetails,omitempty" azure:"ro"` +} + +// SAPDiskConfiguration - The SAP Disk Configuration. +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 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"` +} + +// SAPDiskConfigurationsRequest - The SAP request to get list of disk configurations. +type SAPDiskConfigurationsRequest struct { + // REQUIRED; The geo-location where the SAP resources will be created. + AppLocation *string `json:"appLocation,omitempty"` + + // REQUIRED; The database type. Eg: HANA, DB2, etc + DatabaseType *SAPDatabaseType `json:"databaseType,omitempty"` + + // REQUIRED; The VM SKU for database instance. + DbVMSKU *string `json:"dbVmSku,omitempty"` + + // REQUIRED; The deployment type. Eg: SingleServer/ThreeTier + DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` + + // REQUIRED; Defines the environment type - Production/Non Production. + Environment *SAPEnvironmentType `json:"environment,omitempty"` + + // REQUIRED; Defines the SAP Product type. + SapProduct *SAPProductType `json:"sapProduct,omitempty"` +} + +// 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"` +} + +// SAPInstallWithoutOSConfigSoftwareConfiguration - The SAP Software configuration Input when the software is to be installed +// by service without OS Configurations +type SAPInstallWithoutOSConfigSoftwareConfiguration struct { + // REQUIRED; The URL to the SAP Build of Materials(BOM) file. + BomURL *string `json:"bomUrl,omitempty"` + + // REQUIRED; The SAP bits storage account id. + SapBitsStorageAccountID *string `json:"sapBitsStorageAccountId,omitempty"` + + // REQUIRED; The SAP software installation Type. + SoftwareInstallationType *SAPSoftwareInstallationType `json:"softwareInstallationType,omitempty"` + + // REQUIRED; The software version to install. + SoftwareVersion *string `json:"softwareVersion,omitempty"` + + // Gets or sets the HA software configuration. + HighAvailabilitySoftwareConfiguration *HighAvailabilitySoftwareConfiguration `json:"highAvailabilitySoftwareConfiguration,omitempty"` +} + +// GetSoftwareConfiguration implements the SoftwareConfigurationClassification interface for type SAPInstallWithoutOSConfigSoftwareConfiguration. +func (s *SAPInstallWithoutOSConfigSoftwareConfiguration) GetSoftwareConfiguration() *SoftwareConfiguration { + return &SoftwareConfiguration{ + SoftwareInstallationType: s.SoftwareInstallationType, + } +} + +// SAPSizingRecommendationRequest - The SAP Sizing Recommendation request. +type SAPSizingRecommendationRequest struct { + // REQUIRED; The geo-location where the resource is to be created. + AppLocation *string `json:"appLocation,omitempty"` + + // REQUIRED; The database type. + DatabaseType *SAPDatabaseType `json:"databaseType,omitempty"` + + // REQUIRED; The database memory configuration. + DbMemory *int64 `json:"dbMemory,omitempty"` + + // REQUIRED; The deployment type. Eg: SingleServer/ThreeTier + DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` + + // REQUIRED; Defines the environment type - Production/Non Production. + Environment *SAPEnvironmentType `json:"environment,omitempty"` + + // REQUIRED; Defines the SAP Product type. + SapProduct *SAPProductType `json:"sapProduct,omitempty"` + + // REQUIRED; The SAP Application Performance Standard measurement. + Saps *int64 `json:"saps,omitempty"` + + // The DB scale method. + DbScaleMethod *SAPDatabaseScaleMethod `json:"dbScaleMethod,omitempty"` + + // The high availability type. + HighAvailabilityType *SAPHighAvailabilityType `json:"highAvailabilityType,omitempty"` +} + +// SAPSizingRecommendationResultClassification provides polymorphic access to related types. +// Call the interface's GetSAPSizingRecommendationResult() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *SAPSizingRecommendationResult, *SingleServerRecommendationResult, *ThreeTierRecommendationResult +type SAPSizingRecommendationResultClassification interface { + // GetSAPSizingRecommendationResult returns the SAPSizingRecommendationResult content of the underlying type. + GetSAPSizingRecommendationResult() *SAPSizingRecommendationResult +} + +// SAPSizingRecommendationResult - The SAP sizing recommendation result. +type SAPSizingRecommendationResult struct { + // REQUIRED; The deployment Type. + DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` +} + +// GetSAPSizingRecommendationResult implements the SAPSizingRecommendationResultClassification interface for type SAPSizingRecommendationResult. +func (s *SAPSizingRecommendationResult) GetSAPSizingRecommendationResult() *SAPSizingRecommendationResult { + return s +} + +// SAPSupportedResourceSKUsResult - The list of supported SKUs for different resources which are part of SAP deployment. +type SAPSupportedResourceSKUsResult struct { + // Gets the list of SAP supported SKUs. + SupportedSKUs []*SAPSupportedSKU `json:"supportedSkus,omitempty"` +} + +// SAPSupportedSKU - The SAP supported SKU. +type SAPSupportedSKU struct { + // True if the Sku is certified for App server in the SAP system. + IsAppServerCertified *bool `json:"isAppServerCertified,omitempty"` + + // True if the Sku is certified for Database server in the SAP system. + IsDatabaseCertified *bool `json:"isDatabaseCertified,omitempty"` + + // The VM Sku. + VMSKU *string `json:"vmSku,omitempty"` +} + +// SAPSupportedSKUsRequest - The SAP request to get list of supported SKUs. +type SAPSupportedSKUsRequest struct { + // REQUIRED; The geo-location where the resource is to be created. + AppLocation *string `json:"appLocation,omitempty"` + + // REQUIRED; The database type. Eg: HANA, DB2, etc + DatabaseType *SAPDatabaseType `json:"databaseType,omitempty"` + + // REQUIRED; The deployment type. Eg: SingleServer/ThreeTier + DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` + + // REQUIRED; Defines the environment type - Production/Non Production. + Environment *SAPEnvironmentType `json:"environment,omitempty"` + + // REQUIRED; Defines the SAP Product type. + SapProduct *SAPProductType `json:"sapProduct,omitempty"` + + // The high availability type. + HighAvailabilityType *SAPHighAvailabilityType `json:"highAvailabilityType,omitempty"` +} + +// SAPVirtualInstance - Define the Virtual Instance for SAP. +type SAPVirtualInstance struct { + // REQUIRED; The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // REQUIRED; Defines the Virtual Instance for SAP properties. + Properties *SAPVirtualInstanceProperties `json:"properties,omitempty"` + + // Managed service identity (user assigned identities) + Identity *UserAssignedServiceIdentity `json:"identity,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"` +} + +// SAPVirtualInstanceError - An error response from the Virtual Instance for SAP Workload service. +type SAPVirtualInstanceError struct { + // The Virtual Instance for SAP error body. + Properties *ErrorDefinition `json:"properties,omitempty"` +} + +// SAPVirtualInstanceList - Defines the collection of Virtual Instance for SAP. +type SAPVirtualInstanceList struct { + // Gets the value of next link. + NextLink *string `json:"nextLink,omitempty"` + + // Gets the list of Virtual Instances for SAP. + Value []*SAPVirtualInstance `json:"value,omitempty"` +} + +// SAPVirtualInstanceProperties - Defines the Virtual Instance for SAP properties. +type SAPVirtualInstanceProperties struct { + // REQUIRED; Defines if an existing SAP system is being registered or a new SAP system is being created + Configuration SAPConfigurationClassification `json:"configuration,omitempty"` + + // REQUIRED; Defines the environment type - Production/Non Production. + Environment *SAPEnvironmentType `json:"environment,omitempty"` + + // REQUIRED; Defines the SAP Product type. + SapProduct *SAPProductType `json:"sapProduct,omitempty"` + + // Managed resource group configuration + ManagedResourceGroupConfiguration *ManagedRGConfiguration `json:"managedResourceGroupConfiguration,omitempty"` + + // READ-ONLY; Defines the Virtual Instance for SAP errors. + Errors *SAPVirtualInstanceError `json:"errors,omitempty" azure:"ro"` + + // READ-ONLY; Defines the SAP Instance health. + Health *SAPHealthState `json:"health,omitempty" azure:"ro"` + + // READ-ONLY; Defines the provisioning states. + ProvisioningState *SapVirtualInstanceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; Defines the Virtual Instance for SAP state. + State *SAPVirtualInstanceState `json:"state,omitempty" azure:"ro"` + + // READ-ONLY; Defines the SAP Instance status. + Status *SAPVirtualInstanceStatus `json:"status,omitempty" azure:"ro"` +} + +// SAPVirtualInstancesClientBeginCreateOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginCreate +// method. +type SAPVirtualInstancesClientBeginCreateOptions struct { + // The Virtual Instance for SAP request body. + Body *SAPVirtualInstance + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SAPVirtualInstancesClientBeginDeleteOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginDelete +// method. +type SAPVirtualInstancesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SAPVirtualInstancesClientBeginStartOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginStart +// method. +type SAPVirtualInstancesClientBeginStartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SAPVirtualInstancesClientBeginStopOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginStop +// method. +type SAPVirtualInstancesClientBeginStopOptions struct { + // The Virtual Instances for SAP stop request body. + Body *StopRequest + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SAPVirtualInstancesClientGetOptions contains the optional parameters for the SAPVirtualInstancesClient.Get method. +type SAPVirtualInstancesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SAPVirtualInstancesClientListByResourceGroupOptions contains the optional parameters for the SAPVirtualInstancesClient.ListByResourceGroup +// method. +type SAPVirtualInstancesClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// ProviderSpecificPropertiesClassification provides polymorphic access to related types. -// Call the interface's GetProviderSpecificProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *DB2ProviderInstanceProperties, *HanaDbProviderInstanceProperties, *MsSQLServerProviderInstanceProperties, *PrometheusHaClusterProviderInstanceProperties, -// - *PrometheusOSProviderInstanceProperties, *ProviderSpecificProperties, *SapNetWeaverProviderInstanceProperties -type ProviderSpecificPropertiesClassification interface { - // GetProviderSpecificProperties returns the ProviderSpecificProperties content of the underlying type. - GetProviderSpecificProperties() *ProviderSpecificProperties +// SAPVirtualInstancesClientListBySubscriptionOptions contains the optional parameters for the SAPVirtualInstancesClient.ListBySubscription +// method. +type SAPVirtualInstancesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters } -// ProviderSpecificProperties - Gets or sets the provider specific properties. -type ProviderSpecificProperties struct { - // REQUIRED; The provider type. For example, the value can be SapHana. - ProviderType *string `json:"providerType,omitempty"` +// SAPVirtualInstancesClientUpdateOptions contains the optional parameters for the SAPVirtualInstancesClient.Update method. +type SAPVirtualInstancesClientUpdateOptions struct { + // The Update Virtual Instance for SAP request body. + Body *UpdateSAPVirtualInstanceRequest } -// GetProviderSpecificProperties implements the ProviderSpecificPropertiesClassification interface for type ProviderSpecificProperties. -func (p *ProviderSpecificProperties) GetProviderSpecificProperties() *ProviderSpecificProperties { - return p +// 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"` } -// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a -// location -type ProxyResource struct { - // 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"` +// SKUCapability - The SKU capability definition. +type SKUCapability struct { + // The capability name. + Name *string `json:"name,omitempty"` - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + // The capability value. + Value *string `json:"value,omitempty"` +} - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` +// SKUCapacity - The SKU capacity. +type SKUCapacity struct { + // Default capacity value. + Default *int32 `json:"default,omitempty"` - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + // Maximum capacity value. + Maximum *int32 `json:"maximum,omitempty"` + + // Minimum capacity value. + Minimum *int32 `json:"minimum,omitempty"` + + // Scale type of the SKU capacity. + ScaleType *SKUScaleType `json:"scaleType,omitempty"` } -// Resource - Common fields that are returned in the response for all Azure Resource Manager resources -type Resource struct { - // 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"` +// SKUCost - The SKU cost definition. +type SKUCost struct { + // The extended unit. + ExtendedUnit *string `json:"extendedUnit,omitempty"` - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + // Billing meter id. + MeterID *string `json:"meterId,omitempty"` - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // The quantity. + Quantity *int32 `json:"quantity,omitempty"` +} - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` +// 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"` + + // List of locations where this SKU is available. + LocationInfo []*SKULocationAndZones `json:"locationInfo,omitempty"` + + // List of locations where this SKU is available. + Locations []*string `json:"locations,omitempty"` + + // Resource type the SKU applicable for. + ResourceType *string `json:"resourceType,omitempty"` + + // The SKU restrictions. + Restrictions []*SKURestriction `json:"restrictions,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 *string `json:"tier,omitempty"` +} + +// SKULocationAndZones - The SKU location and zone. +type SKULocationAndZones struct { + // The extended locations of SKU. + ExtendedLocations []*string `json:"extendedLocations,omitempty"` + + // The location of the SKU. + Location *string `json:"location,omitempty"` + + // Type of the extended location. + Type *LocationType `json:"type,omitempty"` + + // The availability zone details of the SKU location. + ZoneDetails []*SKUZoneDetail `json:"zoneDetails,omitempty"` + + // The availability zones of SKU location. + Zones []*string `json:"zones,omitempty"` +} + +// SKURestriction - The SKU restriction definition. +type SKURestriction struct { + // The SKU restriction reason code. + ReasonCode *SKURestrictionReasonCode `json:"reasonCode,omitempty"` + + // The restriction information. + RestrictionInfo interface{} `json:"restrictionInfo,omitempty"` + + // The SKU restriction type. + Type *SKURestrictionType `json:"type,omitempty"` + + // Restriction values. + Values []*string `json:"values,omitempty"` +} + +// SKUZoneDetail - The SKU zone details. +type SKUZoneDetail struct { + // The capabilities. + Capabilities []*SKUCapability `json:"capabilities,omitempty"` + + // The physical zones. + Zones []*string `json:"zones,omitempty"` +} + +// SKUsClientListOptions contains the optional parameters for the SKUsClient.List method. +type SKUsClientListOptions struct { + // placeholder for future optional parameters +} + +// 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"` + + // 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"` +} + +// 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"` + + // 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"` } // SapNetWeaverProviderInstanceProperties - Gets or sets the provider properties. @@ -665,6 +2234,136 @@ 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. + BomURL *string `json:"bomUrl,omitempty"` + + // REQUIRED; The SSH private key. + SSHPrivateKey *string `json:"sshPrivateKey,omitempty"` + + // REQUIRED; The SAP bits storage account id. + SapBitsStorageAccountID *string `json:"sapBitsStorageAccountId,omitempty"` + + // REQUIRED; The FQDN to set for the SAP system during install. + SapFqdn *string `json:"sapFqdn,omitempty"` + + // REQUIRED; The SAP software installation Type. + SoftwareInstallationType *SAPSoftwareInstallationType `json:"softwareInstallationType,omitempty"` + + // REQUIRED; The software version to install. + SoftwareVersion *string `json:"softwareVersion,omitempty"` + + // Gets or sets the HA software configuration. + HighAvailabilitySoftwareConfiguration *HighAvailabilitySoftwareConfiguration `json:"highAvailabilitySoftwareConfiguration,omitempty"` +} + +// GetSoftwareConfiguration implements the SoftwareConfigurationClassification interface for type ServiceInitiatedSoftwareConfiguration. +func (s *ServiceInitiatedSoftwareConfiguration) GetSoftwareConfiguration() *SoftwareConfiguration { + return &SoftwareConfiguration{ + SoftwareInstallationType: s.SoftwareInstallationType, + } +} + +// 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. + DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` + + // REQUIRED; The subnet id. + SubnetID *string `json:"subnetId,omitempty"` + + // REQUIRED; Gets or sets the virtual machine configuration. + VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` + + // The database type. + DatabaseType *SAPDatabaseType `json:"databaseType,omitempty"` + + // Network configuration for the server + NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` +} + +// GetInfrastructureConfiguration implements the InfrastructureConfigurationClassification interface for type SingleServerConfiguration. +func (s *SingleServerConfiguration) GetInfrastructureConfiguration() *InfrastructureConfiguration { + return &InfrastructureConfiguration{ + DeploymentType: s.DeploymentType, + AppResourceGroup: s.AppResourceGroup, + } +} + +// SingleServerRecommendationResult - The recommended configuration for a single server SAP system. +type SingleServerRecommendationResult struct { + // REQUIRED; The deployment Type. + DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` + + // The recommended VM SKU for single server. + VMSKU *string `json:"vmSku,omitempty"` +} + +// GetSAPSizingRecommendationResult implements the SAPSizingRecommendationResultClassification interface for type SingleServerRecommendationResult. +func (s *SingleServerRecommendationResult) GetSAPSizingRecommendationResult() *SAPSizingRecommendationResult { + return &SAPSizingRecommendationResult{ + DeploymentType: s.DeploymentType, + } +} + +// SiteProfile - Workload website profile +type SiteProfile struct { + // Domain name for the application site URL + DomainName *string `json:"domainName,omitempty"` +} + +// 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 +type SoftwareConfigurationClassification interface { + // GetSoftwareConfiguration returns the SoftwareConfiguration content of the underlying type. + GetSoftwareConfiguration() *SoftwareConfiguration +} + +// SoftwareConfiguration - The SAP Software configuration Input. +type SoftwareConfiguration struct { + // REQUIRED; The SAP software installation Type. + SoftwareInstallationType *SAPSoftwareInstallationType `json:"softwareInstallationType,omitempty"` +} + +// GetSoftwareConfiguration implements the SoftwareConfigurationClassification interface for type SoftwareConfiguration. +func (s *SoftwareConfiguration) GetSoftwareConfiguration() *SoftwareConfiguration { return s } + +// StopRequest - Stop SAP Request. +type StopRequest struct { + // A boolean to specify if the SAP system should be hard-stopped. + HardStop *bool `json:"hardStop,omitempty"` +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -692,6 +2391,69 @@ type Tags struct { Tags map[string]*string `json:"tags,omitempty"` } +// ThreeTierConfiguration - Gets or sets the three tier SAP configuration. +type ThreeTierConfiguration struct { + // REQUIRED; The application resource group where SAP system resources will be deployed. + AppResourceGroup *string `json:"appResourceGroup,omitempty"` + + // REQUIRED; The application server configuration. + ApplicationServer *ApplicationServerConfiguration `json:"applicationServer,omitempty"` + + // REQUIRED; The central server configuration. + CentralServer *CentralServerConfiguration `json:"centralServer,omitempty"` + + // REQUIRED; The database configuration. + DatabaseServer *DatabaseConfiguration `json:"databaseServer,omitempty"` + + // REQUIRED; The deployment Type. + DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` + + // The high availability configuration. + HighAvailabilityConfig *HighAvailabilityConfiguration `json:"highAvailabilityConfig,omitempty"` + + // Network configuration common to all servers + NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` +} + +// GetInfrastructureConfiguration implements the InfrastructureConfigurationClassification interface for type ThreeTierConfiguration. +func (t *ThreeTierConfiguration) GetInfrastructureConfiguration() *InfrastructureConfiguration { + return &InfrastructureConfiguration{ + DeploymentType: t.DeploymentType, + AppResourceGroup: t.AppResourceGroup, + } +} + +// ThreeTierRecommendationResult - The recommended configuration for a three tier SAP system. +type ThreeTierRecommendationResult struct { + // REQUIRED; The deployment Type. + DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` + + // The application server instance count. + ApplicationServerInstanceCount *int64 `json:"applicationServerInstanceCount,omitempty"` + + // The application server VM SKU. + ApplicationServerVMSKU *string `json:"applicationServerVmSku,omitempty"` + + // The central server instance count. + CentralServerInstanceCount *int64 `json:"centralServerInstanceCount,omitempty"` + + // The central server VM SKU. + CentralServerVMSKU *string `json:"centralServerVmSku,omitempty"` + + // The database server instance count. + DatabaseInstanceCount *int64 `json:"databaseInstanceCount,omitempty"` + + // The database VM SKU. + DbVMSKU *string `json:"dbVmSku,omitempty"` +} + +// GetSAPSizingRecommendationResult implements the SAPSizingRecommendationResultClassification interface for type ThreeTierRecommendationResult. +func (t *ThreeTierRecommendationResult) GetSAPSizingRecommendationResult() *SAPSizingRecommendationResult { + return &SAPSizingRecommendationResult{ + DeploymentType: t.DeploymentType, + } +} + // TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' // and a 'location' type TrackedResource struct { @@ -713,3 +2475,185 @@ type TrackedResource struct { // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } + +// UpdateMonitorRequest - Defines the request body for updating SAP monitor resource. +type UpdateMonitorRequest struct { + // Managed service identity (user assigned identities) + Identity *UserAssignedServiceIdentity `json:"identity,omitempty"` + + // Gets or sets the Resource tags. + Tags map[string]*string `json:"tags,omitempty"` +} + +// UpdateSAPApplicationInstanceRequest - Defines the request body for updating SAP Application Instance. +type UpdateSAPApplicationInstanceRequest struct { + // Gets or sets the Resource tags. + Tags map[string]*string `json:"tags,omitempty"` +} + +// UpdateSAPCentralInstanceRequest - Defines the request body for updating SAP Central Instance. +type UpdateSAPCentralInstanceRequest struct { + // Gets or sets the Resource tags. + Tags map[string]*string `json:"tags,omitempty"` +} + +// UpdateSAPDatabaseInstanceRequest - Defines the request body for updating SAP Database Instance. +type UpdateSAPDatabaseInstanceRequest struct { + // Gets or sets the Resource tags. + Tags map[string]*string `json:"tags,omitempty"` +} + +// UpdateSAPVirtualInstanceRequest - Defines the request body for updating Virtual Instance for SAP. +type UpdateSAPVirtualInstanceRequest struct { + // Managed service identity (user assigned identities) + Identity *UserAssignedServiceIdentity `json:"identity,omitempty"` + + // Gets or sets the Resource tags. + Tags map[string]*string `json:"tags,omitempty"` +} + +// UserAssignedIdentity - User assigned identity properties +type UserAssignedIdentity struct { + // READ-ONLY; The client ID of the assigned identity. + ClientID *string `json:"clientId,omitempty" azure:"ro"` + + // READ-ONLY; The principal ID of the assigned identity. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` +} + +// UserAssignedServiceIdentity - Managed service identity (user assigned identities) +type UserAssignedServiceIdentity struct { + // REQUIRED; Type of manage identity + Type *ManagedServiceIdentityType `json:"type,omitempty"` + + // User assigned identities dictionary + 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. + ImageReference *ImageReference `json:"imageReference,omitempty"` + + // REQUIRED; The OS profile. + OSProfile *OSProfile `json:"osProfile,omitempty"` + + // REQUIRED; The virtual machine size. + 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"` + + // REQUIRED; OS image used for creating the nodes + OSImage *OsImageProfile `json:"osImage,omitempty"` + + // Maximum number of nodes for autoscale + AutoScaleMaxCount *int32 `json:"autoScaleMaxCount,omitempty"` + + // Minimum number of nodes for autoscale + AutoScaleMinCount *int32 `json:"autoScaleMinCount,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"` +} + +// WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. +type WindowsConfiguration struct { + // REQUIRED; The OS Type + OSType *OSType `json:"osType,omitempty"` +} + +// GetOSConfiguration implements the OSConfigurationClassification interface for type WindowsConfiguration. +func (w *WindowsConfiguration) GetOSConfiguration() *OSConfiguration { + return &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/zz_generated_models_serde.go b/sdk/resourcemanager/workloads/armworkloads/zz_generated_models_serde.go index 886ce3acec93..8504d946e1db 100644 --- a/sdk/resourcemanager/workloads/armworkloads/zz_generated_models_serde.go +++ b/sdk/resourcemanager/workloads/armworkloads/zz_generated_models_serde.go @@ -70,6 +70,123 @@ func (d *DB2ProviderInstanceProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DeploymentConfiguration. +func (d DeploymentConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appLocation", d.AppLocation) + objectMap["configurationType"] = SAPConfigurationTypeDeployment + populate(objectMap, "infrastructureConfiguration", d.InfrastructureConfiguration) + populate(objectMap, "softwareConfiguration", d.SoftwareConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentConfiguration. +func (d *DeploymentConfiguration) 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 "appLocation": + err = unpopulate(val, "AppLocation", &d.AppLocation) + delete(rawMsg, key) + case "configurationType": + err = unpopulate(val, "ConfigurationType", &d.ConfigurationType) + delete(rawMsg, key) + case "infrastructureConfiguration": + d.InfrastructureConfiguration, err = unmarshalInfrastructureConfigurationClassification(val) + delete(rawMsg, key) + case "softwareConfiguration": + d.SoftwareConfiguration, err = unmarshalSoftwareConfigurationClassification(val) + 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 DeploymentWithOSConfiguration. +func (d DeploymentWithOSConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appLocation", d.AppLocation) + objectMap["configurationType"] = SAPConfigurationTypeDeploymentWithOSConfig + populate(objectMap, "infrastructureConfiguration", d.InfrastructureConfiguration) + populate(objectMap, "osSapConfiguration", d.OSSapConfiguration) + populate(objectMap, "softwareConfiguration", d.SoftwareConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentWithOSConfiguration. +func (d *DeploymentWithOSConfiguration) 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 "appLocation": + err = unpopulate(val, "AppLocation", &d.AppLocation) + delete(rawMsg, key) + case "configurationType": + err = unpopulate(val, "ConfigurationType", &d.ConfigurationType) + delete(rawMsg, key) + case "infrastructureConfiguration": + d.InfrastructureConfiguration, err = unmarshalInfrastructureConfigurationClassification(val) + delete(rawMsg, key) + case "osSapConfiguration": + err = unpopulate(val, "OSSapConfiguration", &d.OSSapConfiguration) + delete(rawMsg, key) + case "softwareConfiguration": + d.SoftwareConfiguration, err = unmarshalSoftwareConfigurationClassification(val) + 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 DiscoveryConfiguration. +func (d DiscoveryConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appLocation", d.AppLocation) + populate(objectMap, "centralServerVmId", d.CentralServerVMID) + objectMap["configurationType"] = SAPConfigurationTypeDiscovery + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiscoveryConfiguration. +func (d *DiscoveryConfiguration) 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 "appLocation": + err = unpopulate(val, "AppLocation", &d.AppLocation) + delete(rawMsg, key) + case "centralServerVmId": + err = unpopulate(val, "CentralServerVMID", &d.CentralServerVMID) + delete(rawMsg, key) + case "configurationType": + err = unpopulate(val, "ConfigurationType", &d.ConfigurationType) + 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 Error. func (e Error) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -81,6 +198,15 @@ func (e Error) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type ErrorDefinition. +func (e ErrorDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type HanaDbProviderInstanceProperties. func (h HanaDbProviderInstanceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -144,10 +270,50 @@ func (h *HanaDbProviderInstanceProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type LinuxConfiguration. +func (l LinuxConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "disablePasswordAuthentication", l.DisablePasswordAuthentication) + objectMap["osType"] = OSTypeLinux + populate(objectMap, "ssh", l.SSH) + populate(objectMap, "sshKeyPair", l.SSHKeyPair) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxConfiguration. +func (l *LinuxConfiguration) 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 "disablePasswordAuthentication": + err = unpopulate(val, "DisablePasswordAuthentication", &l.DisablePasswordAuthentication) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &l.OSType) + delete(rawMsg, key) + case "ssh": + err = unpopulate(val, "SSH", &l.SSH) + delete(rawMsg, key) + case "sshKeyPair": + err = unpopulate(val, "SSHKeyPair", &l.SSHKeyPair) + 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 Monitor. func (m Monitor) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", m.ID) + populate(objectMap, "identity", m.Identity) populate(objectMap, "location", m.Location) populate(objectMap, "name", m.Name) populate(objectMap, "properties", m.Properties) @@ -219,6 +385,69 @@ func (m *MsSQLServerProviderInstanceProperties) 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) + return json.Marshal(objectMap) +} + +// 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) +} + +// MarshalJSON implements the json.Marshaller interface for type OSProfile. +func (o OSProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "adminPassword", o.AdminPassword) + populate(objectMap, "adminUsername", o.AdminUsername) + populate(objectMap, "osConfiguration", o.OSConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OSProfile. +func (o *OSProfile) 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 "adminPassword": + err = unpopulate(val, "AdminPassword", &o.AdminPassword) + delete(rawMsg, key) + case "adminUsername": + err = unpopulate(val, "AdminUsername", &o.AdminUsername) + delete(rawMsg, key) + case "osConfiguration": + o.OSConfiguration, err = unmarshalOSConfigurationClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusResult. func (o *OperationStatusResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage @@ -260,6 +489,46 @@ func (o *OperationStatusResult) 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) +} + +// 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) +} + +// 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) +} + +// 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) +} + // MarshalJSON implements the json.Marshaller interface for type PrometheusHaClusterProviderInstanceProperties. func (p PrometheusHaClusterProviderInstanceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -380,6 +649,201 @@ func (p ProviderInstancePropertiesErrors) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type SAPApplicationServerInstance. +func (s SAPApplicationServerInstance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SAPCentralServerInstance. +func (s SAPCentralServerInstance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SAPCentralServerProperties. +func (s SAPCentralServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enqueueReplicationServerProperties", s.EnqueueReplicationServerProperties) + populate(objectMap, "enqueueServerProperties", s.EnqueueServerProperties) + populate(objectMap, "errors", s.Errors) + populate(objectMap, "gatewayServerProperties", s.GatewayServerProperties) + populate(objectMap, "health", s.Health) + populate(objectMap, "instanceNo", s.InstanceNo) + populate(objectMap, "kernelPatch", s.KernelPatch) + populate(objectMap, "kernelVersion", s.KernelVersion) + populate(objectMap, "messageServerProperties", s.MessageServerProperties) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "status", s.Status) + populate(objectMap, "subnet", s.Subnet) + populate(objectMap, "vmDetails", s.VMDetails) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SAPDatabaseInstance. +func (s SAPDatabaseInstance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SAPDatabaseProperties. +func (s SAPDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "databaseSid", s.DatabaseSid) + populate(objectMap, "databaseType", s.DatabaseType) + populate(objectMap, "errors", s.Errors) + populate(objectMap, "ipAddress", s.IPAddress) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "status", s.Status) + populate(objectMap, "subnet", s.Subnet) + populate(objectMap, "vmDetails", s.VMDetails) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SAPInstallWithoutOSConfigSoftwareConfiguration. +func (s SAPInstallWithoutOSConfigSoftwareConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "bomUrl", s.BomURL) + populate(objectMap, "highAvailabilitySoftwareConfiguration", s.HighAvailabilitySoftwareConfiguration) + populate(objectMap, "sapBitsStorageAccountId", s.SapBitsStorageAccountID) + objectMap["softwareInstallationType"] = SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig + populate(objectMap, "softwareVersion", s.SoftwareVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SAPInstallWithoutOSConfigSoftwareConfiguration. +func (s *SAPInstallWithoutOSConfigSoftwareConfiguration) 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 "bomUrl": + err = unpopulate(val, "BomURL", &s.BomURL) + delete(rawMsg, key) + case "highAvailabilitySoftwareConfiguration": + err = unpopulate(val, "HighAvailabilitySoftwareConfiguration", &s.HighAvailabilitySoftwareConfiguration) + delete(rawMsg, key) + case "sapBitsStorageAccountId": + err = unpopulate(val, "SapBitsStorageAccountID", &s.SapBitsStorageAccountID) + delete(rawMsg, key) + case "softwareInstallationType": + err = unpopulate(val, "SoftwareInstallationType", &s.SoftwareInstallationType) + delete(rawMsg, key) + case "softwareVersion": + err = unpopulate(val, "SoftwareVersion", &s.SoftwareVersion) + 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 SAPVirtualInstance. +func (s SAPVirtualInstance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SAPVirtualInstanceProperties. +func (s SAPVirtualInstanceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "configuration", s.Configuration) + populate(objectMap, "environment", s.Environment) + populate(objectMap, "errors", s.Errors) + populate(objectMap, "health", s.Health) + populate(objectMap, "managedResourceGroupConfiguration", s.ManagedResourceGroupConfiguration) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "sapProduct", s.SapProduct) + populate(objectMap, "state", s.State) + populate(objectMap, "status", s.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SAPVirtualInstanceProperties. +func (s *SAPVirtualInstanceProperties) 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 "configuration": + s.Configuration, err = unmarshalSAPConfigurationClassification(val) + delete(rawMsg, key) + case "environment": + err = unpopulate(val, "Environment", &s.Environment) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &s.Errors) + delete(rawMsg, key) + case "health": + err = unpopulate(val, "Health", &s.Health) + delete(rawMsg, key) + case "managedResourceGroupConfiguration": + err = unpopulate(val, "ManagedResourceGroupConfiguration", &s.ManagedResourceGroupConfiguration) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "sapProduct": + err = unpopulate(val, "SapProduct", &s.SapProduct) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SSHConfiguration. +func (s SSHConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "publicKeys", s.PublicKeys) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type SapNetWeaverProviderInstanceProperties. func (s SapNetWeaverProviderInstanceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -447,6 +911,140 @@ 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) +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceInitiatedSoftwareConfiguration. +func (s ServiceInitiatedSoftwareConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "bomUrl", s.BomURL) + populate(objectMap, "highAvailabilitySoftwareConfiguration", s.HighAvailabilitySoftwareConfiguration) + populate(objectMap, "sshPrivateKey", s.SSHPrivateKey) + populate(objectMap, "sapBitsStorageAccountId", s.SapBitsStorageAccountID) + populate(objectMap, "sapFqdn", s.SapFqdn) + objectMap["softwareInstallationType"] = SAPSoftwareInstallationTypeServiceInitiated + populate(objectMap, "softwareVersion", s.SoftwareVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceInitiatedSoftwareConfiguration. +func (s *ServiceInitiatedSoftwareConfiguration) 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 "bomUrl": + err = unpopulate(val, "BomURL", &s.BomURL) + delete(rawMsg, key) + case "highAvailabilitySoftwareConfiguration": + err = unpopulate(val, "HighAvailabilitySoftwareConfiguration", &s.HighAvailabilitySoftwareConfiguration) + delete(rawMsg, key) + case "sshPrivateKey": + err = unpopulate(val, "SSHPrivateKey", &s.SSHPrivateKey) + delete(rawMsg, key) + case "sapBitsStorageAccountId": + err = unpopulate(val, "SapBitsStorageAccountID", &s.SapBitsStorageAccountID) + delete(rawMsg, key) + case "sapFqdn": + err = unpopulate(val, "SapFqdn", &s.SapFqdn) + delete(rawMsg, key) + case "softwareInstallationType": + err = unpopulate(val, "SoftwareInstallationType", &s.SoftwareInstallationType) + delete(rawMsg, key) + case "softwareVersion": + err = unpopulate(val, "SoftwareVersion", &s.SoftwareVersion) + 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{}) + populate(objectMap, "appResourceGroup", s.AppResourceGroup) + populate(objectMap, "databaseType", s.DatabaseType) + objectMap["deploymentType"] = SAPDeploymentTypeSingleServer + populate(objectMap, "networkConfiguration", s.NetworkConfiguration) + populate(objectMap, "subnetId", s.SubnetID) + populate(objectMap, "virtualMachineConfiguration", s.VirtualMachineConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SingleServerConfiguration. +func (s *SingleServerConfiguration) 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 "appResourceGroup": + err = unpopulate(val, "AppResourceGroup", &s.AppResourceGroup) + delete(rawMsg, key) + case "databaseType": + err = unpopulate(val, "DatabaseType", &s.DatabaseType) + delete(rawMsg, key) + case "deploymentType": + err = unpopulate(val, "DeploymentType", &s.DeploymentType) + delete(rawMsg, key) + case "networkConfiguration": + err = unpopulate(val, "NetworkConfiguration", &s.NetworkConfiguration) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &s.SubnetID) + delete(rawMsg, key) + case "virtualMachineConfiguration": + err = unpopulate(val, "VirtualMachineConfiguration", &s.VirtualMachineConfiguration) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SingleServerRecommendationResult. +func (s *SingleServerRecommendationResult) 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 "deploymentType": + err = unpopulate(val, "DeploymentType", &s.DeploymentType) + delete(rawMsg, key) + case "vmSku": + err = unpopulate(val, "VMSKU", &s.VMSKU) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -494,13 +1092,95 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Tags. -func (t Tags) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ThreeTierConfiguration. +func (t ThreeTierConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "tags", t.Tags) + populate(objectMap, "appResourceGroup", t.AppResourceGroup) + populate(objectMap, "applicationServer", t.ApplicationServer) + populate(objectMap, "centralServer", t.CentralServer) + populate(objectMap, "databaseServer", t.DatabaseServer) + objectMap["deploymentType"] = SAPDeploymentTypeThreeTier + populate(objectMap, "highAvailabilityConfig", t.HighAvailabilityConfig) + populate(objectMap, "networkConfiguration", t.NetworkConfiguration) return json.Marshal(objectMap) } +// UnmarshalJSON implements the json.Unmarshaller interface for type ThreeTierConfiguration. +func (t *ThreeTierConfiguration) 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 "appResourceGroup": + err = unpopulate(val, "AppResourceGroup", &t.AppResourceGroup) + delete(rawMsg, 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 "deploymentType": + err = unpopulate(val, "DeploymentType", &t.DeploymentType) + delete(rawMsg, key) + case "highAvailabilityConfig": + err = unpopulate(val, "HighAvailabilityConfig", &t.HighAvailabilityConfig) + delete(rawMsg, key) + case "networkConfiguration": + err = unpopulate(val, "NetworkConfiguration", &t.NetworkConfiguration) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ThreeTierRecommendationResult. +func (t *ThreeTierRecommendationResult) 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 "applicationServerInstanceCount": + err = unpopulate(val, "ApplicationServerInstanceCount", &t.ApplicationServerInstanceCount) + delete(rawMsg, key) + case "applicationServerVmSku": + err = unpopulate(val, "ApplicationServerVMSKU", &t.ApplicationServerVMSKU) + delete(rawMsg, key) + case "centralServerInstanceCount": + err = unpopulate(val, "CentralServerInstanceCount", &t.CentralServerInstanceCount) + delete(rawMsg, key) + case "centralServerVmSku": + err = unpopulate(val, "CentralServerVMSKU", &t.CentralServerVMSKU) + delete(rawMsg, key) + case "databaseInstanceCount": + err = unpopulate(val, "DatabaseInstanceCount", &t.DatabaseInstanceCount) + delete(rawMsg, key) + case "dbVmSku": + err = unpopulate(val, "DbVMSKU", &t.DbVMSKU) + delete(rawMsg, key) + case "deploymentType": + err = unpopulate(val, "DeploymentType", &t.DeploymentType) + 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 TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -513,6 +1193,92 @@ func (t TrackedResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type UpdateMonitorRequest. +func (u UpdateMonitorRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", u.Identity) + populate(objectMap, "tags", u.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateSAPApplicationInstanceRequest. +func (u UpdateSAPApplicationInstanceRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", u.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateSAPCentralInstanceRequest. +func (u UpdateSAPCentralInstanceRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", u.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateSAPDatabaseInstanceRequest. +func (u UpdateSAPDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", u.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateSAPVirtualInstanceRequest. +func (u UpdateSAPVirtualInstanceRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", u.Identity) + populate(objectMap, "tags", u.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type UserAssignedServiceIdentity. +func (u UserAssignedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "type", u.Type) + populate(objectMap, "userAssignedIdentities", u.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// 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) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type WindowsConfiguration. +func (w WindowsConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["osType"] = OSTypeWindows + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WindowsConfiguration. +func (w *WindowsConfiguration) 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 "osType": + err = unpopulate(val, "OSType", &w.OSType) + 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{}) { if v == nil { return diff --git a/sdk/resourcemanager/workloads/armworkloads/zz_generated_monitors_client.go b/sdk/resourcemanager/workloads/armworkloads/zz_generated_monitors_client.go index d2d49baa3b00..8ed1e211d0e8 100644 --- a/sdk/resourcemanager/workloads/armworkloads/zz_generated_monitors_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/zz_generated_monitors_client.go @@ -59,7 +59,7 @@ func NewMonitorsClient(subscriptionID string, credential azcore.TokenCredential, // 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 +// 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 == "" { @@ -119,7 +119,7 @@ func (client *MonitorsClient) createCreateRequest(ctx context.Context, resourceG return req, runtime.MarshalAsJSON(req, monitorParameter) } -// BeginDelete - Deletes a SAP monitor with the specified subscription, resource group, and monitor name. +// 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. @@ -137,7 +137,7 @@ func (client *MonitorsClient) BeginDelete(ctx context.Context, resourceGroupName } } -// Delete - Deletes a SAP monitor with the specified subscription, resource group, and monitor name. +// 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 func (client *MonitorsClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginDeleteOptions) (*http.Response, error) { @@ -362,15 +362,15 @@ func (client *MonitorsClient) listByResourceGroupHandleResponse(resp *http.Respo return result, nil } -// Update - Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor name. +// 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. -// tagsParameter - Request body that only contains the new Tags field +// 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, tagsParameter Tags, options *MonitorsClientUpdateOptions) (MonitorsClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, monitorName, tagsParameter, options) +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 { return MonitorsClientUpdateResponse{}, err } @@ -385,7 +385,7 @@ func (client *MonitorsClient) Update(ctx context.Context, resourceGroupName stri } // updateCreateRequest creates the Update request. -func (client *MonitorsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, tagsParameter Tags, options *MonitorsClientUpdateOptions) (*policy.Request, error) { +func (client *MonitorsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, body UpdateMonitorRequest, options *MonitorsClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -407,7 +407,7 @@ func (client *MonitorsClient) updateCreateRequest(ctx context.Context, resourceG 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, tagsParameter) + return req, runtime.MarshalAsJSON(req, body) } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/workloads/armworkloads/zz_generated_phpworkloads_client.go b/sdk/resourcemanager/workloads/armworkloads/zz_generated_phpworkloads_client.go new file mode 100644 index 000000000000..6b33eef8c975 --- /dev/null +++ b/sdk/resourcemanager/workloads/armworkloads/zz_generated_phpworkloads_client.go @@ -0,0 +1,427 @@ +//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 + +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/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/workloads/armworkloads/zz_generated_polymorphic_helpers.go index bfaba1b63840..a6e40ff0544b 100644 --- a/sdk/resourcemanager/workloads/armworkloads/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/workloads/armworkloads/zz_generated_polymorphic_helpers.go @@ -10,6 +10,46 @@ package armworkloads import "encoding/json" +func unmarshalInfrastructureConfigurationClassification(rawMsg json.RawMessage) (InfrastructureConfigurationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b InfrastructureConfigurationClassification + switch m["deploymentType"] { + case string(SAPDeploymentTypeSingleServer): + b = &SingleServerConfiguration{} + case string(SAPDeploymentTypeThreeTier): + b = &ThreeTierConfiguration{} + default: + b = &InfrastructureConfiguration{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalOSConfigurationClassification(rawMsg json.RawMessage) (OSConfigurationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b OSConfigurationClassification + switch m["osType"] { + case string(OSTypeLinux): + b = &LinuxConfiguration{} + case string(OSTypeWindows): + b = &WindowsConfiguration{} + default: + b = &OSConfiguration{} + } + return b, json.Unmarshal(rawMsg, b) +} + func unmarshalProviderSpecificPropertiesClassification(rawMsg json.RawMessage) (ProviderSpecificPropertiesClassification, error) { if rawMsg == nil { return nil, nil @@ -37,3 +77,65 @@ func unmarshalProviderSpecificPropertiesClassification(rawMsg json.RawMessage) ( } return b, json.Unmarshal(rawMsg, b) } + +func unmarshalSAPConfigurationClassification(rawMsg json.RawMessage) (SAPConfigurationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b SAPConfigurationClassification + switch m["configurationType"] { + case string(SAPConfigurationTypeDeployment): + b = &DeploymentConfiguration{} + case string(SAPConfigurationTypeDeploymentWithOSConfig): + b = &DeploymentWithOSConfiguration{} + case string(SAPConfigurationTypeDiscovery): + b = &DiscoveryConfiguration{} + default: + b = &SAPConfiguration{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalSAPSizingRecommendationResultClassification(rawMsg json.RawMessage) (SAPSizingRecommendationResultClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b SAPSizingRecommendationResultClassification + switch m["deploymentType"] { + case string(SAPDeploymentTypeSingleServer): + b = &SingleServerRecommendationResult{} + case string(SAPDeploymentTypeThreeTier): + b = &ThreeTierRecommendationResult{} + default: + b = &SAPSizingRecommendationResult{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalSoftwareConfigurationClassification(rawMsg json.RawMessage) (SoftwareConfigurationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b SoftwareConfigurationClassification + switch m["softwareInstallationType"] { + case string(SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig): + b = &SAPInstallWithoutOSConfigSoftwareConfiguration{} + case string(SAPSoftwareInstallationTypeServiceInitiated): + b = &ServiceInitiatedSoftwareConfiguration{} + default: + b = &SoftwareConfiguration{} + } + return b, json.Unmarshal(rawMsg, b) +} diff --git a/sdk/resourcemanager/workloads/armworkloads/zz_generated_providerinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/zz_generated_providerinstances_client.go index 1cf764a3e230..608c51a41b4c 100644 --- a/sdk/resourcemanager/workloads/armworkloads/zz_generated_providerinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/zz_generated_providerinstances_client.go @@ -54,7 +54,8 @@ func NewProviderInstancesClient(subscriptionID string, credential azcore.TokenCr return client, nil } -// BeginCreate - Creates a provider instance for the specified subscription, resource group, Monitor name, and resource name. +// 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. @@ -77,7 +78,7 @@ func (client *ProviderInstancesClient) BeginCreate(ctx context.Context, resource } } -// Create - Creates a provider instance for the specified subscription, resource group, Monitor name, and resource name. +// 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 func (client *ProviderInstancesClient) create(ctx context.Context, resourceGroupName string, monitorName string, providerInstanceName string, providerInstanceParameter ProviderInstance, options *ProviderInstancesClientBeginCreateOptions) (*http.Response, error) { @@ -125,7 +126,8 @@ func (client *ProviderInstancesClient) createCreateRequest(ctx context.Context, return req, runtime.MarshalAsJSON(req, providerInstanceParameter) } -// BeginDelete - Deletes a provider instance for the specified subscription, resource group, Monitor name, and resource name. +// 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. @@ -145,7 +147,7 @@ func (client *ProviderInstancesClient) BeginDelete(ctx context.Context, resource } } -// Delete - Deletes a provider instance for the specified subscription, resource group, Monitor name, and resource name. +// 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 func (client *ProviderInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, providerInstanceName string, options *ProviderInstancesClientBeginDeleteOptions) (*http.Response, error) { @@ -193,7 +195,7 @@ func (client *ProviderInstancesClient) deleteCreateRequest(ctx context.Context, return req, nil } -// Get - Gets properties of a provider instance for the specified subscription, resource group, Monitor name, and resource +// 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 diff --git a/sdk/resourcemanager/workloads/armworkloads/zz_generated_response_types.go b/sdk/resourcemanager/workloads/armworkloads/zz_generated_response_types.go index a0a6b864c2e3..5922288536f0 100644 --- a/sdk/resourcemanager/workloads/armworkloads/zz_generated_response_types.go +++ b/sdk/resourcemanager/workloads/armworkloads/zz_generated_response_types.go @@ -8,6 +8,36 @@ package armworkloads +// ClientSAPAvailabilityZoneDetailsResponse contains the response from method Client.SAPAvailabilityZoneDetails. +type ClientSAPAvailabilityZoneDetailsResponse struct { + SAPAvailabilityZoneDetailsResult +} + +// ClientSAPDiskConfigurationsResponse contains the response from method Client.SAPDiskConfigurations. +type ClientSAPDiskConfigurationsResponse struct { + SAPDiskConfigurationsResult +} + +// ClientSAPSizingRecommendationsResponse contains the response from method Client.SAPSizingRecommendations. +type ClientSAPSizingRecommendationsResponse struct { + SAPSizingRecommendationResultClassification +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientSAPSizingRecommendationsResponse. +func (c *ClientSAPSizingRecommendationsResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalSAPSizingRecommendationResultClassification(data) + if err != nil { + return err + } + c.SAPSizingRecommendationResultClassification = res + return nil +} + +// ClientSAPSupportedSKUResponse contains the response from method Client.SAPSupportedSKU. +type ClientSAPSupportedSKUResponse struct { + SAPSupportedResourceSKUsResult +} + // MonitorsClientCreateResponse contains the response from method MonitorsClient.Create. type MonitorsClientCreateResponse struct { Monitor @@ -43,6 +73,36 @@ 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. type ProviderInstancesClientCreateResponse struct { ProviderInstance @@ -62,3 +122,143 @@ type ProviderInstancesClientGetResponse struct { type ProviderInstancesClientListResponse struct { ProviderInstanceListResult } + +// SAPApplicationServerInstancesClientCreateResponse contains the response from method SAPApplicationServerInstancesClient.Create. +type SAPApplicationServerInstancesClientCreateResponse struct { + SAPApplicationServerInstance +} + +// SAPApplicationServerInstancesClientDeleteResponse contains the response from method SAPApplicationServerInstancesClient.Delete. +type SAPApplicationServerInstancesClientDeleteResponse struct { + OperationStatusResult +} + +// SAPApplicationServerInstancesClientGetResponse contains the response from method SAPApplicationServerInstancesClient.Get. +type SAPApplicationServerInstancesClientGetResponse struct { + SAPApplicationServerInstance +} + +// SAPApplicationServerInstancesClientListResponse contains the response from method SAPApplicationServerInstancesClient.List. +type SAPApplicationServerInstancesClientListResponse struct { + SAPApplicationServerInstanceList +} + +// SAPApplicationServerInstancesClientUpdateResponse contains the response from method SAPApplicationServerInstancesClient.Update. +type SAPApplicationServerInstancesClientUpdateResponse struct { + SAPApplicationServerInstance +} + +// SAPCentralInstancesClientCreateResponse contains the response from method SAPCentralInstancesClient.Create. +type SAPCentralInstancesClientCreateResponse struct { + SAPCentralServerInstance +} + +// SAPCentralInstancesClientDeleteResponse contains the response from method SAPCentralInstancesClient.Delete. +type SAPCentralInstancesClientDeleteResponse struct { + OperationStatusResult +} + +// SAPCentralInstancesClientGetResponse contains the response from method SAPCentralInstancesClient.Get. +type SAPCentralInstancesClientGetResponse struct { + SAPCentralServerInstance +} + +// SAPCentralInstancesClientListResponse contains the response from method SAPCentralInstancesClient.List. +type SAPCentralInstancesClientListResponse struct { + SAPCentralInstanceList +} + +// SAPCentralInstancesClientUpdateResponse contains the response from method SAPCentralInstancesClient.Update. +type SAPCentralInstancesClientUpdateResponse struct { + SAPCentralServerInstance +} + +// SAPDatabaseInstancesClientCreateResponse contains the response from method SAPDatabaseInstancesClient.Create. +type SAPDatabaseInstancesClientCreateResponse struct { + SAPDatabaseInstance +} + +// SAPDatabaseInstancesClientDeleteResponse contains the response from method SAPDatabaseInstancesClient.Delete. +type SAPDatabaseInstancesClientDeleteResponse struct { + OperationStatusResult +} + +// SAPDatabaseInstancesClientGetResponse contains the response from method SAPDatabaseInstancesClient.Get. +type SAPDatabaseInstancesClientGetResponse struct { + SAPDatabaseInstance +} + +// SAPDatabaseInstancesClientListResponse contains the response from method SAPDatabaseInstancesClient.List. +type SAPDatabaseInstancesClientListResponse struct { + SAPDatabaseInstanceList +} + +// SAPDatabaseInstancesClientUpdateResponse contains the response from method SAPDatabaseInstancesClient.Update. +type SAPDatabaseInstancesClientUpdateResponse struct { + SAPDatabaseInstance +} + +// SAPVirtualInstancesClientCreateResponse contains the response from method SAPVirtualInstancesClient.Create. +type SAPVirtualInstancesClientCreateResponse struct { + SAPVirtualInstance +} + +// SAPVirtualInstancesClientDeleteResponse contains the response from method SAPVirtualInstancesClient.Delete. +type SAPVirtualInstancesClientDeleteResponse struct { + OperationStatusResult +} + +// SAPVirtualInstancesClientGetResponse contains the response from method SAPVirtualInstancesClient.Get. +type SAPVirtualInstancesClientGetResponse struct { + SAPVirtualInstance +} + +// SAPVirtualInstancesClientListByResourceGroupResponse contains the response from method SAPVirtualInstancesClient.ListByResourceGroup. +type SAPVirtualInstancesClientListByResourceGroupResponse struct { + SAPVirtualInstanceList +} + +// SAPVirtualInstancesClientListBySubscriptionResponse contains the response from method SAPVirtualInstancesClient.ListBySubscription. +type SAPVirtualInstancesClientListBySubscriptionResponse struct { + SAPVirtualInstanceList +} + +// SAPVirtualInstancesClientStartResponse contains the response from method SAPVirtualInstancesClient.Start. +type SAPVirtualInstancesClientStartResponse struct { + OperationStatusResult +} + +// SAPVirtualInstancesClientStopResponse contains the response from method SAPVirtualInstancesClient.Stop. +type SAPVirtualInstancesClientStopResponse struct { + OperationStatusResult +} + +// SAPVirtualInstancesClientUpdateResponse contains the response from method SAPVirtualInstancesClient.Update. +type SAPVirtualInstancesClientUpdateResponse struct { + SAPVirtualInstance +} + +// SKUsClientListResponse contains the response from method SKUsClient.List. +type SKUsClientListResponse struct { + SKUsListResult +} + +// WordpressInstancesClientCreateOrUpdateResponse contains the response from method WordpressInstancesClient.CreateOrUpdate. +type WordpressInstancesClientCreateOrUpdateResponse struct { + WordpressInstanceResource +} + +// WordpressInstancesClientDeleteResponse contains the response from method WordpressInstancesClient.Delete. +type WordpressInstancesClientDeleteResponse struct { + // placeholder for future response values +} + +// WordpressInstancesClientGetResponse contains the response from method WordpressInstancesClient.Get. +type WordpressInstancesClientGetResponse struct { + WordpressInstanceResource +} + +// WordpressInstancesClientListResponse contains the response from method WordpressInstancesClient.List. +type WordpressInstancesClientListResponse struct { + WordpressInstanceResourceList +} diff --git a/sdk/resourcemanager/workloads/armworkloads/zz_generated_sapapplicationserverinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/zz_generated_sapapplicationserverinstances_client.go new file mode 100644 index 000000000000..4632d640fb7a --- /dev/null +++ b/sdk/resourcemanager/workloads/armworkloads/zz_generated_sapapplicationserverinstances_client.go @@ -0,0 +1,407 @@ +//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 + +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" +) + +// SAPApplicationServerInstancesClient contains the methods for the SAPApplicationServerInstances group. +// Don't use this type directly, use NewSAPApplicationServerInstancesClient() instead. +type SAPApplicationServerInstancesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// 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. +func NewSAPApplicationServerInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SAPApplicationServerInstancesClient, 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 := &SAPApplicationServerInstancesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreate - Puts the SAP Application Server Instance. +// 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. +// 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, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPApplicationServerInstancesClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPApplicationServerInstancesClientCreateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Create - Puts the SAP Application Server Instance. +// 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, options *SAPApplicationServerInstancesClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(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.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createCreateRequest creates the Create request. +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") + } + 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.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"} + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil +} + +// BeginDelete - Deletes the SAP Application Server Instance. +// 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. +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) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPApplicationServerInstancesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPApplicationServerInstancesClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Deletes the SAP Application Server Instance. +// 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 +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 { + 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 *SAPApplicationServerInstancesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginDeleteOptions) (*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") + } + 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.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 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. +// 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 { + return SAPApplicationServerInstancesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SAPApplicationServerInstancesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SAPApplicationServerInstancesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SAPApplicationServerInstancesClient) getCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientGetOptions) (*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") + } + 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.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 *SAPApplicationServerInstancesClient) getHandleResponse(resp *http.Response) (SAPApplicationServerInstancesClientGetResponse, error) { + result := SAPApplicationServerInstancesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SAPApplicationServerInstance); err != nil { + return SAPApplicationServerInstancesClientGetResponse{}, err + } + 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. +func (client *SAPApplicationServerInstancesClient) NewListPager(resourceGroupName string, sapVirtualInstanceName string, options *SAPApplicationServerInstancesClientListOptions) *runtime.Pager[SAPApplicationServerInstancesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SAPApplicationServerInstancesClientListResponse]{ + More: func(page SAPApplicationServerInstancesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SAPApplicationServerInstancesClientListResponse) (SAPApplicationServerInstancesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SAPApplicationServerInstancesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SAPApplicationServerInstancesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SAPApplicationServerInstancesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *SAPApplicationServerInstancesClient) listCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPApplicationServerInstancesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances" + 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)) + 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 *SAPApplicationServerInstancesClient) listHandleResponse(resp *http.Response) (SAPApplicationServerInstancesClientListResponse, error) { + result := SAPApplicationServerInstancesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SAPApplicationServerInstanceList); err != nil { + return SAPApplicationServerInstancesClientListResponse{}, err + } + return result, nil +} + +// BeginUpdate - Puts 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. +// 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 + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPApplicationServerInstancesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPApplicationServerInstancesClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Puts the SAP Application Server Instance. +// 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, options *SAPApplicationServerInstancesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(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.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +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") + } + 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.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"} + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil +} diff --git a/sdk/resourcemanager/workloads/armworkloads/zz_generated_sapcentralinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/zz_generated_sapcentralinstances_client.go new file mode 100644 index 000000000000..2e751102c115 --- /dev/null +++ b/sdk/resourcemanager/workloads/armworkloads/zz_generated_sapcentralinstances_client.go @@ -0,0 +1,408 @@ +//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 + +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" +) + +// SAPCentralInstancesClient contains the methods for the SAPCentralInstances group. +// Don't use this type directly, use NewSAPCentralInstancesClient() instead. +type SAPCentralInstancesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// 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. +func NewSAPCentralInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SAPCentralInstancesClient, 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 := &SAPCentralInstancesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + 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. +// 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 - 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, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPCentralInstancesClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPCentralInstancesClientCreateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Create - Puts the SAP Central Instance. +// 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 *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 + } + 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 +} + +// createCreateRequest creates the Create request. +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") + } + 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.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"} + 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. +// 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. +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) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPCentralInstancesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPCentralInstancesClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Deletes the SAP Central Instance. +// 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 +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 { + 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 *SAPCentralInstancesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginDeleteOptions) (*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") + } + 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.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 SAP Central 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. +// 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 { + return SAPCentralInstancesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SAPCentralInstancesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SAPCentralInstancesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SAPCentralInstancesClient) getCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientGetOptions) (*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") + } + 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.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 *SAPCentralInstancesClient) getHandleResponse(resp *http.Response) (SAPCentralInstancesClientGetResponse, error) { + result := SAPCentralInstancesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SAPCentralServerInstance); err != nil { + return SAPCentralInstancesClientGetResponse{}, err + } + 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. +func (client *SAPCentralInstancesClient) NewListPager(resourceGroupName string, sapVirtualInstanceName string, options *SAPCentralInstancesClientListOptions) *runtime.Pager[SAPCentralInstancesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SAPCentralInstancesClientListResponse]{ + More: func(page SAPCentralInstancesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SAPCentralInstancesClientListResponse) (SAPCentralInstancesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SAPCentralInstancesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SAPCentralInstancesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SAPCentralInstancesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *SAPCentralInstancesClient) listCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPCentralInstancesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances" + 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)) + 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 *SAPCentralInstancesClient) listHandleResponse(resp *http.Response) (SAPCentralInstancesClientListResponse, error) { + result := SAPCentralInstancesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SAPCentralInstanceList); err != nil { + return SAPCentralInstancesClientListResponse{}, err + } + return result, nil +} + +// BeginUpdate - Updates the SAP Central Instance. +// This can be used to update tags. +// 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 - 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 + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPCentralInstancesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPCentralInstancesClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Updates the SAP Central Instance. +// This can be used to update tags. +// 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, options *SAPCentralInstancesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(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.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +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") + } + 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.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"} + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil +} diff --git a/sdk/resourcemanager/workloads/armworkloads/zz_generated_sapdatabaseinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/zz_generated_sapdatabaseinstances_client.go new file mode 100644 index 000000000000..36e209d869f6 --- /dev/null +++ b/sdk/resourcemanager/workloads/armworkloads/zz_generated_sapdatabaseinstances_client.go @@ -0,0 +1,407 @@ +//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 + +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" +) + +// SAPDatabaseInstancesClient contains the methods for the SAPDatabaseInstances group. +// Don't use this type directly, use NewSAPDatabaseInstancesClient() instead. +type SAPDatabaseInstancesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// 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. +func NewSAPDatabaseInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SAPDatabaseInstancesClient, 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 := &SAPDatabaseInstancesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreate - Puts the SAP Database Instance. +// 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. +// 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, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPDatabaseInstancesClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPDatabaseInstancesClientCreateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Create - Puts the SAP Database Instance. +// 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, options *SAPDatabaseInstancesClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(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.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createCreateRequest creates the Create request. +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") + } + 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.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"} + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil +} + +// BeginDelete - Deletes the SAP Database Instance. +// 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. +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) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPDatabaseInstancesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPDatabaseInstancesClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Deletes the SAP Database Instance. +// 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 +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 { + 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 *SAPDatabaseInstancesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginDeleteOptions) (*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") + } + 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.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 SAP 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. +// databaseInstanceName - Database Instance 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 { + return SAPDatabaseInstancesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SAPDatabaseInstancesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SAPDatabaseInstancesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SAPDatabaseInstancesClient) getCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientGetOptions) (*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") + } + 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.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 *SAPDatabaseInstancesClient) getHandleResponse(resp *http.Response) (SAPDatabaseInstancesClientGetResponse, error) { + result := SAPDatabaseInstancesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SAPDatabaseInstance); err != nil { + return SAPDatabaseInstancesClientGetResponse{}, err + } + 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. +func (client *SAPDatabaseInstancesClient) NewListPager(resourceGroupName string, sapVirtualInstanceName string, options *SAPDatabaseInstancesClientListOptions) *runtime.Pager[SAPDatabaseInstancesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SAPDatabaseInstancesClientListResponse]{ + More: func(page SAPDatabaseInstancesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SAPDatabaseInstancesClientListResponse) (SAPDatabaseInstancesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SAPDatabaseInstancesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SAPDatabaseInstancesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SAPDatabaseInstancesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *SAPDatabaseInstancesClient) listCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPDatabaseInstancesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances" + 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)) + 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 *SAPDatabaseInstancesClient) listHandleResponse(resp *http.Response) (SAPDatabaseInstancesClientListResponse, error) { + result := SAPDatabaseInstancesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SAPDatabaseInstanceList); err != nil { + return SAPDatabaseInstancesClientListResponse{}, err + } + return result, nil +} + +// BeginUpdate - Puts the SAP 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. +// databaseInstanceName - Database Instance 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 + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPDatabaseInstancesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPDatabaseInstancesClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Puts the SAP Database Instance. +// 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, options *SAPDatabaseInstancesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(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.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +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") + } + 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.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"} + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil +} diff --git a/sdk/resourcemanager/workloads/armworkloads/zz_generated_sapvirtualinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/zz_generated_sapvirtualinstances_client.go new file mode 100644 index 000000000000..e331ff3eba8a --- /dev/null +++ b/sdk/resourcemanager/workloads/armworkloads/zz_generated_sapvirtualinstances_client.go @@ -0,0 +1,562 @@ +//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 + +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" +) + +// SAPVirtualInstancesClient contains the methods for the SAPVirtualInstances group. +// Don't use this type directly, use NewSAPVirtualInstancesClient() instead. +type SAPVirtualInstancesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// 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. +func NewSAPVirtualInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SAPVirtualInstancesClient, 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 := &SAPVirtualInstancesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreate - Creates an Virtual Instance for SAP. +// 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 - 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, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPVirtualInstancesClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPVirtualInstancesClientCreateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Create - Creates an Virtual Instance for SAP. +// 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, options *SAPVirtualInstancesClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, 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 +} + +// createCreateRequest creates the Create request. +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") + } + 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)) + 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"} + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil +} + +// BeginDelete - Deletes an Virtual Instance for SAP. +// 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. +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) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPVirtualInstancesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPVirtualInstancesClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Deletes an Virtual Instance for SAP. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-12-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 { + 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 *SAPVirtualInstancesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginDeleteOptions) (*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") + } + 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)) + 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 an Virtual Instance for SAP. +// 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. +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 { + return SAPVirtualInstancesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SAPVirtualInstancesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SAPVirtualInstancesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SAPVirtualInstancesClient) getCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientGetOptions) (*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") + } + 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)) + 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 *SAPVirtualInstancesClient) getHandleResponse(resp *http.Response) (SAPVirtualInstancesClientGetResponse, error) { + result := SAPVirtualInstancesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SAPVirtualInstance); err != nil { + return SAPVirtualInstancesClientGetResponse{}, err + } + 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. +func (client *SAPVirtualInstancesClient) NewListByResourceGroupPager(resourceGroupName string, options *SAPVirtualInstancesClientListByResourceGroupOptions) *runtime.Pager[SAPVirtualInstancesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[SAPVirtualInstancesClientListByResourceGroupResponse]{ + More: func(page SAPVirtualInstancesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SAPVirtualInstancesClientListByResourceGroupResponse) (SAPVirtualInstancesClientListByResourceGroupResponse, 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 SAPVirtualInstancesClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SAPVirtualInstancesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SAPVirtualInstancesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *SAPVirtualInstancesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SAPVirtualInstancesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances" + 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 *SAPVirtualInstancesClient) listByResourceGroupHandleResponse(resp *http.Response) (SAPVirtualInstancesClientListByResourceGroupResponse, error) { + result := SAPVirtualInstancesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SAPVirtualInstanceList); err != nil { + return SAPVirtualInstancesClientListByResourceGroupResponse{}, err + } + 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. +func (client *SAPVirtualInstancesClient) NewListBySubscriptionPager(options *SAPVirtualInstancesClientListBySubscriptionOptions) *runtime.Pager[SAPVirtualInstancesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[SAPVirtualInstancesClientListBySubscriptionResponse]{ + More: func(page SAPVirtualInstancesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SAPVirtualInstancesClientListBySubscriptionResponse) (SAPVirtualInstancesClientListBySubscriptionResponse, 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 SAPVirtualInstancesClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SAPVirtualInstancesClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SAPVirtualInstancesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *SAPVirtualInstancesClient) listBySubscriptionCreateRequest(ctx context.Context, options *SAPVirtualInstancesClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/sapVirtualInstances" + 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 *SAPVirtualInstancesClient) listBySubscriptionHandleResponse(resp *http.Response) (SAPVirtualInstancesClientListBySubscriptionResponse, error) { + result := SAPVirtualInstancesClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SAPVirtualInstanceList); err != nil { + return SAPVirtualInstancesClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// BeginStart - Starts 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. +// 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) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPVirtualInstancesClientStartResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPVirtualInstancesClientStartResponse](options.ResumeToken, client.pl, nil) + } +} + +// Start - Starts the SAP System. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-12-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 { + 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 +} + +// startCreateRequest creates the Start request. +func (client *SAPVirtualInstancesClient) startCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginStartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/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)) + 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", "2021-12-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginStop - Stops 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. +// 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) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SAPVirtualInstancesClientStopResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SAPVirtualInstancesClientStopResponse](options.ResumeToken, client.pl, nil) + } +} + +// Stop - Stops the SAP System. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-12-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 { + 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 +} + +// stopCreateRequest creates the Stop request. +func (client *SAPVirtualInstancesClient) stopCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginStopOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/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)) + 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", "2021-12-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 +} + +// Update - Updates an Virtual Instance for SAP. +// 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 - 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 + } + resp, err := client.pl.Do(req) + if err != nil { + return SAPVirtualInstancesClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SAPVirtualInstancesClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +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") + } + 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)) + 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"} + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *SAPVirtualInstancesClient) updateHandleResponse(resp *http.Response) (SAPVirtualInstancesClientUpdateResponse, error) { + result := SAPVirtualInstancesClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SAPVirtualInstance); err != nil { + return SAPVirtualInstancesClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/workloads/armworkloads/zz_generated_skus_client.go b/sdk/resourcemanager/workloads/armworkloads/zz_generated_skus_client.go new file mode 100644 index 000000000000..d7e176ad00ac --- /dev/null +++ b/sdk/resourcemanager/workloads/armworkloads/zz_generated_skus_client.go @@ -0,0 +1,114 @@ +//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 + +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/zz_generated_wordpressinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/zz_generated_wordpressinstances_client.go new file mode 100644 index 000000000000..edbcc24ee51f --- /dev/null +++ b/sdk/resourcemanager/workloads/armworkloads/zz_generated_wordpressinstances_client.go @@ -0,0 +1,294 @@ +//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 + +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 +}