diff --git a/sdk/resourcemanager/providerhub/armproviderhub/CHANGELOG.md b/sdk/resourcemanager/providerhub/armproviderhub/CHANGELOG.md index 27c3c187aa30..d816c153c9a9 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/CHANGELOG.md +++ b/sdk/resourcemanager/providerhub/armproviderhub/CHANGELOG.md @@ -1,5 +1,274 @@ # Release History +## 2.0.0 (2025-04-24) +### Breaking Changes + +- Type of `ErrorResponse.Error` has been changed from `*ErrorResponseError` to `*ErrorDetail` +- Type of `ExtendedLocationOptions.SupportedPolicy` has been changed from `*string` to `*ResourceTypeExtendedLocationPolicy` +- Type of `ExtendedLocationOptions.Type` has been changed from `*string` to `*ExtendedLocationType` +- Type of `OperationsDefinition.ActionType` has been changed from `*OperationsDefinitionActionType` to `*OperationActionType` +- Type of `OperationsDefinition.Origin` has been changed from `*OperationsDefinitionOrigin` to `*OperationOrigins` +- Type of `ResourceProviderManagement.ResourceAccessPolicy` has been changed from `*ResourceProviderManagementResourceAccessPolicy` to `*ResourceAccessPolicy` +- Type of `ResourceProviderManagement.ResourceAccessRoles` has been changed from `[]any` to `[]*ResourceAccessRole` +- Type of `ResourceProviderManifestManagement.ResourceAccessPolicy` has been changed from `*ResourceProviderManagementResourceAccessPolicy` to `*ResourceAccessPolicy` +- Type of `ResourceProviderManifestManagement.ResourceAccessRoles` has been changed from `[]any` to `[]*ResourceAccessRole` +- Type of `ResourceProviderManifestPropertiesManagement.ResourceAccessPolicy` has been changed from `*ResourceProviderManagementResourceAccessPolicy` to `*ResourceAccessPolicy` +- Type of `ResourceProviderManifestPropertiesManagement.ResourceAccessRoles` has been changed from `[]any` to `[]*ResourceAccessRole` +- Type of `ResourceType.MarketplaceType` has been changed from `*ResourceTypeMarketplaceType` to `*MarketplaceType` +- Type of `ResourceTypeRegistrationProperties.MarketplaceType` has been changed from `*ResourceTypeRegistrationPropertiesMarketplaceType` to `*MarketplaceType` +- Type of `SKULocationInfo.Type` has been changed from `*SKULocationInfoType` to `*ExtendedLocationType` +- Enum `OperationsDefinitionActionType` has been removed +- Enum `OperationsDefinitionOrigin` has been removed +- Enum `ResourceProviderManagementResourceAccessPolicy` has been removed +- Enum `ResourceTypeMarketplaceType` has been removed +- Enum `ResourceTypeRegistrationPropertiesMarketplaceType` has been removed +- Enum `SKULocationInfoType` has been removed +- Operation `*CustomRolloutsClient.CreateOrUpdate` has been changed to LRO, use `*CustomRolloutsClient.BeginCreateOrUpdate` instead. +- Operation `*ResourceTypeRegistrationsClient.Delete` has been changed to LRO, use `*ResourceTypeRegistrationsClient.BeginDelete` instead. +- Struct `CustomRolloutPropertiesAutoGenerated` has been removed +- Struct `DefaultRolloutPropertiesAutoGenerated` has been removed +- Struct `Error` has been removed +- Struct `ErrorInnerError` has been removed +- Struct `ErrorResponseError` has been removed +- Struct `InnerError` has been removed +- Struct `NotificationRegistrationPropertiesAutoGenerated` has been removed +- Struct `ProviderRegistrationPropertiesAutoGenerated` has been removed +- Struct `ResourceTypeRegistrationPropertiesAutoGenerated` has been removed +- Field `OperationsContent` of struct `OperationsClientCreateOrUpdateResponse` has been removed + +### Features Added + +- New value `ExtensionCategoryBestMatchOperationBegin`, `ExtensionCategorySubscriptionLifecycleNotificationDeletion` added to enum type `ExtensionCategory` +- New value `OptInHeaderTypeClientPrincipalNameEncoded`, `OptInHeaderTypeMSIResourceIDEncoded`, `OptInHeaderTypeManagementGroupAncestorsEncoded`, `OptInHeaderTypePrivateLinkID`, `OptInHeaderTypePrivateLinkResourceID`, `OptInHeaderTypePrivateLinkVnetTrafficTag`, `OptInHeaderTypeResourceGroupLocation` added to enum type `OptInHeaderType` +- New value `RoutingTypeBypassEndpointSelectionOptimization`, `RoutingTypeCascadeAuthorizedExtension`, `RoutingTypeChildFanout`, `RoutingTypeLocationMapping`, `RoutingTypeServiceFanout` added to enum type `RoutingType` +- New enum type `AdditionalOptions` with values `AdditionalOptionsProtectedAsyncOperationPolling`, `AdditionalOptionsProtectedAsyncOperationPollingAuditOnly` +- New enum type `AdditionalOptionsAsyncOperation` with values `AdditionalOptionsAsyncOperationProtectedAsyncOperationPolling`, `AdditionalOptionsAsyncOperationProtectedAsyncOperationPollingAuditOnly` +- New enum type `AdditionalOptionsResourceTypeRegistration` with values `AdditionalOptionsResourceTypeRegistrationProtectedAsyncOperationPolling`, `AdditionalOptionsResourceTypeRegistrationProtectedAsyncOperationPollingAuditOnly` +- New enum type `AuthenticationScheme` with values `AuthenticationSchemeBearer`, `AuthenticationSchemePoP` +- New enum type `AvailabilityZonePolicy` with values `AvailabilityZonePolicyMultiZoned`, `AvailabilityZonePolicyNotSpecified`, `AvailabilityZonePolicySingleZoned` +- New enum type `AvailableCheckInManifestEnvironment` with values `AvailableCheckInManifestEnvironmentAll`, `AvailableCheckInManifestEnvironmentCanary`, `AvailableCheckInManifestEnvironmentFairfax`, `AvailableCheckInManifestEnvironmentMooncake`, `AvailableCheckInManifestEnvironmentNotSpecified`, `AvailableCheckInManifestEnvironmentProd` +- New enum type `BlockActionVerb` with values `BlockActionVerbAction`, `BlockActionVerbDelete`, `BlockActionVerbNotSpecified`, `BlockActionVerbRead`, `BlockActionVerbUnrecognized`, `BlockActionVerbWrite` +- New enum type `CapacityPolicy` with values `CapacityPolicyDefault`, `CapacityPolicyRestricted` +- New enum type `CommonAPIVersionsMergeMode` with values `CommonAPIVersionsMergeModeMerge`, `CommonAPIVersionsMergeModeOverwrite` +- New enum type `CreatedByType` with values `CreatedByTypeApplication`, `CreatedByTypeKey`, `CreatedByTypeManagedIdentity`, `CreatedByTypeUser` +- New enum type `CrossTenantTokenValidation` with values `CrossTenantTokenValidationEnsureSecureValidation`, `CrossTenantTokenValidationPassthroughInsecureToken` +- New enum type `DataBoundary` with values `DataBoundaryEU`, `DataBoundaryGlobal`, `DataBoundaryNotDefined`, `DataBoundaryUS` +- New enum type `EndpointType` with values `EndpointTypeCanary`, `EndpointTypeNotSpecified`, `EndpointTypeProduction`, `EndpointTypeTestInProduction` +- New enum type `EndpointTypeResourceType` with values `EndpointTypeResourceTypeCanary`, `EndpointTypeResourceTypeNotSpecified`, `EndpointTypeResourceTypeProduction`, `EndpointTypeResourceTypeTestInProduction` +- New enum type `ExpeditedRolloutIntent` with values `ExpeditedRolloutIntentHotfix`, `ExpeditedRolloutIntentNotSpecified` +- New enum type `ExtendedLocationType` with values `ExtendedLocationTypeArcZone`, `ExtendedLocationTypeCustomLocation`, `ExtendedLocationTypeEdgeZone`, `ExtendedLocationTypeNotSpecified` +- New enum type `FilterOption` with values `FilterOptionEnableSubscriptionFilterOnTenant`, `FilterOptionNotSpecified` +- New enum type `FrontdoorRequestMode` with values `FrontdoorRequestModeNotSpecified`, `FrontdoorRequestModeUseManifest` +- New enum type `Intent` with values `IntentDEFERREDACCESSCHECK`, `IntentLOWPRIVILEGE`, `IntentNOTSPECIFIED`, `IntentRPCONTRACT` +- New enum type `LegacyOperation` with values `LegacyOperationAction`, `LegacyOperationAzureAsyncOperationWaiting`, `LegacyOperationCreate`, `LegacyOperationDelete`, `LegacyOperationDeploymentCleanup`, `LegacyOperationEvaluateDeploymentOutput`, `LegacyOperationNotSpecified`, `LegacyOperationRead`, `LegacyOperationResourceCacheWaiting`, `LegacyOperationWaiting` +- New enum type `MarketplaceType` with values `MarketplaceTypeAddOn`, `MarketplaceTypeBypass`, `MarketplaceTypeNotSpecified`, `MarketplaceTypeStore` +- New enum type `NotificationEndpointType` with values `NotificationEndpointTypeEventhub`, `NotificationEndpointTypeWebhook` +- New enum type `NotificationOptions` with values `NotificationOptionsEmitSpendingLimit`, `NotificationOptionsNone`, `NotificationOptionsNotSpecified` +- New enum type `NotificationType` with values `NotificationTypeSubscriptionNotification`, `NotificationTypeUnspecified` +- New enum type `OperationActionType` with values `OperationActionTypeInternal`, `OperationActionTypeNotSpecified` +- New enum type `OperationOrigins` with values `OperationOriginsNotSpecified`, `OperationOriginsSystem`, `OperationOriginsUser` +- New enum type `OptOutHeaderType` with values `OptOutHeaderTypeNotSpecified`, `OptOutHeaderTypeSystemDataCreatedByLastModifiedBy` +- New enum type `Policy` with values `PolicyNotSpecified`, `PolicySynchronizeBeginExtension` +- New enum type `PolicyExecutionType` with values `PolicyExecutionTypeBypassPolicies`, `PolicyExecutionTypeExecutePolicies`, `PolicyExecutionTypeExpectPartialPutRequests`, `PolicyExecutionTypeNotSpecified` +- New enum type `ProviderRegistrationKind` with values `ProviderRegistrationKindDirect`, `ProviderRegistrationKindHybrid`, `ProviderRegistrationKindManaged` +- New enum type `QuotaPolicy` with values `QuotaPolicyDefault`, `QuotaPolicyNone`, `QuotaPolicyRestricted` +- New enum type `Readiness` with values `ReadinessClosingDown`, `ReadinessDeprecated`, `ReadinessGA`, `ReadinessInDevelopment`, `ReadinessInternalOnly`, `ReadinessPrivatePreview`, `ReadinessPublicPreview`, `ReadinessRemovedFromARM`, `ReadinessRetired` +- New enum type `ResourceAccessPolicy` with values `ResourceAccessPolicyAcisActionAllowed`, `ResourceAccessPolicyAcisReadAllowed`, `ResourceAccessPolicyNotSpecified` +- New enum type `ResourceSubType` with values `ResourceSubTypeAsyncOperation`, `ResourceSubTypeNotSpecified` +- New enum type `ResourceTypeCategory` with values `ResourceTypeCategoryFreeForm`, `ResourceTypeCategoryInternal`, `ResourceTypeCategoryNone`, `ResourceTypeCategoryPureProxy` +- New enum type `ResourceTypeEndpointKind` with values `ResourceTypeEndpointKindDirect`, `ResourceTypeEndpointKindManaged` +- New enum type `ResourceTypeExtendedLocationPolicy` with values `ResourceTypeExtendedLocationPolicyAll`, `ResourceTypeExtendedLocationPolicyNotSpecified` +- New enum type `ResourceTypeRegistrationKind` with values `ResourceTypeRegistrationKindDirect`, `ResourceTypeRegistrationKindHybrid`, `ResourceTypeRegistrationKindManaged` +- New enum type `Role` with values `RoleLimitedOwner`, `RoleServiceOwner` +- New enum type `ServerFailureResponseMessageType` with values `ServerFailureResponseMessageTypeNotSpecified`, `ServerFailureResponseMessageTypeOutageReporting` +- New enum type `ServiceClientOptionsType` with values `ServiceClientOptionsTypeDisableAutomaticDecompression`, `ServiceClientOptionsTypeNotSpecified` +- New enum type `ServiceFeatureFlagAction` with values `ServiceFeatureFlagActionCreate`, `ServiceFeatureFlagActionDoNotCreate` +- New enum type `ServiceStatus` with values `ServiceStatusActive`, `ServiceStatusInactive` +- New enum type `SignedRequestScope` with values `SignedRequestScopeEndpoint`, `SignedRequestScopeResourceURI` +- New enum type `SkipNotifications` with values `SkipNotificationsDisabled`, `SkipNotificationsEnabled`, `SkipNotificationsUnspecified` +- New enum type `SupportedOperations` with values `SupportedOperationsDelete`, `SupportedOperationsGet`, `SupportedOperationsNotSpecified` +- New enum type `TemplateDeploymentPreflightNotifications` with values `TemplateDeploymentPreflightNotificationsNone`, `TemplateDeploymentPreflightNotificationsUnregisteredSubscriptions` +- New function `NewAuthorizedApplicationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AuthorizedApplicationsClient, error)` +- New function `*AuthorizedApplicationsClient.BeginCreateOrUpdate(context.Context, string, string, AuthorizedApplication, *AuthorizedApplicationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AuthorizedApplicationsClientCreateOrUpdateResponse], error)` +- New function `*AuthorizedApplicationsClient.Delete(context.Context, string, string, *AuthorizedApplicationsClientDeleteOptions) (AuthorizedApplicationsClientDeleteResponse, error)` +- New function `*AuthorizedApplicationsClient.Get(context.Context, string, string, *AuthorizedApplicationsClientGetOptions) (AuthorizedApplicationsClientGetResponse, error)` +- New function `*AuthorizedApplicationsClient.NewListPager(string, *AuthorizedApplicationsClientListOptions) *runtime.Pager[AuthorizedApplicationsClientListResponse]` +- New function `*ClientFactory.NewAuthorizedApplicationsClient() *AuthorizedApplicationsClient` +- New function `*ClientFactory.NewNewRegionFrontloadReleaseClient() *NewRegionFrontloadReleaseClient` +- New function `*ClientFactory.NewProviderMonitorSettingsClient() *ProviderMonitorSettingsClient` +- New function `*ClientFactory.NewResourceActionsClient() *ResourceActionsClient` +- New function `*CustomRolloutsClient.Delete(context.Context, string, string, *CustomRolloutsClientDeleteOptions) (CustomRolloutsClientDeleteResponse, error)` +- New function `*CustomRolloutsClient.Stop(context.Context, string, string, *CustomRolloutsClientStopOptions) (CustomRolloutsClientStopResponse, error)` +- New function `PossiblePolicyValues() []Policy` +- New function `NewProviderMonitorSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ProviderMonitorSettingsClient, error)` +- New function `*ProviderMonitorSettingsClient.BeginCreate(context.Context, string, string, ProviderMonitorSetting, *ProviderMonitorSettingsClientBeginCreateOptions) (*runtime.Poller[ProviderMonitorSettingsClientCreateResponse], error)` +- New function `*ProviderMonitorSettingsClient.Delete(context.Context, string, string, *ProviderMonitorSettingsClientDeleteOptions) (ProviderMonitorSettingsClientDeleteResponse, error)` +- New function `*ProviderMonitorSettingsClient.Get(context.Context, string, string, *ProviderMonitorSettingsClientGetOptions) (ProviderMonitorSettingsClientGetResponse, error)` +- New function `*ProviderMonitorSettingsClient.NewListByResourceGroupPager(string, *ProviderMonitorSettingsClientListByResourceGroupOptions) *runtime.Pager[ProviderMonitorSettingsClientListByResourceGroupResponse]` +- New function `*ProviderMonitorSettingsClient.NewListBySubscriptionPager(*ProviderMonitorSettingsClientListBySubscriptionOptions) *runtime.Pager[ProviderMonitorSettingsClientListBySubscriptionResponse]` +- New function `*ProviderMonitorSettingsClient.Update(context.Context, string, string, *ProviderMonitorSettingsClientUpdateOptions) (ProviderMonitorSettingsClientUpdateResponse, error)` +- New function `NewNewRegionFrontloadReleaseClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NewRegionFrontloadReleaseClient, error)` +- New function `*NewRegionFrontloadReleaseClient.CreateOrUpdate(context.Context, string, string, FrontloadPayload, *NewRegionFrontloadReleaseClientCreateOrUpdateOptions) (NewRegionFrontloadReleaseClientCreateOrUpdateResponse, error)` +- New function `*NewRegionFrontloadReleaseClient.GenerateManifest(context.Context, string, FrontloadPayload, *NewRegionFrontloadReleaseClientGenerateManifestOptions) (NewRegionFrontloadReleaseClientGenerateManifestResponse, error)` +- New function `*NewRegionFrontloadReleaseClient.Get(context.Context, string, string, *NewRegionFrontloadReleaseClientGetOptions) (NewRegionFrontloadReleaseClientGetResponse, error)` +- New function `*NewRegionFrontloadReleaseClient.Stop(context.Context, string, string, *NewRegionFrontloadReleaseClientStopOptions) (NewRegionFrontloadReleaseClientStopResponse, error)` +- New function `*NewRegionFrontloadReleaseClient.ValidateManifest(context.Context, string, *NewRegionFrontloadReleaseClientValidateManifestOptions) (NewRegionFrontloadReleaseClientValidateManifestResponse, error)` +- New function `NewResourceActionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ResourceActionsClient, error)` +- New function `*ResourceActionsClient.BeginDeleteResources(context.Context, string, string, ResourceManagementAction, *ResourceActionsClientBeginDeleteResourcesOptions) (*runtime.Poller[ResourceActionsClientDeleteResourcesResponse], error)` +- New struct `APIProfile` +- New struct `AdditionalAuthorization` +- New struct `AllowedResourceName` +- New struct `AllowedUnauthorizedActionsExtension` +- New struct `ApplicationDataAuthorization` +- New struct `ApplicationProviderAuthorization` +- New struct `AsyncOperationPollingRules` +- New struct `AsyncTimeoutRule` +- New struct `AuthorizedApplication` +- New struct `AuthorizedApplicationArrayResponseWithContinuation` +- New struct `AuthorizedApplicationProperties` +- New struct `CustomRolloutSpecificationAutoProvisionConfig` +- New struct `CustomRolloutStatusManifestCheckinStatus` +- New struct `DefaultRolloutSpecificationAutoProvisionConfig` +- New struct `DefaultRolloutSpecificationExpeditedRollout` +- New struct `DefaultRolloutStatusManifestCheckinStatus` +- New struct `DeleteDependency` +- New struct `DstsConfiguration` +- New struct `EndpointInformation` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `ExpeditedRolloutDefinition` +- New struct `FanoutLinkedNotificationRule` +- New struct `FanoutLinkedNotificationRuleDstsConfiguration` +- New struct `FilterRule` +- New struct `FrontloadPayload` +- New struct `FrontloadPayloadProperties` +- New struct `FrontloadPayloadPropertiesOverrideEndpointLevelFields` +- New struct `FrontloadPayloadPropertiesOverrideManifestLevelFields` +- New struct `GroupConnectivityInformation` +- New struct `LegacyDisallowedCondition` +- New struct `LinkedNotificationRule` +- New struct `LocalizedOperationDefinition` +- New struct `LocalizedOperationDefinitionDisplay` +- New struct `LocalizedOperationDisplayDefinition` +- New struct `LocalizedOperationDisplayDefinitionCs` +- New struct `LocalizedOperationDisplayDefinitionDe` +- New struct `LocalizedOperationDisplayDefinitionDefault` +- New struct `LocalizedOperationDisplayDefinitionEn` +- New struct `LocalizedOperationDisplayDefinitionEs` +- New struct `LocalizedOperationDisplayDefinitionFr` +- New struct `LocalizedOperationDisplayDefinitionHu` +- New struct `LocalizedOperationDisplayDefinitionIt` +- New struct `LocalizedOperationDisplayDefinitionJa` +- New struct `LocalizedOperationDisplayDefinitionKo` +- New struct `LocalizedOperationDisplayDefinitionNl` +- New struct `LocalizedOperationDisplayDefinitionPl` +- New struct `LocalizedOperationDisplayDefinitionPt` +- New struct `LocalizedOperationDisplayDefinitionPtBR` +- New struct `LocalizedOperationDisplayDefinitionRu` +- New struct `LocalizedOperationDisplayDefinitionSv` +- New struct `LocalizedOperationDisplayDefinitionZhHans` +- New struct `LocalizedOperationDisplayDefinitionZhHant` +- New struct `LocationQuotaRule` +- New struct `ManifestLevelPropertyBag` +- New struct `Notification` +- New struct `OpenAPIConfiguration` +- New struct `OpenAPIValidation` +- New struct `OperationsContentProperties` +- New struct `OperationsPutContentProperties` +- New struct `PrivateResourceProviderConfiguration` +- New struct `ProviderMonitorSetting` +- New struct `ProviderMonitorSettingArrayResponseWithContinuation` +- New struct `ProviderMonitorSettingProperties` +- New struct `ProviderRegistrationPropertiesPrivateResourceProviderConfiguration` +- New struct `QuotaRule` +- New struct `ResourceAccessRole` +- New struct `ResourceConcurrencyControlOption` +- New struct `ResourceGraphConfiguration` +- New struct `ResourceHydrationAccount` +- New struct `ResourceManagementAction` +- New struct `ResourceManagementEntity` +- New struct `ResourceProviderAuthorizationManagedByAuthorization` +- New struct `ResourceProviderAuthorizationRules` +- New struct `ResourceProviderManagementErrorResponseMessageOptions` +- New struct `ResourceProviderManagementExpeditedRolloutMetadata` +- New struct `ResourceProviderManifestPropertiesDstsConfiguration` +- New struct `ResourceProviderManifestPropertiesNotificationSettings` +- New struct `ResourceProviderManifestPropertiesResourceGroupLockOptionDuringMove` +- New struct `ResourceProviderManifestPropertiesResponseOptions` +- New struct `ResourceProviderService` +- New struct `ResourceTypeEndpointBase` +- New struct `ResourceTypeEndpointBaseDstsConfiguration` +- New struct `ResourceTypeEndpointBaseFeaturesRule` +- New struct `ResourceTypeEndpointDstsConfiguration` +- New struct `ResourceTypeOnBehalfOfToken` +- New struct `ResourceTypeRegistrationPropertiesAvailabilityZoneRule` +- New struct `ResourceTypeRegistrationPropertiesCapacityRule` +- New struct `ResourceTypeRegistrationPropertiesDstsConfiguration` +- New struct `ResourceTypeRegistrationPropertiesLegacyPolicy` +- New struct `ResourceTypeRegistrationPropertiesManagement` +- New struct `ResourceTypeRegistrationPropertiesMarketplaceOptions` +- New struct `ResourceTypeRegistrationPropertiesResourceCache` +- New struct `ResourceTypeRegistrationPropertiesResourceGraphConfiguration` +- New struct `ResourceTypeRegistrationPropertiesResourceManagementOptions` +- New struct `ResourceTypeRegistrationPropertiesResourceManagementOptionsBatchProvisioningSupport` +- New struct `ResourceTypeRegistrationPropertiesResourceManagementOptionsNestedProvisioningSupport` +- New struct `ResourceTypeRegistrationPropertiesResourceQueryManagement` +- New struct `ResourceTypeRegistrationPropertiesResourceTypeCommonAttributeManagement` +- New struct `ResourceTypeRegistrationPropertiesRoutingRule` +- New struct `ResourceTypeRegistrationPropertiesTemplateDeploymentPolicy` +- New struct `SubscriberSetting` +- New struct `SystemData` +- New struct `ThirdPartyExtension` +- New struct `TokenAuthConfiguration` +- New struct `TrackedResource` +- New field `SystemData` in struct `CustomRollout` +- New field `AutoProvisionConfig`, `RefreshSubscriptionRegistration`, `ReleaseScopes`, `SkipReleaseScopeValidation` in struct `CustomRolloutPropertiesSpecification` +- New field `ManifestCheckinStatus` in struct `CustomRolloutPropertiesStatus` +- New field `AutoProvisionConfig`, `RefreshSubscriptionRegistration`, `ReleaseScopes`, `SkipReleaseScopeValidation` in struct `CustomRolloutSpecification` +- New field `Kind`, `SystemData` in struct `CustomRolloutSpecificationProviderRegistration` +- New field `ManifestCheckinStatus` in struct `CustomRolloutStatus` +- New field `SystemData` in struct `DefaultRollout` +- New field `AutoProvisionConfig`, `ExpeditedRollout` in struct `DefaultRolloutPropertiesSpecification` +- New field `ManifestCheckinStatus` in struct `DefaultRolloutPropertiesStatus` +- New field `AutoProvisionConfig`, `ExpeditedRollout` in struct `DefaultRolloutSpecification` +- New field `Kind`, `SystemData` in struct `DefaultRolloutSpecificationProviderRegistration` +- New field `ManifestCheckinStatus` in struct `DefaultRolloutStatus` +- New field `ApplicationIDs`, `DelegationAppIDs` in struct `IdentityManagementProperties` +- New field `DependsOnTypes` in struct `LinkedOperationRule` +- New field `DirectRpRoleDefinitionID`, `GlobalAsyncOperationResourceTypeName`, `RegionalAsyncOperationResourceTypeName` in struct `Metadata` +- New field `SystemData` in struct `NotificationRegistration` +- New anonymous field `OperationsPutContent` in struct `OperationsClientCreateOrUpdateResponse` +- New field `SystemData` in struct `OperationsContent` +- New field `ID`, `Name`, `Properties`, `SystemData`, `Type` in struct `OperationsPutContent` +- New field `Kind`, `SystemData` in struct `ProviderRegistration` +- New field `CrossTenantTokenValidation`, `CustomManifestVersion`, `DstsConfiguration`, `EnableTenantLinkedNotification`, `GlobalNotificationEndpoints`, `LegacyNamespace`, `LegacyRegistrations`, `LinkedNotificationRules`, `ManagementGroupGlobalNotificationEndpoints`, `NotificationOptions`, `NotificationSettings`, `Notifications`, `OptionalFeatures`, `PrivateResourceProviderConfiguration`, `ResourceGroupLockOptionDuringMove`, `ResourceHydrationAccounts`, `ResourceProviderAuthorizationRules`, `ResponseOptions`, `ServiceName`, `Services`, `TokenAuthConfiguration` in struct `ProviderRegistrationProperties` +- New field `DirectRpRoleDefinitionID`, `GlobalAsyncOperationResourceTypeName`, `RegionalAsyncOperationResourceTypeName` in struct `ProviderRegistrationPropertiesProviderHubMetadata` +- New field `SystemData` in struct `ProxyResource` +- New field `OptOutHeaders` in struct `RequestHeaderOptions` +- New field `SystemData` in struct `Resource` +- New field `AllowedThirdPartyExtensions`, `GroupingTag`, `ManagedByAuthorization` in struct `ResourceProviderAuthorization` +- New field `EndpointType`, `SKULink` in struct `ResourceProviderEndpoint` +- New field `AuthorizationOwners`, `CanaryManifestOwners`, `ErrorResponseMessageOptions`, `ExpeditedRolloutMetadata`, `ExpeditedRolloutSubmitters`, `PcCode`, `ProfitCenterProgramID` in struct `ResourceProviderManagement` +- New field `CrossTenantTokenValidation`, `EnableTenantLinkedNotification`, `LinkedNotificationRules`, `Notifications`, `ResourceProviderAuthorizationRules`, `ServiceName`, `Services` in struct `ResourceProviderManifest` +- New field `AuthorizationOwners`, `CanaryManifestOwners`, `ErrorResponseMessageOptions`, `ExpeditedRolloutMetadata`, `ExpeditedRolloutSubmitters`, `PcCode`, `ProfitCenterProgramID` in struct `ResourceProviderManifestManagement` +- New field `CrossTenantTokenValidation`, `CustomManifestVersion`, `DstsConfiguration`, `EnableTenantLinkedNotification`, `GlobalNotificationEndpoints`, `LegacyNamespace`, `LegacyRegistrations`, `LinkedNotificationRules`, `ManagementGroupGlobalNotificationEndpoints`, `NotificationOptions`, `NotificationSettings`, `Notifications`, `OptionalFeatures`, `ResourceGroupLockOptionDuringMove`, `ResourceHydrationAccounts`, `ResourceProviderAuthorizationRules`, `ResponseOptions`, `ServiceName`, `Services` in struct `ResourceProviderManifestProperties` +- New field `AuthorizationOwners`, `CanaryManifestOwners`, `ErrorResponseMessageOptions`, `ExpeditedRolloutMetadata`, `ExpeditedRolloutSubmitters`, `PcCode`, `ProfitCenterProgramID` in struct `ResourceProviderManifestPropertiesManagement` +- New field `OptOutHeaders` in struct `ResourceProviderManifestPropertiesRequestHeaderOptions` +- New field `OptOutHeaders` in struct `ResourceProviderManifestRequestHeaderOptions` +- New field `AdditionalOptions`, `AllowedUnauthorizedActionsExtensions`, `CrossTenantTokenValidation`, `LinkedNotificationRules`, `Notifications`, `QuotaRule`, `ResourceProviderAuthorizationRules` in struct `ResourceType` +- New field `APIVersion`, `DataBoundary`, `DstsConfiguration`, `EndpointType`, `EndpointURI`, `Kind`, `SKULink`, `TokenAuthConfiguration`, `Zones` in struct `ResourceTypeEndpoint` +- New field `Kind`, `SystemData` in struct `ResourceTypeRegistration` +- New field `APIProfiles`, `AddResourceListTargetLocations`, `AdditionalOptions`, `AllowEmptyRoleAssignments`, `AllowedResourceNames`, `AllowedTemplateDeploymentReferenceActions`, `AllowedUnauthorizedActionsExtensions`, `AsyncOperationResourceTypeName`, `AsyncTimeoutRules`, `AvailabilityZoneRule`, `CapacityRule`, `Category`, `CommonAPIVersions`, `CrossTenantTokenValidation`, `DisallowedEndUserOperations`, `DstsConfiguration`, `FrontdoorRequestMode`, `GroupingTag`, `LegacyName`, `LegacyNames`, `LegacyPolicy`, `LinkedNotificationRules`, `LinkedOperationRules`, `Management`, `ManifestLink`, `MarketplaceOptions`, `Metadata`, `Notifications`, `OnBehalfOfTokens`, `OpenAPIConfiguration`, `PolicyExecutionType`, `QuotaRule`, `ResourceCache`, `ResourceConcurrencyControlOptions`, `ResourceGraphConfiguration`, `ResourceManagementOptions`, `ResourceProviderAuthorizationRules`, `ResourceQueryManagement`, `ResourceSubType`, `ResourceTypeCommonAttributeManagement`, `ResourceValidation`, `RoutingRule`, `SKULink`, `SupportsTags`, `TemplateDeploymentPolicy`, `TokenAuthConfiguration` in struct `ResourceTypeRegistrationProperties` +- New field `ApplicationIDs`, `DelegationAppIDs` in struct `ResourceTypeRegistrationPropertiesIdentityManagement` +- New field `OptOutHeaders` in struct `ResourceTypeRegistrationPropertiesRequestHeaderOptions` +- New field `OptOutHeaders` in struct `ResourceTypeRequestHeaderOptions` +- New field `PreflightNotifications` in struct `ResourceTypeTemplateDeploymentPolicy` +- New field `SystemData` in struct `SKUResource` +- New field `Readiness` in struct `ServiceTreeInfo` +- New field `PreflightNotifications` in struct `TemplateDeploymentPolicy` +- New field `ApplicationID` in struct `ThrottlingRule` + + ## 1.2.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/providerhub/armproviderhub/README.md b/sdk/resourcemanager/providerhub/armproviderhub/README.md index 744b7c0793ee..b0e3864a7849 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/README.md +++ b/sdk/resourcemanager/providerhub/armproviderhub/README.md @@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Provider HUB module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub/v2 ``` ## Authorization @@ -55,7 +55,7 @@ clientFactory, err := armproviderhub.NewClientFactory(, cred, & A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewClient() +client := clientFactory.NewAuthorizedApplicationsClient() ``` ## Fakes diff --git a/sdk/resourcemanager/providerhub/armproviderhub/authorizedapplications_client.go b/sdk/resourcemanager/providerhub/armproviderhub/authorizedapplications_client.go new file mode 100644 index 000000000000..21cc7a0ec4ba --- /dev/null +++ b/sdk/resourcemanager/providerhub/armproviderhub/authorizedapplications_client.go @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armproviderhub + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// AuthorizedApplicationsClient contains the methods for the AuthorizedApplications group. +// Don't use this type directly, use NewAuthorizedApplicationsClient() instead. +type AuthorizedApplicationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAuthorizedApplicationsClient creates a new instance of AuthorizedApplicationsClient 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 NewAuthorizedApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AuthorizedApplicationsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AuthorizedApplicationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates the authorized application. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +// - providerNamespace - The name of the resource provider hosted within ProviderHub. +// - applicationID - The application ID. +// - properties - The authorized application properties supplied to the CreateOrUpdate operation. +// - options - AuthorizedApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the AuthorizedApplicationsClient.BeginCreateOrUpdate +// method. +func (client *AuthorizedApplicationsClient) BeginCreateOrUpdate(ctx context.Context, providerNamespace string, applicationID string, properties AuthorizedApplication, options *AuthorizedApplicationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AuthorizedApplicationsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, providerNamespace, applicationID, properties, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AuthorizedApplicationsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AuthorizedApplicationsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Creates or updates the authorized application. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +func (client *AuthorizedApplicationsClient) createOrUpdate(ctx context.Context, providerNamespace string, applicationID string, properties AuthorizedApplication, options *AuthorizedApplicationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "AuthorizedApplicationsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, providerNamespace, applicationID, properties, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AuthorizedApplicationsClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, applicationID string, properties AuthorizedApplication, _ *AuthorizedApplicationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/authorizedApplications/{applicationId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if providerNamespace == "" { + return nil, errors.New("parameter providerNamespace cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerNamespace}", url.PathEscape(providerNamespace)) + if applicationID == "" { + return nil, errors.New("parameter applicationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationId}", url.PathEscape(applicationID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil +} + +// Delete - Deletes an authorized application. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +// - providerNamespace - The name of the resource provider hosted within ProviderHub. +// - applicationID - The application ID. +// - options - AuthorizedApplicationsClientDeleteOptions contains the optional parameters for the AuthorizedApplicationsClient.Delete +// method. +func (client *AuthorizedApplicationsClient) Delete(ctx context.Context, providerNamespace string, applicationID string, options *AuthorizedApplicationsClientDeleteOptions) (AuthorizedApplicationsClientDeleteResponse, error) { + var err error + const operationName = "AuthorizedApplicationsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, providerNamespace, applicationID, options) + if err != nil { + return AuthorizedApplicationsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizedApplicationsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AuthorizedApplicationsClientDeleteResponse{}, err + } + return AuthorizedApplicationsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AuthorizedApplicationsClient) deleteCreateRequest(ctx context.Context, providerNamespace string, applicationID string, _ *AuthorizedApplicationsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/authorizedApplications/{applicationId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if providerNamespace == "" { + return nil, errors.New("parameter providerNamespace cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerNamespace}", url.PathEscape(providerNamespace)) + if applicationID == "" { + return nil, errors.New("parameter applicationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationId}", url.PathEscape(applicationID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the authorized application details. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +// - providerNamespace - The name of the resource provider hosted within ProviderHub. +// - applicationID - The application ID. +// - options - AuthorizedApplicationsClientGetOptions contains the optional parameters for the AuthorizedApplicationsClient.Get +// method. +func (client *AuthorizedApplicationsClient) Get(ctx context.Context, providerNamespace string, applicationID string, options *AuthorizedApplicationsClientGetOptions) (AuthorizedApplicationsClientGetResponse, error) { + var err error + const operationName = "AuthorizedApplicationsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, providerNamespace, applicationID, options) + if err != nil { + return AuthorizedApplicationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizedApplicationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AuthorizedApplicationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *AuthorizedApplicationsClient) getCreateRequest(ctx context.Context, providerNamespace string, applicationID string, _ *AuthorizedApplicationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/authorizedApplications/{applicationId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if providerNamespace == "" { + return nil, errors.New("parameter providerNamespace cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerNamespace}", url.PathEscape(providerNamespace)) + if applicationID == "" { + return nil, errors.New("parameter applicationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationId}", url.PathEscape(applicationID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AuthorizedApplicationsClient) getHandleResponse(resp *http.Response) (AuthorizedApplicationsClientGetResponse, error) { + result := AuthorizedApplicationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizedApplication); err != nil { + return AuthorizedApplicationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets the list of the authorized applications in the provider namespace. +// +// Generated from API version 2024-09-01 +// - providerNamespace - The name of the resource provider hosted within ProviderHub. +// - options - AuthorizedApplicationsClientListOptions contains the optional parameters for the AuthorizedApplicationsClient.NewListPager +// method. +func (client *AuthorizedApplicationsClient) NewListPager(providerNamespace string, options *AuthorizedApplicationsClientListOptions) *runtime.Pager[AuthorizedApplicationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[AuthorizedApplicationsClientListResponse]{ + More: func(page AuthorizedApplicationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AuthorizedApplicationsClientListResponse) (AuthorizedApplicationsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AuthorizedApplicationsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, providerNamespace, options) + }, nil) + if err != nil { + return AuthorizedApplicationsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *AuthorizedApplicationsClient) listCreateRequest(ctx context.Context, providerNamespace string, _ *AuthorizedApplicationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/authorizedApplications" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if providerNamespace == "" { + return nil, errors.New("parameter providerNamespace cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerNamespace}", url.PathEscape(providerNamespace)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AuthorizedApplicationsClient) listHandleResponse(resp *http.Response) (AuthorizedApplicationsClientListResponse, error) { + result := AuthorizedApplicationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizedApplicationArrayResponseWithContinuation); err != nil { + return AuthorizedApplicationsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/autorest.md b/sdk/resourcemanager/providerhub/armproviderhub/autorest.md index 94c3c21d5f34..9379ac3666bf 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/autorest.md +++ b/sdk/resourcemanager/providerhub/armproviderhub/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/providerhub/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/providerhub/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.2.0 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/providerhub/armproviderhub/client.go b/sdk/resourcemanager/providerhub/armproviderhub/client.go index ff426610ad41..887a9981e221 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/client.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // CheckinManifest - Checkin the manifest. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - checkinManifestParams - The required body parameters supplied to the checkin manifest operation. // - options - ClientCheckinManifestOptions contains the optional parameters for the Client.CheckinManifest method. @@ -73,7 +70,7 @@ func (client *Client) CheckinManifest(ctx context.Context, providerNamespace str } // checkinManifestCreateRequest creates the CheckinManifest request. -func (client *Client) checkinManifestCreateRequest(ctx context.Context, providerNamespace string, checkinManifestParams CheckinManifestParams, options *ClientCheckinManifestOptions) (*policy.Request, error) { +func (client *Client) checkinManifestCreateRequest(ctx context.Context, providerNamespace string, checkinManifestParams CheckinManifestParams, _ *ClientCheckinManifestOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/checkinManifest" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -88,7 +85,7 @@ func (client *Client) checkinManifestCreateRequest(ctx context.Context, provider return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkinManifestParams); err != nil { @@ -109,7 +106,7 @@ func (client *Client) checkinManifestHandleResponse(resp *http.Response) (Client // GenerateManifest - Generates the manifest for the given provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - options - ClientGenerateManifestOptions contains the optional parameters for the Client.GenerateManifest method. func (client *Client) GenerateManifest(ctx context.Context, providerNamespace string, options *ClientGenerateManifestOptions) (ClientGenerateManifestResponse, error) { @@ -135,7 +132,7 @@ func (client *Client) GenerateManifest(ctx context.Context, providerNamespace st } // generateManifestCreateRequest creates the GenerateManifest request. -func (client *Client) generateManifestCreateRequest(ctx context.Context, providerNamespace string, options *ClientGenerateManifestOptions) (*policy.Request, error) { +func (client *Client) generateManifestCreateRequest(ctx context.Context, providerNamespace string, _ *ClientGenerateManifestOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/generateManifest" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -150,7 +147,7 @@ func (client *Client) generateManifestCreateRequest(ctx context.Context, provide return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/providerhub/armproviderhub/client_example_test.go b/sdk/resourcemanager/providerhub/armproviderhub/client_example_test.go deleted file mode 100644 index 111f857c28a5..000000000000 --- a/sdk/resourcemanager/providerhub/armproviderhub/client_example_test.go +++ /dev/null @@ -1,140 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armproviderhub_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/providerhub/armproviderhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/GenerateManifest.json -func ExampleClient_GenerateManifest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().GenerateManifest(ctx, "Microsoft.Contoso", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceProviderManifest = armproviderhub.ResourceProviderManifest{ - // Capabilities: []*armproviderhub.ResourceProviderCapabilities{ - // { - // Effect: to.Ptr(armproviderhub.ResourceProviderCapabilitiesEffectAllow), - // QuotaID: to.Ptr("CSP_2015-05-01"), - // }, - // { - // Effect: to.Ptr(armproviderhub.ResourceProviderCapabilitiesEffectAllow), - // QuotaID: to.Ptr("CSP_MG_2017-12-01"), - // }}, - // GlobalNotificationEndpoints: []*armproviderhub.ResourceProviderEndpoint{ - // { - // Enabled: to.Ptr(true), - // EndpointURI: to.Ptr("https://notificationendpoint.com"), - // }}, - // Management: &armproviderhub.ResourceProviderManifestManagement{ - // IncidentContactEmail: to.Ptr("helpme@contoso.com"), - // IncidentRoutingService: to.Ptr(""), - // IncidentRoutingTeam: to.Ptr(""), - // ManifestOwners: []*string{ - // to.Ptr("manifestOwners-group")}, - // ResourceAccessPolicy: to.Ptr(armproviderhub.ResourceProviderManagementResourceAccessPolicyNotSpecified), - // }, - // Metadata: map[string]any{ - // "onboardedVia": "ProviderHub", - // }, - // Namespace: to.Ptr("microsoft.contoso"), - // ProviderAuthorizations: []*armproviderhub.ResourceProviderAuthorization{ - // { - // ApplicationID: to.Ptr("1a3b5c7d-8e9f-10g1-1h12-i13j14k1"), - // RoleDefinitionID: to.Ptr("123456bf-gkur-2098-b890-98da392a00b2"), - // }}, - // ProviderType: to.Ptr(armproviderhub.ResourceProviderType("Internal, Hidden")), - // ProviderVersion: to.Ptr("2.0"), - // ReRegisterSubscriptionMetadata: &armproviderhub.ResourceProviderManifestReRegisterSubscriptionMetadata{ - // ConcurrencyLimit: to.Ptr[int32](100), - // Enabled: to.Ptr(true), - // }, - // ResourceTypes: []*armproviderhub.ResourceType{ - // { - // Name: to.Ptr("Operations"), - // AllowedUnauthorizedActions: []*string{ - // to.Ptr("microsoft.contoso/operations/read")}, - // Endpoints: []*armproviderhub.ResourceProviderEndpoint{ - // { - // APIVersions: []*string{ - // to.Ptr("2020-01-01-preview")}, - // EndpointURI: to.Ptr("https://resource-endpoint.com/"), - // Locations: []*string{ - // to.Ptr("")}, - // Timeout: to.Ptr("PT20S"), - // }}, - // LinkedOperationRules: []*armproviderhub.LinkedOperationRule{ - // }, - // ResourceValidation: to.Ptr(armproviderhub.ResourceValidation("ReservedWords, ProfaneWords")), - // RoutingType: to.Ptr(armproviderhub.RoutingType("ProxyOnly, Tenant")), - // }, - // { - // Name: to.Ptr("Locations"), - // Endpoints: []*armproviderhub.ResourceProviderEndpoint{ - // { - // APIVersions: []*string{ - // to.Ptr("2020-01-01-preview")}, - // EndpointURI: to.Ptr("https://resource-endpoint.com/"), - // Locations: []*string{ - // to.Ptr("")}, - // Timeout: to.Ptr("PT20S"), - // }}, - // LinkedOperationRules: []*armproviderhub.LinkedOperationRule{ - // }, - // ResourceValidation: to.Ptr(armproviderhub.ResourceValidation("ReservedWords, ProfaneWords")), - // RoutingType: to.Ptr(armproviderhub.RoutingTypeProxyOnly), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/CheckinManifest.json -func ExampleClient_CheckinManifest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().CheckinManifest(ctx, "Microsoft.Contoso", armproviderhub.CheckinManifestParams{ - BaselineArmManifestLocation: to.Ptr("EastUS2EUAP"), - Environment: to.Ptr("Prod"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckinManifestInfo = armproviderhub.CheckinManifestInfo{ - // IsCheckedIn: to.Ptr(false), - // StatusMessage: to.Ptr("Manifest is successfully merged. Use the Default/Custom rollout (http://aka.ms/rpaasrollout) to roll out the manifest in ARM."), - // } -} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/client_factory.go b/sdk/resourcemanager/providerhub/armproviderhub/client_factory.go index f7b7f6e69538..888b26e5af7a 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/client_factory.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/client_factory.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -17,8 +14,7 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. @@ -27,60 +23,108 @@ type ClientFactory struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } +// NewAuthorizedApplicationsClient creates a new instance of AuthorizedApplicationsClient. +func (c *ClientFactory) NewAuthorizedApplicationsClient() *AuthorizedApplicationsClient { + return &AuthorizedApplicationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewClient creates a new instance of Client. func (c *ClientFactory) NewClient() *Client { - subClient, _ := NewClient(c.subscriptionID, c.credential, c.options) - return subClient + return &Client{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewCustomRolloutsClient creates a new instance of CustomRolloutsClient. func (c *ClientFactory) NewCustomRolloutsClient() *CustomRolloutsClient { - subClient, _ := NewCustomRolloutsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &CustomRolloutsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewDefaultRolloutsClient creates a new instance of DefaultRolloutsClient. func (c *ClientFactory) NewDefaultRolloutsClient() *DefaultRolloutsClient { - subClient, _ := NewDefaultRolloutsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DefaultRolloutsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewNewRegionFrontloadReleaseClient creates a new instance of NewRegionFrontloadReleaseClient. +func (c *ClientFactory) NewNewRegionFrontloadReleaseClient() *NewRegionFrontloadReleaseClient { + return &NewRegionFrontloadReleaseClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewNotificationRegistrationsClient creates a new instance of NotificationRegistrationsClient. func (c *ClientFactory) NewNotificationRegistrationsClient() *NotificationRegistrationsClient { - subClient, _ := NewNotificationRegistrationsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &NotificationRegistrationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &OperationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewProviderMonitorSettingsClient creates a new instance of ProviderMonitorSettingsClient. +func (c *ClientFactory) NewProviderMonitorSettingsClient() *ProviderMonitorSettingsClient { + return &ProviderMonitorSettingsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewProviderRegistrationsClient creates a new instance of ProviderRegistrationsClient. func (c *ClientFactory) NewProviderRegistrationsClient() *ProviderRegistrationsClient { - subClient, _ := NewProviderRegistrationsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ProviderRegistrationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewResourceActionsClient creates a new instance of ResourceActionsClient. +func (c *ClientFactory) NewResourceActionsClient() *ResourceActionsClient { + return &ResourceActionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewResourceTypeRegistrationsClient creates a new instance of ResourceTypeRegistrationsClient. func (c *ClientFactory) NewResourceTypeRegistrationsClient() *ResourceTypeRegistrationsClient { - subClient, _ := NewResourceTypeRegistrationsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ResourceTypeRegistrationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewSKUsClient creates a new instance of SKUsClient. func (c *ClientFactory) NewSKUsClient() *SKUsClient { - subClient, _ := NewSKUsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &SKUsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/providerhub/armproviderhub/constants.go b/sdk/resourcemanager/providerhub/armproviderhub/constants.go index dd486f02f362..849081cee2d5 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/constants.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/constants.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -10,33 +7,328 @@ package armproviderhub const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub" - moduleVersion = "v1.2.0" + moduleVersion = "v2.0.0" +) + +// AdditionalOptions - The additional options. +type AdditionalOptions string + +const ( + AdditionalOptionsProtectedAsyncOperationPolling AdditionalOptions = "ProtectedAsyncOperationPolling" + AdditionalOptionsProtectedAsyncOperationPollingAuditOnly AdditionalOptions = "ProtectedAsyncOperationPollingAuditOnly" +) + +// PossibleAdditionalOptionsValues returns the possible values for the AdditionalOptions const type. +func PossibleAdditionalOptionsValues() []AdditionalOptions { + return []AdditionalOptions{ + AdditionalOptionsProtectedAsyncOperationPolling, + AdditionalOptionsProtectedAsyncOperationPollingAuditOnly, + } +} + +// AdditionalOptionsAsyncOperation - The additional options. +type AdditionalOptionsAsyncOperation string + +const ( + AdditionalOptionsAsyncOperationProtectedAsyncOperationPolling AdditionalOptionsAsyncOperation = "ProtectedAsyncOperationPolling" + AdditionalOptionsAsyncOperationProtectedAsyncOperationPollingAuditOnly AdditionalOptionsAsyncOperation = "ProtectedAsyncOperationPollingAuditOnly" +) + +// PossibleAdditionalOptionsAsyncOperationValues returns the possible values for the AdditionalOptionsAsyncOperation const type. +func PossibleAdditionalOptionsAsyncOperationValues() []AdditionalOptionsAsyncOperation { + return []AdditionalOptionsAsyncOperation{ + AdditionalOptionsAsyncOperationProtectedAsyncOperationPolling, + AdditionalOptionsAsyncOperationProtectedAsyncOperationPollingAuditOnly, + } +} + +// AdditionalOptionsResourceTypeRegistration - The additional options. +type AdditionalOptionsResourceTypeRegistration string + +const ( + AdditionalOptionsResourceTypeRegistrationProtectedAsyncOperationPolling AdditionalOptionsResourceTypeRegistration = "ProtectedAsyncOperationPolling" + AdditionalOptionsResourceTypeRegistrationProtectedAsyncOperationPollingAuditOnly AdditionalOptionsResourceTypeRegistration = "ProtectedAsyncOperationPollingAuditOnly" +) + +// PossibleAdditionalOptionsResourceTypeRegistrationValues returns the possible values for the AdditionalOptionsResourceTypeRegistration const type. +func PossibleAdditionalOptionsResourceTypeRegistrationValues() []AdditionalOptionsResourceTypeRegistration { + return []AdditionalOptionsResourceTypeRegistration{ + AdditionalOptionsResourceTypeRegistrationProtectedAsyncOperationPolling, + AdditionalOptionsResourceTypeRegistrationProtectedAsyncOperationPollingAuditOnly, + } +} + +// AuthenticationScheme - The authentication scheme. +type AuthenticationScheme string + +const ( + AuthenticationSchemeBearer AuthenticationScheme = "Bearer" + AuthenticationSchemePoP AuthenticationScheme = "PoP" +) + +// PossibleAuthenticationSchemeValues returns the possible values for the AuthenticationScheme const type. +func PossibleAuthenticationSchemeValues() []AuthenticationScheme { + return []AuthenticationScheme{ + AuthenticationSchemeBearer, + AuthenticationSchemePoP, + } +} + +type AvailabilityZonePolicy string + +const ( + AvailabilityZonePolicyMultiZoned AvailabilityZonePolicy = "MultiZoned" + AvailabilityZonePolicyNotSpecified AvailabilityZonePolicy = "NotSpecified" + AvailabilityZonePolicySingleZoned AvailabilityZonePolicy = "SingleZoned" +) + +// PossibleAvailabilityZonePolicyValues returns the possible values for the AvailabilityZonePolicy const type. +func PossibleAvailabilityZonePolicyValues() []AvailabilityZonePolicy { + return []AvailabilityZonePolicy{ + AvailabilityZonePolicyMultiZoned, + AvailabilityZonePolicyNotSpecified, + AvailabilityZonePolicySingleZoned, + } +} + +// AvailableCheckInManifestEnvironment - The environment type. +type AvailableCheckInManifestEnvironment string + +const ( + AvailableCheckInManifestEnvironmentAll AvailableCheckInManifestEnvironment = "All" + AvailableCheckInManifestEnvironmentCanary AvailableCheckInManifestEnvironment = "Canary" + AvailableCheckInManifestEnvironmentFairfax AvailableCheckInManifestEnvironment = "Fairfax" + AvailableCheckInManifestEnvironmentMooncake AvailableCheckInManifestEnvironment = "Mooncake" + AvailableCheckInManifestEnvironmentNotSpecified AvailableCheckInManifestEnvironment = "NotSpecified" + AvailableCheckInManifestEnvironmentProd AvailableCheckInManifestEnvironment = "Prod" +) + +// PossibleAvailableCheckInManifestEnvironmentValues returns the possible values for the AvailableCheckInManifestEnvironment const type. +func PossibleAvailableCheckInManifestEnvironmentValues() []AvailableCheckInManifestEnvironment { + return []AvailableCheckInManifestEnvironment{ + AvailableCheckInManifestEnvironmentAll, + AvailableCheckInManifestEnvironmentCanary, + AvailableCheckInManifestEnvironmentFairfax, + AvailableCheckInManifestEnvironmentMooncake, + AvailableCheckInManifestEnvironmentNotSpecified, + AvailableCheckInManifestEnvironmentProd, + } +} + +// BlockActionVerb - The action verb that will be blocked when the resource group is locked during move. +type BlockActionVerb string + +const ( + BlockActionVerbAction BlockActionVerb = "Action" + BlockActionVerbDelete BlockActionVerb = "Delete" + BlockActionVerbNotSpecified BlockActionVerb = "NotSpecified" + BlockActionVerbRead BlockActionVerb = "Read" + BlockActionVerbUnrecognized BlockActionVerb = "Unrecognized" + BlockActionVerbWrite BlockActionVerb = "Write" +) + +// PossibleBlockActionVerbValues returns the possible values for the BlockActionVerb const type. +func PossibleBlockActionVerbValues() []BlockActionVerb { + return []BlockActionVerb{ + BlockActionVerbAction, + BlockActionVerbDelete, + BlockActionVerbNotSpecified, + BlockActionVerbRead, + BlockActionVerbUnrecognized, + BlockActionVerbWrite, + } +} + +// CapacityPolicy - Capacity policy. +type CapacityPolicy string + +const ( + CapacityPolicyDefault CapacityPolicy = "Default" + CapacityPolicyRestricted CapacityPolicy = "Restricted" +) + +// PossibleCapacityPolicyValues returns the possible values for the CapacityPolicy const type. +func PossibleCapacityPolicyValues() []CapacityPolicy { + return []CapacityPolicy{ + CapacityPolicyDefault, + CapacityPolicyRestricted, + } +} + +// CommonAPIVersionsMergeMode - Common api versions merge mode. +type CommonAPIVersionsMergeMode string + +const ( + CommonAPIVersionsMergeModeMerge CommonAPIVersionsMergeMode = "Merge" + CommonAPIVersionsMergeModeOverwrite CommonAPIVersionsMergeMode = "Overwrite" +) + +// PossibleCommonAPIVersionsMergeModeValues returns the possible values for the CommonAPIVersionsMergeMode const type. +func PossibleCommonAPIVersionsMergeModeValues() []CommonAPIVersionsMergeMode { + return []CommonAPIVersionsMergeMode{ + CommonAPIVersionsMergeModeMerge, + CommonAPIVersionsMergeModeOverwrite, + } +} + +// CreatedByType - The type of identity that created the resource. +type CreatedByType string + +const ( + CreatedByTypeApplication CreatedByType = "Application" + CreatedByTypeKey CreatedByType = "Key" + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + +// CrossTenantTokenValidation - The cross tenant token validation. +type CrossTenantTokenValidation string + +const ( + CrossTenantTokenValidationEnsureSecureValidation CrossTenantTokenValidation = "EnsureSecureValidation" + CrossTenantTokenValidationPassthroughInsecureToken CrossTenantTokenValidation = "PassthroughInsecureToken" +) + +// PossibleCrossTenantTokenValidationValues returns the possible values for the CrossTenantTokenValidation const type. +func PossibleCrossTenantTokenValidationValues() []CrossTenantTokenValidation { + return []CrossTenantTokenValidation{ + CrossTenantTokenValidationEnsureSecureValidation, + CrossTenantTokenValidationPassthroughInsecureToken, + } +} + +// DataBoundary - The data boundary. +type DataBoundary string + +const ( + DataBoundaryEU DataBoundary = "EU" + DataBoundaryGlobal DataBoundary = "Global" + DataBoundaryNotDefined DataBoundary = "NotDefined" + DataBoundaryUS DataBoundary = "US" +) + +// PossibleDataBoundaryValues returns the possible values for the DataBoundary const type. +func PossibleDataBoundaryValues() []DataBoundary { + return []DataBoundary{ + DataBoundaryEU, + DataBoundaryGlobal, + DataBoundaryNotDefined, + DataBoundaryUS, + } +} + +// EndpointType - The endpoint type. +type EndpointType string + +const ( + EndpointTypeCanary EndpointType = "Canary" + EndpointTypeNotSpecified EndpointType = "NotSpecified" + EndpointTypeProduction EndpointType = "Production" + EndpointTypeTestInProduction EndpointType = "TestInProduction" +) + +// PossibleEndpointTypeValues returns the possible values for the EndpointType const type. +func PossibleEndpointTypeValues() []EndpointType { + return []EndpointType{ + EndpointTypeCanary, + EndpointTypeNotSpecified, + EndpointTypeProduction, + EndpointTypeTestInProduction, + } +} + +// EndpointTypeResourceType - The endpoint type. +type EndpointTypeResourceType string + +const ( + EndpointTypeResourceTypeCanary EndpointTypeResourceType = "Canary" + EndpointTypeResourceTypeNotSpecified EndpointTypeResourceType = "NotSpecified" + EndpointTypeResourceTypeProduction EndpointTypeResourceType = "Production" + EndpointTypeResourceTypeTestInProduction EndpointTypeResourceType = "TestInProduction" +) + +// PossibleEndpointTypeResourceTypeValues returns the possible values for the EndpointTypeResourceType const type. +func PossibleEndpointTypeResourceTypeValues() []EndpointTypeResourceType { + return []EndpointTypeResourceType{ + EndpointTypeResourceTypeCanary, + EndpointTypeResourceTypeNotSpecified, + EndpointTypeResourceTypeProduction, + EndpointTypeResourceTypeTestInProduction, + } +} + +// ExpeditedRolloutIntent - Expedited rollout intent. +type ExpeditedRolloutIntent string + +const ( + ExpeditedRolloutIntentHotfix ExpeditedRolloutIntent = "Hotfix" + ExpeditedRolloutIntentNotSpecified ExpeditedRolloutIntent = "NotSpecified" +) + +// PossibleExpeditedRolloutIntentValues returns the possible values for the ExpeditedRolloutIntent const type. +func PossibleExpeditedRolloutIntentValues() []ExpeditedRolloutIntent { + return []ExpeditedRolloutIntent{ + ExpeditedRolloutIntentHotfix, + ExpeditedRolloutIntentNotSpecified, + } +} + +type ExtendedLocationType string + +const ( + ExtendedLocationTypeArcZone ExtendedLocationType = "ArcZone" + ExtendedLocationTypeCustomLocation ExtendedLocationType = "CustomLocation" + ExtendedLocationTypeEdgeZone ExtendedLocationType = "EdgeZone" + ExtendedLocationTypeNotSpecified ExtendedLocationType = "NotSpecified" ) +// PossibleExtendedLocationTypeValues returns the possible values for the ExtendedLocationType const type. +func PossibleExtendedLocationTypeValues() []ExtendedLocationType { + return []ExtendedLocationType{ + ExtendedLocationTypeArcZone, + ExtendedLocationTypeCustomLocation, + ExtendedLocationTypeEdgeZone, + ExtendedLocationTypeNotSpecified, + } +} + type ExtensionCategory string const ( - ExtensionCategoryNotSpecified ExtensionCategory = "NotSpecified" - ExtensionCategoryResourceCreationBegin ExtensionCategory = "ResourceCreationBegin" - ExtensionCategoryResourceCreationCompleted ExtensionCategory = "ResourceCreationCompleted" - ExtensionCategoryResourceCreationValidate ExtensionCategory = "ResourceCreationValidate" - ExtensionCategoryResourceDeletionBegin ExtensionCategory = "ResourceDeletionBegin" - ExtensionCategoryResourceDeletionCompleted ExtensionCategory = "ResourceDeletionCompleted" - ExtensionCategoryResourceDeletionValidate ExtensionCategory = "ResourceDeletionValidate" - ExtensionCategoryResourceMoveBegin ExtensionCategory = "ResourceMoveBegin" - ExtensionCategoryResourceMoveCompleted ExtensionCategory = "ResourceMoveCompleted" - ExtensionCategoryResourcePatchBegin ExtensionCategory = "ResourcePatchBegin" - ExtensionCategoryResourcePatchCompleted ExtensionCategory = "ResourcePatchCompleted" - ExtensionCategoryResourcePatchValidate ExtensionCategory = "ResourcePatchValidate" - ExtensionCategoryResourcePostAction ExtensionCategory = "ResourcePostAction" - ExtensionCategoryResourceReadBegin ExtensionCategory = "ResourceReadBegin" - ExtensionCategoryResourceReadValidate ExtensionCategory = "ResourceReadValidate" - ExtensionCategorySubscriptionLifecycleNotification ExtensionCategory = "SubscriptionLifecycleNotification" + ExtensionCategoryBestMatchOperationBegin ExtensionCategory = "BestMatchOperationBegin" + ExtensionCategoryNotSpecified ExtensionCategory = "NotSpecified" + ExtensionCategoryResourceCreationBegin ExtensionCategory = "ResourceCreationBegin" + ExtensionCategoryResourceCreationCompleted ExtensionCategory = "ResourceCreationCompleted" + ExtensionCategoryResourceCreationValidate ExtensionCategory = "ResourceCreationValidate" + ExtensionCategoryResourceDeletionBegin ExtensionCategory = "ResourceDeletionBegin" + ExtensionCategoryResourceDeletionCompleted ExtensionCategory = "ResourceDeletionCompleted" + ExtensionCategoryResourceDeletionValidate ExtensionCategory = "ResourceDeletionValidate" + ExtensionCategoryResourceMoveBegin ExtensionCategory = "ResourceMoveBegin" + ExtensionCategoryResourceMoveCompleted ExtensionCategory = "ResourceMoveCompleted" + ExtensionCategoryResourcePatchBegin ExtensionCategory = "ResourcePatchBegin" + ExtensionCategoryResourcePatchCompleted ExtensionCategory = "ResourcePatchCompleted" + ExtensionCategoryResourcePatchValidate ExtensionCategory = "ResourcePatchValidate" + ExtensionCategoryResourcePostAction ExtensionCategory = "ResourcePostAction" + ExtensionCategoryResourceReadBegin ExtensionCategory = "ResourceReadBegin" + ExtensionCategoryResourceReadValidate ExtensionCategory = "ResourceReadValidate" + ExtensionCategorySubscriptionLifecycleNotification ExtensionCategory = "SubscriptionLifecycleNotification" + ExtensionCategorySubscriptionLifecycleNotificationDeletion ExtensionCategory = "SubscriptionLifecycleNotificationDeletion" ) // PossibleExtensionCategoryValues returns the possible values for the ExtensionCategory const type. func PossibleExtensionCategoryValues() []ExtensionCategory { return []ExtensionCategory{ + ExtensionCategoryBestMatchOperationBegin, ExtensionCategoryNotSpecified, ExtensionCategoryResourceCreationBegin, ExtensionCategoryResourceCreationCompleted, @@ -53,6 +345,7 @@ func PossibleExtensionCategoryValues() []ExtensionCategory { ExtensionCategoryResourceReadBegin, ExtensionCategoryResourceReadValidate, ExtensionCategorySubscriptionLifecycleNotification, + ExtensionCategorySubscriptionLifecycleNotificationDeletion, } } @@ -73,6 +366,7 @@ func PossibleExtensionOptionTypeValues() []ExtensionOptionType { } } +// FeaturesPolicy - The required feature policy. type FeaturesPolicy string const ( @@ -88,6 +382,39 @@ func PossibleFeaturesPolicyValues() []FeaturesPolicy { } } +// FilterOption - Filter option. +type FilterOption string + +const ( + FilterOptionEnableSubscriptionFilterOnTenant FilterOption = "EnableSubscriptionFilterOnTenant" + FilterOptionNotSpecified FilterOption = "NotSpecified" +) + +// PossibleFilterOptionValues returns the possible values for the FilterOption const type. +func PossibleFilterOptionValues() []FilterOption { + return []FilterOption{ + FilterOptionEnableSubscriptionFilterOnTenant, + FilterOptionNotSpecified, + } +} + +// FrontdoorRequestMode - The frontdoor request mode. +type FrontdoorRequestMode string + +const ( + FrontdoorRequestModeNotSpecified FrontdoorRequestMode = "NotSpecified" + FrontdoorRequestModeUseManifest FrontdoorRequestMode = "UseManifest" +) + +// PossibleFrontdoorRequestModeValues returns the possible values for the FrontdoorRequestMode const type. +func PossibleFrontdoorRequestModeValues() []FrontdoorRequestMode { + return []FrontdoorRequestMode{ + FrontdoorRequestModeNotSpecified, + FrontdoorRequestModeUseManifest, + } +} + +// IdentityManagementTypes - The type. type IdentityManagementTypes string const ( @@ -109,6 +436,62 @@ func PossibleIdentityManagementTypesValues() []IdentityManagementTypes { } } +// Intent - The intent. +type Intent string + +const ( + // IntentDEFERREDACCESSCHECK - Used for RP's using a custom authorization check outside of ARM. + IntentDEFERREDACCESSCHECK Intent = "DEFERRED_ACCESS_CHECK" + // IntentLOWPRIVILEGE - Data is not sensitive and ok to access. + IntentLOWPRIVILEGE Intent = "LOW_PRIVILEGE" + // IntentNOTSPECIFIED - Default value. + IntentNOTSPECIFIED Intent = "NOT_SPECIFIED" + // IntentRPCONTRACT - RP contract allows certain operations to be unauthorized action. + IntentRPCONTRACT Intent = "RP_CONTRACT" +) + +// PossibleIntentValues returns the possible values for the Intent const type. +func PossibleIntentValues() []Intent { + return []Intent{ + IntentDEFERREDACCESSCHECK, + IntentLOWPRIVILEGE, + IntentNOTSPECIFIED, + IntentRPCONTRACT, + } +} + +type LegacyOperation string + +const ( + LegacyOperationAction LegacyOperation = "Action" + LegacyOperationAzureAsyncOperationWaiting LegacyOperation = "AzureAsyncOperationWaiting" + LegacyOperationCreate LegacyOperation = "Create" + LegacyOperationDelete LegacyOperation = "Delete" + LegacyOperationDeploymentCleanup LegacyOperation = "DeploymentCleanup" + LegacyOperationEvaluateDeploymentOutput LegacyOperation = "EvaluateDeploymentOutput" + LegacyOperationNotSpecified LegacyOperation = "NotSpecified" + LegacyOperationRead LegacyOperation = "Read" + LegacyOperationResourceCacheWaiting LegacyOperation = "ResourceCacheWaiting" + LegacyOperationWaiting LegacyOperation = "Waiting" +) + +// PossibleLegacyOperationValues returns the possible values for the LegacyOperation const type. +func PossibleLegacyOperationValues() []LegacyOperation { + return []LegacyOperation{ + LegacyOperationAction, + LegacyOperationAzureAsyncOperationWaiting, + LegacyOperationCreate, + LegacyOperationDelete, + LegacyOperationDeploymentCleanup, + LegacyOperationEvaluateDeploymentOutput, + LegacyOperationNotSpecified, + LegacyOperationRead, + LegacyOperationResourceCacheWaiting, + LegacyOperationWaiting, + } +} + +// LinkedAction - The linked action. type LinkedAction string const ( @@ -128,6 +511,7 @@ func PossibleLinkedActionValues() []LinkedAction { } } +// LinkedOperation - The linked operation. type LinkedOperation string const ( @@ -145,6 +529,7 @@ func PossibleLinkedOperationValues() []LinkedOperation { } } +// LoggingDetails - The detail level. type LoggingDetails string const ( @@ -160,6 +545,7 @@ func PossibleLoggingDetailsValues() []LoggingDetails { } } +// LoggingDirections - The direction. type LoggingDirections string const ( @@ -177,6 +563,7 @@ func PossibleLoggingDirectionsValues() []LoggingDirections { } } +// ManifestResourceDeletionPolicy - The resource deletion policy. type ManifestResourceDeletionPolicy string const ( @@ -194,6 +581,27 @@ func PossibleManifestResourceDeletionPolicyValues() []ManifestResourceDeletionPo } } +// MarketplaceType - The marketplace type. +type MarketplaceType string + +const ( + MarketplaceTypeAddOn MarketplaceType = "AddOn" + MarketplaceTypeBypass MarketplaceType = "Bypass" + MarketplaceTypeNotSpecified MarketplaceType = "NotSpecified" + MarketplaceTypeStore MarketplaceType = "Store" +) + +// PossibleMarketplaceTypeValues returns the possible values for the MarketplaceType const type. +func PossibleMarketplaceTypeValues() []MarketplaceType { + return []MarketplaceType{ + MarketplaceTypeAddOn, + MarketplaceTypeBypass, + MarketplaceTypeNotSpecified, + MarketplaceTypeStore, + } +} + +// MessageScope - The message scope. type MessageScope string const ( @@ -209,6 +617,23 @@ func PossibleMessageScopeValues() []MessageScope { } } +// NotificationEndpointType - The endpoint type. +type NotificationEndpointType string + +const ( + NotificationEndpointTypeEventhub NotificationEndpointType = "Eventhub" + NotificationEndpointTypeWebhook NotificationEndpointType = "Webhook" +) + +// PossibleNotificationEndpointTypeValues returns the possible values for the NotificationEndpointType const type. +func PossibleNotificationEndpointTypeValues() []NotificationEndpointType { + return []NotificationEndpointType{ + NotificationEndpointTypeEventhub, + NotificationEndpointTypeWebhook, + } +} + +// NotificationMode - The notification mode. type NotificationMode string const ( @@ -226,59 +651,162 @@ func PossibleNotificationModeValues() []NotificationMode { } } -type OperationsDefinitionActionType string +// NotificationOptions - Notification options. +type NotificationOptions string + +const ( + NotificationOptionsEmitSpendingLimit NotificationOptions = "EmitSpendingLimit" + NotificationOptionsNone NotificationOptions = "None" + NotificationOptionsNotSpecified NotificationOptions = "NotSpecified" +) + +// PossibleNotificationOptionsValues returns the possible values for the NotificationOptions const type. +func PossibleNotificationOptionsValues() []NotificationOptions { + return []NotificationOptions{ + NotificationOptionsEmitSpendingLimit, + NotificationOptionsNone, + NotificationOptionsNotSpecified, + } +} + +// NotificationType - The notification type. +type NotificationType string + +const ( + NotificationTypeSubscriptionNotification NotificationType = "SubscriptionNotification" + NotificationTypeUnspecified NotificationType = "Unspecified" +) + +// PossibleNotificationTypeValues returns the possible values for the NotificationType const type. +func PossibleNotificationTypeValues() []NotificationType { + return []NotificationType{ + NotificationTypeSubscriptionNotification, + NotificationTypeUnspecified, + } +} + +// OperationActionType - The action type. +type OperationActionType string const ( - OperationsDefinitionActionTypeInternal OperationsDefinitionActionType = "Internal" - OperationsDefinitionActionTypeNotSpecified OperationsDefinitionActionType = "NotSpecified" + OperationActionTypeInternal OperationActionType = "Internal" + OperationActionTypeNotSpecified OperationActionType = "NotSpecified" ) -// PossibleOperationsDefinitionActionTypeValues returns the possible values for the OperationsDefinitionActionType const type. -func PossibleOperationsDefinitionActionTypeValues() []OperationsDefinitionActionType { - return []OperationsDefinitionActionType{ - OperationsDefinitionActionTypeInternal, - OperationsDefinitionActionTypeNotSpecified, +// PossibleOperationActionTypeValues returns the possible values for the OperationActionType const type. +func PossibleOperationActionTypeValues() []OperationActionType { + return []OperationActionType{ + OperationActionTypeInternal, + OperationActionTypeNotSpecified, } } -type OperationsDefinitionOrigin string +// OperationOrigins - The origin. +type OperationOrigins string const ( - OperationsDefinitionOriginNotSpecified OperationsDefinitionOrigin = "NotSpecified" - OperationsDefinitionOriginSystem OperationsDefinitionOrigin = "System" - OperationsDefinitionOriginUser OperationsDefinitionOrigin = "User" + OperationOriginsNotSpecified OperationOrigins = "NotSpecified" + OperationOriginsSystem OperationOrigins = "System" + OperationOriginsUser OperationOrigins = "User" ) -// PossibleOperationsDefinitionOriginValues returns the possible values for the OperationsDefinitionOrigin const type. -func PossibleOperationsDefinitionOriginValues() []OperationsDefinitionOrigin { - return []OperationsDefinitionOrigin{ - OperationsDefinitionOriginNotSpecified, - OperationsDefinitionOriginSystem, - OperationsDefinitionOriginUser, +// PossibleOperationOriginsValues returns the possible values for the OperationOrigins const type. +func PossibleOperationOriginsValues() []OperationOrigins { + return []OperationOrigins{ + OperationOriginsNotSpecified, + OperationOriginsSystem, + OperationOriginsUser, } } +// OptInHeaderType - The opt in headers. type OptInHeaderType string const ( - OptInHeaderTypeClientGroupMembership OptInHeaderType = "ClientGroupMembership" - OptInHeaderTypeNotSpecified OptInHeaderType = "NotSpecified" - OptInHeaderTypeSignedAuxiliaryTokens OptInHeaderType = "SignedAuxiliaryTokens" - OptInHeaderTypeSignedUserToken OptInHeaderType = "SignedUserToken" - OptInHeaderTypeUnboundedClientGroupMembership OptInHeaderType = "UnboundedClientGroupMembership" + OptInHeaderTypeClientGroupMembership OptInHeaderType = "ClientGroupMembership" + OptInHeaderTypeClientPrincipalNameEncoded OptInHeaderType = "ClientPrincipalNameEncoded" + OptInHeaderTypeMSIResourceIDEncoded OptInHeaderType = "MSIResourceIdEncoded" + OptInHeaderTypeManagementGroupAncestorsEncoded OptInHeaderType = "ManagementGroupAncestorsEncoded" + OptInHeaderTypeNotSpecified OptInHeaderType = "NotSpecified" + OptInHeaderTypePrivateLinkID OptInHeaderType = "PrivateLinkId" + OptInHeaderTypePrivateLinkResourceID OptInHeaderType = "PrivateLinkResourceId" + OptInHeaderTypePrivateLinkVnetTrafficTag OptInHeaderType = "PrivateLinkVnetTrafficTag" + OptInHeaderTypeResourceGroupLocation OptInHeaderType = "ResourceGroupLocation" + OptInHeaderTypeSignedAuxiliaryTokens OptInHeaderType = "SignedAuxiliaryTokens" + OptInHeaderTypeSignedUserToken OptInHeaderType = "SignedUserToken" + OptInHeaderTypeUnboundedClientGroupMembership OptInHeaderType = "UnboundedClientGroupMembership" ) // PossibleOptInHeaderTypeValues returns the possible values for the OptInHeaderType const type. func PossibleOptInHeaderTypeValues() []OptInHeaderType { return []OptInHeaderType{ OptInHeaderTypeClientGroupMembership, + OptInHeaderTypeClientPrincipalNameEncoded, + OptInHeaderTypeMSIResourceIDEncoded, + OptInHeaderTypeManagementGroupAncestorsEncoded, OptInHeaderTypeNotSpecified, + OptInHeaderTypePrivateLinkID, + OptInHeaderTypePrivateLinkResourceID, + OptInHeaderTypePrivateLinkVnetTrafficTag, + OptInHeaderTypeResourceGroupLocation, OptInHeaderTypeSignedAuxiliaryTokens, OptInHeaderTypeSignedUserToken, OptInHeaderTypeUnboundedClientGroupMembership, } } +// OptOutHeaderType - The opt out headers. +type OptOutHeaderType string + +const ( + OptOutHeaderTypeNotSpecified OptOutHeaderType = "NotSpecified" + OptOutHeaderTypeSystemDataCreatedByLastModifiedBy OptOutHeaderType = "SystemDataCreatedByLastModifiedBy" +) + +// PossibleOptOutHeaderTypeValues returns the possible values for the OptOutHeaderType const type. +func PossibleOptOutHeaderTypeValues() []OptOutHeaderType { + return []OptOutHeaderType{ + OptOutHeaderTypeNotSpecified, + OptOutHeaderTypeSystemDataCreatedByLastModifiedBy, + } +} + +// Policy - The policy. +type Policy string + +const ( + PolicyNotSpecified Policy = "NotSpecified" + PolicySynchronizeBeginExtension Policy = "SynchronizeBeginExtension" +) + +// PossiblePolicyValues returns the possible values for the Policy const type. +func PossiblePolicyValues() []Policy { + return []Policy{ + PolicyNotSpecified, + PolicySynchronizeBeginExtension, + } +} + +// PolicyExecutionType - The policy execution type. +type PolicyExecutionType string + +const ( + PolicyExecutionTypeBypassPolicies PolicyExecutionType = "BypassPolicies" + PolicyExecutionTypeExecutePolicies PolicyExecutionType = "ExecutePolicies" + PolicyExecutionTypeExpectPartialPutRequests PolicyExecutionType = "ExpectPartialPutRequests" + PolicyExecutionTypeNotSpecified PolicyExecutionType = "NotSpecified" +) + +// PossiblePolicyExecutionTypeValues returns the possible values for the PolicyExecutionType const type. +func PossiblePolicyExecutionTypeValues() []PolicyExecutionType { + return []PolicyExecutionType{ + PolicyExecutionTypeBypassPolicies, + PolicyExecutionTypeExecutePolicies, + PolicyExecutionTypeExpectPartialPutRequests, + PolicyExecutionTypeNotSpecified, + } +} + type PreflightOption string const ( @@ -296,6 +824,28 @@ func PossiblePreflightOptionValues() []PreflightOption { } } +// ProviderRegistrationKind - Provider registration kind. This Metadata is also used by portal/tooling/etc to render different +// UX experiences for resources of the same type. +type ProviderRegistrationKind string + +const ( + // ProviderRegistrationKindDirect - Resource Provider with all the resource types 'managed' on by itself. + ProviderRegistrationKindDirect ProviderRegistrationKind = "Direct" + // ProviderRegistrationKindHybrid - Resource Provider with a mix of 'managed' and 'direct' resource types. + ProviderRegistrationKindHybrid ProviderRegistrationKind = "Hybrid" + // ProviderRegistrationKindManaged - Resource Provider with all the resource types 'managed' by the ProviderHub service. + ProviderRegistrationKindManaged ProviderRegistrationKind = "Managed" +) + +// PossibleProviderRegistrationKindValues returns the possible values for the ProviderRegistrationKind const type. +func PossibleProviderRegistrationKindValues() []ProviderRegistrationKind { + return []ProviderRegistrationKind{ + ProviderRegistrationKindDirect, + ProviderRegistrationKindHybrid, + ProviderRegistrationKindManaged, + } +} + type ProvisioningState string const ( @@ -333,6 +883,54 @@ func PossibleProvisioningStateValues() []ProvisioningState { } } +type QuotaPolicy string + +const ( + QuotaPolicyDefault QuotaPolicy = "Default" + QuotaPolicyNone QuotaPolicy = "None" + QuotaPolicyRestricted QuotaPolicy = "Restricted" +) + +// PossibleQuotaPolicyValues returns the possible values for the QuotaPolicy const type. +func PossibleQuotaPolicyValues() []QuotaPolicy { + return []QuotaPolicy{ + QuotaPolicyDefault, + QuotaPolicyNone, + QuotaPolicyRestricted, + } +} + +// Readiness - The readiness. +type Readiness string + +const ( + ReadinessClosingDown Readiness = "ClosingDown" + ReadinessDeprecated Readiness = "Deprecated" + ReadinessGA Readiness = "GA" + ReadinessInDevelopment Readiness = "InDevelopment" + ReadinessInternalOnly Readiness = "InternalOnly" + ReadinessPrivatePreview Readiness = "PrivatePreview" + ReadinessPublicPreview Readiness = "PublicPreview" + ReadinessRemovedFromARM Readiness = "RemovedFromARM" + ReadinessRetired Readiness = "Retired" +) + +// PossibleReadinessValues returns the possible values for the Readiness const type. +func PossibleReadinessValues() []Readiness { + return []Readiness{ + ReadinessClosingDown, + ReadinessDeprecated, + ReadinessGA, + ReadinessInDevelopment, + ReadinessInternalOnly, + ReadinessPrivatePreview, + ReadinessPublicPreview, + ReadinessRemovedFromARM, + ReadinessRetired, + } +} + +// Regionality - The regionality. type Regionality string const ( @@ -350,6 +948,25 @@ func PossibleRegionalityValues() []Regionality { } } +// ResourceAccessPolicy - The resource access policy. +type ResourceAccessPolicy string + +const ( + ResourceAccessPolicyAcisActionAllowed ResourceAccessPolicy = "AcisActionAllowed" + ResourceAccessPolicyAcisReadAllowed ResourceAccessPolicy = "AcisReadAllowed" + ResourceAccessPolicyNotSpecified ResourceAccessPolicy = "NotSpecified" +) + +// PossibleResourceAccessPolicyValues returns the possible values for the ResourceAccessPolicy const type. +func PossibleResourceAccessPolicyValues() []ResourceAccessPolicy { + return []ResourceAccessPolicy{ + ResourceAccessPolicyAcisActionAllowed, + ResourceAccessPolicyAcisReadAllowed, + ResourceAccessPolicyNotSpecified, + } +} + +// ResourceDeletionPolicy - The resource deletion policy. type ResourceDeletionPolicy string const ( @@ -367,6 +984,7 @@ func PossibleResourceDeletionPolicyValues() []ResourceDeletionPolicy { } } +// ResourceProviderCapabilitiesEffect - The effect. type ResourceProviderCapabilitiesEffect string const ( @@ -384,23 +1002,7 @@ func PossibleResourceProviderCapabilitiesEffectValues() []ResourceProviderCapabi } } -type ResourceProviderManagementResourceAccessPolicy string - -const ( - ResourceProviderManagementResourceAccessPolicyAcisActionAllowed ResourceProviderManagementResourceAccessPolicy = "AcisActionAllowed" - ResourceProviderManagementResourceAccessPolicyAcisReadAllowed ResourceProviderManagementResourceAccessPolicy = "AcisReadAllowed" - ResourceProviderManagementResourceAccessPolicyNotSpecified ResourceProviderManagementResourceAccessPolicy = "NotSpecified" -) - -// PossibleResourceProviderManagementResourceAccessPolicyValues returns the possible values for the ResourceProviderManagementResourceAccessPolicy const type. -func PossibleResourceProviderManagementResourceAccessPolicyValues() []ResourceProviderManagementResourceAccessPolicy { - return []ResourceProviderManagementResourceAccessPolicy{ - ResourceProviderManagementResourceAccessPolicyAcisActionAllowed, - ResourceProviderManagementResourceAccessPolicyAcisReadAllowed, - ResourceProviderManagementResourceAccessPolicyNotSpecified, - } -} - +// ResourceProviderType - The provider type. type ResourceProviderType string const ( @@ -428,44 +1030,100 @@ func PossibleResourceProviderTypeValues() []ResourceProviderType { } } -type ResourceTypeMarketplaceType string +// ResourceSubType - The resource sub type. +type ResourceSubType string + +const ( + ResourceSubTypeAsyncOperation ResourceSubType = "AsyncOperation" + ResourceSubTypeNotSpecified ResourceSubType = "NotSpecified" +) + +// PossibleResourceSubTypeValues returns the possible values for the ResourceSubType const type. +func PossibleResourceSubTypeValues() []ResourceSubType { + return []ResourceSubType{ + ResourceSubTypeAsyncOperation, + ResourceSubTypeNotSpecified, + } +} + +// ResourceTypeCategory - The category. +type ResourceTypeCategory string + +const ( + ResourceTypeCategoryFreeForm ResourceTypeCategory = "FreeForm" + ResourceTypeCategoryInternal ResourceTypeCategory = "Internal" + ResourceTypeCategoryNone ResourceTypeCategory = "None" + ResourceTypeCategoryPureProxy ResourceTypeCategory = "PureProxy" +) + +// PossibleResourceTypeCategoryValues returns the possible values for the ResourceTypeCategory const type. +func PossibleResourceTypeCategoryValues() []ResourceTypeCategory { + return []ResourceTypeCategory{ + ResourceTypeCategoryFreeForm, + ResourceTypeCategoryInternal, + ResourceTypeCategoryNone, + ResourceTypeCategoryPureProxy, + } +} + +// ResourceTypeEndpointKind - Resource type endpoint kind. This Metadata is also used by portal/tooling/etc to render different +// UX experiences for resources of the same type. +type ResourceTypeEndpointKind string + +const ( + // ResourceTypeEndpointKindDirect - Endpoint served by the onboarded Resource Provider Service. + ResourceTypeEndpointKindDirect ResourceTypeEndpointKind = "Direct" + // ResourceTypeEndpointKindManaged - Endpoint served by ProviderHub service + ResourceTypeEndpointKindManaged ResourceTypeEndpointKind = "Managed" +) + +// PossibleResourceTypeEndpointKindValues returns the possible values for the ResourceTypeEndpointKind const type. +func PossibleResourceTypeEndpointKindValues() []ResourceTypeEndpointKind { + return []ResourceTypeEndpointKind{ + ResourceTypeEndpointKindDirect, + ResourceTypeEndpointKindManaged, + } +} + +type ResourceTypeExtendedLocationPolicy string const ( - ResourceTypeMarketplaceTypeAddOn ResourceTypeMarketplaceType = "AddOn" - ResourceTypeMarketplaceTypeBypass ResourceTypeMarketplaceType = "Bypass" - ResourceTypeMarketplaceTypeNotSpecified ResourceTypeMarketplaceType = "NotSpecified" - ResourceTypeMarketplaceTypeStore ResourceTypeMarketplaceType = "Store" + ResourceTypeExtendedLocationPolicyAll ResourceTypeExtendedLocationPolicy = "All" + ResourceTypeExtendedLocationPolicyNotSpecified ResourceTypeExtendedLocationPolicy = "NotSpecified" ) -// PossibleResourceTypeMarketplaceTypeValues returns the possible values for the ResourceTypeMarketplaceType const type. -func PossibleResourceTypeMarketplaceTypeValues() []ResourceTypeMarketplaceType { - return []ResourceTypeMarketplaceType{ - ResourceTypeMarketplaceTypeAddOn, - ResourceTypeMarketplaceTypeBypass, - ResourceTypeMarketplaceTypeNotSpecified, - ResourceTypeMarketplaceTypeStore, +// PossibleResourceTypeExtendedLocationPolicyValues returns the possible values for the ResourceTypeExtendedLocationPolicy const type. +func PossibleResourceTypeExtendedLocationPolicyValues() []ResourceTypeExtendedLocationPolicy { + return []ResourceTypeExtendedLocationPolicy{ + ResourceTypeExtendedLocationPolicyAll, + ResourceTypeExtendedLocationPolicyNotSpecified, } } -type ResourceTypeRegistrationPropertiesMarketplaceType string +// ResourceTypeRegistrationKind - Resource type registration kind. This Metadata is also used by portal/tooling/etc to render +// different UX experiences for resources of the same type. +type ResourceTypeRegistrationKind string const ( - ResourceTypeRegistrationPropertiesMarketplaceTypeAddOn ResourceTypeRegistrationPropertiesMarketplaceType = "AddOn" - ResourceTypeRegistrationPropertiesMarketplaceTypeBypass ResourceTypeRegistrationPropertiesMarketplaceType = "Bypass" - ResourceTypeRegistrationPropertiesMarketplaceTypeNotSpecified ResourceTypeRegistrationPropertiesMarketplaceType = "NotSpecified" - ResourceTypeRegistrationPropertiesMarketplaceTypeStore ResourceTypeRegistrationPropertiesMarketplaceType = "Store" + // ResourceTypeRegistrationKindDirect - Resource type served by the onboarded Resource Provider Service. + ResourceTypeRegistrationKindDirect ResourceTypeRegistrationKind = "Direct" + // ResourceTypeRegistrationKindHybrid - Resource type served by both the ProviderHub & the onboarded Resource Provider Services + // (i.e. The type has a mix of managed and direct endpoints). + ResourceTypeRegistrationKindHybrid ResourceTypeRegistrationKind = "Hybrid" + // ResourceTypeRegistrationKindManaged - Resource type served by the ProviderHub service. + ResourceTypeRegistrationKindManaged ResourceTypeRegistrationKind = "Managed" ) -// PossibleResourceTypeRegistrationPropertiesMarketplaceTypeValues returns the possible values for the ResourceTypeRegistrationPropertiesMarketplaceType const type. -func PossibleResourceTypeRegistrationPropertiesMarketplaceTypeValues() []ResourceTypeRegistrationPropertiesMarketplaceType { - return []ResourceTypeRegistrationPropertiesMarketplaceType{ - ResourceTypeRegistrationPropertiesMarketplaceTypeAddOn, - ResourceTypeRegistrationPropertiesMarketplaceTypeBypass, - ResourceTypeRegistrationPropertiesMarketplaceTypeNotSpecified, - ResourceTypeRegistrationPropertiesMarketplaceTypeStore, +// PossibleResourceTypeRegistrationKindValues returns the possible values for the ResourceTypeRegistrationKind const type. +func PossibleResourceTypeRegistrationKindValues() []ResourceTypeRegistrationKind { + return []ResourceTypeRegistrationKind{ + ResourceTypeRegistrationKindDirect, + ResourceTypeRegistrationKindHybrid, + ResourceTypeRegistrationKindManaged, } } +// ResourceValidation - The resource validation. type ResourceValidation string const ( @@ -483,52 +1141,65 @@ func PossibleResourceValidationValues() []ResourceValidation { } } +// Role - The ownership role the application has on the resource types. The service owner role gives the application owner +// permissions. The limited owner role gives elevated permissions but does not allow all +// the permissions of a service owner, such as read/write on internal metadata. +type Role string + +const ( + RoleLimitedOwner Role = "LimitedOwner" + RoleServiceOwner Role = "ServiceOwner" +) + +// PossibleRoleValues returns the possible values for the Role const type. +func PossibleRoleValues() []Role { + return []Role{ + RoleLimitedOwner, + RoleServiceOwner, + } +} + +// RoutingType - The routing type. type RoutingType string const ( - RoutingTypeCascadeExtension RoutingType = "CascadeExtension" - RoutingTypeDefault RoutingType = "Default" - RoutingTypeExtension RoutingType = "Extension" - RoutingTypeFailover RoutingType = "Failover" - RoutingTypeFanout RoutingType = "Fanout" - RoutingTypeHostBased RoutingType = "HostBased" - RoutingTypeLocationBased RoutingType = "LocationBased" - RoutingTypeProxyOnly RoutingType = "ProxyOnly" - RoutingTypeTenant RoutingType = "Tenant" + RoutingTypeBypassEndpointSelectionOptimization RoutingType = "BypassEndpointSelectionOptimization" + RoutingTypeCascadeAuthorizedExtension RoutingType = "CascadeAuthorizedExtension" + RoutingTypeCascadeExtension RoutingType = "CascadeExtension" + RoutingTypeChildFanout RoutingType = "ChildFanout" + RoutingTypeDefault RoutingType = "Default" + RoutingTypeExtension RoutingType = "Extension" + RoutingTypeFailover RoutingType = "Failover" + RoutingTypeFanout RoutingType = "Fanout" + RoutingTypeHostBased RoutingType = "HostBased" + RoutingTypeLocationBased RoutingType = "LocationBased" + RoutingTypeLocationMapping RoutingType = "LocationMapping" + RoutingTypeProxyOnly RoutingType = "ProxyOnly" + RoutingTypeServiceFanout RoutingType = "ServiceFanout" + RoutingTypeTenant RoutingType = "Tenant" ) // PossibleRoutingTypeValues returns the possible values for the RoutingType const type. func PossibleRoutingTypeValues() []RoutingType { return []RoutingType{ + RoutingTypeBypassEndpointSelectionOptimization, + RoutingTypeCascadeAuthorizedExtension, RoutingTypeCascadeExtension, + RoutingTypeChildFanout, RoutingTypeDefault, RoutingTypeExtension, RoutingTypeFailover, RoutingTypeFanout, RoutingTypeHostBased, RoutingTypeLocationBased, + RoutingTypeLocationMapping, RoutingTypeProxyOnly, + RoutingTypeServiceFanout, RoutingTypeTenant, } } -type SKULocationInfoType string - -const ( - SKULocationInfoTypeArcZone SKULocationInfoType = "ArcZone" - SKULocationInfoTypeEdgeZone SKULocationInfoType = "EdgeZone" - SKULocationInfoTypeNotSpecified SKULocationInfoType = "NotSpecified" -) - -// PossibleSKULocationInfoTypeValues returns the possible values for the SKULocationInfoType const type. -func PossibleSKULocationInfoTypeValues() []SKULocationInfoType { - return []SKULocationInfoType{ - SKULocationInfoTypeArcZone, - SKULocationInfoTypeEdgeZone, - SKULocationInfoTypeNotSpecified, - } -} - +// SKUScaleType - The scale type. type SKUScaleType string const ( @@ -546,6 +1217,104 @@ func PossibleSKUScaleTypeValues() []SKUScaleType { } } +// ServerFailureResponseMessageType - Type of server failure response message. +type ServerFailureResponseMessageType string + +const ( + ServerFailureResponseMessageTypeNotSpecified ServerFailureResponseMessageType = "NotSpecified" + ServerFailureResponseMessageTypeOutageReporting ServerFailureResponseMessageType = "OutageReporting" +) + +// PossibleServerFailureResponseMessageTypeValues returns the possible values for the ServerFailureResponseMessageType const type. +func PossibleServerFailureResponseMessageTypeValues() []ServerFailureResponseMessageType { + return []ServerFailureResponseMessageType{ + ServerFailureResponseMessageTypeNotSpecified, + ServerFailureResponseMessageTypeOutageReporting, + } +} + +type ServiceClientOptionsType string + +const ( + ServiceClientOptionsTypeDisableAutomaticDecompression ServiceClientOptionsType = "DisableAutomaticDecompression" + ServiceClientOptionsTypeNotSpecified ServiceClientOptionsType = "NotSpecified" +) + +// PossibleServiceClientOptionsTypeValues returns the possible values for the ServiceClientOptionsType const type. +func PossibleServiceClientOptionsTypeValues() []ServiceClientOptionsType { + return []ServiceClientOptionsType{ + ServiceClientOptionsTypeDisableAutomaticDecompression, + ServiceClientOptionsTypeNotSpecified, + } +} + +// ServiceFeatureFlagAction - The service feature flag. +type ServiceFeatureFlagAction string + +const ( + ServiceFeatureFlagActionCreate ServiceFeatureFlagAction = "Create" + ServiceFeatureFlagActionDoNotCreate ServiceFeatureFlagAction = "DoNotCreate" +) + +// PossibleServiceFeatureFlagActionValues returns the possible values for the ServiceFeatureFlagAction const type. +func PossibleServiceFeatureFlagActionValues() []ServiceFeatureFlagAction { + return []ServiceFeatureFlagAction{ + ServiceFeatureFlagActionCreate, + ServiceFeatureFlagActionDoNotCreate, + } +} + +// ServiceStatus - The status. +type ServiceStatus string + +const ( + ServiceStatusActive ServiceStatus = "Active" + ServiceStatusInactive ServiceStatus = "Inactive" +) + +// PossibleServiceStatusValues returns the possible values for the ServiceStatus const type. +func PossibleServiceStatusValues() []ServiceStatus { + return []ServiceStatus{ + ServiceStatusActive, + ServiceStatusInactive, + } +} + +// SignedRequestScope - The signed request scope. +type SignedRequestScope string + +const ( + SignedRequestScopeEndpoint SignedRequestScope = "Endpoint" + SignedRequestScopeResourceURI SignedRequestScope = "ResourceUri" +) + +// PossibleSignedRequestScopeValues returns the possible values for the SignedRequestScope const type. +func PossibleSignedRequestScopeValues() []SignedRequestScope { + return []SignedRequestScope{ + SignedRequestScopeEndpoint, + SignedRequestScopeResourceURI, + } +} + +// SkipNotifications - Whether notifications should be skipped. +type SkipNotifications string + +const ( + SkipNotificationsDisabled SkipNotifications = "Disabled" + SkipNotificationsEnabled SkipNotifications = "Enabled" + SkipNotificationsUnspecified SkipNotifications = "Unspecified" +) + +// PossibleSkipNotificationsValues returns the possible values for the SkipNotifications const type. +func PossibleSkipNotificationsValues() []SkipNotifications { + return []SkipNotifications{ + SkipNotificationsDisabled, + SkipNotificationsEnabled, + SkipNotificationsUnspecified, + } +} + +// SubscriptionNotificationOperation - The action. type SubscriptionNotificationOperation string const ( @@ -569,6 +1338,7 @@ func PossibleSubscriptionNotificationOperationValues() []SubscriptionNotificatio } } +// SubscriptionReregistrationResult - The subscription reregistration result. type SubscriptionReregistrationResult string const ( @@ -588,6 +1358,7 @@ func PossibleSubscriptionReregistrationResultValues() []SubscriptionReregistrati } } +// SubscriptionState - The subscription state. type SubscriptionState string const ( @@ -611,6 +1382,7 @@ func PossibleSubscriptionStateValues() []SubscriptionState { } } +// SubscriptionTransitioningState - The state. type SubscriptionTransitioningState string const ( @@ -648,6 +1420,25 @@ func PossibleSubscriptionTransitioningStateValues() []SubscriptionTransitioningS } } +// SupportedOperations - Supported operations. +type SupportedOperations string + +const ( + SupportedOperationsDelete SupportedOperations = "Delete" + SupportedOperationsGet SupportedOperations = "Get" + SupportedOperationsNotSpecified SupportedOperations = "NotSpecified" +) + +// PossibleSupportedOperationsValues returns the possible values for the SupportedOperations const type. +func PossibleSupportedOperationsValues() []SupportedOperations { + return []SupportedOperations{ + SupportedOperationsDelete, + SupportedOperationsGet, + SupportedOperationsNotSpecified, + } +} + +// TemplateDeploymentCapabilities - The capabilities. type TemplateDeploymentCapabilities string const ( @@ -663,6 +1454,23 @@ func PossibleTemplateDeploymentCapabilitiesValues() []TemplateDeploymentCapabili } } +// TemplateDeploymentPreflightNotifications - The preflight notifications. +type TemplateDeploymentPreflightNotifications string + +const ( + TemplateDeploymentPreflightNotificationsNone TemplateDeploymentPreflightNotifications = "None" + TemplateDeploymentPreflightNotificationsUnregisteredSubscriptions TemplateDeploymentPreflightNotifications = "UnregisteredSubscriptions" +) + +// PossibleTemplateDeploymentPreflightNotificationsValues returns the possible values for the TemplateDeploymentPreflightNotifications const type. +func PossibleTemplateDeploymentPreflightNotificationsValues() []TemplateDeploymentPreflightNotifications { + return []TemplateDeploymentPreflightNotifications{ + TemplateDeploymentPreflightNotificationsNone, + TemplateDeploymentPreflightNotificationsUnregisteredSubscriptions, + } +} + +// TemplateDeploymentPreflightOptions - The preflight options. type TemplateDeploymentPreflightOptions string const ( @@ -684,6 +1492,7 @@ func PossibleTemplateDeploymentPreflightOptionsValues() []TemplateDeploymentPref } } +// ThrottlingMetricType - The throttling metric type type ThrottlingMetricType string const ( @@ -701,6 +1510,7 @@ func PossibleThrottlingMetricTypeValues() []ThrottlingMetricType { } } +// TrafficRegionCategory - The next traffic region. type TrafficRegionCategory string const ( diff --git a/sdk/resourcemanager/providerhub/armproviderhub/customrollouts_client.go b/sdk/resourcemanager/providerhub/armproviderhub/customrollouts_client.go index 7d43b8805816..6487ebb5eed5 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/customrollouts_client.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/customrollouts_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -43,39 +40,60 @@ func NewCustomRolloutsClient(subscriptionID string, credential azcore.TokenCrede return client, nil } -// CreateOrUpdate - Creates or updates the rollout details. +// BeginCreateOrUpdate - Creates or updates the rollout details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - rolloutName - The rollout name. // - properties - The custom rollout properties supplied to the CreateOrUpdate operation. -// - options - CustomRolloutsClientCreateOrUpdateOptions contains the optional parameters for the CustomRolloutsClient.CreateOrUpdate +// - options - CustomRolloutsClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomRolloutsClient.BeginCreateOrUpdate // method. -func (client *CustomRolloutsClient) CreateOrUpdate(ctx context.Context, providerNamespace string, rolloutName string, properties CustomRollout, options *CustomRolloutsClientCreateOrUpdateOptions) (CustomRolloutsClientCreateOrUpdateResponse, error) { +func (client *CustomRolloutsClient) BeginCreateOrUpdate(ctx context.Context, providerNamespace string, rolloutName string, properties CustomRollout, options *CustomRolloutsClientBeginCreateOrUpdateOptions) (*runtime.Poller[CustomRolloutsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, providerNamespace, rolloutName, properties, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CustomRolloutsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CustomRolloutsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Creates or updates the rollout details. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +func (client *CustomRolloutsClient) createOrUpdate(ctx context.Context, providerNamespace string, rolloutName string, properties CustomRollout, options *CustomRolloutsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error - const operationName = "CustomRolloutsClient.CreateOrUpdate" + const operationName = "CustomRolloutsClient.BeginCreateOrUpdate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, providerNamespace, rolloutName, properties, options) if err != nil { - return CustomRolloutsClientCreateOrUpdateResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return CustomRolloutsClientCreateOrUpdateResponse{}, err + return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { err = runtime.NewResponseError(httpResp) - return CustomRolloutsClientCreateOrUpdateResponse{}, err + return nil, err } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *CustomRolloutsClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, rolloutName string, properties CustomRollout, options *CustomRolloutsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *CustomRolloutsClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, rolloutName string, properties CustomRollout, _ *CustomRolloutsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts/{rolloutName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -94,7 +112,7 @@ func (client *CustomRolloutsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { @@ -103,19 +121,64 @@ func (client *CustomRolloutsClient) createOrUpdateCreateRequest(ctx context.Cont return req, nil } -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *CustomRolloutsClient) createOrUpdateHandleResponse(resp *http.Response) (CustomRolloutsClientCreateOrUpdateResponse, error) { - result := CustomRolloutsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CustomRollout); err != nil { - return CustomRolloutsClientCreateOrUpdateResponse{}, err +// Delete - Deletes the custom rollout resource. Custom rollout must be in terminal state. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +// - providerNamespace - The name of the resource provider hosted within ProviderHub. +// - rolloutName - The rollout name. +// - options - CustomRolloutsClientDeleteOptions contains the optional parameters for the CustomRolloutsClient.Delete method. +func (client *CustomRolloutsClient) Delete(ctx context.Context, providerNamespace string, rolloutName string, options *CustomRolloutsClientDeleteOptions) (CustomRolloutsClientDeleteResponse, error) { + var err error + const operationName = "CustomRolloutsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, providerNamespace, rolloutName, options) + if err != nil { + return CustomRolloutsClientDeleteResponse{}, err } - return result, nil + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CustomRolloutsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return CustomRolloutsClientDeleteResponse{}, err + } + return CustomRolloutsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *CustomRolloutsClient) deleteCreateRequest(ctx context.Context, providerNamespace string, rolloutName string, _ *CustomRolloutsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts/{rolloutName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if providerNamespace == "" { + return nil, errors.New("parameter providerNamespace cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerNamespace}", url.PathEscape(providerNamespace)) + if rolloutName == "" { + return nil, errors.New("parameter rolloutName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{rolloutName}", url.PathEscape(rolloutName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil } // Get - Gets the custom rollout details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - rolloutName - The rollout name. // - options - CustomRolloutsClientGetOptions contains the optional parameters for the CustomRolloutsClient.Get method. @@ -142,7 +205,7 @@ func (client *CustomRolloutsClient) Get(ctx context.Context, providerNamespace s } // getCreateRequest creates the Get request. -func (client *CustomRolloutsClient) getCreateRequest(ctx context.Context, providerNamespace string, rolloutName string, options *CustomRolloutsClientGetOptions) (*policy.Request, error) { +func (client *CustomRolloutsClient) getCreateRequest(ctx context.Context, providerNamespace string, rolloutName string, _ *CustomRolloutsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts/{rolloutName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -161,7 +224,7 @@ func (client *CustomRolloutsClient) getCreateRequest(ctx context.Context, provid return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -178,7 +241,7 @@ func (client *CustomRolloutsClient) getHandleResponse(resp *http.Response) (Cust // NewListByProviderRegistrationPager - Gets the list of the custom rollouts for the given provider. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - options - CustomRolloutsClientListByProviderRegistrationOptions contains the optional parameters for the CustomRolloutsClient.NewListByProviderRegistrationPager // method. @@ -206,7 +269,7 @@ func (client *CustomRolloutsClient) NewListByProviderRegistrationPager(providerN } // listByProviderRegistrationCreateRequest creates the ListByProviderRegistration request. -func (client *CustomRolloutsClient) listByProviderRegistrationCreateRequest(ctx context.Context, providerNamespace string, options *CustomRolloutsClientListByProviderRegistrationOptions) (*policy.Request, error) { +func (client *CustomRolloutsClient) listByProviderRegistrationCreateRequest(ctx context.Context, providerNamespace string, _ *CustomRolloutsClientListByProviderRegistrationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -221,7 +284,7 @@ func (client *CustomRolloutsClient) listByProviderRegistrationCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,3 +298,57 @@ func (client *CustomRolloutsClient) listByProviderRegistrationHandleResponse(res } return result, nil } + +// Stop - Stops or cancels the custom rollout, if in progress. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +// - providerNamespace - The name of the resource provider hosted within ProviderHub. +// - rolloutName - The rollout name. +// - options - CustomRolloutsClientStopOptions contains the optional parameters for the CustomRolloutsClient.Stop method. +func (client *CustomRolloutsClient) Stop(ctx context.Context, providerNamespace string, rolloutName string, options *CustomRolloutsClientStopOptions) (CustomRolloutsClientStopResponse, error) { + var err error + const operationName = "CustomRolloutsClient.Stop" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.stopCreateRequest(ctx, providerNamespace, rolloutName, options) + if err != nil { + return CustomRolloutsClientStopResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CustomRolloutsClientStopResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CustomRolloutsClientStopResponse{}, err + } + return CustomRolloutsClientStopResponse{}, nil +} + +// stopCreateRequest creates the Stop request. +func (client *CustomRolloutsClient) stopCreateRequest(ctx context.Context, providerNamespace string, rolloutName string, _ *CustomRolloutsClientStopOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts/{rolloutName}/stop" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if providerNamespace == "" { + return nil, errors.New("parameter providerNamespace cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerNamespace}", url.PathEscape(providerNamespace)) + if rolloutName == "" { + return nil, errors.New("parameter rolloutName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{rolloutName}", url.PathEscape(rolloutName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/customrollouts_client_example_test.go b/sdk/resourcemanager/providerhub/armproviderhub/customrollouts_client_example_test.go deleted file mode 100644 index 42f09e19c6a2..000000000000 --- a/sdk/resourcemanager/providerhub/armproviderhub/customrollouts_client_example_test.go +++ /dev/null @@ -1,260 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armproviderhub_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/providerhub/armproviderhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/CustomRollouts_Get.json -func ExampleCustomRolloutsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomRolloutsClient().Get(ctx, "Microsoft.Contoso", "canaryTesting99", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomRollout = armproviderhub.CustomRollout{ - // Name: to.Ptr("Microsoft.Contoso/canaryTesting99"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/customRollouts"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/customRollouts/canaryTesting99"), - // Properties: &armproviderhub.CustomRolloutProperties{ - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // Specification: &armproviderhub.CustomRolloutPropertiesSpecification{ - // Canary: &armproviderhub.CustomRolloutSpecificationCanary{ - // Regions: []*string{ - // to.Ptr("eastus2euap"), - // to.Ptr("centraluseuap")}, - // }, - // ProviderRegistration: &armproviderhub.CustomRolloutSpecificationProviderRegistration{ - // Name: to.Ptr("Microsoft.Contoso"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso"), - // Properties: &armproviderhub.ProviderRegistrationProperties{ - // Capabilities: []*armproviderhub.ResourceProviderCapabilities{ - // { - // Effect: to.Ptr(armproviderhub.ResourceProviderCapabilitiesEffectAllow), - // QuotaID: to.Ptr("CSP_2015-05-01"), - // }, - // { - // Effect: to.Ptr(armproviderhub.ResourceProviderCapabilitiesEffectAllow), - // QuotaID: to.Ptr("CSP_MG_2017-12-01"), - // }}, - // Management: &armproviderhub.ResourceProviderManifestPropertiesManagement{ - // IncidentContactEmail: to.Ptr("helpme@contoso.com"), - // IncidentRoutingService: to.Ptr(""), - // IncidentRoutingTeam: to.Ptr(""), - // ManifestOwners: []*string{ - // to.Ptr("SPARTA-PlatformServiceAdministrator")}, - // ResourceAccessPolicy: to.Ptr(armproviderhub.ResourceProviderManagementResourceAccessPolicyNotSpecified), - // }, - // Namespace: to.Ptr("microsoft.contoso"), - // ProviderAuthorizations: []*armproviderhub.ResourceProviderAuthorization{ - // { - // ApplicationID: to.Ptr("1a3b5c7d-8e9f-10g1-1h12-i13j14k1"), - // RoleDefinitionID: to.Ptr("123456bf-gkur-2098-b890-98da392a00b2"), - // }}, - // ProviderType: to.Ptr(armproviderhub.ResourceProviderType("Internal, Hidden")), - // ProviderVersion: to.Ptr("2.0"), - // ProviderHubMetadata: &armproviderhub.ProviderRegistrationPropertiesProviderHubMetadata{ - // ProviderAuthentication: &armproviderhub.MetadataProviderAuthentication{ - // AllowedAudiences: []*string{ - // to.Ptr("https://management.core.windows.net/")}, - // }, - // }, - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // }, - // }, - // ResourceTypeRegistrations: []*armproviderhub.ResourceTypeRegistration{ - // { - // Name: to.Ptr("Microsoft.Contoso/employees"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/resourceTypeRegistrations"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/resourceTypeRegistrations/employees"), - // Properties: &armproviderhub.ResourceTypeRegistrationProperties{ - // EnableAsyncOperation: to.Ptr(false), - // EnableThirdPartyS2S: to.Ptr(false), - // Endpoints: []*armproviderhub.ResourceTypeEndpoint{ - // { - // APIVersions: []*string{ - // to.Ptr("2018-11-01-preview"), - // to.Ptr("2020-01-01-preview"), - // to.Ptr("2019-01-01")}, - // Locations: []*string{ - // to.Ptr("East Asia"), - // to.Ptr("East US"), - // to.Ptr("North Europe"), - // to.Ptr("Southeast Asia"), - // to.Ptr("East US 2 EUAP"), - // to.Ptr("Central US EUAP"), - // to.Ptr("West Europe"), - // to.Ptr("West US"), - // to.Ptr("West Central US"), - // to.Ptr("West US 2")}, - // RequiredFeatures: []*string{ - // to.Ptr("Microsoft.Contoso/RPaaSSampleApp")}, - // }}, - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // Regionality: to.Ptr(armproviderhub.RegionalityRegional), - // RoutingType: to.Ptr(armproviderhub.RoutingTypeDefault), - // SwaggerSpecifications: []*armproviderhub.SwaggerSpecification{ - // { - // APIVersions: []*string{ - // to.Ptr("2018-11-01-preview"), - // to.Ptr("2020-01-01-preview"), - // to.Ptr("2019-01-01")}, - // SwaggerSpecFolderURI: to.Ptr("https://github.com/Azure/azure-rest-api-specs/blob/feature/azure/contoso/specification/contoso/resource-manager/Microsoft.SampleRP/"), - // }}, - // }, - // }}, - // }, - // Status: &armproviderhub.CustomRolloutPropertiesStatus{ - // CompletedRegions: []*string{ - // to.Ptr("eastus2euap"), - // to.Ptr("centraluseuap")}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/CustomRollouts_CreateOrUpdate.json -func ExampleCustomRolloutsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomRolloutsClient().CreateOrUpdate(ctx, "Microsoft.Contoso", "brazilUsShoeBoxTesting", armproviderhub.CustomRollout{ - Properties: &armproviderhub.CustomRolloutProperties{ - Specification: &armproviderhub.CustomRolloutPropertiesSpecification{ - Canary: &armproviderhub.CustomRolloutSpecificationCanary{ - Regions: []*string{ - to.Ptr("brazilus")}, - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomRollout = armproviderhub.CustomRollout{ - // Name: to.Ptr("Microsoft.Contoso/brazilUsShoeBoxTesting"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/customRollouts"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/customRollouts/brazilUsShoeBoxTesting"), - // Properties: &armproviderhub.CustomRolloutProperties{ - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // Specification: &armproviderhub.CustomRolloutPropertiesSpecification{ - // Canary: &armproviderhub.CustomRolloutSpecificationCanary{ - // Regions: []*string{ - // to.Ptr("brazilus"), - // to.Ptr("eastus2euap"), - // to.Ptr("centraluseuap")}, - // }, - // }, - // Status: &armproviderhub.CustomRolloutPropertiesStatus{ - // CompletedRegions: []*string{ - // to.Ptr("brazilus"), - // to.Ptr("eastus2euap"), - // to.Ptr("centraluseuap")}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/CustomRollouts_ListByProviderRegistration.json -func ExampleCustomRolloutsClient_NewListByProviderRegistrationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomRolloutsClient().NewListByProviderRegistrationPager("Microsoft.Contoso", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CustomRolloutArrayResponseWithContinuation = armproviderhub.CustomRolloutArrayResponseWithContinuation{ - // Value: []*armproviderhub.CustomRollout{ - // { - // Name: to.Ptr("Microsoft.Contoso/canaryTesting99"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/customRollouts"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/customRollouts/canaryTesting99"), - // Properties: &armproviderhub.CustomRolloutProperties{ - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // Specification: &armproviderhub.CustomRolloutPropertiesSpecification{ - // Canary: &armproviderhub.CustomRolloutSpecificationCanary{ - // Regions: []*string{ - // to.Ptr("eastus2euap"), - // to.Ptr("centraluseuap")}, - // }, - // }, - // Status: &armproviderhub.CustomRolloutPropertiesStatus{ - // CompletedRegions: []*string{ - // to.Ptr("eastus2euap"), - // to.Ptr("centraluseuap")}, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Contoso/brazilustesting"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/customRollouts"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/customRollouts/brazilustesting"), - // Properties: &armproviderhub.CustomRolloutProperties{ - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // Specification: &armproviderhub.CustomRolloutPropertiesSpecification{ - // Canary: &armproviderhub.CustomRolloutSpecificationCanary{ - // Regions: []*string{ - // to.Ptr("brazilus")}, - // }, - // }, - // Status: &armproviderhub.CustomRolloutPropertiesStatus{ - // FailedOrSkippedRegions: map[string]*armproviderhub.ExtendedErrorInfo{ - // "brazilus": &armproviderhub.ExtendedErrorInfo{ - // Code: to.Ptr("RolloutTimedout"), - // Message: to.Ptr("Failed to rollout to specified region."), - // }, - // }, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/defaultrollouts_client.go b/sdk/resourcemanager/providerhub/armproviderhub/defaultrollouts_client.go index d96dfd8957eb..ed693ccd545a 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/defaultrollouts_client.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/defaultrollouts_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewDefaultRolloutsClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Creates or updates the rollout details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - rolloutName - The rollout name. // - properties - The Default rollout properties supplied to the CreateOrUpdate operation. @@ -73,7 +70,7 @@ func (client *DefaultRolloutsClient) BeginCreateOrUpdate(ctx context.Context, pr // CreateOrUpdate - Creates or updates the rollout details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 func (client *DefaultRolloutsClient) createOrUpdate(ctx context.Context, providerNamespace string, rolloutName string, properties DefaultRollout, options *DefaultRolloutsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DefaultRolloutsClient.BeginCreateOrUpdate" @@ -96,7 +93,7 @@ func (client *DefaultRolloutsClient) createOrUpdate(ctx context.Context, provide } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DefaultRolloutsClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, rolloutName string, properties DefaultRollout, options *DefaultRolloutsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *DefaultRolloutsClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, rolloutName string, properties DefaultRollout, _ *DefaultRolloutsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -115,7 +112,7 @@ func (client *DefaultRolloutsClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { @@ -127,7 +124,7 @@ func (client *DefaultRolloutsClient) createOrUpdateCreateRequest(ctx context.Con // Delete - Deletes the rollout resource. Rollout must be in terminal state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - rolloutName - The rollout name. // - options - DefaultRolloutsClientDeleteOptions contains the optional parameters for the DefaultRolloutsClient.Delete method. @@ -153,7 +150,7 @@ func (client *DefaultRolloutsClient) Delete(ctx context.Context, providerNamespa } // deleteCreateRequest creates the Delete request. -func (client *DefaultRolloutsClient) deleteCreateRequest(ctx context.Context, providerNamespace string, rolloutName string, options *DefaultRolloutsClientDeleteOptions) (*policy.Request, error) { +func (client *DefaultRolloutsClient) deleteCreateRequest(ctx context.Context, providerNamespace string, rolloutName string, _ *DefaultRolloutsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -172,7 +169,7 @@ func (client *DefaultRolloutsClient) deleteCreateRequest(ctx context.Context, pr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +178,7 @@ func (client *DefaultRolloutsClient) deleteCreateRequest(ctx context.Context, pr // Get - Gets the default rollout details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - rolloutName - The rollout name. // - options - DefaultRolloutsClientGetOptions contains the optional parameters for the DefaultRolloutsClient.Get method. @@ -208,7 +205,7 @@ func (client *DefaultRolloutsClient) Get(ctx context.Context, providerNamespace } // getCreateRequest creates the Get request. -func (client *DefaultRolloutsClient) getCreateRequest(ctx context.Context, providerNamespace string, rolloutName string, options *DefaultRolloutsClientGetOptions) (*policy.Request, error) { +func (client *DefaultRolloutsClient) getCreateRequest(ctx context.Context, providerNamespace string, rolloutName string, _ *DefaultRolloutsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -227,7 +224,7 @@ func (client *DefaultRolloutsClient) getCreateRequest(ctx context.Context, provi return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -244,7 +241,7 @@ func (client *DefaultRolloutsClient) getHandleResponse(resp *http.Response) (Def // NewListByProviderRegistrationPager - Gets the list of the rollouts for the given provider. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - options - DefaultRolloutsClientListByProviderRegistrationOptions contains the optional parameters for the DefaultRolloutsClient.NewListByProviderRegistrationPager // method. @@ -272,7 +269,7 @@ func (client *DefaultRolloutsClient) NewListByProviderRegistrationPager(provider } // listByProviderRegistrationCreateRequest creates the ListByProviderRegistration request. -func (client *DefaultRolloutsClient) listByProviderRegistrationCreateRequest(ctx context.Context, providerNamespace string, options *DefaultRolloutsClientListByProviderRegistrationOptions) (*policy.Request, error) { +func (client *DefaultRolloutsClient) listByProviderRegistrationCreateRequest(ctx context.Context, providerNamespace string, _ *DefaultRolloutsClientListByProviderRegistrationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -287,7 +284,7 @@ func (client *DefaultRolloutsClient) listByProviderRegistrationCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,7 +302,7 @@ func (client *DefaultRolloutsClient) listByProviderRegistrationHandleResponse(re // Stop - Stops or cancels the rollout, if in progress. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - rolloutName - The rollout name. // - options - DefaultRolloutsClientStopOptions contains the optional parameters for the DefaultRolloutsClient.Stop method. @@ -331,7 +328,7 @@ func (client *DefaultRolloutsClient) Stop(ctx context.Context, providerNamespace } // stopCreateRequest creates the Stop request. -func (client *DefaultRolloutsClient) stopCreateRequest(ctx context.Context, providerNamespace string, rolloutName string, options *DefaultRolloutsClientStopOptions) (*policy.Request, error) { +func (client *DefaultRolloutsClient) stopCreateRequest(ctx context.Context, providerNamespace string, rolloutName string, _ *DefaultRolloutsClientStopOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}/stop" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -350,7 +347,7 @@ func (client *DefaultRolloutsClient) stopCreateRequest(ctx context.Context, prov return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/providerhub/armproviderhub/defaultrollouts_client_example_test.go b/sdk/resourcemanager/providerhub/armproviderhub/defaultrollouts_client_example_test.go deleted file mode 100644 index e432a8093cfd..000000000000 --- a/sdk/resourcemanager/providerhub/armproviderhub/defaultrollouts_client_example_test.go +++ /dev/null @@ -1,455 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armproviderhub_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/providerhub/armproviderhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/DefaultRollouts_Get.json -func ExampleDefaultRolloutsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDefaultRolloutsClient().Get(ctx, "Microsoft.Contoso", "2020week10", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DefaultRollout = armproviderhub.DefaultRollout{ - // Name: to.Ptr("Microsoft.Contoso/2020week10"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/defaultRollouts"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/defaultRollouts/2020week10"), - // Properties: &armproviderhub.DefaultRolloutProperties{ - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // Specification: &armproviderhub.DefaultRolloutPropertiesSpecification{ - // Canary: &armproviderhub.DefaultRolloutSpecificationCanary{ - // Regions: []*string{ - // to.Ptr("eastus2euap"), - // to.Ptr("centraluseuap")}, - // SkipRegions: []*string{ - // to.Ptr("brazilus")}, - // }, - // HighTraffic: &armproviderhub.DefaultRolloutSpecificationHighTraffic{ - // Regions: []*string{ - // to.Ptr("australiasoutheast"), - // to.Ptr("otherhightraficregions")}, - // WaitDuration: to.Ptr("PT24H"), - // }, - // LowTraffic: &armproviderhub.DefaultRolloutSpecificationLowTraffic{ - // Regions: []*string{ - // to.Ptr("southeastasia")}, - // WaitDuration: to.Ptr("PT24H"), - // }, - // MediumTraffic: &armproviderhub.DefaultRolloutSpecificationMediumTraffic{ - // Regions: []*string{ - // to.Ptr("uksouth"), - // to.Ptr("indiawest")}, - // WaitDuration: to.Ptr("PT24H"), - // }, - // ProviderRegistration: &armproviderhub.DefaultRolloutSpecificationProviderRegistration{ - // Name: to.Ptr("Microsoft.Contoso"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso"), - // Properties: &armproviderhub.ProviderRegistrationProperties{ - // Capabilities: []*armproviderhub.ResourceProviderCapabilities{ - // { - // Effect: to.Ptr(armproviderhub.ResourceProviderCapabilitiesEffectAllow), - // QuotaID: to.Ptr("CSP_2015-05-01"), - // }, - // { - // Effect: to.Ptr(armproviderhub.ResourceProviderCapabilitiesEffectAllow), - // QuotaID: to.Ptr("CSP_MG_2017-12-01"), - // }}, - // Management: &armproviderhub.ResourceProviderManifestPropertiesManagement{ - // IncidentContactEmail: to.Ptr("helpme@contoso.com"), - // IncidentRoutingService: to.Ptr(""), - // IncidentRoutingTeam: to.Ptr(""), - // ManifestOwners: []*string{ - // to.Ptr("SPARTA-PlatformServiceAdministrator")}, - // ResourceAccessPolicy: to.Ptr(armproviderhub.ResourceProviderManagementResourceAccessPolicyNotSpecified), - // }, - // Namespace: to.Ptr("microsoft.contoso"), - // ProviderAuthorizations: []*armproviderhub.ResourceProviderAuthorization{ - // { - // ApplicationID: to.Ptr("1a3b5c7d-8e9f-10g1-1h12-i13j14k1"), - // RoleDefinitionID: to.Ptr("123456bf-gkur-2098-b890-98da392a00b2"), - // }}, - // ProviderType: to.Ptr(armproviderhub.ResourceProviderType("Internal, Hidden")), - // ProviderVersion: to.Ptr("2.0"), - // ProviderHubMetadata: &armproviderhub.ProviderRegistrationPropertiesProviderHubMetadata{ - // ProviderAuthentication: &armproviderhub.MetadataProviderAuthentication{ - // AllowedAudiences: []*string{ - // to.Ptr("https://management.core.windows.net/")}, - // }, - // }, - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // }, - // }, - // ResourceTypeRegistrations: []*armproviderhub.ResourceTypeRegistration{ - // { - // Name: to.Ptr("Microsoft.Contoso/employees"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/resourceTypeRegistrations"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/resourceTypeRegistrations/employees"), - // Properties: &armproviderhub.ResourceTypeRegistrationProperties{ - // EnableAsyncOperation: to.Ptr(false), - // EnableThirdPartyS2S: to.Ptr(false), - // Endpoints: []*armproviderhub.ResourceTypeEndpoint{ - // { - // APIVersions: []*string{ - // to.Ptr("2018-11-01-preview"), - // to.Ptr("2020-01-01-preview"), - // to.Ptr("2019-01-01")}, - // Locations: []*string{ - // to.Ptr("East Asia"), - // to.Ptr("East US"), - // to.Ptr("North Europe"), - // to.Ptr("Southeast Asia"), - // to.Ptr("East US 2 EUAP"), - // to.Ptr("Central US EUAP"), - // to.Ptr("West Europe"), - // to.Ptr("West US"), - // to.Ptr("West Central US"), - // to.Ptr("West US 2")}, - // RequiredFeatures: []*string{ - // to.Ptr("Microsoft.Contoso/RPaaSSampleApp")}, - // }}, - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // Regionality: to.Ptr(armproviderhub.RegionalityRegional), - // RoutingType: to.Ptr(armproviderhub.RoutingTypeDefault), - // SwaggerSpecifications: []*armproviderhub.SwaggerSpecification{ - // { - // APIVersions: []*string{ - // to.Ptr("2018-11-01-preview"), - // to.Ptr("2020-01-01-preview"), - // to.Ptr("2019-01-01")}, - // SwaggerSpecFolderURI: to.Ptr("https://github.com/Azure/azure-rest-api-specs/blob/feature/azure/contoso/specification/contoso/resource-manager/Microsoft.SampleRP/"), - // }}, - // }, - // }}, - // RestOfTheWorldGroupOne: &armproviderhub.DefaultRolloutSpecificationRestOfTheWorldGroupOne{ - // Regions: []*string{ - // to.Ptr("koreacentral"), - // to.Ptr("francecentral"), - // to.Ptr("australiacentral"), - // to.Ptr("westus"), - // to.Ptr("allotherregions")}, - // WaitDuration: to.Ptr("PT4H"), - // }, - // RestOfTheWorldGroupTwo: &armproviderhub.DefaultRolloutSpecificationRestOfTheWorldGroupTwo{ - // Regions: []*string{ - // to.Ptr("germanynorth"), - // to.Ptr("norwayeast"), - // to.Ptr("allotherregions")}, - // WaitDuration: to.Ptr("PT4H"), - // }, - // }, - // Status: &armproviderhub.DefaultRolloutPropertiesStatus{ - // CompletedRegions: []*string{ - // to.Ptr("brazilus"), - // to.Ptr("eastus2euap"), - // to.Ptr("centraluseuap"), - // to.Ptr("allcompletedregions")}, - // FailedOrSkippedRegions: map[string]*armproviderhub.ExtendedErrorInfo{ - // "westus2": &armproviderhub.ExtendedErrorInfo{ - // Code: to.Ptr("RolloutStoppedByUser"), - // Message: to.Ptr("Rollout was explicitly stopped by the user."), - // }, - // }, - // SubscriptionReregistrationResult: to.Ptr(armproviderhub.SubscriptionReregistrationResultConditionalUpdate), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/DefaultRollouts_Delete.json -func ExampleDefaultRolloutsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDefaultRolloutsClient().Delete(ctx, "Microsoft.Contoso", "2020week10", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/DefaultRollouts_CreateOrUpdate.json -func ExampleDefaultRolloutsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDefaultRolloutsClient().BeginCreateOrUpdate(ctx, "Microsoft.Contoso", "2020week10", armproviderhub.DefaultRollout{ - Properties: &armproviderhub.DefaultRolloutProperties{ - Specification: &armproviderhub.DefaultRolloutPropertiesSpecification{ - Canary: &armproviderhub.DefaultRolloutSpecificationCanary{ - SkipRegions: []*string{ - to.Ptr("eastus2euap")}, - }, - RestOfTheWorldGroupTwo: &armproviderhub.DefaultRolloutSpecificationRestOfTheWorldGroupTwo{ - WaitDuration: to.Ptr("PT4H"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DefaultRollout = armproviderhub.DefaultRollout{ - // Name: to.Ptr("Microsoft.Contoso/2020week10"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/defaultRollouts"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/defaultRollouts/2020week10"), - // Properties: &armproviderhub.DefaultRolloutProperties{ - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // Specification: &armproviderhub.DefaultRolloutPropertiesSpecification{ - // Canary: &armproviderhub.DefaultRolloutSpecificationCanary{ - // Regions: []*string{ - // to.Ptr("brazilus"), - // to.Ptr("eastus2euap"), - // to.Ptr("centraluseuap")}, - // }, - // HighTraffic: &armproviderhub.DefaultRolloutSpecificationHighTraffic{ - // Regions: []*string{ - // to.Ptr("australiasoutheast"), - // to.Ptr("otherhightraficregions")}, - // WaitDuration: to.Ptr("PT24H"), - // }, - // LowTraffic: &armproviderhub.DefaultRolloutSpecificationLowTraffic{ - // Regions: []*string{ - // to.Ptr("southeastasia")}, - // WaitDuration: to.Ptr("PT24H"), - // }, - // MediumTraffic: &armproviderhub.DefaultRolloutSpecificationMediumTraffic{ - // Regions: []*string{ - // to.Ptr("uksouth"), - // to.Ptr("indiawest")}, - // WaitDuration: to.Ptr("PT24H"), - // }, - // RestOfTheWorldGroupOne: &armproviderhub.DefaultRolloutSpecificationRestOfTheWorldGroupOne{ - // Regions: []*string{ - // to.Ptr("koreacentral"), - // to.Ptr("francecentral"), - // to.Ptr("australiacentral"), - // to.Ptr("westus"), - // to.Ptr("allotherregions")}, - // WaitDuration: to.Ptr("PT4H"), - // }, - // RestOfTheWorldGroupTwo: &armproviderhub.DefaultRolloutSpecificationRestOfTheWorldGroupTwo{ - // Regions: []*string{ - // to.Ptr("germanynorth"), - // to.Ptr("norwayeast"), - // to.Ptr("allotherregions")}, - // WaitDuration: to.Ptr("PT4H"), - // }, - // }, - // Status: &armproviderhub.DefaultRolloutPropertiesStatus{ - // CompletedRegions: []*string{ - // to.Ptr("brazilus"), - // to.Ptr("eastus2euap"), - // to.Ptr("centraluseuap"), - // to.Ptr("allcompletedregions")}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/DefaultRollouts_ListByProviderRegistration.json -func ExampleDefaultRolloutsClient_NewListByProviderRegistrationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDefaultRolloutsClient().NewListByProviderRegistrationPager("Microsoft.Contoso", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DefaultRolloutArrayResponseWithContinuation = armproviderhub.DefaultRolloutArrayResponseWithContinuation{ - // Value: []*armproviderhub.DefaultRollout{ - // { - // Name: to.Ptr("Microsoft.Contoso/2020week01"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/defaultRollouts"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/defaultRollouts/2020week01"), - // Properties: &armproviderhub.DefaultRolloutProperties{ - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // Specification: &armproviderhub.DefaultRolloutPropertiesSpecification{ - // Canary: &armproviderhub.DefaultRolloutSpecificationCanary{ - // Regions: []*string{ - // to.Ptr("brazilus"), - // to.Ptr("eastus2euap"), - // to.Ptr("centraluseuap")}, - // }, - // HighTraffic: &armproviderhub.DefaultRolloutSpecificationHighTraffic{ - // Regions: []*string{ - // to.Ptr("australiasoutheast"), - // to.Ptr("otherhightraficregions")}, - // WaitDuration: to.Ptr("PT24H"), - // }, - // LowTraffic: &armproviderhub.DefaultRolloutSpecificationLowTraffic{ - // Regions: []*string{ - // to.Ptr("southeastasia")}, - // WaitDuration: to.Ptr("PT24H"), - // }, - // MediumTraffic: &armproviderhub.DefaultRolloutSpecificationMediumTraffic{ - // Regions: []*string{ - // to.Ptr("uksouth"), - // to.Ptr("indiawest")}, - // WaitDuration: to.Ptr("PT24H"), - // }, - // RestOfTheWorldGroupOne: &armproviderhub.DefaultRolloutSpecificationRestOfTheWorldGroupOne{ - // Regions: []*string{ - // to.Ptr("koreacentral"), - // to.Ptr("francecentral"), - // to.Ptr("australiacentral"), - // to.Ptr("westus"), - // to.Ptr("allotherregions")}, - // WaitDuration: to.Ptr("PT4H"), - // }, - // RestOfTheWorldGroupTwo: &armproviderhub.DefaultRolloutSpecificationRestOfTheWorldGroupTwo{ - // Regions: []*string{ - // to.Ptr("germanynorth"), - // to.Ptr("norwayeast"), - // to.Ptr("allotherregions")}, - // WaitDuration: to.Ptr("PT4H"), - // }, - // }, - // Status: &armproviderhub.DefaultRolloutPropertiesStatus{ - // CompletedRegions: []*string{ - // to.Ptr("brazilus"), - // to.Ptr("eastus2euap"), - // to.Ptr("centraluseuap"), - // to.Ptr("allcompletedregions")}, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Contoso/2020week10"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/defaultRollouts"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/defaultRollouts/2020week10"), - // Properties: &armproviderhub.DefaultRolloutProperties{ - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // Specification: &armproviderhub.DefaultRolloutPropertiesSpecification{ - // Canary: &armproviderhub.DefaultRolloutSpecificationCanary{ - // Regions: []*string{ - // to.Ptr("brazilus"), - // to.Ptr("eastus2euap"), - // to.Ptr("centraluseuap")}, - // }, - // HighTraffic: &armproviderhub.DefaultRolloutSpecificationHighTraffic{ - // Regions: []*string{ - // to.Ptr("australiasoutheast"), - // to.Ptr("otherhightraficregions")}, - // WaitDuration: to.Ptr("PT24H"), - // }, - // LowTraffic: &armproviderhub.DefaultRolloutSpecificationLowTraffic{ - // Regions: []*string{ - // to.Ptr("southeastasia")}, - // WaitDuration: to.Ptr("PT24H"), - // }, - // MediumTraffic: &armproviderhub.DefaultRolloutSpecificationMediumTraffic{ - // Regions: []*string{ - // to.Ptr("uksouth"), - // to.Ptr("indiawest")}, - // WaitDuration: to.Ptr("PT24H"), - // }, - // RestOfTheWorldGroupOne: &armproviderhub.DefaultRolloutSpecificationRestOfTheWorldGroupOne{ - // Regions: []*string{ - // to.Ptr("koreacentral"), - // to.Ptr("francecentral"), - // to.Ptr("australiacentral"), - // to.Ptr("westus"), - // to.Ptr("allotherregions")}, - // WaitDuration: to.Ptr("PT4H"), - // }, - // RestOfTheWorldGroupTwo: &armproviderhub.DefaultRolloutSpecificationRestOfTheWorldGroupTwo{ - // Regions: []*string{ - // to.Ptr("germanynorth"), - // to.Ptr("norwayeast"), - // to.Ptr("allotherregions")}, - // WaitDuration: to.Ptr("PT4H"), - // }, - // }, - // Status: &armproviderhub.DefaultRolloutPropertiesStatus{ - // CompletedRegions: []*string{ - // to.Ptr("brazilus"), - // to.Ptr("eastus2euap"), - // to.Ptr("centraluseuap"), - // to.Ptr("allcompletedregions")}, - // FailedOrSkippedRegions: map[string]*armproviderhub.ExtendedErrorInfo{ - // "westus2": &armproviderhub.ExtendedErrorInfo{ - // Code: to.Ptr("RolloutStoppedByUser"), - // Message: to.Ptr("Rollout was explicitly stopped by the user."), - // }, - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/DefaultRollouts_Stop.json -func ExampleDefaultRolloutsClient_Stop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDefaultRolloutsClient().Stop(ctx, "Microsoft.Contoso", "2020week10", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/fake/authorizedapplications_server.go b/sdk/resourcemanager/providerhub/armproviderhub/fake/authorizedapplications_server.go new file mode 100644 index 000000000000..c8ebb3b02298 --- /dev/null +++ b/sdk/resourcemanager/providerhub/armproviderhub/fake/authorizedapplications_server.go @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub/v2" + "net/http" + "net/url" + "regexp" +) + +// AuthorizedApplicationsServer is a fake server for instances of the armproviderhub.AuthorizedApplicationsClient type. +type AuthorizedApplicationsServer struct { + // BeginCreateOrUpdate is the fake for method AuthorizedApplicationsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, providerNamespace string, applicationID string, properties armproviderhub.AuthorizedApplication, options *armproviderhub.AuthorizedApplicationsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armproviderhub.AuthorizedApplicationsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method AuthorizedApplicationsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, providerNamespace string, applicationID string, options *armproviderhub.AuthorizedApplicationsClientDeleteOptions) (resp azfake.Responder[armproviderhub.AuthorizedApplicationsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method AuthorizedApplicationsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, providerNamespace string, applicationID string, options *armproviderhub.AuthorizedApplicationsClientGetOptions) (resp azfake.Responder[armproviderhub.AuthorizedApplicationsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method AuthorizedApplicationsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(providerNamespace string, options *armproviderhub.AuthorizedApplicationsClientListOptions) (resp azfake.PagerResponder[armproviderhub.AuthorizedApplicationsClientListResponse]) +} + +// NewAuthorizedApplicationsServerTransport creates a new instance of AuthorizedApplicationsServerTransport with the provided implementation. +// The returned AuthorizedApplicationsServerTransport instance is connected to an instance of armproviderhub.AuthorizedApplicationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewAuthorizedApplicationsServerTransport(srv *AuthorizedApplicationsServer) *AuthorizedApplicationsServerTransport { + return &AuthorizedApplicationsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armproviderhub.AuthorizedApplicationsClientCreateOrUpdateResponse]](), + newListPager: newTracker[azfake.PagerResponder[armproviderhub.AuthorizedApplicationsClientListResponse]](), + } +} + +// AuthorizedApplicationsServerTransport connects instances of armproviderhub.AuthorizedApplicationsClient to instances of AuthorizedApplicationsServer. +// Don't use this type directly, use NewAuthorizedApplicationsServerTransport instead. +type AuthorizedApplicationsServerTransport struct { + srv *AuthorizedApplicationsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armproviderhub.AuthorizedApplicationsClientCreateOrUpdateResponse]] + newListPager *tracker[azfake.PagerResponder[armproviderhub.AuthorizedApplicationsClientListResponse]] +} + +// Do implements the policy.Transporter interface for AuthorizedApplicationsServerTransport. +func (a *AuthorizedApplicationsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return a.dispatchToMethodFake(req, method) +} + +func (a *AuthorizedApplicationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if authorizedApplicationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = authorizedApplicationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AuthorizedApplicationsClient.BeginCreateOrUpdate": + res.resp, res.err = a.dispatchBeginCreateOrUpdate(req) + case "AuthorizedApplicationsClient.Delete": + res.resp, res.err = a.dispatchDelete(req) + case "AuthorizedApplicationsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AuthorizedApplicationsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (a *AuthorizedApplicationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if a.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := a.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizedApplications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armproviderhub.AuthorizedApplication](req) + if err != nil { + return nil, err + } + providerNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerNamespace")]) + if err != nil { + return nil, err + } + applicationIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("applicationId")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.BeginCreateOrUpdate(req.Context(), providerNamespaceParam, applicationIDParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + a.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + a.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + a.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (a *AuthorizedApplicationsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if a.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizedApplications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + providerNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerNamespace")]) + if err != nil { + return nil, err + } + applicationIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("applicationId")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.Delete(req.Context(), providerNamespaceParam, applicationIDParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (a *AuthorizedApplicationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if a.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizedApplications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + providerNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerNamespace")]) + if err != nil { + return nil, err + } + applicationIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("applicationId")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.Get(req.Context(), providerNamespaceParam, applicationIDParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AuthorizedApplication, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (a *AuthorizedApplicationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if a.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := a.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizedApplications` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + providerNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerNamespace")]) + if err != nil { + return nil, err + } + resp := a.srv.NewListPager(providerNamespaceParam, nil) + newListPager = &resp + a.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armproviderhub.AuthorizedApplicationsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + a.newListPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to AuthorizedApplicationsServerTransport +var authorizedApplicationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/fake/customrollouts_server.go b/sdk/resourcemanager/providerhub/armproviderhub/fake/customrollouts_server.go index 8ff1eab76448..e25f26887582 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/fake/customrollouts_server.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/fake/customrollouts_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub/v2" "net/http" "net/url" "regexp" @@ -24,9 +21,13 @@ import ( // CustomRolloutsServer is a fake server for instances of the armproviderhub.CustomRolloutsClient type. type CustomRolloutsServer struct { - // CreateOrUpdate is the fake for method CustomRolloutsClient.CreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK - CreateOrUpdate func(ctx context.Context, providerNamespace string, rolloutName string, properties armproviderhub.CustomRollout, options *armproviderhub.CustomRolloutsClientCreateOrUpdateOptions) (resp azfake.Responder[armproviderhub.CustomRolloutsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + // BeginCreateOrUpdate is the fake for method CustomRolloutsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, providerNamespace string, rolloutName string, properties armproviderhub.CustomRollout, options *armproviderhub.CustomRolloutsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armproviderhub.CustomRolloutsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method CustomRolloutsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, providerNamespace string, rolloutName string, options *armproviderhub.CustomRolloutsClientDeleteOptions) (resp azfake.Responder[armproviderhub.CustomRolloutsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method CustomRolloutsClient.Get // HTTP status codes to indicate success: http.StatusOK @@ -35,6 +36,10 @@ type CustomRolloutsServer struct { // NewListByProviderRegistrationPager is the fake for method CustomRolloutsClient.NewListByProviderRegistrationPager // HTTP status codes to indicate success: http.StatusOK NewListByProviderRegistrationPager func(providerNamespace string, options *armproviderhub.CustomRolloutsClientListByProviderRegistrationOptions) (resp azfake.PagerResponder[armproviderhub.CustomRolloutsClientListByProviderRegistrationResponse]) + + // Stop is the fake for method CustomRolloutsClient.Stop + // HTTP status codes to indicate success: http.StatusOK + Stop func(ctx context.Context, providerNamespace string, rolloutName string, options *armproviderhub.CustomRolloutsClientStopOptions) (resp azfake.Responder[armproviderhub.CustomRolloutsClientStopResponse], errResp azfake.ErrorResponder) } // NewCustomRolloutsServerTransport creates a new instance of CustomRolloutsServerTransport with the provided implementation. @@ -43,6 +48,7 @@ type CustomRolloutsServer struct { func NewCustomRolloutsServerTransport(srv *CustomRolloutsServer) *CustomRolloutsServerTransport { return &CustomRolloutsServerTransport{ srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armproviderhub.CustomRolloutsClientCreateOrUpdateResponse]](), newListByProviderRegistrationPager: newTracker[azfake.PagerResponder[armproviderhub.CustomRolloutsClientListByProviderRegistrationResponse]](), } } @@ -51,6 +57,7 @@ func NewCustomRolloutsServerTransport(srv *CustomRolloutsServer) *CustomRollouts // Don't use this type directly, use NewCustomRolloutsServerTransport instead. type CustomRolloutsServerTransport struct { srv *CustomRolloutsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armproviderhub.CustomRolloutsClientCreateOrUpdateResponse]] newListByProviderRegistrationPager *tracker[azfake.PagerResponder[armproviderhub.CustomRolloutsClientListByProviderRegistrationResponse]] } @@ -62,30 +69,101 @@ func (c *CustomRolloutsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} + +func (c *CustomRolloutsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if customRolloutsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = customRolloutsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CustomRolloutsClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "CustomRolloutsClient.Delete": + res.resp, res.err = c.dispatchDelete(req) + case "CustomRolloutsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "CustomRolloutsClient.NewListByProviderRegistrationPager": + res.resp, res.err = c.dispatchNewListByProviderRegistrationPager(req) + case "CustomRolloutsClient.Stop": + res.resp, res.err = c.dispatchStop(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() - switch method { - case "CustomRolloutsClient.CreateOrUpdate": - resp, err = c.dispatchCreateOrUpdate(req) - case "CustomRolloutsClient.Get": - resp, err = c.dispatchGet(req) - case "CustomRolloutsClient.NewListByProviderRegistrationPager": - resp, err = c.dispatchNewListByProviderRegistrationPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } +} +func (c *CustomRolloutsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if c.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := c.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/customRollouts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armproviderhub.CustomRollout](req) + if err != nil { + return nil, err + } + providerNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerNamespace")]) + if err != nil { + return nil, err + } + rolloutNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("rolloutName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginCreateOrUpdate(req.Context(), providerNamespaceParam, rolloutNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + c.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + c.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + c.beginCreateOrUpdate.remove(req) + } + return resp, nil } -func (c *CustomRolloutsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { - if c.srv.CreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} +func (c *CustomRolloutsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if c.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} } const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/customRollouts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) @@ -93,10 +171,6 @@ func (c *CustomRolloutsServerTransport) dispatchCreateOrUpdate(req *http.Request if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armproviderhub.CustomRollout](req) - if err != nil { - return nil, err - } providerNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerNamespace")]) if err != nil { return nil, err @@ -105,15 +179,15 @@ func (c *CustomRolloutsServerTransport) dispatchCreateOrUpdate(req *http.Request if err != nil { return nil, err } - respr, errRespr := c.srv.CreateOrUpdate(req.Context(), providerNamespaceParam, rolloutNameParam, body, nil) + respr, errRespr := c.srv.Delete(req.Context(), providerNamespaceParam, rolloutNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CustomRollout, req) + resp, err := server.NewResponse(respContent, req, nil) if err != nil { return nil, err } @@ -189,3 +263,42 @@ func (c *CustomRolloutsServerTransport) dispatchNewListByProviderRegistrationPag } return resp, nil } + +func (c *CustomRolloutsServerTransport) dispatchStop(req *http.Request) (*http.Response, error) { + if c.srv.Stop == nil { + return nil, &nonRetriableError{errors.New("fake for method Stop not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/customRollouts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stop` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + providerNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerNamespace")]) + if err != nil { + return nil, err + } + rolloutNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("rolloutName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Stop(req.Context(), providerNamespaceParam, rolloutNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to CustomRolloutsServerTransport +var customRolloutsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/fake/defaultrollouts_server.go b/sdk/resourcemanager/providerhub/armproviderhub/fake/defaultrollouts_server.go index fa742cebe720..b32053bc068b 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/fake/defaultrollouts_server.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/fake/defaultrollouts_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub/v2" "net/http" "net/url" "regexp" @@ -72,29 +69,48 @@ func (d *DefaultRolloutsServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DefaultRolloutsClient.BeginCreateOrUpdate": - resp, err = d.dispatchBeginCreateOrUpdate(req) - case "DefaultRolloutsClient.Delete": - resp, err = d.dispatchDelete(req) - case "DefaultRolloutsClient.Get": - resp, err = d.dispatchGet(req) - case "DefaultRolloutsClient.NewListByProviderRegistrationPager": - resp, err = d.dispatchNewListByProviderRegistrationPager(req) - case "DefaultRolloutsClient.Stop": - resp, err = d.dispatchStop(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DefaultRolloutsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if defaultRolloutsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = defaultRolloutsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DefaultRolloutsClient.BeginCreateOrUpdate": + res.resp, res.err = d.dispatchBeginCreateOrUpdate(req) + case "DefaultRolloutsClient.Delete": + res.resp, res.err = d.dispatchDelete(req) + case "DefaultRolloutsClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DefaultRolloutsClient.NewListByProviderRegistrationPager": + res.resp, res.err = d.dispatchNewListByProviderRegistrationPager(req) + case "DefaultRolloutsClient.Stop": + res.resp, res.err = d.dispatchStop(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DefaultRolloutsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -280,3 +296,9 @@ func (d *DefaultRolloutsServerTransport) dispatchStop(req *http.Request) (*http. } return resp, nil } + +// set this to conditionally intercept incoming requests to DefaultRolloutsServerTransport +var defaultRolloutsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/fake/internal.go b/sdk/resourcemanager/providerhub/armproviderhub/fake/internal.go index 5f75802a569e..4b65adc76adb 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/fake/internal.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/fake/internal.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -14,6 +11,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } diff --git a/sdk/resourcemanager/providerhub/armproviderhub/fake/newregionfrontloadrelease_server.go b/sdk/resourcemanager/providerhub/armproviderhub/fake/newregionfrontloadrelease_server.go new file mode 100644 index 000000000000..b96c537f8c23 --- /dev/null +++ b/sdk/resourcemanager/providerhub/armproviderhub/fake/newregionfrontloadrelease_server.go @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub/v2" + "net/http" + "net/url" + "regexp" +) + +// NewRegionFrontloadReleaseServer is a fake server for instances of the armproviderhub.NewRegionFrontloadReleaseClient type. +type NewRegionFrontloadReleaseServer struct { + // CreateOrUpdate is the fake for method NewRegionFrontloadReleaseClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, providerNamespace string, releaseName string, properties armproviderhub.FrontloadPayload, options *armproviderhub.NewRegionFrontloadReleaseClientCreateOrUpdateOptions) (resp azfake.Responder[armproviderhub.NewRegionFrontloadReleaseClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // GenerateManifest is the fake for method NewRegionFrontloadReleaseClient.GenerateManifest + // HTTP status codes to indicate success: http.StatusOK + GenerateManifest func(ctx context.Context, providerNamespace string, properties armproviderhub.FrontloadPayload, options *armproviderhub.NewRegionFrontloadReleaseClientGenerateManifestOptions) (resp azfake.Responder[armproviderhub.NewRegionFrontloadReleaseClientGenerateManifestResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method NewRegionFrontloadReleaseClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, providerNamespace string, releaseName string, options *armproviderhub.NewRegionFrontloadReleaseClientGetOptions) (resp azfake.Responder[armproviderhub.NewRegionFrontloadReleaseClientGetResponse], errResp azfake.ErrorResponder) + + // Stop is the fake for method NewRegionFrontloadReleaseClient.Stop + // HTTP status codes to indicate success: http.StatusOK + Stop func(ctx context.Context, providerNamespace string, releaseName string, options *armproviderhub.NewRegionFrontloadReleaseClientStopOptions) (resp azfake.Responder[armproviderhub.NewRegionFrontloadReleaseClientStopResponse], errResp azfake.ErrorResponder) + + // ValidateManifest is the fake for method NewRegionFrontloadReleaseClient.ValidateManifest + // HTTP status codes to indicate success: http.StatusOK + ValidateManifest func(ctx context.Context, providerNamespace string, options *armproviderhub.NewRegionFrontloadReleaseClientValidateManifestOptions) (resp azfake.Responder[armproviderhub.NewRegionFrontloadReleaseClientValidateManifestResponse], errResp azfake.ErrorResponder) +} + +// NewNewRegionFrontloadReleaseServerTransport creates a new instance of NewRegionFrontloadReleaseServerTransport with the provided implementation. +// The returned NewRegionFrontloadReleaseServerTransport instance is connected to an instance of armproviderhub.NewRegionFrontloadReleaseClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewNewRegionFrontloadReleaseServerTransport(srv *NewRegionFrontloadReleaseServer) *NewRegionFrontloadReleaseServerTransport { + return &NewRegionFrontloadReleaseServerTransport{srv: srv} +} + +// NewRegionFrontloadReleaseServerTransport connects instances of armproviderhub.NewRegionFrontloadReleaseClient to instances of NewRegionFrontloadReleaseServer. +// Don't use this type directly, use NewNewRegionFrontloadReleaseServerTransport instead. +type NewRegionFrontloadReleaseServerTransport struct { + srv *NewRegionFrontloadReleaseServer +} + +// Do implements the policy.Transporter interface for NewRegionFrontloadReleaseServerTransport. +func (n *NewRegionFrontloadReleaseServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return n.dispatchToMethodFake(req, method) +} + +func (n *NewRegionFrontloadReleaseServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if newRegionFrontloadReleaseServerTransportInterceptor != nil { + res.resp, res.err, intercepted = newRegionFrontloadReleaseServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "NewRegionFrontloadReleaseClient.CreateOrUpdate": + res.resp, res.err = n.dispatchCreateOrUpdate(req) + case "NewRegionFrontloadReleaseClient.GenerateManifest": + res.resp, res.err = n.dispatchGenerateManifest(req) + case "NewRegionFrontloadReleaseClient.Get": + res.resp, res.err = n.dispatchGet(req) + case "NewRegionFrontloadReleaseClient.Stop": + res.resp, res.err = n.dispatchStop(req) + case "NewRegionFrontloadReleaseClient.ValidateManifest": + res.resp, res.err = n.dispatchValidateManifest(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (n *NewRegionFrontloadReleaseServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if n.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/newRegionFrontloadRelease/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armproviderhub.FrontloadPayload](req) + if err != nil { + return nil, err + } + providerNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerNamespace")]) + if err != nil { + return nil, err + } + releaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("releaseName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.CreateOrUpdate(req.Context(), providerNamespaceParam, releaseNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DefaultRollout, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (n *NewRegionFrontloadReleaseServerTransport) dispatchGenerateManifest(req *http.Request) (*http.Response, error) { + if n.srv.GenerateManifest == nil { + return nil, &nonRetriableError{errors.New("fake for method GenerateManifest not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/generateNewRegionFrontloadManifest` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armproviderhub.FrontloadPayload](req) + if err != nil { + return nil, err + } + providerNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerNamespace")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.GenerateManifest(req.Context(), providerNamespaceParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ResourceProviderManifest, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (n *NewRegionFrontloadReleaseServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if n.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/newRegionFrontloadRelease/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + providerNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerNamespace")]) + if err != nil { + return nil, err + } + releaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("releaseName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.Get(req.Context(), providerNamespaceParam, releaseNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DefaultRollout, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (n *NewRegionFrontloadReleaseServerTransport) dispatchStop(req *http.Request) (*http.Response, error) { + if n.srv.Stop == nil { + return nil, &nonRetriableError{errors.New("fake for method Stop not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/newRegionFrontloadRelease/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stop` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + providerNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerNamespace")]) + if err != nil { + return nil, err + } + releaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("releaseName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.Stop(req.Context(), providerNamespaceParam, releaseNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (n *NewRegionFrontloadReleaseServerTransport) dispatchValidateManifest(req *http.Request) (*http.Response, error) { + if n.srv.ValidateManifest == nil { + return nil, &nonRetriableError{errors.New("fake for method ValidateManifest not implemented")} + } + const regexStr = `/providers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/validateManifestAppliedInAllRegions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + providerNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerNamespace")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.ValidateManifest(req.Context(), providerNamespaceParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Value, req) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to NewRegionFrontloadReleaseServerTransport +var newRegionFrontloadReleaseServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/fake/notificationregistrations_server.go b/sdk/resourcemanager/providerhub/armproviderhub/fake/notificationregistrations_server.go index 5441a344940d..485d0dd88e13 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/fake/notificationregistrations_server.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/fake/notificationregistrations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub/v2" "net/http" "net/url" "regexp" @@ -66,27 +63,46 @@ func (n *NotificationRegistrationsServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return n.dispatchToMethodFake(req, method) +} - switch method { - case "NotificationRegistrationsClient.CreateOrUpdate": - resp, err = n.dispatchCreateOrUpdate(req) - case "NotificationRegistrationsClient.Delete": - resp, err = n.dispatchDelete(req) - case "NotificationRegistrationsClient.Get": - resp, err = n.dispatchGet(req) - case "NotificationRegistrationsClient.NewListByProviderRegistrationPager": - resp, err = n.dispatchNewListByProviderRegistrationPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (n *NotificationRegistrationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if notificationRegistrationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = notificationRegistrationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "NotificationRegistrationsClient.CreateOrUpdate": + res.resp, res.err = n.dispatchCreateOrUpdate(req) + case "NotificationRegistrationsClient.Delete": + res.resp, res.err = n.dispatchDelete(req) + case "NotificationRegistrationsClient.Get": + res.resp, res.err = n.dispatchGet(req) + case "NotificationRegistrationsClient.NewListByProviderRegistrationPager": + res.resp, res.err = n.dispatchNewListByProviderRegistrationPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (n *NotificationRegistrationsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -228,3 +244,9 @@ func (n *NotificationRegistrationsServerTransport) dispatchNewListByProviderRegi } return resp, nil } + +// set this to conditionally intercept incoming requests to NotificationRegistrationsServerTransport +var notificationRegistrationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/fake/operations_server.go b/sdk/resourcemanager/providerhub/armproviderhub/fake/operations_server.go index 6323ce2a5698..27f439f71762 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/fake/operations_server.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/fake/operations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub/v2" "net/http" "net/url" "regexp" @@ -66,27 +63,46 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "OperationsClient.CreateOrUpdate": - resp, err = o.dispatchCreateOrUpdate(req) - case "OperationsClient.Delete": - resp, err = o.dispatchDelete(req) - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - case "OperationsClient.ListByProviderRegistration": - resp, err = o.dispatchListByProviderRegistration(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return o.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.CreateOrUpdate": + res.resp, res.err = o.dispatchCreateOrUpdate(req) + case "OperationsClient.Delete": + res.resp, res.err = o.dispatchDelete(req) + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + case "OperationsClient.ListByProviderRegistration": + res.resp, res.err = o.dispatchListByProviderRegistration(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (o *OperationsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -115,7 +131,7 @@ func (o *OperationsServerTransport) dispatchCreateOrUpdate(req *http.Request) (* if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).OperationsContent, req) + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).OperationsPutContent, req) if err != nil { return nil, err } @@ -206,3 +222,9 @@ func (o *OperationsServerTransport) dispatchListByProviderRegistration(req *http } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/fake/providermonitorsettings_server.go b/sdk/resourcemanager/providerhub/armproviderhub/fake/providermonitorsettings_server.go new file mode 100644 index 000000000000..88c3f80372a5 --- /dev/null +++ b/sdk/resourcemanager/providerhub/armproviderhub/fake/providermonitorsettings_server.go @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub/v2" + "net/http" + "net/url" + "regexp" +) + +// ProviderMonitorSettingsServer is a fake server for instances of the armproviderhub.ProviderMonitorSettingsClient type. +type ProviderMonitorSettingsServer struct { + // BeginCreate is the fake for method ProviderMonitorSettingsClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreate func(ctx context.Context, resourceGroupName string, providerMonitorSettingName string, properties armproviderhub.ProviderMonitorSetting, options *armproviderhub.ProviderMonitorSettingsClientBeginCreateOptions) (resp azfake.PollerResponder[armproviderhub.ProviderMonitorSettingsClientCreateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method ProviderMonitorSettingsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, providerMonitorSettingName string, options *armproviderhub.ProviderMonitorSettingsClientDeleteOptions) (resp azfake.Responder[armproviderhub.ProviderMonitorSettingsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ProviderMonitorSettingsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, providerMonitorSettingName string, options *armproviderhub.ProviderMonitorSettingsClientGetOptions) (resp azfake.Responder[armproviderhub.ProviderMonitorSettingsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByResourceGroupPager is the fake for method ProviderMonitorSettingsClient.NewListByResourceGroupPager + // HTTP status codes to indicate success: http.StatusOK + NewListByResourceGroupPager func(resourceGroupName string, options *armproviderhub.ProviderMonitorSettingsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armproviderhub.ProviderMonitorSettingsClientListByResourceGroupResponse]) + + // NewListBySubscriptionPager is the fake for method ProviderMonitorSettingsClient.NewListBySubscriptionPager + // HTTP status codes to indicate success: http.StatusOK + NewListBySubscriptionPager func(options *armproviderhub.ProviderMonitorSettingsClientListBySubscriptionOptions) (resp azfake.PagerResponder[armproviderhub.ProviderMonitorSettingsClientListBySubscriptionResponse]) + + // Update is the fake for method ProviderMonitorSettingsClient.Update + // HTTP status codes to indicate success: http.StatusOK + Update func(ctx context.Context, resourceGroupName string, providerMonitorSettingName string, options *armproviderhub.ProviderMonitorSettingsClientUpdateOptions) (resp azfake.Responder[armproviderhub.ProviderMonitorSettingsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewProviderMonitorSettingsServerTransport creates a new instance of ProviderMonitorSettingsServerTransport with the provided implementation. +// The returned ProviderMonitorSettingsServerTransport instance is connected to an instance of armproviderhub.ProviderMonitorSettingsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewProviderMonitorSettingsServerTransport(srv *ProviderMonitorSettingsServer) *ProviderMonitorSettingsServerTransport { + return &ProviderMonitorSettingsServerTransport{ + srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armproviderhub.ProviderMonitorSettingsClientCreateResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armproviderhub.ProviderMonitorSettingsClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armproviderhub.ProviderMonitorSettingsClientListBySubscriptionResponse]](), + } +} + +// ProviderMonitorSettingsServerTransport connects instances of armproviderhub.ProviderMonitorSettingsClient to instances of ProviderMonitorSettingsServer. +// Don't use this type directly, use NewProviderMonitorSettingsServerTransport instead. +type ProviderMonitorSettingsServerTransport struct { + srv *ProviderMonitorSettingsServer + beginCreate *tracker[azfake.PollerResponder[armproviderhub.ProviderMonitorSettingsClientCreateResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armproviderhub.ProviderMonitorSettingsClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armproviderhub.ProviderMonitorSettingsClientListBySubscriptionResponse]] +} + +// Do implements the policy.Transporter interface for ProviderMonitorSettingsServerTransport. +func (p *ProviderMonitorSettingsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return p.dispatchToMethodFake(req, method) +} + +func (p *ProviderMonitorSettingsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if providerMonitorSettingsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = providerMonitorSettingsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ProviderMonitorSettingsClient.BeginCreate": + res.resp, res.err = p.dispatchBeginCreate(req) + case "ProviderMonitorSettingsClient.Delete": + res.resp, res.err = p.dispatchDelete(req) + case "ProviderMonitorSettingsClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "ProviderMonitorSettingsClient.NewListByResourceGroupPager": + res.resp, res.err = p.dispatchNewListByResourceGroupPager(req) + case "ProviderMonitorSettingsClient.NewListBySubscriptionPager": + res.resp, res.err = p.dispatchNewListBySubscriptionPager(req) + case "ProviderMonitorSettingsClient.Update": + res.resp, res.err = p.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (p *ProviderMonitorSettingsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { + if p.srv.BeginCreate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} + } + beginCreate := p.beginCreate.get(req) + if beginCreate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerMonitorSettings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armproviderhub.ProviderMonitorSetting](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + providerMonitorSettingNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerMonitorSettingName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.BeginCreate(req.Context(), resourceGroupNameParam, providerMonitorSettingNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreate = &respr + p.beginCreate.add(req, beginCreate) + } + + resp, err := server.PollerResponderNext(beginCreate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + p.beginCreate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreate) { + p.beginCreate.remove(req) + } + + return resp, nil +} + +func (p *ProviderMonitorSettingsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if p.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerMonitorSettings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + providerMonitorSettingNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerMonitorSettingName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.Delete(req.Context(), resourceGroupNameParam, providerMonitorSettingNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (p *ProviderMonitorSettingsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if p.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerMonitorSettings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + providerMonitorSettingNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerMonitorSettingName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.Get(req.Context(), resourceGroupNameParam, providerMonitorSettingNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ProviderMonitorSetting, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (p *ProviderMonitorSettingsServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { + if p.srv.NewListByResourceGroupPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} + } + newListByResourceGroupPager := p.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerMonitorSettings` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resp := p.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) + newListByResourceGroupPager = &resp + p.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armproviderhub.ProviderMonitorSettingsClientListByResourceGroupResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + p.newListByResourceGroupPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByResourceGroupPager) { + p.newListByResourceGroupPager.remove(req) + } + return resp, nil +} + +func (p *ProviderMonitorSettingsServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { + if p.srv.NewListBySubscriptionPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} + } + newListBySubscriptionPager := p.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerMonitorSettings` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resp := p.srv.NewListBySubscriptionPager(nil) + newListBySubscriptionPager = &resp + p.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armproviderhub.ProviderMonitorSettingsClientListBySubscriptionResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + p.newListBySubscriptionPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListBySubscriptionPager) { + p.newListBySubscriptionPager.remove(req) + } + return resp, nil +} + +func (p *ProviderMonitorSettingsServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { + if p.srv.Update == nil { + return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerMonitorSettings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + providerMonitorSettingNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerMonitorSettingName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.Update(req.Context(), resourceGroupNameParam, providerMonitorSettingNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ProviderMonitorSetting, req) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to ProviderMonitorSettingsServerTransport +var providerMonitorSettingsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/fake/providerregistrations_server.go b/sdk/resourcemanager/providerhub/armproviderhub/fake/providerregistrations_server.go index 1ff93b61ac51..82cb80f74fc1 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/fake/providerregistrations_server.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/fake/providerregistrations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub/v2" "net/http" "net/url" "regexp" @@ -72,29 +69,48 @@ func (p *ProviderRegistrationsServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "ProviderRegistrationsClient.BeginCreateOrUpdate": - resp, err = p.dispatchBeginCreateOrUpdate(req) - case "ProviderRegistrationsClient.Delete": - resp, err = p.dispatchDelete(req) - case "ProviderRegistrationsClient.GenerateOperations": - resp, err = p.dispatchGenerateOperations(req) - case "ProviderRegistrationsClient.Get": - resp, err = p.dispatchGet(req) - case "ProviderRegistrationsClient.NewListPager": - resp, err = p.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *ProviderRegistrationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if providerRegistrationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = providerRegistrationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ProviderRegistrationsClient.BeginCreateOrUpdate": + res.resp, res.err = p.dispatchBeginCreateOrUpdate(req) + case "ProviderRegistrationsClient.Delete": + res.resp, res.err = p.dispatchDelete(req) + case "ProviderRegistrationsClient.GenerateOperations": + res.resp, res.err = p.dispatchGenerateOperations(req) + case "ProviderRegistrationsClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "ProviderRegistrationsClient.NewListPager": + res.resp, res.err = p.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *ProviderRegistrationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -260,3 +276,9 @@ func (p *ProviderRegistrationsServerTransport) dispatchNewListPager(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to ProviderRegistrationsServerTransport +var providerRegistrationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/fake/resourceactions_server.go b/sdk/resourcemanager/providerhub/armproviderhub/fake/resourceactions_server.go new file mode 100644 index 000000000000..ae6b69d3e2e2 --- /dev/null +++ b/sdk/resourcemanager/providerhub/armproviderhub/fake/resourceactions_server.go @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub/v2" + "net/http" + "net/url" + "regexp" +) + +// ResourceActionsServer is a fake server for instances of the armproviderhub.ResourceActionsClient type. +type ResourceActionsServer struct { + // BeginDeleteResources is the fake for method ResourceActionsClient.BeginDeleteResources + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDeleteResources func(ctx context.Context, providerNamespace string, resourceActionName string, properties armproviderhub.ResourceManagementAction, options *armproviderhub.ResourceActionsClientBeginDeleteResourcesOptions) (resp azfake.PollerResponder[armproviderhub.ResourceActionsClientDeleteResourcesResponse], errResp azfake.ErrorResponder) +} + +// NewResourceActionsServerTransport creates a new instance of ResourceActionsServerTransport with the provided implementation. +// The returned ResourceActionsServerTransport instance is connected to an instance of armproviderhub.ResourceActionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewResourceActionsServerTransport(srv *ResourceActionsServer) *ResourceActionsServerTransport { + return &ResourceActionsServerTransport{ + srv: srv, + beginDeleteResources: newTracker[azfake.PollerResponder[armproviderhub.ResourceActionsClientDeleteResourcesResponse]](), + } +} + +// ResourceActionsServerTransport connects instances of armproviderhub.ResourceActionsClient to instances of ResourceActionsServer. +// Don't use this type directly, use NewResourceActionsServerTransport instead. +type ResourceActionsServerTransport struct { + srv *ResourceActionsServer + beginDeleteResources *tracker[azfake.PollerResponder[armproviderhub.ResourceActionsClientDeleteResourcesResponse]] +} + +// Do implements the policy.Transporter interface for ResourceActionsServerTransport. +func (r *ResourceActionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return r.dispatchToMethodFake(req, method) +} + +func (r *ResourceActionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if resourceActionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = resourceActionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ResourceActionsClient.BeginDeleteResources": + res.resp, res.err = r.dispatchBeginDeleteResources(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (r *ResourceActionsServerTransport) dispatchBeginDeleteResources(req *http.Request) (*http.Response, error) { + if r.srv.BeginDeleteResources == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDeleteResources not implemented")} + } + beginDeleteResources := r.beginDeleteResources.get(req) + if beginDeleteResources == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceActions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deleteResources` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armproviderhub.ResourceManagementAction](req) + if err != nil { + return nil, err + } + providerNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerNamespace")]) + if err != nil { + return nil, err + } + resourceActionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceActionName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginDeleteResources(req.Context(), providerNamespaceParam, resourceActionNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDeleteResources = &respr + r.beginDeleteResources.add(req, beginDeleteResources) + } + + resp, err := server.PollerResponderNext(beginDeleteResources, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginDeleteResources.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDeleteResources) { + r.beginDeleteResources.remove(req) + } + + return resp, nil +} + +// set this to conditionally intercept incoming requests to ResourceActionsServerTransport +var resourceActionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/fake/resourcetyperegistrations_server.go b/sdk/resourcemanager/providerhub/armproviderhub/fake/resourcetyperegistrations_server.go index e12f6277ef23..8e0fbb7631c8 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/fake/resourcetyperegistrations_server.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/fake/resourcetyperegistrations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub/v2" "net/http" "net/url" "regexp" @@ -28,9 +25,9 @@ type ResourceTypeRegistrationsServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated BeginCreateOrUpdate func(ctx context.Context, providerNamespace string, resourceType string, properties armproviderhub.ResourceTypeRegistration, options *armproviderhub.ResourceTypeRegistrationsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armproviderhub.ResourceTypeRegistrationsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - // Delete is the fake for method ResourceTypeRegistrationsClient.Delete - // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent - Delete func(ctx context.Context, providerNamespace string, resourceType string, options *armproviderhub.ResourceTypeRegistrationsClientDeleteOptions) (resp azfake.Responder[armproviderhub.ResourceTypeRegistrationsClientDeleteResponse], errResp azfake.ErrorResponder) + // BeginDelete is the fake for method ResourceTypeRegistrationsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, providerNamespace string, resourceType string, options *armproviderhub.ResourceTypeRegistrationsClientBeginDeleteOptions) (resp azfake.PollerResponder[armproviderhub.ResourceTypeRegistrationsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method ResourceTypeRegistrationsClient.Get // HTTP status codes to indicate success: http.StatusOK @@ -48,6 +45,7 @@ func NewResourceTypeRegistrationsServerTransport(srv *ResourceTypeRegistrationsS return &ResourceTypeRegistrationsServerTransport{ srv: srv, beginCreateOrUpdate: newTracker[azfake.PollerResponder[armproviderhub.ResourceTypeRegistrationsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armproviderhub.ResourceTypeRegistrationsClientDeleteResponse]](), newListByProviderRegistrationPager: newTracker[azfake.PagerResponder[armproviderhub.ResourceTypeRegistrationsClientListByProviderRegistrationResponse]](), } } @@ -57,6 +55,7 @@ func NewResourceTypeRegistrationsServerTransport(srv *ResourceTypeRegistrationsS type ResourceTypeRegistrationsServerTransport struct { srv *ResourceTypeRegistrationsServer beginCreateOrUpdate *tracker[azfake.PollerResponder[armproviderhub.ResourceTypeRegistrationsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armproviderhub.ResourceTypeRegistrationsClientDeleteResponse]] newListByProviderRegistrationPager *tracker[azfake.PagerResponder[armproviderhub.ResourceTypeRegistrationsClientListByProviderRegistrationResponse]] } @@ -68,27 +67,46 @@ func (r *ResourceTypeRegistrationsServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "ResourceTypeRegistrationsClient.BeginCreateOrUpdate": - resp, err = r.dispatchBeginCreateOrUpdate(req) - case "ResourceTypeRegistrationsClient.Delete": - resp, err = r.dispatchDelete(req) - case "ResourceTypeRegistrationsClient.Get": - resp, err = r.dispatchGet(req) - case "ResourceTypeRegistrationsClient.NewListByProviderRegistrationPager": - resp, err = r.dispatchNewListByProviderRegistrationPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *ResourceTypeRegistrationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if resourceTypeRegistrationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = resourceTypeRegistrationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ResourceTypeRegistrationsClient.BeginCreateOrUpdate": + res.resp, res.err = r.dispatchBeginCreateOrUpdate(req) + case "ResourceTypeRegistrationsClient.BeginDelete": + res.resp, res.err = r.dispatchBeginDelete(req) + case "ResourceTypeRegistrationsClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "ResourceTypeRegistrationsClient.NewListByProviderRegistrationPager": + res.resp, res.err = r.dispatchNewListByProviderRegistrationPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *ResourceTypeRegistrationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -139,36 +157,47 @@ func (r *ResourceTypeRegistrationsServerTransport) dispatchBeginCreateOrUpdate(r return resp, nil } -func (r *ResourceTypeRegistrationsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { - if r.srv.Delete == nil { - return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} +func (r *ResourceTypeRegistrationsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if r.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcetypeRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - providerNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerNamespace")]) - if err != nil { - return nil, err + beginDelete := r.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ProviderHub/providerRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcetypeRegistrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + providerNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("providerNamespace")]) + if err != nil { + return nil, err + } + resourceTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceType")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginDelete(req.Context(), providerNamespaceParam, resourceTypeParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + r.beginDelete.add(req, beginDelete) } - resourceTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceType")]) + + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } - respr, errRespr := r.srv.Delete(req.Context(), providerNamespaceParam, resourceTypeParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - resp, err := server.NewResponse(respContent, req, nil) - if err != nil { - return nil, err + if !server.PollerResponderMore(beginDelete) { + r.beginDelete.remove(req) } + return resp, nil } @@ -241,3 +270,9 @@ func (r *ResourceTypeRegistrationsServerTransport) dispatchNewListByProviderRegi } return resp, nil } + +// set this to conditionally intercept incoming requests to ResourceTypeRegistrationsServerTransport +var resourceTypeRegistrationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/fake/server.go b/sdk/resourcemanager/providerhub/armproviderhub/fake/server.go index 9cc27cb71dac..e441e4c65bd6 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/fake/server.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/fake/server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub/v2" "net/http" "net/url" "regexp" @@ -53,23 +50,42 @@ func (s *ServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "Client.CheckinManifest": - resp, err = s.dispatchCheckinManifest(req) - case "Client.GenerateManifest": - resp, err = s.dispatchGenerateManifest(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if serverTransportInterceptor != nil { + res.resp, res.err, intercepted = serverTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "Client.CheckinManifest": + res.resp, res.err = s.dispatchCheckinManifest(req) + case "Client.GenerateManifest": + res.resp, res.err = s.dispatchGenerateManifest(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServerTransport) dispatchCheckinManifest(req *http.Request) (*http.Response, error) { @@ -133,3 +149,9 @@ func (s *ServerTransport) dispatchGenerateManifest(req *http.Request) (*http.Res } return resp, nil } + +// set this to conditionally intercept incoming requests to ServerTransport +var serverTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/fake/server_factory.go b/sdk/resourcemanager/providerhub/armproviderhub/fake/server_factory.go index c84d919c10ea..491fca6edebf 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/fake/server_factory.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/fake/server_factory.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -19,14 +16,41 @@ import ( // ServerFactory is a fake server for instances of the armproviderhub.ClientFactory type. type ServerFactory struct { - Server Server - CustomRolloutsServer CustomRolloutsServer - DefaultRolloutsServer DefaultRolloutsServer + // AuthorizedApplicationsServer contains the fakes for client AuthorizedApplicationsClient + AuthorizedApplicationsServer AuthorizedApplicationsServer + + // Server contains the fakes for client Client + Server Server + + // CustomRolloutsServer contains the fakes for client CustomRolloutsClient + CustomRolloutsServer CustomRolloutsServer + + // DefaultRolloutsServer contains the fakes for client DefaultRolloutsClient + DefaultRolloutsServer DefaultRolloutsServer + + // NewRegionFrontloadReleaseServer contains the fakes for client NewRegionFrontloadReleaseClient + NewRegionFrontloadReleaseServer NewRegionFrontloadReleaseServer + + // NotificationRegistrationsServer contains the fakes for client NotificationRegistrationsClient NotificationRegistrationsServer NotificationRegistrationsServer - OperationsServer OperationsServer - ProviderRegistrationsServer ProviderRegistrationsServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // ProviderMonitorSettingsServer contains the fakes for client ProviderMonitorSettingsClient + ProviderMonitorSettingsServer ProviderMonitorSettingsServer + + // ProviderRegistrationsServer contains the fakes for client ProviderRegistrationsClient + ProviderRegistrationsServer ProviderRegistrationsServer + + // ResourceActionsServer contains the fakes for client ResourceActionsClient + ResourceActionsServer ResourceActionsServer + + // ResourceTypeRegistrationsServer contains the fakes for client ResourceTypeRegistrationsClient ResourceTypeRegistrationsServer ResourceTypeRegistrationsServer - SKUsServer SKUsServer + + // SKUsServer contains the fakes for client SKUsClient + SKUsServer SKUsServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -43,12 +67,16 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { type ServerFactoryTransport struct { srv *ServerFactory trMu sync.Mutex + trAuthorizedApplicationsServer *AuthorizedApplicationsServerTransport trServer *ServerTransport trCustomRolloutsServer *CustomRolloutsServerTransport trDefaultRolloutsServer *DefaultRolloutsServerTransport + trNewRegionFrontloadReleaseServer *NewRegionFrontloadReleaseServerTransport trNotificationRegistrationsServer *NotificationRegistrationsServerTransport trOperationsServer *OperationsServerTransport + trProviderMonitorSettingsServer *ProviderMonitorSettingsServerTransport trProviderRegistrationsServer *ProviderRegistrationsServerTransport + trResourceActionsServer *ResourceActionsServerTransport trResourceTypeRegistrationsServer *ResourceTypeRegistrationsServerTransport trSKUsServer *SKUsServerTransport } @@ -66,6 +94,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { var err error switch client { + case "AuthorizedApplicationsClient": + initServer(s, &s.trAuthorizedApplicationsServer, func() *AuthorizedApplicationsServerTransport { + return NewAuthorizedApplicationsServerTransport(&s.srv.AuthorizedApplicationsServer) + }) + resp, err = s.trAuthorizedApplicationsServer.Do(req) case "Client": initServer(s, &s.trServer, func() *ServerTransport { return NewServerTransport(&s.srv.Server) }) resp, err = s.trServer.Do(req) @@ -79,6 +112,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewDefaultRolloutsServerTransport(&s.srv.DefaultRolloutsServer) }) resp, err = s.trDefaultRolloutsServer.Do(req) + case "NewRegionFrontloadReleaseClient": + initServer(s, &s.trNewRegionFrontloadReleaseServer, func() *NewRegionFrontloadReleaseServerTransport { + return NewNewRegionFrontloadReleaseServerTransport(&s.srv.NewRegionFrontloadReleaseServer) + }) + resp, err = s.trNewRegionFrontloadReleaseServer.Do(req) case "NotificationRegistrationsClient": initServer(s, &s.trNotificationRegistrationsServer, func() *NotificationRegistrationsServerTransport { return NewNotificationRegistrationsServerTransport(&s.srv.NotificationRegistrationsServer) @@ -87,11 +125,21 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) + case "ProviderMonitorSettingsClient": + initServer(s, &s.trProviderMonitorSettingsServer, func() *ProviderMonitorSettingsServerTransport { + return NewProviderMonitorSettingsServerTransport(&s.srv.ProviderMonitorSettingsServer) + }) + resp, err = s.trProviderMonitorSettingsServer.Do(req) case "ProviderRegistrationsClient": initServer(s, &s.trProviderRegistrationsServer, func() *ProviderRegistrationsServerTransport { return NewProviderRegistrationsServerTransport(&s.srv.ProviderRegistrationsServer) }) resp, err = s.trProviderRegistrationsServer.Do(req) + case "ResourceActionsClient": + initServer(s, &s.trResourceActionsServer, func() *ResourceActionsServerTransport { + return NewResourceActionsServerTransport(&s.srv.ResourceActionsServer) + }) + resp, err = s.trResourceActionsServer.Do(req) case "ResourceTypeRegistrationsClient": initServer(s, &s.trResourceTypeRegistrationsServer, func() *ResourceTypeRegistrationsServerTransport { return NewResourceTypeRegistrationsServerTransport(&s.srv.ResourceTypeRegistrationsServer) diff --git a/sdk/resourcemanager/providerhub/armproviderhub/fake/skus_server.go b/sdk/resourcemanager/providerhub/armproviderhub/fake/skus_server.go index 6cb2306cb5f6..2abcdc724388 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/fake/skus_server.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/fake/skus_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub/v2" "net/http" "net/url" "regexp" @@ -120,51 +117,70 @@ func (s *SKUsServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "SKUsClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "SKUsClient.CreateOrUpdateNestedResourceTypeFirst": - resp, err = s.dispatchCreateOrUpdateNestedResourceTypeFirst(req) - case "SKUsClient.CreateOrUpdateNestedResourceTypeSecond": - resp, err = s.dispatchCreateOrUpdateNestedResourceTypeSecond(req) - case "SKUsClient.CreateOrUpdateNestedResourceTypeThird": - resp, err = s.dispatchCreateOrUpdateNestedResourceTypeThird(req) - case "SKUsClient.Delete": - resp, err = s.dispatchDelete(req) - case "SKUsClient.DeleteNestedResourceTypeFirst": - resp, err = s.dispatchDeleteNestedResourceTypeFirst(req) - case "SKUsClient.DeleteNestedResourceTypeSecond": - resp, err = s.dispatchDeleteNestedResourceTypeSecond(req) - case "SKUsClient.DeleteNestedResourceTypeThird": - resp, err = s.dispatchDeleteNestedResourceTypeThird(req) - case "SKUsClient.Get": - resp, err = s.dispatchGet(req) - case "SKUsClient.GetNestedResourceTypeFirst": - resp, err = s.dispatchGetNestedResourceTypeFirst(req) - case "SKUsClient.GetNestedResourceTypeSecond": - resp, err = s.dispatchGetNestedResourceTypeSecond(req) - case "SKUsClient.GetNestedResourceTypeThird": - resp, err = s.dispatchGetNestedResourceTypeThird(req) - case "SKUsClient.NewListByResourceTypeRegistrationsPager": - resp, err = s.dispatchNewListByResourceTypeRegistrationsPager(req) - case "SKUsClient.NewListByResourceTypeRegistrationsNestedResourceTypeFirstPager": - resp, err = s.dispatchNewListByResourceTypeRegistrationsNestedResourceTypeFirstPager(req) - case "SKUsClient.NewListByResourceTypeRegistrationsNestedResourceTypeSecondPager": - resp, err = s.dispatchNewListByResourceTypeRegistrationsNestedResourceTypeSecondPager(req) - case "SKUsClient.NewListByResourceTypeRegistrationsNestedResourceTypeThirdPager": - resp, err = s.dispatchNewListByResourceTypeRegistrationsNestedResourceTypeThirdPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return s.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (s *SKUsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if skUsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = skUsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SKUsClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SKUsClient.CreateOrUpdateNestedResourceTypeFirst": + res.resp, res.err = s.dispatchCreateOrUpdateNestedResourceTypeFirst(req) + case "SKUsClient.CreateOrUpdateNestedResourceTypeSecond": + res.resp, res.err = s.dispatchCreateOrUpdateNestedResourceTypeSecond(req) + case "SKUsClient.CreateOrUpdateNestedResourceTypeThird": + res.resp, res.err = s.dispatchCreateOrUpdateNestedResourceTypeThird(req) + case "SKUsClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "SKUsClient.DeleteNestedResourceTypeFirst": + res.resp, res.err = s.dispatchDeleteNestedResourceTypeFirst(req) + case "SKUsClient.DeleteNestedResourceTypeSecond": + res.resp, res.err = s.dispatchDeleteNestedResourceTypeSecond(req) + case "SKUsClient.DeleteNestedResourceTypeThird": + res.resp, res.err = s.dispatchDeleteNestedResourceTypeThird(req) + case "SKUsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SKUsClient.GetNestedResourceTypeFirst": + res.resp, res.err = s.dispatchGetNestedResourceTypeFirst(req) + case "SKUsClient.GetNestedResourceTypeSecond": + res.resp, res.err = s.dispatchGetNestedResourceTypeSecond(req) + case "SKUsClient.GetNestedResourceTypeThird": + res.resp, res.err = s.dispatchGetNestedResourceTypeThird(req) + case "SKUsClient.NewListByResourceTypeRegistrationsPager": + res.resp, res.err = s.dispatchNewListByResourceTypeRegistrationsPager(req) + case "SKUsClient.NewListByResourceTypeRegistrationsNestedResourceTypeFirstPager": + res.resp, res.err = s.dispatchNewListByResourceTypeRegistrationsNestedResourceTypeFirstPager(req) + case "SKUsClient.NewListByResourceTypeRegistrationsNestedResourceTypeSecondPager": + res.resp, res.err = s.dispatchNewListByResourceTypeRegistrationsNestedResourceTypeSecondPager(req) + case "SKUsClient.NewListByResourceTypeRegistrationsNestedResourceTypeThirdPager": + res.resp, res.err = s.dispatchNewListByResourceTypeRegistrationsNestedResourceTypeThirdPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SKUsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -886,3 +902,9 @@ func (s *SKUsServerTransport) dispatchNewListByResourceTypeRegistrationsNestedRe } return resp, nil } + +// set this to conditionally intercept incoming requests to SKUsServerTransport +var skUsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/fake/time_rfc3339.go b/sdk/resourcemanager/providerhub/armproviderhub/fake/time_rfc3339.go deleted file mode 100644 index b0535a7b63e6..000000000000 --- a/sdk/resourcemanager/providerhub/armproviderhub/fake/time_rfc3339.go +++ /dev/null @@ -1,86 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) - -const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { - layout = dateTimeJSON - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { - layout = time.RFC3339Nano - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/go.mod b/sdk/resourcemanager/providerhub/armproviderhub/go.mod index bea88dd27694..22eeeb73e365 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/go.mod +++ b/sdk/resourcemanager/providerhub/armproviderhub/go.mod @@ -1,21 +1,11 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/providerhub/armproviderhub/v2 go 1.23.0 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.36.0 // indirect golang.org/x/net v0.38.0 // indirect - golang.org/x/sys v0.31.0 // indirect golang.org/x/text v0.23.0 // indirect ) diff --git a/sdk/resourcemanager/providerhub/armproviderhub/go.sum b/sdk/resourcemanager/providerhub/armproviderhub/go.sum index 4bacf756f06c..4de695d9e23a 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/go.sum +++ b/sdk/resourcemanager/providerhub/armproviderhub/go.sum @@ -1,44 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 h1:DSDNVxqkoXJiko6x8a90zidoYqnYYa6c1MTzDKzKkTo= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1/go.mod h1:zGqV2R4Cr/k8Uye5w+dgQ06WJtEcbQG/8J7BB6hnCr4= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 h1:F0gBpfdPLGsw+nsgk6aqqkZS1jiixa5WwFe3fk/T3Ys= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2/go.mod h1:SqINnQ9lVVdRlyC8cd1lCI0SdX4n2paeABd2K8ggfnE= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6/go.mod h1:3VeWNIJaW+O5xpRQbPp0Ybqu1vJd/pm7s2F473HRrkw= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E= -github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/providerhub/armproviderhub/models.go b/sdk/resourcemanager/providerhub/armproviderhub/models.go index d172aad8b915..7938737e4a14 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/models.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/models.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -10,29 +7,139 @@ package armproviderhub import "time" +type APIProfile struct { + // Api version. + APIVersion *string + + // Profile version. + ProfileVersion *string +} + +type AdditionalAuthorization struct { + ApplicationID *string + RoleDefinitionID *string +} + +type AllowedResourceName struct { + // Get action verb. + GetActionVerb *string + + // Resource name. + Name *string +} + +type AllowedUnauthorizedActionsExtension struct { + // The action. + Action *string + + // The intent. + Intent *Intent +} + +type ApplicationDataAuthorization struct { + // REQUIRED; The ownership role the application has on the resource types. The service owner role gives the application owner + // permissions. The limited owner role gives elevated permissions but does not allow all + // the permissions of a service owner, such as read/write on internal metadata. + Role *Role + + // The resource types from the defined resource types in the provider namespace that the application can access. If no resource + // types are specified and the role is service owner, the default is * which + // is all resource types + ResourceTypes []*string +} + +type ApplicationProviderAuthorization struct { + // The managed by role definition ID for the application. + ManagedByRoleDefinitionID *string + + // The role definition ID for the application. + RoleDefinitionID *string +} + +type AsyncOperationPollingRules struct { + // The additional options. + AdditionalOptions *AdditionalOptionsAsyncOperation + + // The authorization actions. + AuthorizationActions []*string +} + +type AsyncTimeoutRule struct { + ActionName *string + + // This is a TimeSpan property + Timeout *string +} + type AuthorizationActionMapping struct { - Desired *string + // The desired action name. + Desired *string + + // The original action name. Original *string } +type AuthorizedApplication struct { + Properties *AuthorizedApplicationProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +type AuthorizedApplicationArrayResponseWithContinuation struct { + // The URL to get to the next set of results, if there are any. + NextLink *string + + // The value. + Value []*AuthorizedApplication +} + +type AuthorizedApplicationProperties struct { + // The authorizations that determine the level of data access permissions on the specified resource types. + DataAuthorizations []*ApplicationDataAuthorization + ProviderAuthorization *ApplicationProviderAuthorization + + // READ-ONLY; The provisioning state. + ProvisioningState *ProvisioningState +} + type CanaryTrafficRegionRolloutConfiguration struct { - Regions []*string + // The regions. + Regions []*string + + // The skip regions. SkipRegions []*string } type CheckNameAvailabilitySpecifications struct { - EnableDefaultValidation *bool + // Whether default validation is enabled. + EnableDefaultValidation *bool + + // The resource types with custom validation. ResourceTypesWithCustomValidation []*string } type CheckinManifestInfo struct { - // REQUIRED + // REQUIRED; Whether the manifest is checked in. IsCheckedIn *bool - // REQUIRED + // REQUIRED; The status message. StatusMessage *string - CommitID *string - PullRequest *string + + // The commit id. + CommitID *string + + // The pull request. + PullRequest *string } type CheckinManifestParams struct { @@ -43,7 +150,6 @@ type CheckinManifestParams struct { Environment *string } -// CustomRollout - Rollout details. type CustomRollout struct { // REQUIRED; Properties of the rollout. Properties *CustomRolloutProperties @@ -54,6 +160,9 @@ type CustomRollout struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -64,47 +173,92 @@ type CustomRolloutArrayResponseWithContinuation struct { Value []*CustomRollout } -// CustomRolloutProperties - Properties of the rollout. type CustomRolloutProperties struct { - // REQUIRED - Specification *CustomRolloutPropertiesSpecification - ProvisioningState *ProvisioningState - Status *CustomRolloutPropertiesStatus -} + // REQUIRED; The specification. + Specification *CustomRolloutPropertiesSpecification + + // The status. + Status *CustomRolloutPropertiesStatus -type CustomRolloutPropertiesAutoGenerated struct { - // REQUIRED - Specification *CustomRolloutPropertiesSpecification + // READ-ONLY; The provisioned state of the resource. ProvisioningState *ProvisioningState - Status *CustomRolloutPropertiesStatus } +// CustomRolloutPropertiesSpecification - The specification. type CustomRolloutPropertiesSpecification struct { - // REQUIRED - Canary *CustomRolloutSpecificationCanary - ProviderRegistration *CustomRolloutSpecificationProviderRegistration + // The auto provisioning configuration. + AutoProvisionConfig *CustomRolloutSpecificationAutoProvisionConfig + + // The canary region configuration. + Canary *CustomRolloutSpecificationCanary + + // The provider registration. + ProviderRegistration *CustomRolloutSpecificationProviderRegistration + + // Whether refreshing subscription registration is enabled or disabled. + RefreshSubscriptionRegistration *bool + + // The release scopes. + ReleaseScopes []*string + + // The resource type registrations. ResourceTypeRegistrations []*ResourceTypeRegistration + + // Whether release scope validation should be skipped. + SkipReleaseScopeValidation *bool } +// CustomRolloutPropertiesStatus - The status. type CustomRolloutPropertiesStatus struct { + // The completed regions. CompletedRegions []*string - // Dictionary of + // The failed or skipped regions. FailedOrSkippedRegions map[string]*ExtendedErrorInfo + + // The manifest checkin status. + ManifestCheckinStatus *CustomRolloutStatusManifestCheckinStatus } type CustomRolloutSpecification struct { - // REQUIRED - Canary *CustomRolloutSpecificationCanary - ProviderRegistration *CustomRolloutSpecificationProviderRegistration + // The auto provisioning configuration. + AutoProvisionConfig *CustomRolloutSpecificationAutoProvisionConfig + + // The canary region configuration. + Canary *CustomRolloutSpecificationCanary + + // The provider registration. + ProviderRegistration *CustomRolloutSpecificationProviderRegistration + + // Whether refreshing subscription registration is enabled or disabled. + RefreshSubscriptionRegistration *bool + + // The release scopes. + ReleaseScopes []*string + + // The resource type registrations. ResourceTypeRegistrations []*ResourceTypeRegistration + + // Whether release scope validation should be skipped. + SkipReleaseScopeValidation *bool +} + +// CustomRolloutSpecificationAutoProvisionConfig - The auto provisioning configuration. +type CustomRolloutSpecificationAutoProvisionConfig struct { + ResourceGraph *bool + Storage *bool } +// CustomRolloutSpecificationCanary - The canary region configuration. type CustomRolloutSpecificationCanary struct { Regions []*string } +// CustomRolloutSpecificationProviderRegistration - The provider registration. type CustomRolloutSpecificationProviderRegistration struct { + // Provider registration kind. This Metadata is also used by portal/tooling/etc to render different UX experiences for resources + // of the same type. + Kind *ProviderRegistrationKind Properties *ProviderRegistrationProperties // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -113,18 +267,39 @@ type CustomRolloutSpecificationProviderRegistration struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } type CustomRolloutStatus struct { + // The completed regions. CompletedRegions []*string - // Dictionary of + // The failed or skipped regions. FailedOrSkippedRegions map[string]*ExtendedErrorInfo + + // The manifest checkin status. + ManifestCheckinStatus *CustomRolloutStatusManifestCheckinStatus +} + +// CustomRolloutStatusManifestCheckinStatus - The manifest checkin status. +type CustomRolloutStatusManifestCheckinStatus struct { + // REQUIRED; Whether the manifest is checked in. + IsCheckedIn *bool + + // REQUIRED; The status message. + StatusMessage *string + + // The commit id. + CommitID *string + + // The pull request. + PullRequest *string } -// DefaultRollout - Default rollout definition. type DefaultRollout struct { // Properties of the rollout. Properties *DefaultRolloutProperties @@ -135,6 +310,9 @@ type DefaultRollout struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -145,72 +323,156 @@ type DefaultRolloutArrayResponseWithContinuation struct { Value []*DefaultRollout } -// DefaultRolloutProperties - Properties of the rollout. type DefaultRolloutProperties struct { - ProvisioningState *ProvisioningState - Specification *DefaultRolloutPropertiesSpecification - Status *DefaultRolloutPropertiesStatus -} + // The default rollout specification. + Specification *DefaultRolloutPropertiesSpecification + + // The default rollout status. + Status *DefaultRolloutPropertiesStatus -type DefaultRolloutPropertiesAutoGenerated struct { + // READ-ONLY; The provisioned state of the resource. ProvisioningState *ProvisioningState - Specification *DefaultRolloutPropertiesSpecification - Status *DefaultRolloutPropertiesStatus } +// DefaultRolloutPropertiesSpecification - The default rollout specification. type DefaultRolloutPropertiesSpecification struct { - Canary *DefaultRolloutSpecificationCanary - HighTraffic *DefaultRolloutSpecificationHighTraffic - LowTraffic *DefaultRolloutSpecificationLowTraffic - MediumTraffic *DefaultRolloutSpecificationMediumTraffic - ProviderRegistration *DefaultRolloutSpecificationProviderRegistration + // The auto provisioning config. + AutoProvisionConfig *DefaultRolloutSpecificationAutoProvisionConfig + + // The canary traffic region configuration. + Canary *DefaultRolloutSpecificationCanary + + // The expedited rollout definition. + ExpeditedRollout *DefaultRolloutSpecificationExpeditedRollout + + // The high traffic region configuration. + HighTraffic *DefaultRolloutSpecificationHighTraffic + + // The low traffic region configuration. + LowTraffic *DefaultRolloutSpecificationLowTraffic + + // The medium traffic region configuration. + MediumTraffic *DefaultRolloutSpecificationMediumTraffic + + // The provider registration. + ProviderRegistration *DefaultRolloutSpecificationProviderRegistration + + // The resource type registrations. ResourceTypeRegistrations []*ResourceTypeRegistration - RestOfTheWorldGroupOne *DefaultRolloutSpecificationRestOfTheWorldGroupOne - RestOfTheWorldGroupTwo *DefaultRolloutSpecificationRestOfTheWorldGroupTwo + + // The rest of the world group one region configuration. + RestOfTheWorldGroupOne *DefaultRolloutSpecificationRestOfTheWorldGroupOne + + // The rest of the world group two region configuration. + RestOfTheWorldGroupTwo *DefaultRolloutSpecificationRestOfTheWorldGroupTwo } +// DefaultRolloutPropertiesStatus - The default rollout status. type DefaultRolloutPropertiesStatus struct { + // The completed regions. CompletedRegions []*string - // Dictionary of - FailedOrSkippedRegions map[string]*ExtendedErrorInfo - NextTrafficRegion *TrafficRegionCategory - NextTrafficRegionScheduledTime *time.Time + // The failed or skipped regions. + FailedOrSkippedRegions map[string]*ExtendedErrorInfo + + // The manifest checkin status. + ManifestCheckinStatus *DefaultRolloutStatusManifestCheckinStatus + + // The next traffic region. + NextTrafficRegion *TrafficRegionCategory + + // The next traffic region scheduled time. + NextTrafficRegionScheduledTime *time.Time + + // The subscription reregistration result. SubscriptionReregistrationResult *SubscriptionReregistrationResult } type DefaultRolloutSpecification struct { - Canary *DefaultRolloutSpecificationCanary - HighTraffic *DefaultRolloutSpecificationHighTraffic - LowTraffic *DefaultRolloutSpecificationLowTraffic - MediumTraffic *DefaultRolloutSpecificationMediumTraffic - ProviderRegistration *DefaultRolloutSpecificationProviderRegistration + // The auto provisioning config. + AutoProvisionConfig *DefaultRolloutSpecificationAutoProvisionConfig + + // The canary traffic region configuration. + Canary *DefaultRolloutSpecificationCanary + + // The expedited rollout definition. + ExpeditedRollout *DefaultRolloutSpecificationExpeditedRollout + + // The high traffic region configuration. + HighTraffic *DefaultRolloutSpecificationHighTraffic + + // The low traffic region configuration. + LowTraffic *DefaultRolloutSpecificationLowTraffic + + // The medium traffic region configuration. + MediumTraffic *DefaultRolloutSpecificationMediumTraffic + + // The provider registration. + ProviderRegistration *DefaultRolloutSpecificationProviderRegistration + + // The resource type registrations. ResourceTypeRegistrations []*ResourceTypeRegistration - RestOfTheWorldGroupOne *DefaultRolloutSpecificationRestOfTheWorldGroupOne - RestOfTheWorldGroupTwo *DefaultRolloutSpecificationRestOfTheWorldGroupTwo + + // The rest of the world group one region configuration. + RestOfTheWorldGroupOne *DefaultRolloutSpecificationRestOfTheWorldGroupOne + + // The rest of the world group two region configuration. + RestOfTheWorldGroupTwo *DefaultRolloutSpecificationRestOfTheWorldGroupTwo +} + +// DefaultRolloutSpecificationAutoProvisionConfig - The auto provisioning config. +type DefaultRolloutSpecificationAutoProvisionConfig struct { + // Whether auto provisioning for resource graph is enabled. + ResourceGraph *bool + + // Whether auto provisioning for storage is enabled. + Storage *bool } +// DefaultRolloutSpecificationCanary - The canary traffic region configuration. type DefaultRolloutSpecificationCanary struct { - Regions []*string + // The regions. + Regions []*string + + // The skip regions. SkipRegions []*string } +// DefaultRolloutSpecificationExpeditedRollout - The expedited rollout definition. +type DefaultRolloutSpecificationExpeditedRollout struct { + // Indicates whether expedited rollout is enabled/disabled + Enabled *bool +} + +// DefaultRolloutSpecificationHighTraffic - The high traffic region configuration. type DefaultRolloutSpecificationHighTraffic struct { - Regions []*string + Regions []*string + + // The wait duration. WaitDuration *string } +// DefaultRolloutSpecificationLowTraffic - The low traffic region configuration. type DefaultRolloutSpecificationLowTraffic struct { - Regions []*string + Regions []*string + + // The wait duration. WaitDuration *string } +// DefaultRolloutSpecificationMediumTraffic - The medium traffic region configuration. type DefaultRolloutSpecificationMediumTraffic struct { - Regions []*string + Regions []*string + + // The wait duration. WaitDuration *string } +// DefaultRolloutSpecificationProviderRegistration - The provider registration. type DefaultRolloutSpecificationProviderRegistration struct { + // Provider registration kind. This Metadata is also used by portal/tooling/etc to render different UX experiences for resources + // of the same type. + Kind *ProviderRegistrationKind Properties *ProviderRegistrationProperties // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -219,625 +481,2126 @@ type DefaultRolloutSpecificationProviderRegistration struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// DefaultRolloutSpecificationRestOfTheWorldGroupOne - The rest of the world group one region configuration. type DefaultRolloutSpecificationRestOfTheWorldGroupOne struct { - Regions []*string + Regions []*string + + // The wait duration. WaitDuration *string } +// DefaultRolloutSpecificationRestOfTheWorldGroupTwo - The rest of the world group two region configuration. type DefaultRolloutSpecificationRestOfTheWorldGroupTwo struct { - Regions []*string + Regions []*string + + // The wait duration. WaitDuration *string } type DefaultRolloutStatus struct { + // The completed regions. CompletedRegions []*string - // Dictionary of - FailedOrSkippedRegions map[string]*ExtendedErrorInfo - NextTrafficRegion *TrafficRegionCategory - NextTrafficRegionScheduledTime *time.Time + // The failed or skipped regions. + FailedOrSkippedRegions map[string]*ExtendedErrorInfo + + // The manifest checkin status. + ManifestCheckinStatus *DefaultRolloutStatusManifestCheckinStatus + + // The next traffic region. + NextTrafficRegion *TrafficRegionCategory + + // The next traffic region scheduled time. + NextTrafficRegionScheduledTime *time.Time + + // The subscription reregistration result. SubscriptionReregistrationResult *SubscriptionReregistrationResult } -// Error - Standard error object. -type Error struct { - // READ-ONLY; Server-defined set of error codes. - Code *string +// DefaultRolloutStatusManifestCheckinStatus - The manifest checkin status. +type DefaultRolloutStatusManifestCheckinStatus struct { + // REQUIRED; Whether the manifest is checked in. + IsCheckedIn *bool - // READ-ONLY; Array of details about specific errors that led to this reported error. - Details []*Error + // REQUIRED; The status message. + StatusMessage *string - // READ-ONLY; Object containing more specific information than the current object about the error. - InnerError *ErrorInnerError + // The commit id. + CommitID *string - // READ-ONLY; Human-readable representation of the error. - Message *string + // The pull request. + PullRequest *string +} - // READ-ONLY; Target of the error. - Target *string +type DeleteDependency struct { + // Linked property. + LinkedProperty *string + + // Linked type. + LinkedType *string + + // Required features. + RequiredFeatures []*string } -// ErrorInnerError - Object containing more specific information than the current object about the error. -type ErrorInnerError struct { - // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]any +type DstsConfiguration struct { + // REQUIRED; The service name. + ServiceName *string - // READ-ONLY; Specific error code than was provided by the containing error. - Code *string + // This is a URI property. + ServiceDNSName *string +} + +type EndpointInformation struct { + // The endpoint. + Endpoint *string - // READ-ONLY; Object containing more specific information than the current object about the error. - InnerError any + // The endpoint type. + EndpointType *NotificationEndpointType + + // The schema version. + SchemaVersion *string } -// ErrorResponse - Standard error response. -type ErrorResponse struct { - // Standard error object. - Error *ErrorResponseError +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info any + + // READ-ONLY; The additional info type. + Type *string } -// ErrorResponseError - Standard error object. -type ErrorResponseError struct { - // READ-ONLY; Server-defined set of error codes. - Code *string +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo - // READ-ONLY; Array of details about specific errors that led to this reported error. - Details []*Error + // READ-ONLY; The error code. + Code *string - // READ-ONLY; Object containing more specific information than the current object about the error. - InnerError *ErrorInnerError + // READ-ONLY; The error details. + Details []*ErrorDetail - // READ-ONLY; Human-readable representation of the error. + // READ-ONLY; The error message. Message *string - // READ-ONLY; Target of the error. + // READ-ONLY; The error target. Target *string } +// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. +// (This also follows the OData error response format.). +type ErrorResponse struct { + // The error object. + Error *ErrorDetail +} + +type ExpeditedRolloutDefinition struct { + // Indicates whether expedited rollout is enabled/disabled + Enabled *bool +} + +// ExtendedErrorInfo - Error information. type ExtendedErrorInfo struct { + // The additional error information. AdditionalInfo []*TypedErrorInfo - Code *string - Details []*ExtendedErrorInfo - Message *string - Target *string + + // The error code. + Code *string + + // The error details. + Details []*ExtendedErrorInfo + + // The error message. + Message *string + + // The target of the error. + Target *string } type ExtendedLocationOptions struct { - SupportedPolicy *string - Type *string + SupportedPolicy *ResourceTypeExtendedLocationPolicy + Type *ExtendedLocationType } type ExtensionOptions struct { - Request []*ExtensionOptionType + // The request. + Request []*ExtensionOptionType + + // The response. Response []*ExtensionOptionType } -type FeaturesRule struct { - // REQUIRED - RequiredFeaturesPolicy *FeaturesPolicy -} +type FanoutLinkedNotificationRule struct { + // The actions. + Actions []*string -type IdentityManagement struct { - Type *IdentityManagementTypes -} + // The dsts configuration. + DstsConfiguration *FanoutLinkedNotificationRuleDstsConfiguration -type IdentityManagementProperties struct { - ApplicationID *string - Type *IdentityManagementTypes + // The endpoints. + Endpoints []*ResourceProviderEndpoint + + // The token auth configuration. + TokenAuthConfiguration *TokenAuthConfiguration } -// InnerError - Inner error containing list of errors. -type InnerError struct { - // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]any +// FanoutLinkedNotificationRuleDstsConfiguration - The dsts configuration. +type FanoutLinkedNotificationRuleDstsConfiguration struct { + // REQUIRED; The service name. + ServiceName *string - // READ-ONLY; Specific error code than was provided by the containing error. - Code *string + // This is a URI property. + ServiceDNSName *string +} - // READ-ONLY; Object containing more specific information than the current object about the error. - InnerError any +type FeaturesRule struct { + // REQUIRED; The required feature policy. + RequiredFeaturesPolicy *FeaturesPolicy } -type LightHouseAuthorization struct { - // REQUIRED - PrincipalID *string +type FilterRule struct { + // The endpoint information. + EndpointInformation []*EndpointInformation - // REQUIRED - RoleDefinitionID *string + // The filter query. + FilterQuery *string } -type LinkedAccessCheck struct { - ActionName *string - LinkedAction *string - LinkedActionVerb *string - LinkedProperty *string - LinkedType *string +type FrontloadPayload struct { + // REQUIRED; Properties of the frontload payload. + Properties *FrontloadPayloadProperties } -type LinkedOperationRule struct { - // REQUIRED - LinkedAction *LinkedAction +type FrontloadPayloadProperties struct { + // REQUIRED; The copy from location. + CopyFromLocation *string - // REQUIRED - LinkedOperation *LinkedOperation -} + // REQUIRED; The environment type. + EnvironmentType *AvailableCheckInManifestEnvironment -type LoggingHiddenPropertyPath struct { - HiddenPathsOnRequest []*string - HiddenPathsOnResponse []*string -} + // REQUIRED; The resource types to exclude. + ExcludeResourceTypes []*string -type LoggingRule struct { - // REQUIRED - Action *string + // REQUIRED; The frontload location. + FrontloadLocation *string - // REQUIRED - DetailLevel *LoggingDetails + // REQUIRED; The fields to ignore. + IgnoreFields []*string - // REQUIRED - Direction *LoggingDirections - HiddenPropertyPaths *LoggingRuleHiddenPropertyPaths -} + // REQUIRED; The resource types to include. + IncludeResourceTypes []*string -type LoggingRuleHiddenPropertyPaths struct { - HiddenPathsOnRequest []*string - HiddenPathsOnResponse []*string -} + // REQUIRED; The operation type. + OperationType *string -type Metadata struct { - ProviderAuthentication *MetadataProviderAuthentication - ProviderAuthorizations []*ResourceProviderAuthorization - ThirdPartyProviderAuthorization *MetadataThirdPartyProviderAuthorization -} + // REQUIRED; The endpoint level fields to override. + OverrideEndpointLevelFields *FrontloadPayloadPropertiesOverrideEndpointLevelFields -type MetadataProviderAuthentication struct { - // REQUIRED - AllowedAudiences []*string -} + // REQUIRED; The manifest level fields to override. + OverrideManifestLevelFields *FrontloadPayloadPropertiesOverrideManifestLevelFields -type MetadataThirdPartyProviderAuthorization struct { - Authorizations []*LightHouseAuthorization - ManagedByTenantID *string -} + // REQUIRED; The provider namespace. + ProviderNamespace *string -type NotificationEndpoint struct { - Locations []*string - NotificationDestination *string + // REQUIRED; The service feature flag. + ServiceFeatureFlag *ServiceFeatureFlagAction } -// NotificationRegistration - The notification registration definition. -type NotificationRegistration struct { - Properties *NotificationRegistrationProperties +// FrontloadPayloadPropertiesOverrideEndpointLevelFields - The endpoint level fields to override. +type FrontloadPayloadPropertiesOverrideEndpointLevelFields struct { + // REQUIRED; The api version. + APIVersion *string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string + // REQUIRED; The api versions. + APIVersions []*string - // READ-ONLY; The name of the resource - Name *string + // REQUIRED; The dsts configuration. + DstsConfiguration *ResourceTypeEndpointBaseDstsConfiguration - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} + // REQUIRED; Whether it's enabled. + Enabled *bool -type NotificationRegistrationArrayResponseWithContinuation struct { - // The URL to get to the next set of results, if there are any. - NextLink *string - Value []*NotificationRegistration -} + // REQUIRED; The endpoint type. + EndpointType *EndpointType -type NotificationRegistrationProperties struct { - IncludedEvents []*string - MessageScope *MessageScope - NotificationEndpoints []*NotificationEndpoint - NotificationMode *NotificationMode - ProvisioningState *ProvisioningState -} + // REQUIRED; The endpoint uri. + EndpointURI *string -type NotificationRegistrationPropertiesAutoGenerated struct { - IncludedEvents []*string - MessageScope *MessageScope - NotificationEndpoints []*NotificationEndpoint - NotificationMode *NotificationMode - ProvisioningState *ProvisioningState -} + // REQUIRED; The features rule. + FeaturesRule *ResourceTypeEndpointBaseFeaturesRule -type OperationsContent struct { - // Operations content. - Properties *OperationsDefinition + // REQUIRED; The locations. + Locations []*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string + // REQUIRED; The required features. + RequiredFeatures []*string - // READ-ONLY; The name of the resource - Name *string + // REQUIRED; The sku link. + SKULink *string - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string + // REQUIRED; This is a TimeSpan property. + Timeout *string + + // REQUIRED; The zones. + Zones []*string } -// OperationsDefinition - Properties of an Operation. -type OperationsDefinition struct { - // REQUIRED; Display information of the operation. - Display *OperationsDefinitionDisplay +// FrontloadPayloadPropertiesOverrideManifestLevelFields - The manifest level fields to override. +type FrontloadPayloadPropertiesOverrideManifestLevelFields struct { + // The resource hydration accounts. + ResourceHydrationAccounts []*ResourceHydrationAccount +} - // REQUIRED; Name of the operation. - Name *string - ActionType *OperationsDefinitionActionType +type GroupConnectivityInformation struct { + // REQUIRED; The group id. + GroupID *string - // Indicates whether the operation applies to data-plane. - IsDataAction *bool - Origin *OperationsDefinitionOrigin + // REQUIRED; List of required members for the group id. + RequiredMembers []*string - // Anything - Properties any + // REQUIRED; List of required zone names for the group id. + RequiredZoneNames []*string + + // The redirect map id. + RedirectMapID *string } -type OperationsDefinitionArrayResponseWithContinuation struct { - // The URL to get to the next set of results, if there are any. - NextLink *string - Value []*OperationsDefinition +type IdentityManagement struct { + // The type. + Type *IdentityManagementTypes } -// OperationsDefinitionDisplay - Display information of the operation. -type OperationsDefinitionDisplay struct { - // REQUIRED - Description *string +type IdentityManagementProperties struct { + // The application id. + ApplicationID *string - // REQUIRED - Operation *string + // The application ids. + ApplicationIDs []*string - // REQUIRED - Provider *string + // The delegation app ids. + DelegationAppIDs []*string - // REQUIRED - Resource *string + // The type. + Type *IdentityManagementTypes } -type OperationsDisplayDefinition struct { - // REQUIRED - Description *string +type LegacyDisallowedCondition struct { + // The disallowed legacy operations. + DisallowedLegacyOperations []*LegacyOperation - // REQUIRED - Operation *string + // Feature string. + Feature *string +} - // REQUIRED - Provider *string +type LightHouseAuthorization struct { + // REQUIRED; The principal id. + PrincipalID *string - // REQUIRED - Resource *string + // REQUIRED; The role definition id. + RoleDefinitionID *string } -type OperationsPutContent struct { - // REQUIRED - Contents []*OperationsDefinition +type LinkedAccessCheck struct { + // The action name. + ActionName *string + + // The linked action. + LinkedAction *string + + // The linked action verb. + LinkedActionVerb *string + + // The linked property. + LinkedProperty *string + + // The linked type. + LinkedType *string } -type ProviderRegistration struct { - Properties *ProviderRegistrationProperties +type LinkedNotificationRule struct { + // The actions. + Actions []*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string + // The actions on failed operation. + ActionsOnFailedOperation []*string - // READ-ONLY; The name of the resource - Name *string + // The fast path actions. + FastPathActions []*string - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string + // The fast path action on failed operation. + FastPathActionsOnFailedOperation []*string + + // This is a TimeSpan property. + LinkedNotificationTimeout *string } -type ProviderRegistrationArrayResponseWithContinuation struct { - // The URL to get to the next set of results, if there are any. - NextLink *string - Value []*ProviderRegistration +type LinkedOperationRule struct { + // REQUIRED; The linked action. + LinkedAction *LinkedAction + + // REQUIRED; The linked operation. + LinkedOperation *LinkedOperation + + // Depends on types. + DependsOnTypes []*string } -type ProviderRegistrationProperties struct { - Capabilities []*ResourceProviderCapabilities - FeaturesRule *ResourceProviderManifestPropertiesFeaturesRule - Management *ResourceProviderManifestPropertiesManagement +type LocalizedOperationDefinition struct { + // REQUIRED; Display information of the operation. + Display *LocalizedOperationDefinitionDisplay - // Anything - Metadata any - Namespace *string - ProviderAuthentication *ResourceProviderManifestPropertiesProviderAuthentication - ProviderAuthorizations []*ResourceProviderAuthorization - ProviderHubMetadata *ProviderRegistrationPropertiesProviderHubMetadata - ProviderType *ResourceProviderType - ProviderVersion *string - ProvisioningState *ProvisioningState - RequestHeaderOptions *ResourceProviderManifestPropertiesRequestHeaderOptions - RequiredFeatures []*string - SubscriptionLifecycleNotificationSpecifications *ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications - TemplateDeploymentOptions *ResourceProviderManifestPropertiesTemplateDeploymentOptions + // REQUIRED; Name of the operation. + Name *string + + // The action type. + ActionType *OperationActionType + + // Indicates whether the operation applies to data-plane. + IsDataAction *bool + + // The origin. + Origin *OperationOrigins } -type ProviderRegistrationPropertiesAutoGenerated struct { - Capabilities []*ResourceProviderCapabilities - FeaturesRule *ResourceProviderManifestPropertiesFeaturesRule - Management *ResourceProviderManifestPropertiesManagement +// LocalizedOperationDefinitionDisplay - Display information of the operation. +type LocalizedOperationDefinitionDisplay struct { + // REQUIRED; Display information of the operation. + Default *LocalizedOperationDisplayDefinitionDefault - // Anything - Metadata any - Namespace *string - ProviderAuthentication *ResourceProviderManifestPropertiesProviderAuthentication - ProviderAuthorizations []*ResourceProviderAuthorization - ProviderHubMetadata *ProviderRegistrationPropertiesProviderHubMetadata - ProviderType *ResourceProviderType - ProviderVersion *string - ProvisioningState *ProvisioningState - RequestHeaderOptions *ResourceProviderManifestPropertiesRequestHeaderOptions - RequiredFeatures []*string - SubscriptionLifecycleNotificationSpecifications *ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications - TemplateDeploymentOptions *ResourceProviderManifestPropertiesTemplateDeploymentOptions + // Display information of the operation for cs locale. + Cs *LocalizedOperationDisplayDefinitionCs + + // Display information of the operation for de locale. + De *LocalizedOperationDisplayDefinitionDe + + // Display information of the operation for en locale. + En *LocalizedOperationDisplayDefinitionEn + + // Display information of the operation for es locale. + Es *LocalizedOperationDisplayDefinitionEs + + // Display information of the operation for fr locale. + Fr *LocalizedOperationDisplayDefinitionFr + + // Display information of the operation for hu locale. + Hu *LocalizedOperationDisplayDefinitionHu + + // Display information of the operation for it locale. + It *LocalizedOperationDisplayDefinitionIt + + // Display information of the operation for ja locale. + Ja *LocalizedOperationDisplayDefinitionJa + + // Display information of the operation for ko locale. + Ko *LocalizedOperationDisplayDefinitionKo + + // Display information of the operation for nl locale. + Nl *LocalizedOperationDisplayDefinitionNl + + // Display information of the operation for pl locale. + Pl *LocalizedOperationDisplayDefinitionPl + + // Display information of the operation for pt-PT locale. + Pt *LocalizedOperationDisplayDefinitionPt + + // Display information of the operation for pt-BR locale. + PtBR *LocalizedOperationDisplayDefinitionPtBR + + // Display information of the operation for ru locale. + Ru *LocalizedOperationDisplayDefinitionRu + + // Display information of the operation for sv locale. + Sv *LocalizedOperationDisplayDefinitionSv + + // Display information of the operation for zh-Hans locale. + ZhHans *LocalizedOperationDisplayDefinitionZhHans + + // Display information of the operation for zh-Hant locale. + ZhHant *LocalizedOperationDisplayDefinitionZhHant } -type ProviderRegistrationPropertiesProviderHubMetadata struct { - ProviderAuthentication *MetadataProviderAuthentication - ProviderAuthorizations []*ResourceProviderAuthorization - ThirdPartyProviderAuthorization *MetadataThirdPartyProviderAuthorization +type LocalizedOperationDisplayDefinition struct { + // REQUIRED; Display information of the operation. + Default *LocalizedOperationDisplayDefinitionDefault + + // Display information of the operation for cs locale. + Cs *LocalizedOperationDisplayDefinitionCs + + // Display information of the operation for de locale. + De *LocalizedOperationDisplayDefinitionDe + + // Display information of the operation for en locale. + En *LocalizedOperationDisplayDefinitionEn + + // Display information of the operation for es locale. + Es *LocalizedOperationDisplayDefinitionEs + + // Display information of the operation for fr locale. + Fr *LocalizedOperationDisplayDefinitionFr + + // Display information of the operation for hu locale. + Hu *LocalizedOperationDisplayDefinitionHu + + // Display information of the operation for it locale. + It *LocalizedOperationDisplayDefinitionIt + + // Display information of the operation for ja locale. + Ja *LocalizedOperationDisplayDefinitionJa + + // Display information of the operation for ko locale. + Ko *LocalizedOperationDisplayDefinitionKo + + // Display information of the operation for nl locale. + Nl *LocalizedOperationDisplayDefinitionNl + + // Display information of the operation for pl locale. + Pl *LocalizedOperationDisplayDefinitionPl + + // Display information of the operation for pt-PT locale. + Pt *LocalizedOperationDisplayDefinitionPt + + // Display information of the operation for pt-BR locale. + PtBR *LocalizedOperationDisplayDefinitionPtBR + + // Display information of the operation for ru locale. + Ru *LocalizedOperationDisplayDefinitionRu + + // Display information of the operation for sv locale. + Sv *LocalizedOperationDisplayDefinitionSv + + // Display information of the operation for zh-Hans locale. + ZhHans *LocalizedOperationDisplayDefinitionZhHans + + // Display information of the operation for zh-Hant locale. + ZhHant *LocalizedOperationDisplayDefinitionZhHant } -type ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications struct { - SoftDeleteTTL *string - SubscriptionStateOverrideActions []*SubscriptionStateOverrideAction +// LocalizedOperationDisplayDefinitionCs - Display information of the operation for cs locale. +type LocalizedOperationDisplayDefinitionCs struct { + // REQUIRED; The description. + Description *string + + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -// 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 +// LocalizedOperationDisplayDefinitionDe - Display information of the operation for de locale. +type LocalizedOperationDisplayDefinitionDe struct { + // REQUIRED; The description. + Description *string - // READ-ONLY; The name of the resource - Name *string + // REQUIRED; The operation. + Operation *string - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -type ReRegisterSubscriptionMetadata struct { - // REQUIRED - Enabled *bool - ConcurrencyLimit *int32 +// LocalizedOperationDisplayDefinitionDefault - Display information of the operation. +type LocalizedOperationDisplayDefinitionDefault struct { + // REQUIRED; The description. + Description *string + + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -type RequestHeaderOptions struct { - OptInHeaders *OptInHeaderType +// LocalizedOperationDisplayDefinitionEn - Display information of the operation for en locale. +type LocalizedOperationDisplayDefinitionEn struct { + // REQUIRED; The description. + Description *string + + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -// 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 +// LocalizedOperationDisplayDefinitionEs - Display information of the operation for es locale. +type LocalizedOperationDisplayDefinitionEs struct { + // REQUIRED; The description. + Description *string - // READ-ONLY; The name of the resource - Name *string + // REQUIRED; The operation. + Operation *string - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -type ResourceMovePolicy struct { - CrossResourceGroupMoveEnabled *bool - CrossSubscriptionMoveEnabled *bool - ValidationRequired *bool +// LocalizedOperationDisplayDefinitionFr - Display information of the operation for fr locale. +type LocalizedOperationDisplayDefinitionFr struct { + // REQUIRED; The description. + Description *string + + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -type ResourceProviderAuthentication struct { - // REQUIRED - AllowedAudiences []*string +// LocalizedOperationDisplayDefinitionHu - Display information of the operation for hu locale. +type LocalizedOperationDisplayDefinitionHu struct { + // REQUIRED; The description. + Description *string + + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -type ResourceProviderAuthorization struct { - ApplicationID *string - ManagedByRoleDefinitionID *string - RoleDefinitionID *string +// LocalizedOperationDisplayDefinitionIt - Display information of the operation for it locale. +type LocalizedOperationDisplayDefinitionIt struct { + // REQUIRED; The description. + Description *string + + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -type ResourceProviderCapabilities struct { - // REQUIRED - Effect *ResourceProviderCapabilitiesEffect +// LocalizedOperationDisplayDefinitionJa - Display information of the operation for ja locale. +type LocalizedOperationDisplayDefinitionJa struct { + // REQUIRED; The description. + Description *string - // REQUIRED - QuotaID *string - RequiredFeatures []*string + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -type ResourceProviderEndpoint struct { - APIVersions []*string - Enabled *bool - EndpointURI *string - FeaturesRule *ResourceProviderEndpointFeaturesRule - Locations []*string - RequiredFeatures []*string - Timeout *string +// LocalizedOperationDisplayDefinitionKo - Display information of the operation for ko locale. +type LocalizedOperationDisplayDefinitionKo struct { + // REQUIRED; The description. + Description *string + + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -type ResourceProviderEndpointFeaturesRule struct { - // REQUIRED - RequiredFeaturesPolicy *FeaturesPolicy +// LocalizedOperationDisplayDefinitionNl - Display information of the operation for nl locale. +type LocalizedOperationDisplayDefinitionNl struct { + // REQUIRED; The description. + Description *string + + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -type ResourceProviderManagement struct { - IncidentContactEmail *string - IncidentRoutingService *string - IncidentRoutingTeam *string - ManifestOwners []*string - ResourceAccessPolicy *ResourceProviderManagementResourceAccessPolicy - ResourceAccessRoles []any - SchemaOwners []*string - ServiceTreeInfos []*ServiceTreeInfo +// LocalizedOperationDisplayDefinitionPl - Display information of the operation for pl locale. +type LocalizedOperationDisplayDefinitionPl struct { + // REQUIRED; The description. + Description *string + + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -type ResourceProviderManifest struct { - Capabilities []*ResourceProviderCapabilities - FeaturesRule *ResourceProviderManifestFeaturesRule - GlobalNotificationEndpoints []*ResourceProviderEndpoint - Management *ResourceProviderManifestManagement +// LocalizedOperationDisplayDefinitionPt - Display information of the operation for pt-PT locale. +type LocalizedOperationDisplayDefinitionPt struct { + // REQUIRED; The description. + Description *string - // Anything - Metadata any - Namespace *string - ProviderAuthentication *ResourceProviderManifestProviderAuthentication - ProviderAuthorizations []*ResourceProviderAuthorization - ProviderType *ResourceProviderType - ProviderVersion *string - ReRegisterSubscriptionMetadata *ResourceProviderManifestReRegisterSubscriptionMetadata - RequestHeaderOptions *ResourceProviderManifestRequestHeaderOptions - RequiredFeatures []*string - ResourceTypes []*ResourceType + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -type ResourceProviderManifestFeaturesRule struct { - // REQUIRED - RequiredFeaturesPolicy *FeaturesPolicy +// LocalizedOperationDisplayDefinitionPtBR - Display information of the operation for pt-BR locale. +type LocalizedOperationDisplayDefinitionPtBR struct { + // REQUIRED; The description. + Description *string + + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -type ResourceProviderManifestManagement struct { - IncidentContactEmail *string - IncidentRoutingService *string - IncidentRoutingTeam *string - ManifestOwners []*string - ResourceAccessPolicy *ResourceProviderManagementResourceAccessPolicy - ResourceAccessRoles []any - SchemaOwners []*string - ServiceTreeInfos []*ServiceTreeInfo +// LocalizedOperationDisplayDefinitionRu - Display information of the operation for ru locale. +type LocalizedOperationDisplayDefinitionRu struct { + // REQUIRED; The description. + Description *string + + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -type ResourceProviderManifestProperties struct { - Capabilities []*ResourceProviderCapabilities - FeaturesRule *ResourceProviderManifestPropertiesFeaturesRule - Management *ResourceProviderManifestPropertiesManagement +// LocalizedOperationDisplayDefinitionSv - Display information of the operation for sv locale. +type LocalizedOperationDisplayDefinitionSv struct { + // REQUIRED; The description. + Description *string - // Anything - Metadata any - Namespace *string - ProviderAuthentication *ResourceProviderManifestPropertiesProviderAuthentication - ProviderAuthorizations []*ResourceProviderAuthorization - ProviderType *ResourceProviderType - ProviderVersion *string - RequestHeaderOptions *ResourceProviderManifestPropertiesRequestHeaderOptions - RequiredFeatures []*string - TemplateDeploymentOptions *ResourceProviderManifestPropertiesTemplateDeploymentOptions + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string } -type ResourceProviderManifestPropertiesFeaturesRule struct { - // REQUIRED - RequiredFeaturesPolicy *FeaturesPolicy -} +// LocalizedOperationDisplayDefinitionZhHans - Display information of the operation for zh-Hans locale. +type LocalizedOperationDisplayDefinitionZhHans struct { + // REQUIRED; The description. + Description *string + + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string +} + +// LocalizedOperationDisplayDefinitionZhHant - Display information of the operation for zh-Hant locale. +type LocalizedOperationDisplayDefinitionZhHant struct { + // REQUIRED; The description. + Description *string + + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string +} + +type LocationQuotaRule struct { + // The location. + Location *string + + // The policy. + Policy *QuotaPolicy + + // The quota id. + QuotaID *string +} + +type LoggingHiddenPropertyPath struct { + // The hidden paths on request. + HiddenPathsOnRequest []*string + + // The hidden paths on response. + HiddenPathsOnResponse []*string +} + +type LoggingRule struct { + // REQUIRED; The action. + Action *string + + // REQUIRED; The detail level. + DetailLevel *LoggingDetails + + // REQUIRED; The direction. + Direction *LoggingDirections + + // The hidden property paths. + HiddenPropertyPaths *LoggingRuleHiddenPropertyPaths +} + +// LoggingRuleHiddenPropertyPaths - The hidden property paths. +type LoggingRuleHiddenPropertyPaths struct { + // The hidden paths on request. + HiddenPathsOnRequest []*string + + // The hidden paths on response. + HiddenPathsOnResponse []*string +} + +type ManifestLevelPropertyBag struct { + // The resource hydration accounts. + ResourceHydrationAccounts []*ResourceHydrationAccount +} + +type Metadata struct { + // The direct RP role definition id. + DirectRpRoleDefinitionID *string + + // The global async operation resource type name. + GlobalAsyncOperationResourceTypeName *string + + // The provider authentication. + ProviderAuthentication *MetadataProviderAuthentication + + // The provider authorizations. + ProviderAuthorizations []*ResourceProviderAuthorization + + // The regional async operation resource type name. + RegionalAsyncOperationResourceTypeName *string + + // The third party provider authorization. + ThirdPartyProviderAuthorization *MetadataThirdPartyProviderAuthorization +} + +// MetadataProviderAuthentication - The provider authentication. +type MetadataProviderAuthentication struct { + // REQUIRED; The allowed audiences. + AllowedAudiences []*string +} + +// MetadataThirdPartyProviderAuthorization - The third party provider authorization. +type MetadataThirdPartyProviderAuthorization struct { + // The authorizations. + Authorizations []*LightHouseAuthorization + + // The managed by tenant id. + ManagedByTenantID *string +} + +type Notification struct { + // The notification type. + NotificationType *NotificationType + + // Whether notifications should be skipped. + SkipNotifications *SkipNotifications +} + +type NotificationEndpoint struct { + // The locations. + Locations []*string + + // The notification destination. + NotificationDestination *string +} + +type NotificationRegistration struct { + Properties *NotificationRegistrationProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +type NotificationRegistrationArrayResponseWithContinuation struct { + // The URL to get to the next set of results, if there are any. + NextLink *string + + // The value. + Value []*NotificationRegistration +} + +type NotificationRegistrationProperties struct { + // The included events. + IncludedEvents []*string + + // The message scope. + MessageScope *MessageScope + + // The notification endpoints. + NotificationEndpoints []*NotificationEndpoint + + // The notification mode. + NotificationMode *NotificationMode + + // READ-ONLY; The provisioned state of the resource. + ProvisioningState *ProvisioningState +} + +type OpenAPIConfiguration struct { + // The open api validation. + Validation *OpenAPIValidation +} + +type OpenAPIValidation struct { + // Indicates whether a non compliance response is allowed for a LIST call + AllowNoncompliantCollectionResponse *bool +} + +type OperationsContent struct { + // Operations content. + Properties *OperationsDefinition + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +type OperationsContentProperties struct { + // Operations content. + Contents []*LocalizedOperationDefinition +} + +// OperationsDefinition - Properties of an Operation. +type OperationsDefinition struct { + // REQUIRED; Display information of the operation. + Display *OperationsDefinitionDisplay + + // REQUIRED; Name of the operation. + Name *string + + // The action type. + ActionType *OperationActionType + + // Indicates whether the operation applies to data-plane. + IsDataAction *bool + + // The origin. + Origin *OperationOrigins + + // Anything + Properties any +} + +type OperationsDefinitionArrayResponseWithContinuation struct { + // The URL to get to the next set of results, if there are any. + NextLink *string + + // The value. + Value []*OperationsDefinition +} + +// OperationsDefinitionDisplay - Display information of the operation. +type OperationsDefinitionDisplay struct { + // REQUIRED; The description. + Description *string + + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string +} + +type OperationsDisplayDefinition struct { + // REQUIRED; The description. + Description *string + + // REQUIRED; The operation. + Operation *string + + // REQUIRED; The provider. + Provider *string + + // REQUIRED; The resource. + Resource *string +} + +type OperationsPutContent struct { + Contents []*OperationsDefinition + Properties *OperationsPutContentProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +type OperationsPutContentProperties struct { + // Operations content. + Contents []*LocalizedOperationDefinition +} + +type PrivateResourceProviderConfiguration struct { + // The allowed subscriptions. + AllowedSubscriptions []*string +} + +type ProviderMonitorSetting struct { + // REQUIRED; The geo-location where the resource lives + Location *string + Properties *ProviderMonitorSettingProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +type ProviderMonitorSettingArrayResponseWithContinuation struct { + // The URL to get to the next set of results, if there are any. + NextLink *string + Value []*ProviderMonitorSetting +} + +type ProviderMonitorSettingProperties struct { + // READ-ONLY; The provisioning state. + ProvisioningState *ProvisioningState +} + +type ProviderRegistration struct { + // Provider registration kind. This Metadata is also used by portal/tooling/etc to render different UX experiences for resources + // of the same type. + Kind *ProviderRegistrationKind + Properties *ProviderRegistrationProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +type ProviderRegistrationArrayResponseWithContinuation struct { + // The URL to get to the next set of results, if there are any. + NextLink *string + + // The value. + Value []*ProviderRegistration +} + +type ProviderRegistrationProperties struct { + // The capabilities. + Capabilities []*ResourceProviderCapabilities + + // The cross tenant token validation. + CrossTenantTokenValidation *CrossTenantTokenValidation + + // Custom manifest version. + CustomManifestVersion *string + + // The dsts configuration. + DstsConfiguration *ResourceProviderManifestPropertiesDstsConfiguration + + // The enable tenant linked notification. + EnableTenantLinkedNotification *bool + + // The features rule. + FeaturesRule *ResourceProviderManifestPropertiesFeaturesRule + + // The global notification endpoints. + GlobalNotificationEndpoints []*ResourceProviderEndpoint + + // Legacy namespace. + LegacyNamespace *string + + // Legacy registrations. + LegacyRegistrations []*string + + // The linked notification rules. + LinkedNotificationRules []*FanoutLinkedNotificationRule + + // The resource provider management. + Management *ResourceProviderManifestPropertiesManagement + + // Management groups global notification endpoints. + ManagementGroupGlobalNotificationEndpoints []*ResourceProviderEndpoint + + // The metadata. + Metadata any + + // The namespace. + Namespace *string + + // Notification options. + NotificationOptions *NotificationOptions + + // Notification settings. + NotificationSettings *ResourceProviderManifestPropertiesNotificationSettings + + // The notifications. + Notifications []*Notification + + // Optional features. + OptionalFeatures []*string + + // The private resource provider configuration. + PrivateResourceProviderConfiguration *ProviderRegistrationPropertiesPrivateResourceProviderConfiguration + + // The provider authentication. + ProviderAuthentication *ResourceProviderManifestPropertiesProviderAuthentication + + // The provider authorizations. + ProviderAuthorizations []*ResourceProviderAuthorization + + // The provider hub metadata. + ProviderHubMetadata *ProviderRegistrationPropertiesProviderHubMetadata + + // The provider type. + ProviderType *ResourceProviderType + + // The provider version. + ProviderVersion *string + + // The request header options. + RequestHeaderOptions *ResourceProviderManifestPropertiesRequestHeaderOptions + + // The required features. + RequiredFeatures []*string + + // Resource group lock option during move. + ResourceGroupLockOptionDuringMove *ResourceProviderManifestPropertiesResourceGroupLockOptionDuringMove + + // resource hydration accounts + ResourceHydrationAccounts []*ResourceHydrationAccount + + // The resource provider authorization rules. + ResourceProviderAuthorizationRules *ResourceProviderAuthorizationRules + + // Response options. + ResponseOptions *ResourceProviderManifestPropertiesResponseOptions + + // The service name. + ServiceName *string + + // The services. + Services []*ResourceProviderService + + // The subscription lifecycle notification specifications. + SubscriptionLifecycleNotificationSpecifications *ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + + // The template deployment options. + TemplateDeploymentOptions *ResourceProviderManifestPropertiesTemplateDeploymentOptions + + // The token auth configuration. + TokenAuthConfiguration *TokenAuthConfiguration + + // READ-ONLY; The provisioning state. + ProvisioningState *ProvisioningState +} + +// ProviderRegistrationPropertiesPrivateResourceProviderConfiguration - The private resource provider configuration. +type ProviderRegistrationPropertiesPrivateResourceProviderConfiguration struct { + // The allowed subscriptions. + AllowedSubscriptions []*string +} + +// ProviderRegistrationPropertiesProviderHubMetadata - The provider hub metadata. +type ProviderRegistrationPropertiesProviderHubMetadata struct { + // The direct RP role definition id. + DirectRpRoleDefinitionID *string + + // The global async operation resource type name. + GlobalAsyncOperationResourceTypeName *string + + // The provider authentication. + ProviderAuthentication *MetadataProviderAuthentication + + // The provider authorizations. + ProviderAuthorizations []*ResourceProviderAuthorization + + // The regional async operation resource type name. + RegionalAsyncOperationResourceTypeName *string + + // The third party provider authorization. + ThirdPartyProviderAuthorization *MetadataThirdPartyProviderAuthorization +} + +// ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications - The subscription lifecycle notification +// specifications. +type ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications struct { + // The soft delete TTL. + SoftDeleteTTL *string + + // The subscription state override actions. + SubscriptionStateOverrideActions []*SubscriptionStateOverrideAction +} + +// 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 + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +type QuotaRule struct { + // The location rules. + LocationRules []*LocationQuotaRule + + // The quota policy. + QuotaPolicy *QuotaPolicy + + // The required features. + RequiredFeatures []*string +} + +type ReRegisterSubscriptionMetadata struct { + // REQUIRED; Whether it's enabled or not. + Enabled *bool + + // The concurrency limit. + ConcurrencyLimit *int32 +} + +type RequestHeaderOptions struct { + // The opt in headers. + OptInHeaders *OptInHeaderType + + // The opt out headers. + OptOutHeaders *OptOutHeaderType +} + +// 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 + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +type ResourceAccessRole struct { + // The actions. + Actions []*string + + // The allowed group claims. + AllowedGroupClaims []*string +} + +type ResourceConcurrencyControlOption struct { + // The policy. + Policy *Policy +} + +type ResourceGraphConfiguration struct { + // The api version. + APIVersion *string + + // Whether it's enabled. + Enabled *bool +} + +type ResourceHydrationAccount struct { + // The account name. + AccountName *string + + // The encrypted key. + EncryptedKey *string + + // The max child resource consistency job limit. + MaxChildResourceConsistencyJobLimit *int64 + + // The subscription id. + SubscriptionID *string +} + +type ResourceManagementAction struct { + // resource management action content. + Resources []*ResourceManagementEntity +} + +type ResourceManagementEntity struct { + // REQUIRED; The resource id. + ResourceID *string + + // The home tenant id. + HomeTenantID *string + + // The location. + Location *string + + // READ-ONLY; The operation status. + Status *string +} + +type ResourceMovePolicy struct { + // Whether cross resource group move is enabled. + CrossResourceGroupMoveEnabled *bool + + // Whether cross subscription move is enabled. + CrossSubscriptionMoveEnabled *bool + + // Whether validation is required. + ValidationRequired *bool +} + +type ResourceProviderAuthentication struct { + // REQUIRED; The allowed audiences. + AllowedAudiences []*string +} + +type ResourceProviderAuthorization struct { + // The allowed third party extensions. + AllowedThirdPartyExtensions []*ThirdPartyExtension + + // The application id. + ApplicationID *string + + // The grouping tag. + GroupingTag *string + + // Managed by authorization. + ManagedByAuthorization *ResourceProviderAuthorizationManagedByAuthorization + + // The managed by role definition id. + ManagedByRoleDefinitionID *string + + // The role definition id. + RoleDefinitionID *string +} + +// ResourceProviderAuthorizationManagedByAuthorization - Managed by authorization. +type ResourceProviderAuthorizationManagedByAuthorization struct { + AdditionalAuthorizations []*AdditionalAuthorization + + // Indicates whether the managed by resource role definition ID should be inherited. + AllowManagedByInheritance *bool + + // The managed by resource role definition ID for the application. + ManagedByResourceRoleDefinitionID *string +} + +type ResourceProviderAuthorizationRules struct { + // The async operation polling rules. + AsyncOperationPollingRules *AsyncOperationPollingRules +} + +type ResourceProviderCapabilities struct { + // REQUIRED; The effect. + Effect *ResourceProviderCapabilitiesEffect + + // REQUIRED; The quota id. + QuotaID *string + + // The required features. + RequiredFeatures []*string +} + +type ResourceProviderEndpoint struct { + // The api versions. + APIVersions []*string + + // Whether the endpoint is enabled. + Enabled *bool + + // The endpoint type. + EndpointType *EndpointType + + // The endpoint uri. + EndpointURI *string + + // The feature rules. + FeaturesRule *ResourceProviderEndpointFeaturesRule + + // The locations. + Locations []*string + + // The required features. + RequiredFeatures []*string + + // The sku link. + SKULink *string + + // The timeout. + Timeout *string +} + +// ResourceProviderEndpointFeaturesRule - The feature rules. +type ResourceProviderEndpointFeaturesRule struct { + // REQUIRED; The required feature policy. + RequiredFeaturesPolicy *FeaturesPolicy +} + +type ResourceProviderManagement struct { + // The authorization owners. + AuthorizationOwners []*string + + // List of manifest owners for canary. + CanaryManifestOwners []*string + + // Options for error response messages. + ErrorResponseMessageOptions *ResourceProviderManagementErrorResponseMessageOptions + + // Metadata for expedited rollout. + ExpeditedRolloutMetadata *ResourceProviderManagementExpeditedRolloutMetadata + + // List of expedited rollout submitters. + ExpeditedRolloutSubmitters []*string + + // The incident contact email. + IncidentContactEmail *string + + // The incident routing service. + IncidentRoutingService *string + + // The incident routing team. + IncidentRoutingTeam *string + + // The manifest owners. + ManifestOwners []*string + + // The profit center code for the subscription. + PcCode *string + + // The profit center program id for the subscription. + ProfitCenterProgramID *string + + // The resource access policy. + ResourceAccessPolicy *ResourceAccessPolicy + + // The resource access roles. + ResourceAccessRoles []*ResourceAccessRole + + // The schema owners. + SchemaOwners []*string + + // The service tree infos. + ServiceTreeInfos []*ServiceTreeInfo +} + +// ResourceProviderManagementErrorResponseMessageOptions - Options for error response messages. +type ResourceProviderManagementErrorResponseMessageOptions struct { + // Type of server failure response message. + ServerFailureResponseMessageType *ServerFailureResponseMessageType +} + +// ResourceProviderManagementExpeditedRolloutMetadata - Metadata for expedited rollout. +type ResourceProviderManagementExpeditedRolloutMetadata struct { + // Expedited rollout enabled? + Enabled *bool + + // Expedited rollout intent. + ExpeditedRolloutIntent *ExpeditedRolloutIntent +} + +type ResourceProviderManifest struct { + // The capabilities. + Capabilities []*ResourceProviderCapabilities + + // The cross tenant token validation. + CrossTenantTokenValidation *CrossTenantTokenValidation + + // Whether tenant linked notification is enabled. + EnableTenantLinkedNotification *bool + + // The features rule. + FeaturesRule *ResourceProviderManifestFeaturesRule + + // The global notification endpoints. + GlobalNotificationEndpoints []*ResourceProviderEndpoint + + // The linked notification rules. + LinkedNotificationRules []*FanoutLinkedNotificationRule + + // The resource provider management. + Management *ResourceProviderManifestManagement + + // The metadata. + Metadata any + + // The namespace. + Namespace *string + + // The notifications. + Notifications []*Notification + + // The provider authentication. + ProviderAuthentication *ResourceProviderManifestProviderAuthentication + + // The provider authorizations. + ProviderAuthorizations []*ResourceProviderAuthorization + + // The provider type. + ProviderType *ResourceProviderType + + // The provider version. + ProviderVersion *string + + // The reregister subscription metadata. + ReRegisterSubscriptionMetadata *ResourceProviderManifestReRegisterSubscriptionMetadata + + // The request header options. + RequestHeaderOptions *ResourceProviderManifestRequestHeaderOptions + + // The required features. + RequiredFeatures []*string + + // The resource provider authorization rules. + ResourceProviderAuthorizationRules *ResourceProviderAuthorizationRules + + // The resource types. + ResourceTypes []*ResourceType + + // The service name. + ServiceName *string + + // The services. + Services []*ResourceProviderService +} + +// ResourceProviderManifestFeaturesRule - The features rule. +type ResourceProviderManifestFeaturesRule struct { + // REQUIRED; The required feature policy. + RequiredFeaturesPolicy *FeaturesPolicy +} + +// ResourceProviderManifestManagement - The resource provider management. +type ResourceProviderManifestManagement struct { + // The authorization owners. + AuthorizationOwners []*string + + // List of manifest owners for canary. + CanaryManifestOwners []*string + + // Options for error response messages. + ErrorResponseMessageOptions *ResourceProviderManagementErrorResponseMessageOptions + + // Metadata for expedited rollout. + ExpeditedRolloutMetadata *ResourceProviderManagementExpeditedRolloutMetadata + + // List of expedited rollout submitters. + ExpeditedRolloutSubmitters []*string + + // The incident contact email. + IncidentContactEmail *string + + // The incident routing service. + IncidentRoutingService *string + + // The incident routing team. + IncidentRoutingTeam *string + + // The manifest owners. + ManifestOwners []*string + + // The profit center code for the subscription. + PcCode *string + + // The profit center program id for the subscription. + ProfitCenterProgramID *string + + // The resource access policy. + ResourceAccessPolicy *ResourceAccessPolicy + + // The resource access roles. + ResourceAccessRoles []*ResourceAccessRole + + // The schema owners. + SchemaOwners []*string + + // The service tree infos. + ServiceTreeInfos []*ServiceTreeInfo +} + +type ResourceProviderManifestProperties struct { + // The capabilities. + Capabilities []*ResourceProviderCapabilities + + // The cross tenant token validation. + CrossTenantTokenValidation *CrossTenantTokenValidation + + // Custom manifest version. + CustomManifestVersion *string + + // The dsts configuration. + DstsConfiguration *ResourceProviderManifestPropertiesDstsConfiguration + + // The enable tenant linked notification. + EnableTenantLinkedNotification *bool + + // The features rule. + FeaturesRule *ResourceProviderManifestPropertiesFeaturesRule + + // The global notification endpoints. + GlobalNotificationEndpoints []*ResourceProviderEndpoint + + // Legacy namespace. + LegacyNamespace *string + + // Legacy registrations. + LegacyRegistrations []*string + + // The linked notification rules. + LinkedNotificationRules []*FanoutLinkedNotificationRule + + // The resource provider management. + Management *ResourceProviderManifestPropertiesManagement + + // Management groups global notification endpoints. + ManagementGroupGlobalNotificationEndpoints []*ResourceProviderEndpoint + + // The metadata. + Metadata any + + // The namespace. + Namespace *string + + // Notification options. + NotificationOptions *NotificationOptions + + // Notification settings. + NotificationSettings *ResourceProviderManifestPropertiesNotificationSettings + + // The notifications. + Notifications []*Notification + + // Optional features. + OptionalFeatures []*string + + // The provider authentication. + ProviderAuthentication *ResourceProviderManifestPropertiesProviderAuthentication + + // The provider authorizations. + ProviderAuthorizations []*ResourceProviderAuthorization + + // The provider type. + ProviderType *ResourceProviderType + + // The provider version. + ProviderVersion *string + + // The request header options. + RequestHeaderOptions *ResourceProviderManifestPropertiesRequestHeaderOptions + + // The required features. + RequiredFeatures []*string + + // Resource group lock option during move. + ResourceGroupLockOptionDuringMove *ResourceProviderManifestPropertiesResourceGroupLockOptionDuringMove + + // resource hydration accounts + ResourceHydrationAccounts []*ResourceHydrationAccount + + // The resource provider authorization rules. + ResourceProviderAuthorizationRules *ResourceProviderAuthorizationRules + + // Response options. + ResponseOptions *ResourceProviderManifestPropertiesResponseOptions + + // The service name. + ServiceName *string + + // The services. + Services []*ResourceProviderService + + // The template deployment options. + TemplateDeploymentOptions *ResourceProviderManifestPropertiesTemplateDeploymentOptions +} + +// ResourceProviderManifestPropertiesDstsConfiguration - The dsts configuration. +type ResourceProviderManifestPropertiesDstsConfiguration struct { + // REQUIRED; The service name. + ServiceName *string + + // This is a URI property. + ServiceDNSName *string +} + +// ResourceProviderManifestPropertiesFeaturesRule - The features rule. +type ResourceProviderManifestPropertiesFeaturesRule struct { + // REQUIRED; The required feature policy. + RequiredFeaturesPolicy *FeaturesPolicy +} + +// ResourceProviderManifestPropertiesManagement - The resource provider management. +type ResourceProviderManifestPropertiesManagement struct { + // The authorization owners. + AuthorizationOwners []*string + + // List of manifest owners for canary. + CanaryManifestOwners []*string + + // Options for error response messages. + ErrorResponseMessageOptions *ResourceProviderManagementErrorResponseMessageOptions + + // Metadata for expedited rollout. + ExpeditedRolloutMetadata *ResourceProviderManagementExpeditedRolloutMetadata + + // List of expedited rollout submitters. + ExpeditedRolloutSubmitters []*string + + // The incident contact email. + IncidentContactEmail *string + + // The incident routing service. + IncidentRoutingService *string + + // The incident routing team. + IncidentRoutingTeam *string + + // The manifest owners. + ManifestOwners []*string + + // The profit center code for the subscription. + PcCode *string + + // The profit center program id for the subscription. + ProfitCenterProgramID *string + + // The resource access policy. + ResourceAccessPolicy *ResourceAccessPolicy + + // The resource access roles. + ResourceAccessRoles []*ResourceAccessRole + + // The schema owners. + SchemaOwners []*string + + // The service tree infos. + ServiceTreeInfos []*ServiceTreeInfo +} + +// ResourceProviderManifestPropertiesNotificationSettings - Notification settings. +type ResourceProviderManifestPropertiesNotificationSettings struct { + SubscriberSettings []*SubscriberSetting +} + +// ResourceProviderManifestPropertiesProviderAuthentication - The provider authentication. +type ResourceProviderManifestPropertiesProviderAuthentication struct { + // REQUIRED; The allowed audiences. + AllowedAudiences []*string +} + +// ResourceProviderManifestPropertiesRequestHeaderOptions - The request header options. +type ResourceProviderManifestPropertiesRequestHeaderOptions struct { + // The opt in headers. + OptInHeaders *OptInHeaderType + + // The opt out headers. + OptOutHeaders *OptOutHeaderType +} + +// ResourceProviderManifestPropertiesResourceGroupLockOptionDuringMove - Resource group lock option during move. +type ResourceProviderManifestPropertiesResourceGroupLockOptionDuringMove struct { + // The action verb that will be blocked when the resource group is locked during move. + BlockActionVerb *BlockActionVerb +} + +// ResourceProviderManifestPropertiesResponseOptions - Response options. +type ResourceProviderManifestPropertiesResponseOptions struct { + ServiceClientOptionsType *ServiceClientOptionsType +} + +// ResourceProviderManifestPropertiesTemplateDeploymentOptions - The template deployment options. +type ResourceProviderManifestPropertiesTemplateDeploymentOptions struct { + // The preflight options. + PreflightOptions []*PreflightOption + + // Whether preflight is supported. + PreflightSupported *bool +} + +// ResourceProviderManifestProviderAuthentication - The provider authentication. +type ResourceProviderManifestProviderAuthentication struct { + // REQUIRED; The allowed audiences. + AllowedAudiences []*string +} + +// ResourceProviderManifestReRegisterSubscriptionMetadata - The reregister subscription metadata. +type ResourceProviderManifestReRegisterSubscriptionMetadata struct { + // REQUIRED; Whether it's enabled or not. + Enabled *bool + + // The concurrency limit. + ConcurrencyLimit *int32 +} + +// ResourceProviderManifestRequestHeaderOptions - The request header options. +type ResourceProviderManifestRequestHeaderOptions struct { + // The opt in headers. + OptInHeaders *OptInHeaderType + + // The opt out headers. + OptOutHeaders *OptOutHeaderType +} + +// ResourceProviderService - Resource provider service. +type ResourceProviderService struct { + // The service name. + ServiceName *string + + // The status. + Status *ServiceStatus +} + +type ResourceType struct { + // The additional options. + AdditionalOptions *AdditionalOptions + + // The allowed unauthorized actions. + AllowedUnauthorizedActions []*string + + // The allowed unauthorized actions extensions. + AllowedUnauthorizedActionsExtensions []*AllowedUnauthorizedActionsExtension + + // The authorization action mappings. + AuthorizationActionMappings []*AuthorizationActionMapping + + // The cross tenant token validation. + CrossTenantTokenValidation *CrossTenantTokenValidation + + // The default api version. + DefaultAPIVersion *string + + // The disallowed action verbs. + DisallowedActionVerbs []*string + + // The endpoints. + Endpoints []*ResourceProviderEndpoint + + // The extended locations. + ExtendedLocations []*ExtendedLocationOptions + + // The features rule. + FeaturesRule *ResourceTypeFeaturesRule + + // The identity management. + IdentityManagement *ResourceTypeIdentityManagement + + // The linked access checks. + LinkedAccessChecks []*LinkedAccessCheck + + // The linked notification rules. + LinkedNotificationRules []*LinkedNotificationRule + + // The linked operation rules. + LinkedOperationRules []*LinkedOperationRule + + // The logging rules. + LoggingRules []*LoggingRule + + // The marketplace type. + MarketplaceType *MarketplaceType + + // The metadata. + Metadata any + + // The resource type name. + Name *string + + // The notifications. + Notifications []*Notification + + // The quota rule. + QuotaRule *QuotaRule + + // The request header options. + RequestHeaderOptions *ResourceTypeRequestHeaderOptions + + // The required features. + RequiredFeatures []*string + + // The resource deletion policy. + ResourceDeletionPolicy *ManifestResourceDeletionPolicy + + // The resource provider authorization rules. + ResourceProviderAuthorizationRules *ResourceProviderAuthorizationRules + + // The resource validation. + ResourceValidation *ResourceValidation + + // The routing type. + RoutingType *RoutingType + + // The sku link. + SKULink *string + + // The service tree infos. + ServiceTreeInfos []*ServiceTreeInfo + + // The subscription state rules. + SubscriptionStateRules []*SubscriptionStateRule + + // The template deployment policy. + TemplateDeploymentPolicy *ResourceTypeTemplateDeploymentPolicy + + // The throttling rules. + ThrottlingRules []*ThrottlingRule +} + +type ResourceTypeEndpoint struct { + // Api version. + APIVersion *string + + // The api versions. + APIVersions []*string + + // The data boundary. + DataBoundary *DataBoundary + + // The dsts configuration. + DstsConfiguration *ResourceTypeEndpointDstsConfiguration + + // Whether the endpoint is enabled. + Enabled *bool + + // The endpoint type. + EndpointType *EndpointTypeResourceType + + // The endpoint uri. + EndpointURI *string + + // The extensions. + Extensions []*ResourceTypeExtension + + // The features rule. + FeaturesRule *ResourceTypeEndpointFeaturesRule + + // Resource type endpoint kind. This Metadata is also used by portal/tooling/etc to render different UX experiences for resources + // of the same type. + Kind *ResourceTypeEndpointKind + + // The locations. + Locations []*string + + // The required features. + RequiredFeatures []*string + + // The sku link. + SKULink *string + + // The timeout. + Timeout *string + + // The token auth configuration. + TokenAuthConfiguration *TokenAuthConfiguration + + // List of zones. + Zones []*string +} + +type ResourceTypeEndpointBase struct { + // REQUIRED; The api version. + APIVersion *string + + // REQUIRED; The api versions. + APIVersions []*string + + // REQUIRED; The dsts configuration. + DstsConfiguration *ResourceTypeEndpointBaseDstsConfiguration + + // REQUIRED; Whether it's enabled. + Enabled *bool + + // REQUIRED; The endpoint type. + EndpointType *EndpointType + + // REQUIRED; The endpoint uri. + EndpointURI *string + + // REQUIRED; The features rule. + FeaturesRule *ResourceTypeEndpointBaseFeaturesRule + + // REQUIRED; The locations. + Locations []*string -type ResourceProviderManifestPropertiesManagement struct { - IncidentContactEmail *string - IncidentRoutingService *string - IncidentRoutingTeam *string - ManifestOwners []*string - ResourceAccessPolicy *ResourceProviderManagementResourceAccessPolicy - ResourceAccessRoles []any - SchemaOwners []*string - ServiceTreeInfos []*ServiceTreeInfo -} + // REQUIRED; The required features. + RequiredFeatures []*string -type ResourceProviderManifestPropertiesProviderAuthentication struct { - // REQUIRED - AllowedAudiences []*string -} + // REQUIRED; The sku link. + SKULink *string -type ResourceProviderManifestPropertiesRequestHeaderOptions struct { - OptInHeaders *OptInHeaderType -} + // REQUIRED; This is a TimeSpan property. + Timeout *string -type ResourceProviderManifestPropertiesTemplateDeploymentOptions struct { - PreflightOptions []*PreflightOption - PreflightSupported *bool + // REQUIRED; The zones. + Zones []*string } -type ResourceProviderManifestProviderAuthentication struct { - // REQUIRED - AllowedAudiences []*string -} +// ResourceTypeEndpointBaseDstsConfiguration - The dsts configuration. +type ResourceTypeEndpointBaseDstsConfiguration struct { + // REQUIRED; The service name. + ServiceName *string -type ResourceProviderManifestReRegisterSubscriptionMetadata struct { - // REQUIRED - Enabled *bool - ConcurrencyLimit *int32 + // This is a URI property. + ServiceDNSName *string } -type ResourceProviderManifestRequestHeaderOptions struct { - OptInHeaders *OptInHeaderType +// ResourceTypeEndpointBaseFeaturesRule - The features rule. +type ResourceTypeEndpointBaseFeaturesRule struct { + // REQUIRED; The required feature policy. + RequiredFeaturesPolicy *FeaturesPolicy } -type ResourceType struct { - AllowedUnauthorizedActions []*string - AuthorizationActionMappings []*AuthorizationActionMapping - DefaultAPIVersion *string - DisallowedActionVerbs []*string - Endpoints []*ResourceProviderEndpoint - ExtendedLocations []*ExtendedLocationOptions - FeaturesRule *ResourceTypeFeaturesRule - IdentityManagement *ResourceTypeIdentityManagement - LinkedAccessChecks []*LinkedAccessCheck - LinkedOperationRules []*LinkedOperationRule - LoggingRules []*LoggingRule - MarketplaceType *ResourceTypeMarketplaceType - - // Anything - Metadata any - Name *string - RequestHeaderOptions *ResourceTypeRequestHeaderOptions - RequiredFeatures []*string - ResourceDeletionPolicy *ManifestResourceDeletionPolicy - ResourceValidation *ResourceValidation - RoutingType *RoutingType - SKULink *string - ServiceTreeInfos []*ServiceTreeInfo - SubscriptionStateRules []*SubscriptionStateRule - TemplateDeploymentPolicy *ResourceTypeTemplateDeploymentPolicy - ThrottlingRules []*ThrottlingRule -} +// ResourceTypeEndpointDstsConfiguration - The dsts configuration. +type ResourceTypeEndpointDstsConfiguration struct { + // REQUIRED; The service name. + ServiceName *string -type ResourceTypeEndpoint struct { - APIVersions []*string - Enabled *bool - Extensions []*ResourceTypeExtension - FeaturesRule *ResourceTypeEndpointFeaturesRule - Locations []*string - RequiredFeatures []*string - Timeout *string + // This is a URI property. + ServiceDNSName *string } +// ResourceTypeEndpointFeaturesRule - The features rule. type ResourceTypeEndpointFeaturesRule struct { - // REQUIRED + // REQUIRED; The required feature policy. RequiredFeaturesPolicy *FeaturesPolicy } type ResourceTypeExtension struct { - EndpointURI *string + // The endpoint uri. + EndpointURI *string + + // The extension categories. ExtensionCategories []*ExtensionCategory - Timeout *string + + // The timeout. + Timeout *string } type ResourceTypeExtensionOptions struct { + // Resource creation begin. ResourceCreationBegin *ResourceTypeExtensionOptionsResourceCreationBegin } +// ResourceTypeExtensionOptionsResourceCreationBegin - Resource creation begin. type ResourceTypeExtensionOptionsResourceCreationBegin struct { - Request []*ExtensionOptionType + // The request. + Request []*ExtensionOptionType + + // The response. Response []*ExtensionOptionType } +// ResourceTypeFeaturesRule - The features rule. type ResourceTypeFeaturesRule struct { - // REQUIRED + // REQUIRED; The required feature policy. RequiredFeaturesPolicy *FeaturesPolicy } +// ResourceTypeIdentityManagement - The identity management. type ResourceTypeIdentityManagement struct { + // The type. Type *IdentityManagementTypes } +type ResourceTypeOnBehalfOfToken struct { + // The action name. + ActionName *string + + // This is a TimeSpan property. + LifeTime *string +} + type ResourceTypeRegistration struct { + // Resource type registration kind. This Metadata is also used by portal/tooling/etc to render different UX experiences for + // resources of the same type. + Kind *ResourceTypeRegistrationKind Properties *ResourceTypeRegistrationProperties // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -846,6 +2609,9 @@ type ResourceTypeRegistration struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -853,167 +2619,554 @@ type ResourceTypeRegistration struct { type ResourceTypeRegistrationArrayResponseWithContinuation struct { // The URL to get to the next set of results, if there are any. NextLink *string - Value []*ResourceTypeRegistration + + // The value. + Value []*ResourceTypeRegistration } type ResourceTypeRegistrationProperties struct { - AllowedUnauthorizedActions []*string - AuthorizationActionMappings []*AuthorizationActionMapping - CheckNameAvailabilitySpecifications *ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications - DefaultAPIVersion *string - DisallowedActionVerbs []*string - EnableAsyncOperation *bool - EnableThirdPartyS2S *bool - Endpoints []*ResourceTypeEndpoint - ExtendedLocations []*ExtendedLocationOptions - ExtensionOptions *ResourceTypeRegistrationPropertiesExtensionOptions - FeaturesRule *ResourceTypeRegistrationPropertiesFeaturesRule - IdentityManagement *ResourceTypeRegistrationPropertiesIdentityManagement - IsPureProxy *bool - LinkedAccessChecks []*LinkedAccessCheck - LoggingRules []*LoggingRule - MarketplaceType *ResourceTypeRegistrationPropertiesMarketplaceType - ProvisioningState *ProvisioningState - Regionality *Regionality - RequestHeaderOptions *ResourceTypeRegistrationPropertiesRequestHeaderOptions - RequiredFeatures []*string - ResourceDeletionPolicy *ResourceDeletionPolicy - ResourceMovePolicy *ResourceTypeRegistrationPropertiesResourceMovePolicy - RoutingType *RoutingType - ServiceTreeInfos []*ServiceTreeInfo - SubscriptionLifecycleNotificationSpecifications *ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications - SubscriptionStateRules []*SubscriptionStateRule - SwaggerSpecifications []*SwaggerSpecification - TemplateDeploymentOptions *ResourceTypeRegistrationPropertiesTemplateDeploymentOptions - ThrottlingRules []*ThrottlingRule -} - -type ResourceTypeRegistrationPropertiesAutoGenerated struct { - AllowedUnauthorizedActions []*string - AuthorizationActionMappings []*AuthorizationActionMapping - CheckNameAvailabilitySpecifications *ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications - DefaultAPIVersion *string - DisallowedActionVerbs []*string - EnableAsyncOperation *bool - EnableThirdPartyS2S *bool - Endpoints []*ResourceTypeEndpoint - ExtendedLocations []*ExtendedLocationOptions - ExtensionOptions *ResourceTypeRegistrationPropertiesExtensionOptions - FeaturesRule *ResourceTypeRegistrationPropertiesFeaturesRule - IdentityManagement *ResourceTypeRegistrationPropertiesIdentityManagement - IsPureProxy *bool - LinkedAccessChecks []*LinkedAccessCheck - LoggingRules []*LoggingRule - MarketplaceType *ResourceTypeRegistrationPropertiesMarketplaceType - ProvisioningState *ProvisioningState - Regionality *Regionality - RequestHeaderOptions *ResourceTypeRegistrationPropertiesRequestHeaderOptions - RequiredFeatures []*string - ResourceDeletionPolicy *ResourceDeletionPolicy - ResourceMovePolicy *ResourceTypeRegistrationPropertiesResourceMovePolicy - RoutingType *RoutingType - ServiceTreeInfos []*ServiceTreeInfo + // The api profiles. + APIProfiles []*APIProfile + + // Add resource list target locations? + AddResourceListTargetLocations *bool + + // The additional options. + AdditionalOptions *AdditionalOptionsResourceTypeRegistration + + // The allow empty role assignments. + AllowEmptyRoleAssignments *bool + + // The allowed resource names. + AllowedResourceNames []*AllowedResourceName + + // Allowed template deployment reference actions. + AllowedTemplateDeploymentReferenceActions []*string + + // The allowed unauthorized actions. + AllowedUnauthorizedActions []*string + + // The allowed unauthorized actions extensions. + AllowedUnauthorizedActionsExtensions []*AllowedUnauthorizedActionsExtension + + // The async operation resource type name. + AsyncOperationResourceTypeName *string + + // Async timeout rules + AsyncTimeoutRules []*AsyncTimeoutRule + + // The authorization action mappings + AuthorizationActionMappings []*AuthorizationActionMapping + + // The availability zone rule. + AvailabilityZoneRule *ResourceTypeRegistrationPropertiesAvailabilityZoneRule + + // Capacity rule. + CapacityRule *ResourceTypeRegistrationPropertiesCapacityRule + + // The category. + Category *ResourceTypeCategory + + // The check name availability specifications. + CheckNameAvailabilitySpecifications *ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications + + // Common API versions for the resource type. + CommonAPIVersions []*string + + // The cross tenant token validation. + CrossTenantTokenValidation *CrossTenantTokenValidation + + // The default api version. + DefaultAPIVersion *string + + // The disallowed action verbs. + DisallowedActionVerbs []*string + + // The disallowed end user operations. + DisallowedEndUserOperations []*string + + // The dsts configuration. + DstsConfiguration *ResourceTypeRegistrationPropertiesDstsConfiguration + + // Whether async operation is enabled. + EnableAsyncOperation *bool + + // Whether third party S2S is enabled. + EnableThirdPartyS2S *bool + + // The extensions. + Endpoints []*ResourceTypeEndpoint + + // The extended locations. + ExtendedLocations []*ExtendedLocationOptions + + // The extension options. + ExtensionOptions *ResourceTypeRegistrationPropertiesExtensionOptions + + // The features rule. + FeaturesRule *ResourceTypeRegistrationPropertiesFeaturesRule + + // The frontdoor request mode. + FrontdoorRequestMode *FrontdoorRequestMode + + // Grouping tag. + GroupingTag *string + + // The identity management. + IdentityManagement *ResourceTypeRegistrationPropertiesIdentityManagement + + // Whether it is pure proxy. + IsPureProxy *bool + + // The legacy name. + LegacyName *string + + // The legacy names. + LegacyNames []*string + + // The legacy policy. + LegacyPolicy *ResourceTypeRegistrationPropertiesLegacyPolicy + + // The linked access checks. + LinkedAccessChecks []*LinkedAccessCheck + + // The linked notification rules. + LinkedNotificationRules []*LinkedNotificationRule + + // The linked operation rules. + LinkedOperationRules []*LinkedOperationRule + + // The logging rules. + LoggingRules []*LoggingRule + + // The resource provider management. + Management *ResourceTypeRegistrationPropertiesManagement + + // Manifest link. + ManifestLink *string + + // Marketplace options. + MarketplaceOptions *ResourceTypeRegistrationPropertiesMarketplaceOptions + + // The marketplace type. + MarketplaceType *MarketplaceType + + // The metadata. + Metadata map[string]any + + // The notifications. + Notifications []*Notification + + // The on behalf of tokens. + OnBehalfOfTokens *ResourceTypeOnBehalfOfToken + + // The open api configuration. + OpenAPIConfiguration *OpenAPIConfiguration + + // The policy execution type. + PolicyExecutionType *PolicyExecutionType + + // The quota rule. + QuotaRule *QuotaRule + + // The regionality. + Regionality *Regionality + + // The request header options. + RequestHeaderOptions *ResourceTypeRegistrationPropertiesRequestHeaderOptions + + // The required features. + RequiredFeatures []*string + + // Resource cache options. + ResourceCache *ResourceTypeRegistrationPropertiesResourceCache + + // The resource concurrency control options. + ResourceConcurrencyControlOptions map[string]*ResourceConcurrencyControlOption + + // The resource deletion policy. + ResourceDeletionPolicy *ResourceDeletionPolicy + + // The resource graph configuration. + ResourceGraphConfiguration *ResourceTypeRegistrationPropertiesResourceGraphConfiguration + + // Resource management options. + ResourceManagementOptions *ResourceTypeRegistrationPropertiesResourceManagementOptions + + // The resource move policy. + ResourceMovePolicy *ResourceTypeRegistrationPropertiesResourceMovePolicy + + // The resource provider authorization rules. + ResourceProviderAuthorizationRules *ResourceProviderAuthorizationRules + + // Resource query management options. + ResourceQueryManagement *ResourceTypeRegistrationPropertiesResourceQueryManagement + + // The resource sub type. + ResourceSubType *ResourceSubType + + // Resource type common attribute management. + ResourceTypeCommonAttributeManagement *ResourceTypeRegistrationPropertiesResourceTypeCommonAttributeManagement + + // The resource validation. + ResourceValidation *ResourceValidation + + // Routing rule. + RoutingRule *ResourceTypeRegistrationPropertiesRoutingRule + + // The routing type. + RoutingType *RoutingType + + // The sku link. + SKULink *string + + // The service tree infos. + ServiceTreeInfos []*ServiceTreeInfo + + // The subscription lifecycle notification specifications. SubscriptionLifecycleNotificationSpecifications *ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications - SubscriptionStateRules []*SubscriptionStateRule - SwaggerSpecifications []*SwaggerSpecification - TemplateDeploymentOptions *ResourceTypeRegistrationPropertiesTemplateDeploymentOptions - ThrottlingRules []*ThrottlingRule + + // The subscription state rules. + SubscriptionStateRules []*SubscriptionStateRule + + // Whether tags are supported. + SupportsTags *bool + + // The swagger specifications. + SwaggerSpecifications []*SwaggerSpecification + + // The template deployment options. + TemplateDeploymentOptions *ResourceTypeRegistrationPropertiesTemplateDeploymentOptions + + // The template deployment policy. + TemplateDeploymentPolicy *ResourceTypeRegistrationPropertiesTemplateDeploymentPolicy + + // The throttling rules. + ThrottlingRules []*ThrottlingRule + + // The token auth configuration. + TokenAuthConfiguration *TokenAuthConfiguration + + // READ-ONLY; The provisioning state. + ProvisioningState *ProvisioningState +} + +// ResourceTypeRegistrationPropertiesAvailabilityZoneRule - The availability zone rule. +type ResourceTypeRegistrationPropertiesAvailabilityZoneRule struct { + AvailabilityZonePolicy *AvailabilityZonePolicy +} + +// ResourceTypeRegistrationPropertiesCapacityRule - Capacity rule. +type ResourceTypeRegistrationPropertiesCapacityRule struct { + // Capacity policy. + CapacityPolicy *CapacityPolicy + + // Sku alias + SKUAlias *string } +// ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications - The check name availability specifications. type ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications struct { - EnableDefaultValidation *bool + // Whether default validation is enabled. + EnableDefaultValidation *bool + + // The resource types with custom validation. ResourceTypesWithCustomValidation []*string } +// ResourceTypeRegistrationPropertiesDstsConfiguration - The dsts configuration. +type ResourceTypeRegistrationPropertiesDstsConfiguration struct { + // REQUIRED; The service name. + ServiceName *string + + // This is a URI property. + ServiceDNSName *string +} + +// ResourceTypeRegistrationPropertiesExtensionOptions - The extension options. type ResourceTypeRegistrationPropertiesExtensionOptions struct { + // Resource creation begin. ResourceCreationBegin *ResourceTypeExtensionOptionsResourceCreationBegin } +// ResourceTypeRegistrationPropertiesFeaturesRule - The features rule. type ResourceTypeRegistrationPropertiesFeaturesRule struct { - // REQUIRED + // REQUIRED; The required feature policy. RequiredFeaturesPolicy *FeaturesPolicy } +// ResourceTypeRegistrationPropertiesIdentityManagement - The identity management. type ResourceTypeRegistrationPropertiesIdentityManagement struct { + // The application id. ApplicationID *string - Type *IdentityManagementTypes + + // The application ids. + ApplicationIDs []*string + + // The delegation app ids. + DelegationAppIDs []*string + + // The type. + Type *IdentityManagementTypes +} + +// ResourceTypeRegistrationPropertiesLegacyPolicy - The legacy policy. +type ResourceTypeRegistrationPropertiesLegacyPolicy struct { + DisallowedConditions []*LegacyDisallowedCondition + DisallowedLegacyOperations []*LegacyOperation +} + +// ResourceTypeRegistrationPropertiesManagement - The resource provider management. +type ResourceTypeRegistrationPropertiesManagement struct { + // The authorization owners. + AuthorizationOwners []*string + + // List of manifest owners for canary. + CanaryManifestOwners []*string + + // Options for error response messages. + ErrorResponseMessageOptions *ResourceProviderManagementErrorResponseMessageOptions + + // Metadata for expedited rollout. + ExpeditedRolloutMetadata *ResourceProviderManagementExpeditedRolloutMetadata + + // List of expedited rollout submitters. + ExpeditedRolloutSubmitters []*string + + // The incident contact email. + IncidentContactEmail *string + + // The incident routing service. + IncidentRoutingService *string + + // The incident routing team. + IncidentRoutingTeam *string + + // The manifest owners. + ManifestOwners []*string + + // The profit center code for the subscription. + PcCode *string + + // The profit center program id for the subscription. + ProfitCenterProgramID *string + + // The resource access policy. + ResourceAccessPolicy *ResourceAccessPolicy + + // The resource access roles. + ResourceAccessRoles []*ResourceAccessRole + + // The schema owners. + SchemaOwners []*string + + // The service tree infos. + ServiceTreeInfos []*ServiceTreeInfo +} + +// ResourceTypeRegistrationPropertiesMarketplaceOptions - Marketplace options. +type ResourceTypeRegistrationPropertiesMarketplaceOptions struct { + // Add-on plan conversion allowed. + AddOnPlanConversionAllowed *bool } +// ResourceTypeRegistrationPropertiesRequestHeaderOptions - The request header options. type ResourceTypeRegistrationPropertiesRequestHeaderOptions struct { + // The opt in headers. OptInHeaders *OptInHeaderType + + // The opt out headers. + OptOutHeaders *OptOutHeaderType +} + +// ResourceTypeRegistrationPropertiesResourceCache - Resource cache options. +type ResourceTypeRegistrationPropertiesResourceCache struct { + // Enable resource cache. + EnableResourceCache *bool + + // Resource cache expiration timespan. This is a TimeSpan property. + ResourceCacheExpirationTimespan *string +} + +// ResourceTypeRegistrationPropertiesResourceGraphConfiguration - The resource graph configuration. +type ResourceTypeRegistrationPropertiesResourceGraphConfiguration struct { + // The api version. + APIVersion *string + + // Whether it's enabled. + Enabled *bool +} + +// ResourceTypeRegistrationPropertiesResourceManagementOptions - Resource management options. +type ResourceTypeRegistrationPropertiesResourceManagementOptions struct { + // Batch provisioning support. + BatchProvisioningSupport *ResourceTypeRegistrationPropertiesResourceManagementOptionsBatchProvisioningSupport + + // Delete dependencies. + DeleteDependencies []*DeleteDependency + + // Nested provisioning support. + NestedProvisioningSupport *ResourceTypeRegistrationPropertiesResourceManagementOptionsNestedProvisioningSupport +} + +// ResourceTypeRegistrationPropertiesResourceManagementOptionsBatchProvisioningSupport - Batch provisioning support. +type ResourceTypeRegistrationPropertiesResourceManagementOptionsBatchProvisioningSupport struct { + // Supported operations. + SupportedOperations *SupportedOperations } +// ResourceTypeRegistrationPropertiesResourceManagementOptionsNestedProvisioningSupport - Nested provisioning support. +type ResourceTypeRegistrationPropertiesResourceManagementOptionsNestedProvisioningSupport struct { + // Minimum API version. + MinimumAPIVersion *string +} + +// ResourceTypeRegistrationPropertiesResourceMovePolicy - The resource move policy. type ResourceTypeRegistrationPropertiesResourceMovePolicy struct { + // Whether cross resource group move is enabled. CrossResourceGroupMoveEnabled *bool - CrossSubscriptionMoveEnabled *bool - ValidationRequired *bool + + // Whether cross subscription move is enabled. + CrossSubscriptionMoveEnabled *bool + + // Whether validation is required. + ValidationRequired *bool } +// ResourceTypeRegistrationPropertiesResourceQueryManagement - Resource query management options. +type ResourceTypeRegistrationPropertiesResourceQueryManagement struct { + // Filter option. + FilterOption *FilterOption +} + +// ResourceTypeRegistrationPropertiesResourceTypeCommonAttributeManagement - Resource type common attribute management. +type ResourceTypeRegistrationPropertiesResourceTypeCommonAttributeManagement struct { + // Common api versions merge mode. + CommonAPIVersionsMergeMode *CommonAPIVersionsMergeMode +} + +// ResourceTypeRegistrationPropertiesRoutingRule - Routing rule. +type ResourceTypeRegistrationPropertiesRoutingRule struct { + // Hosted resource type. + HostResourceType *string +} + +// ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications - The subscription lifecycle notification +// specifications. type ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications struct { - SoftDeleteTTL *string + // The soft delete TTL. + SoftDeleteTTL *string + + // The subscription state override actions. SubscriptionStateOverrideActions []*SubscriptionStateOverrideAction } +// ResourceTypeRegistrationPropertiesTemplateDeploymentOptions - The template deployment options. type ResourceTypeRegistrationPropertiesTemplateDeploymentOptions struct { - PreflightOptions []*PreflightOption + // The preflight options. + PreflightOptions []*PreflightOption + + // Whether preflight is supported. PreflightSupported *bool } +// ResourceTypeRegistrationPropertiesTemplateDeploymentPolicy - The template deployment policy. +type ResourceTypeRegistrationPropertiesTemplateDeploymentPolicy struct { + // REQUIRED; The capabilities. + Capabilities *TemplateDeploymentCapabilities + + // REQUIRED; The preflight options. + PreflightOptions *TemplateDeploymentPreflightOptions + + // The preflight notifications. + PreflightNotifications *TemplateDeploymentPreflightNotifications +} + +// ResourceTypeRequestHeaderOptions - The request header options. type ResourceTypeRequestHeaderOptions struct { + // The opt in headers. OptInHeaders *OptInHeaderType + + // The opt out headers. + OptOutHeaders *OptOutHeaderType } type ResourceTypeSKU struct { - // REQUIRED - SKUSettings []*SKUSetting + // REQUIRED; The sku settings. + SKUSettings []*SKUSetting + + // READ-ONLY; The provisioning state. ProvisioningState *ProvisioningState } +// ResourceTypeTemplateDeploymentPolicy - The template deployment policy. type ResourceTypeTemplateDeploymentPolicy struct { - // REQUIRED + // REQUIRED; The capabilities. Capabilities *TemplateDeploymentCapabilities - // REQUIRED + // REQUIRED; The preflight options. PreflightOptions *TemplateDeploymentPreflightOptions + + // The preflight notifications. + PreflightNotifications *TemplateDeploymentPreflightNotifications } type RolloutStatusBase struct { + // The completed regions. CompletedRegions []*string - // Dictionary of + // The failed or skipped regions. FailedOrSkippedRegions map[string]*ExtendedErrorInfo } type SKUCapability struct { - // REQUIRED + // REQUIRED; The name. Name *string - // REQUIRED + // REQUIRED; The value. Value *string } type SKUCapacity struct { - // REQUIRED - Minimum *int32 - Default *int32 - Maximum *int32 + // REQUIRED; The minimum. + Minimum *int32 + + // The default. + Default *int32 + + // The maximum. + Maximum *int32 + + // The scale type. ScaleType *SKUScaleType } type SKUCost struct { - // REQUIRED - MeterID *string + // REQUIRED; The meter id. + MeterID *string + + // The extended unit. ExtendedUnit *string - Quantity *int32 + + // The quantity. + Quantity *int32 } type SKULocationInfo struct { - // REQUIRED - Location *string + // REQUIRED; The location. + Location *string + + // The extended locations. ExtendedLocations []*string - Type *SKULocationInfoType - ZoneDetails []*SKUZoneDetail - Zones []*string + + // The type. + Type *ExtendedLocationType + + // The zone details. + ZoneDetails []*SKUZoneDetail + + // The zones. + Zones []*string } type SKUResource struct { @@ -1025,6 +3178,9 @@ type SKUResource struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -1032,110 +3188,243 @@ type SKUResource struct { type SKUResourceArrayResponseWithContinuation struct { // The URL to get to the next set of results, if there are any. NextLink *string - Value []*SKUResource + + // The sku resources. + Value []*SKUResource } type SKUResourceProperties struct { - // REQUIRED - SKUSettings []*SKUSetting + // REQUIRED; The sku settings. + SKUSettings []*SKUSetting + + // READ-ONLY; The provisioning state. ProvisioningState *ProvisioningState } type SKUSetting struct { - // REQUIRED - Name *string - Capabilities []*SKUCapability - Capacity *SKUSettingCapacity - Costs []*SKUCost - Family *string - Kind *string - LocationInfo []*SKULocationInfo - Locations []*string + // REQUIRED; The name. + Name *string + + // The capabilities. + Capabilities []*SKUCapability + + // The capacity. + Capacity *SKUSettingCapacity + + // The costs. + Costs []*SKUCost + + // The family. + Family *string + + // The kind. + Kind *string + + // The location info. + LocationInfo []*SKULocationInfo + + // The locations. + Locations []*string + + // The required features. RequiredFeatures []*string + + // The required quota ids. RequiredQuotaIDs []*string - Size *string - Tier *string + + // The size. + Size *string + + // The tier. + Tier *string } +// SKUSettingCapacity - The capacity. type SKUSettingCapacity struct { - // REQUIRED - Minimum *int32 - Default *int32 - Maximum *int32 + // REQUIRED; The minimum. + Minimum *int32 + + // The default. + Default *int32 + + // The maximum. + Maximum *int32 + + // The scale type. ScaleType *SKUScaleType } type SKUZoneDetail struct { + // The capabilities. Capabilities []*SKUCapability - Name []*string + + // The name. + Name []*string } type ServiceTreeInfo struct { + // The component id. ComponentID *string - ServiceID *string + + // The readiness. + Readiness *Readiness + + // The service id. + ServiceID *string +} + +type SubscriberSetting struct { + // The filter rules. + FilterRules []*FilterRule } type SubscriptionLifecycleNotificationSpecifications struct { - SoftDeleteTTL *string + // The soft delete TTL. + SoftDeleteTTL *string + + // The subscription state override actions. SubscriptionStateOverrideActions []*SubscriptionStateOverrideAction } type SubscriptionStateOverrideAction struct { - // REQUIRED + // REQUIRED; The action. Action *SubscriptionNotificationOperation - // REQUIRED + // REQUIRED; The state. State *SubscriptionTransitioningState } type SubscriptionStateRule struct { + // The allowed actions. AllowedActions []*string - State *SubscriptionState + + // The subscription state. + State *SubscriptionState } type SwaggerSpecification struct { - APIVersions []*string + // The api versions. + APIVersions []*string + + // The swagger spec folder uri. SwaggerSpecFolderURI *string } +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time + + // The identity that created the resource. + CreatedBy *string + + // The type of identity that created the resource. + CreatedByType *CreatedByType + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time + + // The identity that last modified the resource. + LastModifiedBy *string + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType +} + type TemplateDeploymentOptions struct { - PreflightOptions []*PreflightOption + // The preflight options. + PreflightOptions []*PreflightOption + + // Whether preflight is supported. PreflightSupported *bool } type TemplateDeploymentPolicy struct { - // REQUIRED + // REQUIRED; The capabilities. Capabilities *TemplateDeploymentCapabilities - // REQUIRED + // REQUIRED; The preflight options. PreflightOptions *TemplateDeploymentPreflightOptions + + // The preflight notifications. + PreflightNotifications *TemplateDeploymentPreflightNotifications +} + +type ThirdPartyExtension struct { + // Name of third party extension. + Name *string } type ThirdPartyProviderAuthorization struct { - Authorizations []*LightHouseAuthorization + // The authorizations. + Authorizations []*LightHouseAuthorization + + // The managed by tenant id. ManagedByTenantID *string } type ThrottlingMetric struct { - // REQUIRED + // REQUIRED; The limit. Limit *int64 - // REQUIRED - Type *ThrottlingMetricType + // REQUIRED; The throttling metric type + Type *ThrottlingMetricType + + // The interval. Interval *string } type ThrottlingRule struct { - // REQUIRED + // REQUIRED; The action. Action *string - // REQUIRED - Metrics []*ThrottlingMetric + // REQUIRED; The metrics. + Metrics []*ThrottlingMetric + + // The application id. + ApplicationID []*string + + // The required features. RequiredFeatures []*string } +type TokenAuthConfiguration struct { + // The authentication scheme. + AuthenticationScheme *AuthenticationScheme + + // Whether certification authentication fallback is disabled. + DisableCertificateAuthenticationFallback *bool + + // The signed request scope. + SignedRequestScope *SignedRequestScope +} + +// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' +// and a 'location' +type TrackedResource struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + type TrafficRegionRolloutConfiguration struct { - Regions []*string + Regions []*string + + // The wait duration. WaitDuration *string } @@ -1143,10 +3432,11 @@ type TrafficRegions struct { Regions []*string } +// TypedErrorInfo - Error information. type TypedErrorInfo struct { - // REQUIRED + // REQUIRED; The type of the error. Type *string - // READ-ONLY; Anything + // READ-ONLY; The error information. Info any } diff --git a/sdk/resourcemanager/providerhub/armproviderhub/models_serde.go b/sdk/resourcemanager/providerhub/armproviderhub/models_serde.go index c39f62dc44d0..0c51a2c0cf30 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/models_serde.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/models_serde.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,6 +12,254 @@ import ( "reflect" ) +// MarshalJSON implements the json.Marshaller interface for type APIProfile. +func (a APIProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiVersion", a.APIVersion) + populate(objectMap, "profileVersion", a.ProfileVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIProfile. +func (a *APIProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiVersion": + err = unpopulate(val, "APIVersion", &a.APIVersion) + delete(rawMsg, key) + case "profileVersion": + err = unpopulate(val, "ProfileVersion", &a.ProfileVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AdditionalAuthorization. +func (a AdditionalAuthorization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationId", a.ApplicationID) + populate(objectMap, "roleDefinitionId", a.RoleDefinitionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalAuthorization. +func (a *AdditionalAuthorization) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "applicationId": + err = unpopulate(val, "ApplicationID", &a.ApplicationID) + delete(rawMsg, key) + case "roleDefinitionId": + err = unpopulate(val, "RoleDefinitionID", &a.RoleDefinitionID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AllowedResourceName. +func (a AllowedResourceName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "getActionVerb", a.GetActionVerb) + populate(objectMap, "name", a.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AllowedResourceName. +func (a *AllowedResourceName) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "getActionVerb": + err = unpopulate(val, "GetActionVerb", &a.GetActionVerb) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AllowedUnauthorizedActionsExtension. +func (a AllowedUnauthorizedActionsExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", a.Action) + populate(objectMap, "intent", a.Intent) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AllowedUnauthorizedActionsExtension. +func (a *AllowedUnauthorizedActionsExtension) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &a.Action) + delete(rawMsg, key) + case "intent": + err = unpopulate(val, "Intent", &a.Intent) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationDataAuthorization. +func (a ApplicationDataAuthorization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceTypes", a.ResourceTypes) + populate(objectMap, "role", a.Role) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationDataAuthorization. +func (a *ApplicationDataAuthorization) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceTypes": + err = unpopulate(val, "ResourceTypes", &a.ResourceTypes) + delete(rawMsg, key) + case "role": + err = unpopulate(val, "Role", &a.Role) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationProviderAuthorization. +func (a ApplicationProviderAuthorization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "managedByRoleDefinitionId", a.ManagedByRoleDefinitionID) + populate(objectMap, "roleDefinitionId", a.RoleDefinitionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationProviderAuthorization. +func (a *ApplicationProviderAuthorization) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "managedByRoleDefinitionId": + err = unpopulate(val, "ManagedByRoleDefinitionID", &a.ManagedByRoleDefinitionID) + delete(rawMsg, key) + case "roleDefinitionId": + err = unpopulate(val, "RoleDefinitionID", &a.RoleDefinitionID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AsyncOperationPollingRules. +func (a AsyncOperationPollingRules) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalOptions", a.AdditionalOptions) + populate(objectMap, "authorizationActions", a.AuthorizationActions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AsyncOperationPollingRules. +func (a *AsyncOperationPollingRules) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalOptions": + err = unpopulate(val, "AdditionalOptions", &a.AdditionalOptions) + delete(rawMsg, key) + case "authorizationActions": + err = unpopulate(val, "AuthorizationActions", &a.AuthorizationActions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AsyncTimeoutRule. +func (a AsyncTimeoutRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionName", a.ActionName) + populate(objectMap, "timeout", a.Timeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AsyncTimeoutRule. +func (a *AsyncTimeoutRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionName": + err = unpopulate(val, "ActionName", &a.ActionName) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &a.Timeout) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AuthorizationActionMapping. func (a AuthorizationActionMapping) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -46,6 +291,115 @@ func (a *AuthorizationActionMapping) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AuthorizedApplication. +func (a AuthorizedApplication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizedApplication. +func (a *AuthorizedApplication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizedApplicationArrayResponseWithContinuation. +func (a AuthorizedApplicationArrayResponseWithContinuation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizedApplicationArrayResponseWithContinuation. +func (a *AuthorizedApplicationArrayResponseWithContinuation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizedApplicationProperties. +func (a AuthorizedApplicationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataAuthorizations", a.DataAuthorizations) + populate(objectMap, "providerAuthorization", a.ProviderAuthorization) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizedApplicationProperties. +func (a *AuthorizedApplicationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataAuthorizations": + err = unpopulate(val, "DataAuthorizations", &a.DataAuthorizations) + delete(rawMsg, key) + case "providerAuthorization": + err = unpopulate(val, "ProviderAuthorization", &a.ProviderAuthorization) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CanaryTrafficRegionRolloutConfiguration. func (c CanaryTrafficRegionRolloutConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -184,6 +538,7 @@ func (c CustomRollout) MarshalJSON() ([]byte, error) { populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } @@ -206,6 +561,9 @@ func (c *CustomRollout) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) @@ -283,47 +641,16 @@ func (c *CustomRolloutProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomRolloutPropertiesAutoGenerated. -func (c CustomRolloutPropertiesAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "specification", c.Specification) - populate(objectMap, "status", c.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomRolloutPropertiesAutoGenerated. -func (c *CustomRolloutPropertiesAutoGenerated) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "specification": - err = unpopulate(val, "Specification", &c.Specification) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CustomRolloutPropertiesSpecification. -func (c CustomRolloutPropertiesSpecification) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomRolloutPropertiesSpecification. +func (c CustomRolloutPropertiesSpecification) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "autoProvisionConfig", c.AutoProvisionConfig) populate(objectMap, "canary", c.Canary) populate(objectMap, "providerRegistration", c.ProviderRegistration) + populate(objectMap, "refreshSubscriptionRegistration", c.RefreshSubscriptionRegistration) + populate(objectMap, "releaseScopes", c.ReleaseScopes) populate(objectMap, "resourceTypeRegistrations", c.ResourceTypeRegistrations) + populate(objectMap, "skipReleaseScopeValidation", c.SkipReleaseScopeValidation) return json.Marshal(objectMap) } @@ -336,15 +663,27 @@ func (c *CustomRolloutPropertiesSpecification) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { + case "autoProvisionConfig": + err = unpopulate(val, "AutoProvisionConfig", &c.AutoProvisionConfig) + delete(rawMsg, key) case "canary": err = unpopulate(val, "Canary", &c.Canary) delete(rawMsg, key) case "providerRegistration": err = unpopulate(val, "ProviderRegistration", &c.ProviderRegistration) delete(rawMsg, key) + case "refreshSubscriptionRegistration": + err = unpopulate(val, "RefreshSubscriptionRegistration", &c.RefreshSubscriptionRegistration) + delete(rawMsg, key) + case "releaseScopes": + err = unpopulate(val, "ReleaseScopes", &c.ReleaseScopes) + delete(rawMsg, key) case "resourceTypeRegistrations": err = unpopulate(val, "ResourceTypeRegistrations", &c.ResourceTypeRegistrations) delete(rawMsg, key) + case "skipReleaseScopeValidation": + err = unpopulate(val, "SkipReleaseScopeValidation", &c.SkipReleaseScopeValidation) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -358,6 +697,7 @@ func (c CustomRolloutPropertiesStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "completedRegions", c.CompletedRegions) populate(objectMap, "failedOrSkippedRegions", c.FailedOrSkippedRegions) + populate(objectMap, "manifestCheckinStatus", c.ManifestCheckinStatus) return json.Marshal(objectMap) } @@ -376,6 +716,9 @@ func (c *CustomRolloutPropertiesStatus) UnmarshalJSON(data []byte) error { case "failedOrSkippedRegions": err = unpopulate(val, "FailedOrSkippedRegions", &c.FailedOrSkippedRegions) delete(rawMsg, key) + case "manifestCheckinStatus": + err = unpopulate(val, "ManifestCheckinStatus", &c.ManifestCheckinStatus) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -387,9 +730,13 @@ func (c *CustomRolloutPropertiesStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CustomRolloutSpecification. func (c CustomRolloutSpecification) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "autoProvisionConfig", c.AutoProvisionConfig) populate(objectMap, "canary", c.Canary) populate(objectMap, "providerRegistration", c.ProviderRegistration) + populate(objectMap, "refreshSubscriptionRegistration", c.RefreshSubscriptionRegistration) + populate(objectMap, "releaseScopes", c.ReleaseScopes) populate(objectMap, "resourceTypeRegistrations", c.ResourceTypeRegistrations) + populate(objectMap, "skipReleaseScopeValidation", c.SkipReleaseScopeValidation) return json.Marshal(objectMap) } @@ -402,15 +749,58 @@ func (c *CustomRolloutSpecification) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "autoProvisionConfig": + err = unpopulate(val, "AutoProvisionConfig", &c.AutoProvisionConfig) + delete(rawMsg, key) case "canary": err = unpopulate(val, "Canary", &c.Canary) delete(rawMsg, key) case "providerRegistration": err = unpopulate(val, "ProviderRegistration", &c.ProviderRegistration) delete(rawMsg, key) + case "refreshSubscriptionRegistration": + err = unpopulate(val, "RefreshSubscriptionRegistration", &c.RefreshSubscriptionRegistration) + delete(rawMsg, key) + case "releaseScopes": + err = unpopulate(val, "ReleaseScopes", &c.ReleaseScopes) + delete(rawMsg, key) case "resourceTypeRegistrations": err = unpopulate(val, "ResourceTypeRegistrations", &c.ResourceTypeRegistrations) delete(rawMsg, key) + case "skipReleaseScopeValidation": + err = unpopulate(val, "SkipReleaseScopeValidation", &c.SkipReleaseScopeValidation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomRolloutSpecificationAutoProvisionConfig. +func (c CustomRolloutSpecificationAutoProvisionConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceGraph", c.ResourceGraph) + populate(objectMap, "storage", c.Storage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomRolloutSpecificationAutoProvisionConfig. +func (c *CustomRolloutSpecificationAutoProvisionConfig) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceGraph": + err = unpopulate(val, "ResourceGraph", &c.ResourceGraph) + delete(rawMsg, key) + case "storage": + err = unpopulate(val, "Storage", &c.Storage) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -450,8 +840,10 @@ func (c *CustomRolloutSpecificationCanary) UnmarshalJSON(data []byte) error { func (c CustomRolloutSpecificationProviderRegistration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", c.ID) + populate(objectMap, "kind", c.Kind) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } @@ -468,12 +860,18 @@ func (c *CustomRolloutSpecificationProviderRegistration) UnmarshalJSON(data []by case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &c.Kind) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) @@ -490,6 +888,7 @@ func (c CustomRolloutStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "completedRegions", c.CompletedRegions) populate(objectMap, "failedOrSkippedRegions", c.FailedOrSkippedRegions) + populate(objectMap, "manifestCheckinStatus", c.ManifestCheckinStatus) return json.Marshal(objectMap) } @@ -508,6 +907,48 @@ func (c *CustomRolloutStatus) UnmarshalJSON(data []byte) error { case "failedOrSkippedRegions": err = unpopulate(val, "FailedOrSkippedRegions", &c.FailedOrSkippedRegions) delete(rawMsg, key) + case "manifestCheckinStatus": + err = unpopulate(val, "ManifestCheckinStatus", &c.ManifestCheckinStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomRolloutStatusManifestCheckinStatus. +func (c CustomRolloutStatusManifestCheckinStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "commitId", c.CommitID) + populate(objectMap, "isCheckedIn", c.IsCheckedIn) + populate(objectMap, "pullRequest", c.PullRequest) + populate(objectMap, "statusMessage", c.StatusMessage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomRolloutStatusManifestCheckinStatus. +func (c *CustomRolloutStatusManifestCheckinStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "commitId": + err = unpopulate(val, "CommitID", &c.CommitID) + delete(rawMsg, key) + case "isCheckedIn": + err = unpopulate(val, "IsCheckedIn", &c.IsCheckedIn) + delete(rawMsg, key) + case "pullRequest": + err = unpopulate(val, "PullRequest", &c.PullRequest) + delete(rawMsg, key) + case "statusMessage": + err = unpopulate(val, "StatusMessage", &c.StatusMessage) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -522,6 +963,7 @@ func (d DefaultRollout) MarshalJSON() ([]byte, error) { populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } @@ -544,6 +986,9 @@ func (d *DefaultRollout) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) @@ -621,45 +1066,12 @@ func (d *DefaultRolloutProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DefaultRolloutPropertiesAutoGenerated. -func (d DefaultRolloutPropertiesAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "specification", d.Specification) - populate(objectMap, "status", d.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultRolloutPropertiesAutoGenerated. -func (d *DefaultRolloutPropertiesAutoGenerated) 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 "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "specification": - err = unpopulate(val, "Specification", &d.Specification) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) - 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 DefaultRolloutPropertiesSpecification. func (d DefaultRolloutPropertiesSpecification) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "autoProvisionConfig", d.AutoProvisionConfig) populate(objectMap, "canary", d.Canary) + populate(objectMap, "expeditedRollout", d.ExpeditedRollout) populate(objectMap, "highTraffic", d.HighTraffic) populate(objectMap, "lowTraffic", d.LowTraffic) populate(objectMap, "mediumTraffic", d.MediumTraffic) @@ -679,9 +1091,15 @@ func (d *DefaultRolloutPropertiesSpecification) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { + case "autoProvisionConfig": + err = unpopulate(val, "AutoProvisionConfig", &d.AutoProvisionConfig) + delete(rawMsg, key) case "canary": err = unpopulate(val, "Canary", &d.Canary) delete(rawMsg, key) + case "expeditedRollout": + err = unpopulate(val, "ExpeditedRollout", &d.ExpeditedRollout) + delete(rawMsg, key) case "highTraffic": err = unpopulate(val, "HighTraffic", &d.HighTraffic) delete(rawMsg, key) @@ -716,6 +1134,7 @@ func (d DefaultRolloutPropertiesStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "completedRegions", d.CompletedRegions) populate(objectMap, "failedOrSkippedRegions", d.FailedOrSkippedRegions) + populate(objectMap, "manifestCheckinStatus", d.ManifestCheckinStatus) populate(objectMap, "nextTrafficRegion", d.NextTrafficRegion) populateDateTimeRFC3339(objectMap, "nextTrafficRegionScheduledTime", d.NextTrafficRegionScheduledTime) populate(objectMap, "subscriptionReregistrationResult", d.SubscriptionReregistrationResult) @@ -737,6 +1156,9 @@ func (d *DefaultRolloutPropertiesStatus) UnmarshalJSON(data []byte) error { case "failedOrSkippedRegions": err = unpopulate(val, "FailedOrSkippedRegions", &d.FailedOrSkippedRegions) delete(rawMsg, key) + case "manifestCheckinStatus": + err = unpopulate(val, "ManifestCheckinStatus", &d.ManifestCheckinStatus) + delete(rawMsg, key) case "nextTrafficRegion": err = unpopulate(val, "NextTrafficRegion", &d.NextTrafficRegion) delete(rawMsg, key) @@ -757,7 +1179,9 @@ func (d *DefaultRolloutPropertiesStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefaultRolloutSpecification. func (d DefaultRolloutSpecification) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "autoProvisionConfig", d.AutoProvisionConfig) populate(objectMap, "canary", d.Canary) + populate(objectMap, "expeditedRollout", d.ExpeditedRollout) populate(objectMap, "highTraffic", d.HighTraffic) populate(objectMap, "lowTraffic", d.LowTraffic) populate(objectMap, "mediumTraffic", d.MediumTraffic) @@ -777,9 +1201,15 @@ func (d *DefaultRolloutSpecification) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "autoProvisionConfig": + err = unpopulate(val, "AutoProvisionConfig", &d.AutoProvisionConfig) + delete(rawMsg, key) case "canary": err = unpopulate(val, "Canary", &d.Canary) delete(rawMsg, key) + case "expeditedRollout": + err = unpopulate(val, "ExpeditedRollout", &d.ExpeditedRollout) + delete(rawMsg, key) case "highTraffic": err = unpopulate(val, "HighTraffic", &d.HighTraffic) delete(rawMsg, key) @@ -809,6 +1239,37 @@ func (d *DefaultRolloutSpecification) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DefaultRolloutSpecificationAutoProvisionConfig. +func (d DefaultRolloutSpecificationAutoProvisionConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceGraph", d.ResourceGraph) + populate(objectMap, "storage", d.Storage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultRolloutSpecificationAutoProvisionConfig. +func (d *DefaultRolloutSpecificationAutoProvisionConfig) 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 "resourceGraph": + err = unpopulate(val, "ResourceGraph", &d.ResourceGraph) + delete(rawMsg, key) + case "storage": + err = unpopulate(val, "Storage", &d.Storage) + 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 DefaultRolloutSpecificationCanary. func (d DefaultRolloutSpecificationCanary) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -840,6 +1301,33 @@ func (d *DefaultRolloutSpecificationCanary) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DefaultRolloutSpecificationExpeditedRollout. +func (d DefaultRolloutSpecificationExpeditedRollout) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", d.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultRolloutSpecificationExpeditedRollout. +func (d *DefaultRolloutSpecificationExpeditedRollout) 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 "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + 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 DefaultRolloutSpecificationHighTraffic. func (d DefaultRolloutSpecificationHighTraffic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -937,8 +1425,10 @@ func (d *DefaultRolloutSpecificationMediumTraffic) UnmarshalJSON(data []byte) er func (d DefaultRolloutSpecificationProviderRegistration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", d.ID) + populate(objectMap, "kind", d.Kind) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } @@ -955,12 +1445,18 @@ func (d *DefaultRolloutSpecificationProviderRegistration) UnmarshalJSON(data []b case "id": err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) @@ -1039,6 +1535,7 @@ func (d DefaultRolloutStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "completedRegions", d.CompletedRegions) populate(objectMap, "failedOrSkippedRegions", d.FailedOrSkippedRegions) + populate(objectMap, "manifestCheckinStatus", d.ManifestCheckinStatus) populate(objectMap, "nextTrafficRegion", d.NextTrafficRegion) populateDateTimeRFC3339(objectMap, "nextTrafficRegionScheduledTime", d.NextTrafficRegionScheduledTime) populate(objectMap, "subscriptionReregistrationResult", d.SubscriptionReregistrationResult) @@ -1060,6 +1557,9 @@ func (d *DefaultRolloutStatus) UnmarshalJSON(data []byte) error { case "failedOrSkippedRegions": err = unpopulate(val, "FailedOrSkippedRegions", &d.FailedOrSkippedRegions) delete(rawMsg, key) + case "manifestCheckinStatus": + err = unpopulate(val, "ManifestCheckinStatus", &d.ManifestCheckinStatus) + delete(rawMsg, key) case "nextTrafficRegion": err = unpopulate(val, "NextTrafficRegion", &d.NextTrafficRegion) delete(rawMsg, key) @@ -1077,135 +1577,122 @@ func (d *DefaultRolloutStatus) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Error. -func (e Error) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefaultRolloutStatusManifestCheckinStatus. +func (d DefaultRolloutStatusManifestCheckinStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "innerError", e.InnerError) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) + populate(objectMap, "commitId", d.CommitID) + populate(objectMap, "isCheckedIn", d.IsCheckedIn) + populate(objectMap, "pullRequest", d.PullRequest) + populate(objectMap, "statusMessage", d.StatusMessage) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Error. -func (e *Error) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultRolloutStatusManifestCheckinStatus. +func (d *DefaultRolloutStatusManifestCheckinStatus) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &e.Details) + case "commitId": + err = unpopulate(val, "CommitID", &d.CommitID) delete(rawMsg, key) - case "innerError": - err = unpopulate(val, "InnerError", &e.InnerError) + case "isCheckedIn": + err = unpopulate(val, "IsCheckedIn", &d.IsCheckedIn) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) + case "pullRequest": + err = unpopulate(val, "PullRequest", &d.PullRequest) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) + case "statusMessage": + err = unpopulate(val, "StatusMessage", &d.StatusMessage) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorInnerError. -func (e ErrorInnerError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeleteDependency. +func (d DeleteDependency) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", e.Code) - populateAny(objectMap, "innerError", e.InnerError) - if e.AdditionalProperties != nil { - for key, val := range e.AdditionalProperties { - objectMap[key] = val - } - } + populate(objectMap, "linkedProperty", d.LinkedProperty) + populate(objectMap, "linkedType", d.LinkedType) + populate(objectMap, "requiredFeatures", d.RequiredFeatures) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorInnerError. -func (e *ErrorInnerError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeleteDependency. +func (d *DeleteDependency) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &e.Code) + case "linkedProperty": + err = unpopulate(val, "LinkedProperty", &d.LinkedProperty) delete(rawMsg, key) - case "innerError": - err = unpopulate(val, "InnerError", &e.InnerError) + case "linkedType": + err = unpopulate(val, "LinkedType", &d.LinkedType) delete(rawMsg, key) - default: - if e.AdditionalProperties == nil { - e.AdditionalProperties = map[string]any{} - } - if val != nil { - var aux any - err = json.Unmarshal(val, &aux) - e.AdditionalProperties[key] = aux - } + case "requiredFeatures": + err = unpopulate(val, "RequiredFeatures", &d.RequiredFeatures) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. -func (e ErrorResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DstsConfiguration. +func (d DstsConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "error", e.Error) + populate(objectMap, "serviceDnsName", d.ServiceDNSName) + populate(objectMap, "serviceName", d.ServiceName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. -func (e *ErrorResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DstsConfiguration. +func (d *DstsConfiguration) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "error": - err = unpopulate(val, "Error", &e.Error) + case "serviceDnsName": + err = unpopulate(val, "ServiceDNSName", &d.ServiceDNSName) + delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &d.ServiceName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorResponseError. -func (e ErrorResponseError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EndpointInformation. +func (e EndpointInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "innerError", e.InnerError) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) + populate(objectMap, "endpoint", e.Endpoint) + populate(objectMap, "endpointType", e.EndpointType) + populate(objectMap, "schemaVersion", e.SchemaVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseError. -func (e *ErrorResponseError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointInformation. +func (e *EndpointInformation) 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", e, err) @@ -1213,20 +1700,14 @@ func (e *ErrorResponseError) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &e.Details) + case "endpoint": + err = unpopulate(val, "Endpoint", &e.Endpoint) delete(rawMsg, key) - case "innerError": - err = unpopulate(val, "InnerError", &e.InnerError) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) + case "endpointType": + err = unpopulate(val, "EndpointType", &e.EndpointType) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) + case "schemaVersion": + err = unpopulate(val, "SchemaVersion", &e.SchemaVersion) delete(rawMsg, key) } if err != nil { @@ -1236,19 +1717,16 @@ func (e *ErrorResponseError) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExtendedErrorInfo. -func (e ExtendedErrorInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "additionalInfo", e.AdditionalInfo) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedErrorInfo. -func (e *ExtendedErrorInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) 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", e, err) @@ -1256,8 +1734,42 @@ func (e *ExtendedErrorInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "additionalInfo": - err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + case "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) delete(rawMsg, key) case "code": err = unpopulate(val, "Code", &e.Code) @@ -1279,16 +1791,15 @@ func (e *ExtendedErrorInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExtendedLocationOptions. -func (e ExtendedLocationOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "supportedPolicy", e.SupportedPolicy) - populate(objectMap, "type", e.Type) + populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocationOptions. -func (e *ExtendedLocationOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) 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", e, err) @@ -1296,11 +1807,8 @@ func (e *ExtendedLocationOptions) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "supportedPolicy": - err = unpopulate(val, "SupportedPolicy", &e.SupportedPolicy) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "error": + err = unpopulate(val, "Error", &e.Error) delete(rawMsg, key) } if err != nil { @@ -1310,16 +1818,15 @@ func (e *ExtendedLocationOptions) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExtensionOptions. -func (e ExtensionOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExpeditedRolloutDefinition. +func (e ExpeditedRolloutDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "request", e.Request) - populate(objectMap, "response", e.Response) + populate(objectMap, "enabled", e.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionOptions. -func (e *ExtensionOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpeditedRolloutDefinition. +func (e *ExpeditedRolloutDefinition) 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", e, err) @@ -1327,11 +1834,8 @@ func (e *ExtensionOptions) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "request": - err = unpopulate(val, "Request", &e.Request) - delete(rawMsg, key) - case "response": - err = unpopulate(val, "Response", &e.Response) + case "enabled": + err = unpopulate(val, "Enabled", &e.Enabled) delete(rawMsg, key) } if err != nil { @@ -1341,2707 +1845,5976 @@ func (e *ExtensionOptions) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type FeaturesRule. -func (f FeaturesRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExtendedErrorInfo. +func (e ExtendedErrorInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "requiredFeaturesPolicy", f.RequiredFeaturesPolicy) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturesRule. -func (f *FeaturesRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedErrorInfo. +func (e *ExtendedErrorInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "requiredFeaturesPolicy": - err = unpopulate(val, "RequiredFeaturesPolicy", &f.RequiredFeaturesPolicy) + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentityManagement. -func (i IdentityManagement) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExtendedLocationOptions. +func (e ExtendedLocationOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "type", i.Type) + populate(objectMap, "supportedPolicy", e.SupportedPolicy) + populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityManagement. -func (i *IdentityManagement) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocationOptions. +func (e *ExtendedLocationOptions) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { + case "supportedPolicy": + err = unpopulate(val, "SupportedPolicy", &e.SupportedPolicy) + delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &i.Type) + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentityManagementProperties. -func (i IdentityManagementProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExtensionOptions. +func (e ExtensionOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "applicationId", i.ApplicationID) - populate(objectMap, "type", i.Type) + populate(objectMap, "request", e.Request) + populate(objectMap, "response", e.Response) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityManagementProperties. -func (i *IdentityManagementProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionOptions. +func (e *ExtensionOptions) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "applicationId": - err = unpopulate(val, "ApplicationID", &i.ApplicationID) + case "request": + err = unpopulate(val, "Request", &e.Request) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "response": + err = unpopulate(val, "Response", &e.Response) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InnerError. -func (i InnerError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FanoutLinkedNotificationRule. +func (f FanoutLinkedNotificationRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", i.Code) - populateAny(objectMap, "innerError", i.InnerError) - if i.AdditionalProperties != nil { - for key, val := range i.AdditionalProperties { - objectMap[key] = val - } - } + populate(objectMap, "actions", f.Actions) + populate(objectMap, "dstsConfiguration", f.DstsConfiguration) + populate(objectMap, "endpoints", f.Endpoints) + populate(objectMap, "tokenAuthConfiguration", f.TokenAuthConfiguration) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InnerError. -func (i *InnerError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FanoutLinkedNotificationRule. +func (f *FanoutLinkedNotificationRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &i.Code) + case "actions": + err = unpopulate(val, "Actions", &f.Actions) + delete(rawMsg, key) + case "dstsConfiguration": + err = unpopulate(val, "DstsConfiguration", &f.DstsConfiguration) delete(rawMsg, key) - case "innerError": - err = unpopulate(val, "InnerError", &i.InnerError) + case "endpoints": + err = unpopulate(val, "Endpoints", &f.Endpoints) delete(rawMsg, key) - default: - if i.AdditionalProperties == nil { - i.AdditionalProperties = map[string]any{} - } - if val != nil { - var aux any - err = json.Unmarshal(val, &aux) - i.AdditionalProperties[key] = aux - } + case "tokenAuthConfiguration": + err = unpopulate(val, "TokenAuthConfiguration", &f.TokenAuthConfiguration) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LightHouseAuthorization. -func (l LightHouseAuthorization) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FanoutLinkedNotificationRuleDstsConfiguration. +func (f FanoutLinkedNotificationRuleDstsConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "principalId", l.PrincipalID) - populate(objectMap, "roleDefinitionId", l.RoleDefinitionID) + populate(objectMap, "serviceDnsName", f.ServiceDNSName) + populate(objectMap, "serviceName", f.ServiceName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LightHouseAuthorization. -func (l *LightHouseAuthorization) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FanoutLinkedNotificationRuleDstsConfiguration. +func (f *FanoutLinkedNotificationRuleDstsConfiguration) 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) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &l.PrincipalID) + case "serviceDnsName": + err = unpopulate(val, "ServiceDNSName", &f.ServiceDNSName) delete(rawMsg, key) - case "roleDefinitionId": - err = unpopulate(val, "RoleDefinitionID", &l.RoleDefinitionID) + case "serviceName": + err = unpopulate(val, "ServiceName", &f.ServiceName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LinkedAccessCheck. -func (l LinkedAccessCheck) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FeaturesRule. +func (f FeaturesRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "actionName", l.ActionName) - populate(objectMap, "linkedAction", l.LinkedAction) - populate(objectMap, "linkedActionVerb", l.LinkedActionVerb) - populate(objectMap, "linkedProperty", l.LinkedProperty) - populate(objectMap, "linkedType", l.LinkedType) + populate(objectMap, "requiredFeaturesPolicy", f.RequiredFeaturesPolicy) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedAccessCheck. -func (l *LinkedAccessCheck) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturesRule. +func (f *FeaturesRule) 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) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "actionName": - err = unpopulate(val, "ActionName", &l.ActionName) - delete(rawMsg, key) - case "linkedAction": - err = unpopulate(val, "LinkedAction", &l.LinkedAction) - delete(rawMsg, key) - case "linkedActionVerb": - err = unpopulate(val, "LinkedActionVerb", &l.LinkedActionVerb) - delete(rawMsg, key) - case "linkedProperty": - err = unpopulate(val, "LinkedProperty", &l.LinkedProperty) - delete(rawMsg, key) - case "linkedType": - err = unpopulate(val, "LinkedType", &l.LinkedType) + case "requiredFeaturesPolicy": + err = unpopulate(val, "RequiredFeaturesPolicy", &f.RequiredFeaturesPolicy) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LinkedOperationRule. -func (l LinkedOperationRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FilterRule. +func (f FilterRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "linkedAction", l.LinkedAction) - populate(objectMap, "linkedOperation", l.LinkedOperation) + populate(objectMap, "endpointInformation", f.EndpointInformation) + populate(objectMap, "filterQuery", f.FilterQuery) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedOperationRule. -func (l *LinkedOperationRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FilterRule. +func (f *FilterRule) 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) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "linkedAction": - err = unpopulate(val, "LinkedAction", &l.LinkedAction) + case "endpointInformation": + err = unpopulate(val, "EndpointInformation", &f.EndpointInformation) delete(rawMsg, key) - case "linkedOperation": - err = unpopulate(val, "LinkedOperation", &l.LinkedOperation) + case "filterQuery": + err = unpopulate(val, "FilterQuery", &f.FilterQuery) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LoggingHiddenPropertyPath. -func (l LoggingHiddenPropertyPath) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FrontloadPayload. +func (f FrontloadPayload) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "hiddenPathsOnRequest", l.HiddenPathsOnRequest) - populate(objectMap, "hiddenPathsOnResponse", l.HiddenPathsOnResponse) + populate(objectMap, "properties", f.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LoggingHiddenPropertyPath. -func (l *LoggingHiddenPropertyPath) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FrontloadPayload. +func (f *FrontloadPayload) 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) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "hiddenPathsOnRequest": - err = unpopulate(val, "HiddenPathsOnRequest", &l.HiddenPathsOnRequest) - delete(rawMsg, key) - case "hiddenPathsOnResponse": - err = unpopulate(val, "HiddenPathsOnResponse", &l.HiddenPathsOnResponse) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LoggingRule. -func (l LoggingRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FrontloadPayloadProperties. +func (f FrontloadPayloadProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "action", l.Action) - populate(objectMap, "detailLevel", l.DetailLevel) - populate(objectMap, "direction", l.Direction) - populate(objectMap, "hiddenPropertyPaths", l.HiddenPropertyPaths) + populate(objectMap, "copyFromLocation", f.CopyFromLocation) + populate(objectMap, "environmentType", f.EnvironmentType) + populate(objectMap, "excludeResourceTypes", f.ExcludeResourceTypes) + populate(objectMap, "frontloadLocation", f.FrontloadLocation) + populate(objectMap, "ignoreFields", f.IgnoreFields) + populate(objectMap, "includeResourceTypes", f.IncludeResourceTypes) + populate(objectMap, "operationType", f.OperationType) + populate(objectMap, "overrideEndpointLevelFields", f.OverrideEndpointLevelFields) + populate(objectMap, "overrideManifestLevelFields", f.OverrideManifestLevelFields) + populate(objectMap, "providerNamespace", f.ProviderNamespace) + populate(objectMap, "serviceFeatureFlag", f.ServiceFeatureFlag) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LoggingRule. -func (l *LoggingRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FrontloadPayloadProperties. +func (f *FrontloadPayloadProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "action": - err = unpopulate(val, "Action", &l.Action) + case "copyFromLocation": + err = unpopulate(val, "CopyFromLocation", &f.CopyFromLocation) delete(rawMsg, key) - case "detailLevel": - err = unpopulate(val, "DetailLevel", &l.DetailLevel) + case "environmentType": + err = unpopulate(val, "EnvironmentType", &f.EnvironmentType) delete(rawMsg, key) - case "direction": - err = unpopulate(val, "Direction", &l.Direction) + case "excludeResourceTypes": + err = unpopulate(val, "ExcludeResourceTypes", &f.ExcludeResourceTypes) delete(rawMsg, key) - case "hiddenPropertyPaths": - err = unpopulate(val, "HiddenPropertyPaths", &l.HiddenPropertyPaths) + case "frontloadLocation": + err = unpopulate(val, "FrontloadLocation", &f.FrontloadLocation) + delete(rawMsg, key) + case "ignoreFields": + err = unpopulate(val, "IgnoreFields", &f.IgnoreFields) + delete(rawMsg, key) + case "includeResourceTypes": + err = unpopulate(val, "IncludeResourceTypes", &f.IncludeResourceTypes) + delete(rawMsg, key) + case "operationType": + err = unpopulate(val, "OperationType", &f.OperationType) + delete(rawMsg, key) + case "overrideEndpointLevelFields": + err = unpopulate(val, "OverrideEndpointLevelFields", &f.OverrideEndpointLevelFields) + delete(rawMsg, key) + case "overrideManifestLevelFields": + err = unpopulate(val, "OverrideManifestLevelFields", &f.OverrideManifestLevelFields) + delete(rawMsg, key) + case "providerNamespace": + err = unpopulate(val, "ProviderNamespace", &f.ProviderNamespace) + delete(rawMsg, key) + case "serviceFeatureFlag": + err = unpopulate(val, "ServiceFeatureFlag", &f.ServiceFeatureFlag) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LoggingRuleHiddenPropertyPaths. -func (l LoggingRuleHiddenPropertyPaths) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FrontloadPayloadPropertiesOverrideEndpointLevelFields. +func (f FrontloadPayloadPropertiesOverrideEndpointLevelFields) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "hiddenPathsOnRequest", l.HiddenPathsOnRequest) - populate(objectMap, "hiddenPathsOnResponse", l.HiddenPathsOnResponse) + populate(objectMap, "apiVersion", f.APIVersion) + populate(objectMap, "apiVersions", f.APIVersions) + populate(objectMap, "dstsConfiguration", f.DstsConfiguration) + populate(objectMap, "enabled", f.Enabled) + populate(objectMap, "endpointType", f.EndpointType) + populate(objectMap, "endpointUri", f.EndpointURI) + populate(objectMap, "featuresRule", f.FeaturesRule) + populate(objectMap, "locations", f.Locations) + populate(objectMap, "requiredFeatures", f.RequiredFeatures) + populate(objectMap, "skuLink", f.SKULink) + populate(objectMap, "timeout", f.Timeout) + populate(objectMap, "zones", f.Zones) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LoggingRuleHiddenPropertyPaths. -func (l *LoggingRuleHiddenPropertyPaths) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FrontloadPayloadPropertiesOverrideEndpointLevelFields. +func (f *FrontloadPayloadPropertiesOverrideEndpointLevelFields) 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) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "hiddenPathsOnRequest": - err = unpopulate(val, "HiddenPathsOnRequest", &l.HiddenPathsOnRequest) + case "apiVersion": + err = unpopulate(val, "APIVersion", &f.APIVersion) delete(rawMsg, key) - case "hiddenPathsOnResponse": - err = unpopulate(val, "HiddenPathsOnResponse", &l.HiddenPathsOnResponse) + case "apiVersions": + err = unpopulate(val, "APIVersions", &f.APIVersions) + delete(rawMsg, key) + case "dstsConfiguration": + err = unpopulate(val, "DstsConfiguration", &f.DstsConfiguration) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &f.Enabled) + delete(rawMsg, key) + case "endpointType": + err = unpopulate(val, "EndpointType", &f.EndpointType) + delete(rawMsg, key) + case "endpointUri": + err = unpopulate(val, "EndpointURI", &f.EndpointURI) + delete(rawMsg, key) + case "featuresRule": + err = unpopulate(val, "FeaturesRule", &f.FeaturesRule) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &f.Locations) + delete(rawMsg, key) + case "requiredFeatures": + err = unpopulate(val, "RequiredFeatures", &f.RequiredFeatures) + delete(rawMsg, key) + case "skuLink": + err = unpopulate(val, "SKULink", &f.SKULink) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &f.Timeout) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &f.Zones) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Metadata. -func (m Metadata) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FrontloadPayloadPropertiesOverrideManifestLevelFields. +func (f FrontloadPayloadPropertiesOverrideManifestLevelFields) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "providerAuthentication", m.ProviderAuthentication) - populate(objectMap, "providerAuthorizations", m.ProviderAuthorizations) - populate(objectMap, "thirdPartyProviderAuthorization", m.ThirdPartyProviderAuthorization) + populate(objectMap, "resourceHydrationAccounts", f.ResourceHydrationAccounts) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Metadata. -func (m *Metadata) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FrontloadPayloadPropertiesOverrideManifestLevelFields. +func (f *FrontloadPayloadPropertiesOverrideManifestLevelFields) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "providerAuthentication": - err = unpopulate(val, "ProviderAuthentication", &m.ProviderAuthentication) - delete(rawMsg, key) - case "providerAuthorizations": - err = unpopulate(val, "ProviderAuthorizations", &m.ProviderAuthorizations) - delete(rawMsg, key) - case "thirdPartyProviderAuthorization": - err = unpopulate(val, "ThirdPartyProviderAuthorization", &m.ThirdPartyProviderAuthorization) + case "resourceHydrationAccounts": + err = unpopulate(val, "ResourceHydrationAccounts", &f.ResourceHydrationAccounts) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetadataProviderAuthentication. -func (m MetadataProviderAuthentication) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GroupConnectivityInformation. +func (g GroupConnectivityInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedAudiences", m.AllowedAudiences) + populate(objectMap, "groupId", g.GroupID) + populate(objectMap, "redirectMapId", g.RedirectMapID) + populate(objectMap, "requiredMembers", g.RequiredMembers) + populate(objectMap, "requiredZoneNames", g.RequiredZoneNames) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetadataProviderAuthentication. -func (m *MetadataProviderAuthentication) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupConnectivityInformation. +func (g *GroupConnectivityInformation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "allowedAudiences": - err = unpopulate(val, "AllowedAudiences", &m.AllowedAudiences) + case "groupId": + err = unpopulate(val, "GroupID", &g.GroupID) + delete(rawMsg, key) + case "redirectMapId": + err = unpopulate(val, "RedirectMapID", &g.RedirectMapID) + delete(rawMsg, key) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &g.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &g.RequiredZoneNames) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetadataThirdPartyProviderAuthorization. -func (m MetadataThirdPartyProviderAuthorization) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IdentityManagement. +func (i IdentityManagement) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authorizations", m.Authorizations) - populate(objectMap, "managedByTenantId", m.ManagedByTenantID) + populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetadataThirdPartyProviderAuthorization. -func (m *MetadataThirdPartyProviderAuthorization) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityManagement. +func (i *IdentityManagement) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "authorizations": - err = unpopulate(val, "Authorizations", &m.Authorizations) - delete(rawMsg, key) - case "managedByTenantId": - err = unpopulate(val, "ManagedByTenantID", &m.ManagedByTenantID) + case "type": + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotificationEndpoint. -func (n NotificationEndpoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IdentityManagementProperties. +func (i IdentityManagementProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "locations", n.Locations) - populate(objectMap, "notificationDestination", n.NotificationDestination) + populate(objectMap, "applicationId", i.ApplicationID) + populate(objectMap, "applicationIds", i.ApplicationIDs) + populate(objectMap, "delegationAppIds", i.DelegationAppIDs) + populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationEndpoint. -func (n *NotificationEndpoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityManagementProperties. +func (i *IdentityManagementProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "locations": - err = unpopulate(val, "Locations", &n.Locations) + case "applicationId": + err = unpopulate(val, "ApplicationID", &i.ApplicationID) delete(rawMsg, key) - case "notificationDestination": - err = unpopulate(val, "NotificationDestination", &n.NotificationDestination) + case "applicationIds": + err = unpopulate(val, "ApplicationIDs", &i.ApplicationIDs) + delete(rawMsg, key) + case "delegationAppIds": + err = unpopulate(val, "DelegationAppIDs", &i.DelegationAppIDs) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotificationRegistration. -func (n NotificationRegistration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LegacyDisallowedCondition. +func (l LegacyDisallowedCondition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", n.ID) - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "type", n.Type) + populate(objectMap, "disallowedLegacyOperations", l.DisallowedLegacyOperations) + populate(objectMap, "feature", l.Feature) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationRegistration. -func (n *NotificationRegistration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LegacyDisallowedCondition. +func (l *LegacyDisallowedCondition) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &n.ID) + case "disallowedLegacyOperations": + err = unpopulate(val, "DisallowedLegacyOperations", &l.DisallowedLegacyOperations) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &n.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &n.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) + case "feature": + err = unpopulate(val, "Feature", &l.Feature) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotificationRegistrationArrayResponseWithContinuation. -func (n NotificationRegistrationArrayResponseWithContinuation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LightHouseAuthorization. +func (l LightHouseAuthorization) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", n.NextLink) - populate(objectMap, "value", n.Value) + populate(objectMap, "principalId", l.PrincipalID) + populate(objectMap, "roleDefinitionId", l.RoleDefinitionID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationRegistrationArrayResponseWithContinuation. -func (n *NotificationRegistrationArrayResponseWithContinuation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LightHouseAuthorization. +func (l *LightHouseAuthorization) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &n.NextLink) + case "principalId": + err = unpopulate(val, "PrincipalID", &l.PrincipalID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "roleDefinitionId": + err = unpopulate(val, "RoleDefinitionID", &l.RoleDefinitionID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotificationRegistrationProperties. -func (n NotificationRegistrationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LinkedAccessCheck. +func (l LinkedAccessCheck) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "includedEvents", n.IncludedEvents) - populate(objectMap, "messageScope", n.MessageScope) - populate(objectMap, "notificationEndpoints", n.NotificationEndpoints) - populate(objectMap, "notificationMode", n.NotificationMode) - populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "actionName", l.ActionName) + populate(objectMap, "linkedAction", l.LinkedAction) + populate(objectMap, "linkedActionVerb", l.LinkedActionVerb) + populate(objectMap, "linkedProperty", l.LinkedProperty) + populate(objectMap, "linkedType", l.LinkedType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationRegistrationProperties. -func (n *NotificationRegistrationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedAccessCheck. +func (l *LinkedAccessCheck) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "includedEvents": - err = unpopulate(val, "IncludedEvents", &n.IncludedEvents) + case "actionName": + err = unpopulate(val, "ActionName", &l.ActionName) delete(rawMsg, key) - case "messageScope": - err = unpopulate(val, "MessageScope", &n.MessageScope) + case "linkedAction": + err = unpopulate(val, "LinkedAction", &l.LinkedAction) delete(rawMsg, key) - case "notificationEndpoints": - err = unpopulate(val, "NotificationEndpoints", &n.NotificationEndpoints) + case "linkedActionVerb": + err = unpopulate(val, "LinkedActionVerb", &l.LinkedActionVerb) delete(rawMsg, key) - case "notificationMode": - err = unpopulate(val, "NotificationMode", &n.NotificationMode) + case "linkedProperty": + err = unpopulate(val, "LinkedProperty", &l.LinkedProperty) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + case "linkedType": + err = unpopulate(val, "LinkedType", &l.LinkedType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotificationRegistrationPropertiesAutoGenerated. -func (n NotificationRegistrationPropertiesAutoGenerated) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LinkedNotificationRule. +func (l LinkedNotificationRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "includedEvents", n.IncludedEvents) - populate(objectMap, "messageScope", n.MessageScope) - populate(objectMap, "notificationEndpoints", n.NotificationEndpoints) - populate(objectMap, "notificationMode", n.NotificationMode) - populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "actions", l.Actions) + populate(objectMap, "actionsOnFailedOperation", l.ActionsOnFailedOperation) + populate(objectMap, "fastPathActions", l.FastPathActions) + populate(objectMap, "fastPathActionsOnFailedOperation", l.FastPathActionsOnFailedOperation) + populate(objectMap, "linkedNotificationTimeout", l.LinkedNotificationTimeout) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationRegistrationPropertiesAutoGenerated. -func (n *NotificationRegistrationPropertiesAutoGenerated) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedNotificationRule. +func (l *LinkedNotificationRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "includedEvents": - err = unpopulate(val, "IncludedEvents", &n.IncludedEvents) + case "actions": + err = unpopulate(val, "Actions", &l.Actions) delete(rawMsg, key) - case "messageScope": - err = unpopulate(val, "MessageScope", &n.MessageScope) + case "actionsOnFailedOperation": + err = unpopulate(val, "ActionsOnFailedOperation", &l.ActionsOnFailedOperation) delete(rawMsg, key) - case "notificationEndpoints": - err = unpopulate(val, "NotificationEndpoints", &n.NotificationEndpoints) + case "fastPathActions": + err = unpopulate(val, "FastPathActions", &l.FastPathActions) delete(rawMsg, key) - case "notificationMode": - err = unpopulate(val, "NotificationMode", &n.NotificationMode) + case "fastPathActionsOnFailedOperation": + err = unpopulate(val, "FastPathActionsOnFailedOperation", &l.FastPathActionsOnFailedOperation) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + case "linkedNotificationTimeout": + err = unpopulate(val, "LinkedNotificationTimeout", &l.LinkedNotificationTimeout) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationsContent. -func (o OperationsContent) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LinkedOperationRule. +func (l LinkedOperationRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", o.ID) - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "type", o.Type) + populate(objectMap, "dependsOnTypes", l.DependsOnTypes) + populate(objectMap, "linkedAction", l.LinkedAction) + populate(objectMap, "linkedOperation", l.LinkedOperation) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsContent. -func (o *OperationsContent) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedOperationRule. +func (l *LinkedOperationRule) 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) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &o.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "dependsOnTypes": + err = unpopulate(val, "DependsOnTypes", &l.DependsOnTypes) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) + case "linkedAction": + err = unpopulate(val, "LinkedAction", &l.LinkedAction) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &o.Type) + case "linkedOperation": + err = unpopulate(val, "LinkedOperation", &l.LinkedOperation) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationsDefinition. -func (o OperationsDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDefinition. +func (l LocalizedOperationDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "actionType", o.ActionType) - populate(objectMap, "display", o.Display) - populate(objectMap, "isDataAction", o.IsDataAction) - populate(objectMap, "name", o.Name) - populate(objectMap, "origin", o.Origin) - populateAny(objectMap, "properties", o.Properties) + populate(objectMap, "actionType", l.ActionType) + populate(objectMap, "display", l.Display) + populate(objectMap, "isDataAction", l.IsDataAction) + populate(objectMap, "name", l.Name) + populate(objectMap, "origin", l.Origin) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsDefinition. -func (o *OperationsDefinition) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDefinition. +func (l *LocalizedOperationDefinition) 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) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "actionType": - err = unpopulate(val, "ActionType", &o.ActionType) + err = unpopulate(val, "ActionType", &l.ActionType) delete(rawMsg, key) case "display": - err = unpopulate(val, "Display", &o.Display) + err = unpopulate(val, "Display", &l.Display) delete(rawMsg, key) case "isDataAction": - err = unpopulate(val, "IsDataAction", &o.IsDataAction) + err = unpopulate(val, "IsDataAction", &l.IsDataAction) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &o.Name) + err = unpopulate(val, "Name", &l.Name) delete(rawMsg, key) case "origin": - err = unpopulate(val, "Origin", &o.Origin) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) + err = unpopulate(val, "Origin", &l.Origin) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationsDefinitionArrayResponseWithContinuation. -func (o OperationsDefinitionArrayResponseWithContinuation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDefinitionDisplay. +func (l LocalizedOperationDefinitionDisplay) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + populate(objectMap, "cs", l.Cs) + populate(objectMap, "de", l.De) + populate(objectMap, "default", l.Default) + populate(objectMap, "en", l.En) + populate(objectMap, "es", l.Es) + populate(objectMap, "fr", l.Fr) + populate(objectMap, "hu", l.Hu) + populate(objectMap, "it", l.It) + populate(objectMap, "ja", l.Ja) + populate(objectMap, "ko", l.Ko) + populate(objectMap, "nl", l.Nl) + populate(objectMap, "pl", l.Pl) + populate(objectMap, "ptPT", l.Pt) + populate(objectMap, "ptBR", l.PtBR) + populate(objectMap, "ru", l.Ru) + populate(objectMap, "sv", l.Sv) + populate(objectMap, "zhHans", l.ZhHans) + populate(objectMap, "zhHant", l.ZhHant) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsDefinitionArrayResponseWithContinuation. -func (o *OperationsDefinitionArrayResponseWithContinuation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDefinitionDisplay. +func (l *LocalizedOperationDefinitionDisplay) 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) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) + case "cs": + err = unpopulate(val, "Cs", &l.Cs) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) + case "de": + err = unpopulate(val, "De", &l.De) + delete(rawMsg, key) + case "default": + err = unpopulate(val, "Default", &l.Default) + delete(rawMsg, key) + case "en": + err = unpopulate(val, "En", &l.En) + delete(rawMsg, key) + case "es": + err = unpopulate(val, "Es", &l.Es) + delete(rawMsg, key) + case "fr": + err = unpopulate(val, "Fr", &l.Fr) + delete(rawMsg, key) + case "hu": + err = unpopulate(val, "Hu", &l.Hu) + delete(rawMsg, key) + case "it": + err = unpopulate(val, "It", &l.It) + delete(rawMsg, key) + case "ja": + err = unpopulate(val, "Ja", &l.Ja) + delete(rawMsg, key) + case "ko": + err = unpopulate(val, "Ko", &l.Ko) + delete(rawMsg, key) + case "nl": + err = unpopulate(val, "Nl", &l.Nl) + delete(rawMsg, key) + case "pl": + err = unpopulate(val, "Pl", &l.Pl) + delete(rawMsg, key) + case "ptPT": + err = unpopulate(val, "Pt", &l.Pt) + delete(rawMsg, key) + case "ptBR": + err = unpopulate(val, "PtBR", &l.PtBR) + delete(rawMsg, key) + case "ru": + err = unpopulate(val, "Ru", &l.Ru) + delete(rawMsg, key) + case "sv": + err = unpopulate(val, "Sv", &l.Sv) + delete(rawMsg, key) + case "zhHans": + err = unpopulate(val, "ZhHans", &l.ZhHans) + delete(rawMsg, key) + case "zhHant": + err = unpopulate(val, "ZhHant", &l.ZhHant) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationsDefinitionDisplay. -func (o OperationsDefinitionDisplay) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinition. +func (l LocalizedOperationDisplayDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) + populate(objectMap, "cs", l.Cs) + populate(objectMap, "de", l.De) + populate(objectMap, "default", l.Default) + populate(objectMap, "en", l.En) + populate(objectMap, "es", l.Es) + populate(objectMap, "fr", l.Fr) + populate(objectMap, "hu", l.Hu) + populate(objectMap, "it", l.It) + populate(objectMap, "ja", l.Ja) + populate(objectMap, "ko", l.Ko) + populate(objectMap, "nl", l.Nl) + populate(objectMap, "pl", l.Pl) + populate(objectMap, "ptPT", l.Pt) + populate(objectMap, "ptBR", l.PtBR) + populate(objectMap, "ru", l.Ru) + populate(objectMap, "sv", l.Sv) + populate(objectMap, "zhHans", l.ZhHans) + populate(objectMap, "zhHant", l.ZhHant) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsDefinitionDisplay. -func (o *OperationsDefinitionDisplay) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinition. +func (l *LocalizedOperationDisplayDefinition) 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) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) + case "cs": + err = unpopulate(val, "Cs", &l.Cs) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) + case "de": + err = unpopulate(val, "De", &l.De) delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) + case "default": + err = unpopulate(val, "Default", &l.Default) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) + case "en": + err = unpopulate(val, "En", &l.En) + delete(rawMsg, key) + case "es": + err = unpopulate(val, "Es", &l.Es) + delete(rawMsg, key) + case "fr": + err = unpopulate(val, "Fr", &l.Fr) + delete(rawMsg, key) + case "hu": + err = unpopulate(val, "Hu", &l.Hu) + delete(rawMsg, key) + case "it": + err = unpopulate(val, "It", &l.It) + delete(rawMsg, key) + case "ja": + err = unpopulate(val, "Ja", &l.Ja) + delete(rawMsg, key) + case "ko": + err = unpopulate(val, "Ko", &l.Ko) + delete(rawMsg, key) + case "nl": + err = unpopulate(val, "Nl", &l.Nl) + delete(rawMsg, key) + case "pl": + err = unpopulate(val, "Pl", &l.Pl) + delete(rawMsg, key) + case "ptPT": + err = unpopulate(val, "Pt", &l.Pt) + delete(rawMsg, key) + case "ptBR": + err = unpopulate(val, "PtBR", &l.PtBR) + delete(rawMsg, key) + case "ru": + err = unpopulate(val, "Ru", &l.Ru) + delete(rawMsg, key) + case "sv": + err = unpopulate(val, "Sv", &l.Sv) + delete(rawMsg, key) + case "zhHans": + err = unpopulate(val, "ZhHans", &l.ZhHans) + delete(rawMsg, key) + case "zhHant": + err = unpopulate(val, "ZhHant", &l.ZhHant) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationsDisplayDefinition. -func (o OperationsDisplayDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionCs. +func (l LocalizedOperationDisplayDefinitionCs) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsDisplayDefinition. -func (o *OperationsDisplayDefinition) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionCs. +func (l *LocalizedOperationDisplayDefinitionCs) 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) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "description": - err = unpopulate(val, "Description", &o.Description) + err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) case "operation": - err = unpopulate(val, "Operation", &o.Operation) + err = unpopulate(val, "Operation", &l.Operation) delete(rawMsg, key) case "provider": - err = unpopulate(val, "Provider", &o.Provider) + err = unpopulate(val, "Provider", &l.Provider) delete(rawMsg, key) case "resource": - err = unpopulate(val, "Resource", &o.Resource) + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationsPutContent. -func (o OperationsPutContent) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionDe. +func (l LocalizedOperationDisplayDefinitionDe) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "contents", o.Contents) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsPutContent. -func (o *OperationsPutContent) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionDe. +func (l *LocalizedOperationDisplayDefinitionDe) 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) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "contents": - err = unpopulate(val, "Contents", &o.Contents) + case "description": + err = unpopulate(val, "Description", &l.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProviderRegistration. -func (p ProviderRegistration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionDefault. +func (l LocalizedOperationDisplayDefinitionDefault) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderRegistration. -func (p *ProviderRegistration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionDefault. +func (l *LocalizedOperationDisplayDefinitionDefault) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "description": + err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProviderRegistrationArrayResponseWithContinuation. -func (p ProviderRegistrationArrayResponseWithContinuation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionEn. +func (l LocalizedOperationDisplayDefinitionEn) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderRegistrationArrayResponseWithContinuation. -func (p *ProviderRegistrationArrayResponseWithContinuation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionEn. +func (l *LocalizedOperationDisplayDefinitionEn) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + case "description": + err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProviderRegistrationProperties. -func (p ProviderRegistrationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionEs. +func (l LocalizedOperationDisplayDefinitionEs) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "capabilities", p.Capabilities) - populate(objectMap, "featuresRule", p.FeaturesRule) - populate(objectMap, "management", p.Management) - populateAny(objectMap, "metadata", p.Metadata) - populate(objectMap, "namespace", p.Namespace) - populate(objectMap, "providerAuthentication", p.ProviderAuthentication) - populate(objectMap, "providerAuthorizations", p.ProviderAuthorizations) - populate(objectMap, "providerHubMetadata", p.ProviderHubMetadata) - populate(objectMap, "providerType", p.ProviderType) - populate(objectMap, "providerVersion", p.ProviderVersion) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "requestHeaderOptions", p.RequestHeaderOptions) - populate(objectMap, "requiredFeatures", p.RequiredFeatures) - populate(objectMap, "subscriptionLifecycleNotificationSpecifications", p.SubscriptionLifecycleNotificationSpecifications) - populate(objectMap, "templateDeploymentOptions", p.TemplateDeploymentOptions) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderRegistrationProperties. -func (p *ProviderRegistrationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionEs. +func (l *LocalizedOperationDisplayDefinitionEs) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "capabilities": - err = unpopulate(val, "Capabilities", &p.Capabilities) - delete(rawMsg, key) - case "featuresRule": - err = unpopulate(val, "FeaturesRule", &p.FeaturesRule) - delete(rawMsg, key) - case "management": - err = unpopulate(val, "Management", &p.Management) - delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &p.Metadata) - delete(rawMsg, key) - case "namespace": - err = unpopulate(val, "Namespace", &p.Namespace) - delete(rawMsg, key) - case "providerAuthentication": - err = unpopulate(val, "ProviderAuthentication", &p.ProviderAuthentication) - delete(rawMsg, key) - case "providerAuthorizations": - err = unpopulate(val, "ProviderAuthorizations", &p.ProviderAuthorizations) - delete(rawMsg, key) - case "providerHubMetadata": - err = unpopulate(val, "ProviderHubMetadata", &p.ProviderHubMetadata) - delete(rawMsg, key) - case "providerType": - err = unpopulate(val, "ProviderType", &p.ProviderType) - delete(rawMsg, key) - case "providerVersion": - err = unpopulate(val, "ProviderVersion", &p.ProviderVersion) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "requestHeaderOptions": - err = unpopulate(val, "RequestHeaderOptions", &p.RequestHeaderOptions) + case "description": + err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) - case "requiredFeatures": - err = unpopulate(val, "RequiredFeatures", &p.RequiredFeatures) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) delete(rawMsg, key) - case "subscriptionLifecycleNotificationSpecifications": - err = unpopulate(val, "SubscriptionLifecycleNotificationSpecifications", &p.SubscriptionLifecycleNotificationSpecifications) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) delete(rawMsg, key) - case "templateDeploymentOptions": - err = unpopulate(val, "TemplateDeploymentOptions", &p.TemplateDeploymentOptions) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProviderRegistrationPropertiesAutoGenerated. -func (p ProviderRegistrationPropertiesAutoGenerated) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionFr. +func (l LocalizedOperationDisplayDefinitionFr) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "capabilities", p.Capabilities) - populate(objectMap, "featuresRule", p.FeaturesRule) - populate(objectMap, "management", p.Management) - populateAny(objectMap, "metadata", p.Metadata) - populate(objectMap, "namespace", p.Namespace) - populate(objectMap, "providerAuthentication", p.ProviderAuthentication) - populate(objectMap, "providerAuthorizations", p.ProviderAuthorizations) - populate(objectMap, "providerHubMetadata", p.ProviderHubMetadata) - populate(objectMap, "providerType", p.ProviderType) - populate(objectMap, "providerVersion", p.ProviderVersion) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "requestHeaderOptions", p.RequestHeaderOptions) - populate(objectMap, "requiredFeatures", p.RequiredFeatures) - populate(objectMap, "subscriptionLifecycleNotificationSpecifications", p.SubscriptionLifecycleNotificationSpecifications) - populate(objectMap, "templateDeploymentOptions", p.TemplateDeploymentOptions) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderRegistrationPropertiesAutoGenerated. -func (p *ProviderRegistrationPropertiesAutoGenerated) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionFr. +func (l *LocalizedOperationDisplayDefinitionFr) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "capabilities": - err = unpopulate(val, "Capabilities", &p.Capabilities) - delete(rawMsg, key) - case "featuresRule": - err = unpopulate(val, "FeaturesRule", &p.FeaturesRule) + case "description": + err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) - case "management": - err = unpopulate(val, "Management", &p.Management) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &p.Metadata) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) delete(rawMsg, key) - case "namespace": - err = unpopulate(val, "Namespace", &p.Namespace) - delete(rawMsg, key) - case "providerAuthentication": - err = unpopulate(val, "ProviderAuthentication", &p.ProviderAuthentication) - delete(rawMsg, key) - case "providerAuthorizations": - err = unpopulate(val, "ProviderAuthorizations", &p.ProviderAuthorizations) - delete(rawMsg, key) - case "providerHubMetadata": - err = unpopulate(val, "ProviderHubMetadata", &p.ProviderHubMetadata) - delete(rawMsg, key) - case "providerType": - err = unpopulate(val, "ProviderType", &p.ProviderType) - delete(rawMsg, key) - case "providerVersion": - err = unpopulate(val, "ProviderVersion", &p.ProviderVersion) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "requestHeaderOptions": - err = unpopulate(val, "RequestHeaderOptions", &p.RequestHeaderOptions) - delete(rawMsg, key) - case "requiredFeatures": - err = unpopulate(val, "RequiredFeatures", &p.RequiredFeatures) - delete(rawMsg, key) - case "subscriptionLifecycleNotificationSpecifications": - err = unpopulate(val, "SubscriptionLifecycleNotificationSpecifications", &p.SubscriptionLifecycleNotificationSpecifications) - delete(rawMsg, key) - case "templateDeploymentOptions": - err = unpopulate(val, "TemplateDeploymentOptions", &p.TemplateDeploymentOptions) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProviderRegistrationPropertiesProviderHubMetadata. -func (p ProviderRegistrationPropertiesProviderHubMetadata) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionHu. +func (l LocalizedOperationDisplayDefinitionHu) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "providerAuthentication", p.ProviderAuthentication) - populate(objectMap, "providerAuthorizations", p.ProviderAuthorizations) - populate(objectMap, "thirdPartyProviderAuthorization", p.ThirdPartyProviderAuthorization) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderRegistrationPropertiesProviderHubMetadata. -func (p *ProviderRegistrationPropertiesProviderHubMetadata) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionHu. +func (l *LocalizedOperationDisplayDefinitionHu) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "providerAuthentication": - err = unpopulate(val, "ProviderAuthentication", &p.ProviderAuthentication) + case "description": + err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) - case "providerAuthorizations": - err = unpopulate(val, "ProviderAuthorizations", &p.ProviderAuthorizations) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) delete(rawMsg, key) - case "thirdPartyProviderAuthorization": - err = unpopulate(val, "ThirdPartyProviderAuthorization", &p.ThirdPartyProviderAuthorization) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications. -func (p ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionIt. +func (l LocalizedOperationDisplayDefinitionIt) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "softDeleteTTL", p.SoftDeleteTTL) - populate(objectMap, "subscriptionStateOverrideActions", p.SubscriptionStateOverrideActions) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications. -func (p *ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionIt. +func (l *LocalizedOperationDisplayDefinitionIt) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "softDeleteTTL": - err = unpopulate(val, "SoftDeleteTTL", &p.SoftDeleteTTL) + case "description": + err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) - case "subscriptionStateOverrideActions": - err = unpopulate(val, "SubscriptionStateOverrideActions", &p.SubscriptionStateOverrideActions) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProxyResource. -func (p ProxyResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionJa. +func (l LocalizedOperationDisplayDefinitionJa) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. -func (p *ProxyResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionJa. +func (l *LocalizedOperationDisplayDefinitionJa) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "description": + err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ReRegisterSubscriptionMetadata. -func (r ReRegisterSubscriptionMetadata) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionKo. +func (l LocalizedOperationDisplayDefinitionKo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "concurrencyLimit", r.ConcurrencyLimit) - populate(objectMap, "enabled", r.Enabled) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReRegisterSubscriptionMetadata. -func (r *ReRegisterSubscriptionMetadata) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionKo. +func (l *LocalizedOperationDisplayDefinitionKo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "concurrencyLimit": - err = unpopulate(val, "ConcurrencyLimit", &r.ConcurrencyLimit) + case "description": + err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &r.Enabled) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RequestHeaderOptions. -func (r RequestHeaderOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionNl. +func (l LocalizedOperationDisplayDefinitionNl) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "optInHeaders", r.OptInHeaders) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RequestHeaderOptions. -func (r *RequestHeaderOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionNl. +func (l *LocalizedOperationDisplayDefinitionNl) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "optInHeaders": - err = unpopulate(val, "OptInHeaders", &r.OptInHeaders) + case "description": + err = unpopulate(val, "Description", &l.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionPl. +func (l LocalizedOperationDisplayDefinitionPl) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "type", r.Type) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionPl. +func (l *LocalizedOperationDisplayDefinitionPl) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) + case "description": + err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceMovePolicy. -func (r ResourceMovePolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionPt. +func (l LocalizedOperationDisplayDefinitionPt) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "crossResourceGroupMoveEnabled", r.CrossResourceGroupMoveEnabled) - populate(objectMap, "crossSubscriptionMoveEnabled", r.CrossSubscriptionMoveEnabled) - populate(objectMap, "validationRequired", r.ValidationRequired) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceMovePolicy. -func (r *ResourceMovePolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionPt. +func (l *LocalizedOperationDisplayDefinitionPt) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "crossResourceGroupMoveEnabled": - err = unpopulate(val, "CrossResourceGroupMoveEnabled", &r.CrossResourceGroupMoveEnabled) + case "description": + err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) - case "crossSubscriptionMoveEnabled": - err = unpopulate(val, "CrossSubscriptionMoveEnabled", &r.CrossSubscriptionMoveEnabled) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) delete(rawMsg, key) - case "validationRequired": - err = unpopulate(val, "ValidationRequired", &r.ValidationRequired) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderAuthentication. -func (r ResourceProviderAuthentication) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionPtBR. +func (l LocalizedOperationDisplayDefinitionPtBR) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedAudiences", r.AllowedAudiences) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderAuthentication. -func (r *ResourceProviderAuthentication) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionPtBR. +func (l *LocalizedOperationDisplayDefinitionPtBR) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "allowedAudiences": - err = unpopulate(val, "AllowedAudiences", &r.AllowedAudiences) + case "description": + err = unpopulate(val, "Description", &l.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderAuthorization. -func (r ResourceProviderAuthorization) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionRu. +func (l LocalizedOperationDisplayDefinitionRu) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "applicationId", r.ApplicationID) - populate(objectMap, "managedByRoleDefinitionId", r.ManagedByRoleDefinitionID) - populate(objectMap, "roleDefinitionId", r.RoleDefinitionID) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderAuthorization. -func (r *ResourceProviderAuthorization) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionRu. +func (l *LocalizedOperationDisplayDefinitionRu) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "applicationId": - err = unpopulate(val, "ApplicationID", &r.ApplicationID) + case "description": + err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) - case "managedByRoleDefinitionId": - err = unpopulate(val, "ManagedByRoleDefinitionID", &r.ManagedByRoleDefinitionID) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) delete(rawMsg, key) - case "roleDefinitionId": - err = unpopulate(val, "RoleDefinitionID", &r.RoleDefinitionID) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderCapabilities. -func (r ResourceProviderCapabilities) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionSv. +func (l LocalizedOperationDisplayDefinitionSv) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "effect", r.Effect) - populate(objectMap, "quotaId", r.QuotaID) - populate(objectMap, "requiredFeatures", r.RequiredFeatures) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderCapabilities. -func (r *ResourceProviderCapabilities) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionSv. +func (l *LocalizedOperationDisplayDefinitionSv) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "effect": - err = unpopulate(val, "Effect", &r.Effect) + case "description": + err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) - case "quotaId": - err = unpopulate(val, "QuotaID", &r.QuotaID) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) delete(rawMsg, key) - case "requiredFeatures": - err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderEndpoint. -func (r ResourceProviderEndpoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionZhHans. +func (l LocalizedOperationDisplayDefinitionZhHans) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "apiVersions", r.APIVersions) - populate(objectMap, "enabled", r.Enabled) - populate(objectMap, "endpointUri", r.EndpointURI) - populate(objectMap, "featuresRule", r.FeaturesRule) - populate(objectMap, "locations", r.Locations) - populate(objectMap, "requiredFeatures", r.RequiredFeatures) - populate(objectMap, "timeout", r.Timeout) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderEndpoint. -func (r *ResourceProviderEndpoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionZhHans. +func (l *LocalizedOperationDisplayDefinitionZhHans) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "apiVersions": - err = unpopulate(val, "APIVersions", &r.APIVersions) + case "description": + err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &r.Enabled) - delete(rawMsg, key) - case "endpointUri": - err = unpopulate(val, "EndpointURI", &r.EndpointURI) - delete(rawMsg, key) - case "featuresRule": - err = unpopulate(val, "FeaturesRule", &r.FeaturesRule) - delete(rawMsg, key) - case "locations": - err = unpopulate(val, "Locations", &r.Locations) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) delete(rawMsg, key) - case "requiredFeatures": - err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &r.Timeout) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderEndpointFeaturesRule. -func (r ResourceProviderEndpointFeaturesRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocalizedOperationDisplayDefinitionZhHant. +func (l LocalizedOperationDisplayDefinitionZhHant) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "requiredFeaturesPolicy", r.RequiredFeaturesPolicy) + populate(objectMap, "description", l.Description) + populate(objectMap, "operation", l.Operation) + populate(objectMap, "provider", l.Provider) + populate(objectMap, "resource", l.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderEndpointFeaturesRule. -func (r *ResourceProviderEndpointFeaturesRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalizedOperationDisplayDefinitionZhHant. +func (l *LocalizedOperationDisplayDefinitionZhHant) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "requiredFeaturesPolicy": - err = unpopulate(val, "RequiredFeaturesPolicy", &r.RequiredFeaturesPolicy) + case "description": + err = unpopulate(val, "Description", &l.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &l.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &l.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &l.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManagement. -func (r ResourceProviderManagement) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocationQuotaRule. +func (l LocationQuotaRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "incidentContactEmail", r.IncidentContactEmail) - populate(objectMap, "incidentRoutingService", r.IncidentRoutingService) - populate(objectMap, "incidentRoutingTeam", r.IncidentRoutingTeam) - populate(objectMap, "manifestOwners", r.ManifestOwners) - populate(objectMap, "resourceAccessPolicy", r.ResourceAccessPolicy) - populate(objectMap, "resourceAccessRoles", r.ResourceAccessRoles) - populate(objectMap, "schemaOwners", r.SchemaOwners) - populate(objectMap, "serviceTreeInfos", r.ServiceTreeInfos) + populate(objectMap, "location", l.Location) + populate(objectMap, "policy", l.Policy) + populate(objectMap, "quotaId", l.QuotaID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManagement. -func (r *ResourceProviderManagement) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocationQuotaRule. +func (l *LocationQuotaRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "incidentContactEmail": - err = unpopulate(val, "IncidentContactEmail", &r.IncidentContactEmail) - delete(rawMsg, key) - case "incidentRoutingService": - err = unpopulate(val, "IncidentRoutingService", &r.IncidentRoutingService) - delete(rawMsg, key) - case "incidentRoutingTeam": - err = unpopulate(val, "IncidentRoutingTeam", &r.IncidentRoutingTeam) - delete(rawMsg, key) - case "manifestOwners": - err = unpopulate(val, "ManifestOwners", &r.ManifestOwners) - delete(rawMsg, key) - case "resourceAccessPolicy": - err = unpopulate(val, "ResourceAccessPolicy", &r.ResourceAccessPolicy) - delete(rawMsg, key) - case "resourceAccessRoles": - err = unpopulate(val, "ResourceAccessRoles", &r.ResourceAccessRoles) + case "location": + err = unpopulate(val, "Location", &l.Location) delete(rawMsg, key) - case "schemaOwners": - err = unpopulate(val, "SchemaOwners", &r.SchemaOwners) + case "policy": + err = unpopulate(val, "Policy", &l.Policy) delete(rawMsg, key) - case "serviceTreeInfos": - err = unpopulate(val, "ServiceTreeInfos", &r.ServiceTreeInfos) + case "quotaId": + err = unpopulate(val, "QuotaID", &l.QuotaID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifest. -func (r ResourceProviderManifest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LoggingHiddenPropertyPath. +func (l LoggingHiddenPropertyPath) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "capabilities", r.Capabilities) - populate(objectMap, "featuresRule", r.FeaturesRule) - populate(objectMap, "globalNotificationEndpoints", r.GlobalNotificationEndpoints) - populate(objectMap, "management", r.Management) - populateAny(objectMap, "metadata", r.Metadata) - populate(objectMap, "namespace", r.Namespace) - populate(objectMap, "providerAuthentication", r.ProviderAuthentication) - populate(objectMap, "providerAuthorizations", r.ProviderAuthorizations) - populate(objectMap, "providerType", r.ProviderType) - populate(objectMap, "providerVersion", r.ProviderVersion) - populate(objectMap, "reRegisterSubscriptionMetadata", r.ReRegisterSubscriptionMetadata) - populate(objectMap, "requestHeaderOptions", r.RequestHeaderOptions) - populate(objectMap, "requiredFeatures", r.RequiredFeatures) - populate(objectMap, "resourceTypes", r.ResourceTypes) + populate(objectMap, "hiddenPathsOnRequest", l.HiddenPathsOnRequest) + populate(objectMap, "hiddenPathsOnResponse", l.HiddenPathsOnResponse) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifest. -func (r *ResourceProviderManifest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LoggingHiddenPropertyPath. +func (l *LoggingHiddenPropertyPath) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "capabilities": - err = unpopulate(val, "Capabilities", &r.Capabilities) - delete(rawMsg, key) - case "featuresRule": - err = unpopulate(val, "FeaturesRule", &r.FeaturesRule) - delete(rawMsg, key) - case "globalNotificationEndpoints": - err = unpopulate(val, "GlobalNotificationEndpoints", &r.GlobalNotificationEndpoints) - delete(rawMsg, key) - case "management": - err = unpopulate(val, "Management", &r.Management) - delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &r.Metadata) - delete(rawMsg, key) - case "namespace": - err = unpopulate(val, "Namespace", &r.Namespace) - delete(rawMsg, key) - case "providerAuthentication": - err = unpopulate(val, "ProviderAuthentication", &r.ProviderAuthentication) - delete(rawMsg, key) - case "providerAuthorizations": - err = unpopulate(val, "ProviderAuthorizations", &r.ProviderAuthorizations) - delete(rawMsg, key) - case "providerType": - err = unpopulate(val, "ProviderType", &r.ProviderType) - delete(rawMsg, key) - case "providerVersion": - err = unpopulate(val, "ProviderVersion", &r.ProviderVersion) - delete(rawMsg, key) - case "reRegisterSubscriptionMetadata": - err = unpopulate(val, "ReRegisterSubscriptionMetadata", &r.ReRegisterSubscriptionMetadata) - delete(rawMsg, key) - case "requestHeaderOptions": - err = unpopulate(val, "RequestHeaderOptions", &r.RequestHeaderOptions) - delete(rawMsg, key) - case "requiredFeatures": - err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) + case "hiddenPathsOnRequest": + err = unpopulate(val, "HiddenPathsOnRequest", &l.HiddenPathsOnRequest) delete(rawMsg, key) - case "resourceTypes": - err = unpopulate(val, "ResourceTypes", &r.ResourceTypes) + case "hiddenPathsOnResponse": + err = unpopulate(val, "HiddenPathsOnResponse", &l.HiddenPathsOnResponse) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestFeaturesRule. -func (r ResourceProviderManifestFeaturesRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LoggingRule. +func (l LoggingRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "requiredFeaturesPolicy", r.RequiredFeaturesPolicy) + populate(objectMap, "action", l.Action) + populate(objectMap, "detailLevel", l.DetailLevel) + populate(objectMap, "direction", l.Direction) + populate(objectMap, "hiddenPropertyPaths", l.HiddenPropertyPaths) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestFeaturesRule. -func (r *ResourceProviderManifestFeaturesRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LoggingRule. +func (l *LoggingRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "requiredFeaturesPolicy": - err = unpopulate(val, "RequiredFeaturesPolicy", &r.RequiredFeaturesPolicy) + case "action": + err = unpopulate(val, "Action", &l.Action) + delete(rawMsg, key) + case "detailLevel": + err = unpopulate(val, "DetailLevel", &l.DetailLevel) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &l.Direction) + delete(rawMsg, key) + case "hiddenPropertyPaths": + err = unpopulate(val, "HiddenPropertyPaths", &l.HiddenPropertyPaths) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestManagement. -func (r ResourceProviderManifestManagement) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LoggingRuleHiddenPropertyPaths. +func (l LoggingRuleHiddenPropertyPaths) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "incidentContactEmail", r.IncidentContactEmail) - populate(objectMap, "incidentRoutingService", r.IncidentRoutingService) - populate(objectMap, "incidentRoutingTeam", r.IncidentRoutingTeam) - populate(objectMap, "manifestOwners", r.ManifestOwners) - populate(objectMap, "resourceAccessPolicy", r.ResourceAccessPolicy) - populate(objectMap, "resourceAccessRoles", r.ResourceAccessRoles) - populate(objectMap, "schemaOwners", r.SchemaOwners) - populate(objectMap, "serviceTreeInfos", r.ServiceTreeInfos) + populate(objectMap, "hiddenPathsOnRequest", l.HiddenPathsOnRequest) + populate(objectMap, "hiddenPathsOnResponse", l.HiddenPathsOnResponse) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestManagement. -func (r *ResourceProviderManifestManagement) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LoggingRuleHiddenPropertyPaths. +func (l *LoggingRuleHiddenPropertyPaths) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "incidentContactEmail": - err = unpopulate(val, "IncidentContactEmail", &r.IncidentContactEmail) - delete(rawMsg, key) - case "incidentRoutingService": - err = unpopulate(val, "IncidentRoutingService", &r.IncidentRoutingService) - delete(rawMsg, key) - case "incidentRoutingTeam": - err = unpopulate(val, "IncidentRoutingTeam", &r.IncidentRoutingTeam) - delete(rawMsg, key) - case "manifestOwners": - err = unpopulate(val, "ManifestOwners", &r.ManifestOwners) - delete(rawMsg, key) - case "resourceAccessPolicy": - err = unpopulate(val, "ResourceAccessPolicy", &r.ResourceAccessPolicy) - delete(rawMsg, key) - case "resourceAccessRoles": - err = unpopulate(val, "ResourceAccessRoles", &r.ResourceAccessRoles) - delete(rawMsg, key) - case "schemaOwners": - err = unpopulate(val, "SchemaOwners", &r.SchemaOwners) + case "hiddenPathsOnRequest": + err = unpopulate(val, "HiddenPathsOnRequest", &l.HiddenPathsOnRequest) delete(rawMsg, key) - case "serviceTreeInfos": - err = unpopulate(val, "ServiceTreeInfos", &r.ServiceTreeInfos) + case "hiddenPathsOnResponse": + err = unpopulate(val, "HiddenPathsOnResponse", &l.HiddenPathsOnResponse) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestProperties. -func (r ResourceProviderManifestProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManifestLevelPropertyBag. +func (m ManifestLevelPropertyBag) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "capabilities", r.Capabilities) - populate(objectMap, "featuresRule", r.FeaturesRule) - populate(objectMap, "management", r.Management) - populateAny(objectMap, "metadata", r.Metadata) - populate(objectMap, "namespace", r.Namespace) - populate(objectMap, "providerAuthentication", r.ProviderAuthentication) - populate(objectMap, "providerAuthorizations", r.ProviderAuthorizations) - populate(objectMap, "providerType", r.ProviderType) - populate(objectMap, "providerVersion", r.ProviderVersion) - populate(objectMap, "requestHeaderOptions", r.RequestHeaderOptions) - populate(objectMap, "requiredFeatures", r.RequiredFeatures) - populate(objectMap, "templateDeploymentOptions", r.TemplateDeploymentOptions) + populate(objectMap, "resourceHydrationAccounts", m.ResourceHydrationAccounts) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestProperties. -func (r *ResourceProviderManifestProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManifestLevelPropertyBag. +func (m *ManifestLevelPropertyBag) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "capabilities": - err = unpopulate(val, "Capabilities", &r.Capabilities) - delete(rawMsg, key) - case "featuresRule": - err = unpopulate(val, "FeaturesRule", &r.FeaturesRule) - delete(rawMsg, key) - case "management": - err = unpopulate(val, "Management", &r.Management) - delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &r.Metadata) + case "resourceHydrationAccounts": + err = unpopulate(val, "ResourceHydrationAccounts", &m.ResourceHydrationAccounts) delete(rawMsg, key) - case "namespace": - err = unpopulate(val, "Namespace", &r.Namespace) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Metadata. +func (m Metadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "directRpRoleDefinitionId", m.DirectRpRoleDefinitionID) + populate(objectMap, "globalAsyncOperationResourceTypeName", m.GlobalAsyncOperationResourceTypeName) + populate(objectMap, "providerAuthentication", m.ProviderAuthentication) + populate(objectMap, "providerAuthorizations", m.ProviderAuthorizations) + populate(objectMap, "regionalAsyncOperationResourceTypeName", m.RegionalAsyncOperationResourceTypeName) + populate(objectMap, "thirdPartyProviderAuthorization", m.ThirdPartyProviderAuthorization) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Metadata. +func (m *Metadata) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "directRpRoleDefinitionId": + err = unpopulate(val, "DirectRpRoleDefinitionID", &m.DirectRpRoleDefinitionID) + delete(rawMsg, key) + case "globalAsyncOperationResourceTypeName": + err = unpopulate(val, "GlobalAsyncOperationResourceTypeName", &m.GlobalAsyncOperationResourceTypeName) delete(rawMsg, key) case "providerAuthentication": - err = unpopulate(val, "ProviderAuthentication", &r.ProviderAuthentication) + err = unpopulate(val, "ProviderAuthentication", &m.ProviderAuthentication) delete(rawMsg, key) case "providerAuthorizations": - err = unpopulate(val, "ProviderAuthorizations", &r.ProviderAuthorizations) - delete(rawMsg, key) - case "providerType": - err = unpopulate(val, "ProviderType", &r.ProviderType) - delete(rawMsg, key) - case "providerVersion": - err = unpopulate(val, "ProviderVersion", &r.ProviderVersion) - delete(rawMsg, key) - case "requestHeaderOptions": - err = unpopulate(val, "RequestHeaderOptions", &r.RequestHeaderOptions) + err = unpopulate(val, "ProviderAuthorizations", &m.ProviderAuthorizations) delete(rawMsg, key) - case "requiredFeatures": - err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) + case "regionalAsyncOperationResourceTypeName": + err = unpopulate(val, "RegionalAsyncOperationResourceTypeName", &m.RegionalAsyncOperationResourceTypeName) delete(rawMsg, key) - case "templateDeploymentOptions": - err = unpopulate(val, "TemplateDeploymentOptions", &r.TemplateDeploymentOptions) + case "thirdPartyProviderAuthorization": + err = unpopulate(val, "ThirdPartyProviderAuthorization", &m.ThirdPartyProviderAuthorization) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestPropertiesFeaturesRule. -func (r ResourceProviderManifestPropertiesFeaturesRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MetadataProviderAuthentication. +func (m MetadataProviderAuthentication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "requiredFeaturesPolicy", r.RequiredFeaturesPolicy) + populate(objectMap, "allowedAudiences", m.AllowedAudiences) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestPropertiesFeaturesRule. -func (r *ResourceProviderManifestPropertiesFeaturesRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MetadataProviderAuthentication. +func (m *MetadataProviderAuthentication) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "requiredFeaturesPolicy": - err = unpopulate(val, "RequiredFeaturesPolicy", &r.RequiredFeaturesPolicy) + case "allowedAudiences": + err = unpopulate(val, "AllowedAudiences", &m.AllowedAudiences) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestPropertiesManagement. -func (r ResourceProviderManifestPropertiesManagement) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MetadataThirdPartyProviderAuthorization. +func (m MetadataThirdPartyProviderAuthorization) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "incidentContactEmail", r.IncidentContactEmail) - populate(objectMap, "incidentRoutingService", r.IncidentRoutingService) - populate(objectMap, "incidentRoutingTeam", r.IncidentRoutingTeam) - populate(objectMap, "manifestOwners", r.ManifestOwners) - populate(objectMap, "resourceAccessPolicy", r.ResourceAccessPolicy) - populate(objectMap, "resourceAccessRoles", r.ResourceAccessRoles) - populate(objectMap, "schemaOwners", r.SchemaOwners) - populate(objectMap, "serviceTreeInfos", r.ServiceTreeInfos) + populate(objectMap, "authorizations", m.Authorizations) + populate(objectMap, "managedByTenantId", m.ManagedByTenantID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestPropertiesManagement. -func (r *ResourceProviderManifestPropertiesManagement) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MetadataThirdPartyProviderAuthorization. +func (m *MetadataThirdPartyProviderAuthorization) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "incidentContactEmail": - err = unpopulate(val, "IncidentContactEmail", &r.IncidentContactEmail) - delete(rawMsg, key) - case "incidentRoutingService": - err = unpopulate(val, "IncidentRoutingService", &r.IncidentRoutingService) - delete(rawMsg, key) - case "incidentRoutingTeam": - err = unpopulate(val, "IncidentRoutingTeam", &r.IncidentRoutingTeam) - delete(rawMsg, key) - case "manifestOwners": - err = unpopulate(val, "ManifestOwners", &r.ManifestOwners) - delete(rawMsg, key) - case "resourceAccessPolicy": - err = unpopulate(val, "ResourceAccessPolicy", &r.ResourceAccessPolicy) - delete(rawMsg, key) - case "resourceAccessRoles": - err = unpopulate(val, "ResourceAccessRoles", &r.ResourceAccessRoles) - delete(rawMsg, key) - case "schemaOwners": - err = unpopulate(val, "SchemaOwners", &r.SchemaOwners) + case "authorizations": + err = unpopulate(val, "Authorizations", &m.Authorizations) delete(rawMsg, key) - case "serviceTreeInfos": - err = unpopulate(val, "ServiceTreeInfos", &r.ServiceTreeInfos) + case "managedByTenantId": + err = unpopulate(val, "ManagedByTenantID", &m.ManagedByTenantID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestPropertiesProviderAuthentication. -func (r ResourceProviderManifestPropertiesProviderAuthentication) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Notification. +func (n Notification) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedAudiences", r.AllowedAudiences) + populate(objectMap, "notificationType", n.NotificationType) + populate(objectMap, "skipNotifications", n.SkipNotifications) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestPropertiesProviderAuthentication. -func (r *ResourceProviderManifestPropertiesProviderAuthentication) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Notification. +func (n *Notification) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "allowedAudiences": - err = unpopulate(val, "AllowedAudiences", &r.AllowedAudiences) + case "notificationType": + err = unpopulate(val, "NotificationType", &n.NotificationType) + delete(rawMsg, key) + case "skipNotifications": + err = unpopulate(val, "SkipNotifications", &n.SkipNotifications) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestPropertiesRequestHeaderOptions. -func (r ResourceProviderManifestPropertiesRequestHeaderOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotificationEndpoint. +func (n NotificationEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "optInHeaders", r.OptInHeaders) + populate(objectMap, "locations", n.Locations) + populate(objectMap, "notificationDestination", n.NotificationDestination) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestPropertiesRequestHeaderOptions. -func (r *ResourceProviderManifestPropertiesRequestHeaderOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationEndpoint. +func (n *NotificationEndpoint) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "optInHeaders": - err = unpopulate(val, "OptInHeaders", &r.OptInHeaders) + case "locations": + err = unpopulate(val, "Locations", &n.Locations) + delete(rawMsg, key) + case "notificationDestination": + err = unpopulate(val, "NotificationDestination", &n.NotificationDestination) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestPropertiesTemplateDeploymentOptions. -func (r ResourceProviderManifestPropertiesTemplateDeploymentOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotificationRegistration. +func (n NotificationRegistration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "preflightOptions", r.PreflightOptions) - populate(objectMap, "preflightSupported", r.PreflightSupported) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestPropertiesTemplateDeploymentOptions. -func (r *ResourceProviderManifestPropertiesTemplateDeploymentOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationRegistration. +func (n *NotificationRegistration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "preflightOptions": - err = unpopulate(val, "PreflightOptions", &r.PreflightOptions) + case "id": + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) - case "preflightSupported": - err = unpopulate(val, "PreflightSupported", &r.PreflightSupported) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestProviderAuthentication. -func (r ResourceProviderManifestProviderAuthentication) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotificationRegistrationArrayResponseWithContinuation. +func (n NotificationRegistrationArrayResponseWithContinuation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedAudiences", r.AllowedAudiences) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestProviderAuthentication. -func (r *ResourceProviderManifestProviderAuthentication) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationRegistrationArrayResponseWithContinuation. +func (n *NotificationRegistrationArrayResponseWithContinuation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "allowedAudiences": - err = unpopulate(val, "AllowedAudiences", &r.AllowedAudiences) + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestReRegisterSubscriptionMetadata. -func (r ResourceProviderManifestReRegisterSubscriptionMetadata) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotificationRegistrationProperties. +func (n NotificationRegistrationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "concurrencyLimit", r.ConcurrencyLimit) - populate(objectMap, "enabled", r.Enabled) + populate(objectMap, "includedEvents", n.IncludedEvents) + populate(objectMap, "messageScope", n.MessageScope) + populate(objectMap, "notificationEndpoints", n.NotificationEndpoints) + populate(objectMap, "notificationMode", n.NotificationMode) + populate(objectMap, "provisioningState", n.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestReRegisterSubscriptionMetadata. -func (r *ResourceProviderManifestReRegisterSubscriptionMetadata) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationRegistrationProperties. +func (n *NotificationRegistrationProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "concurrencyLimit": - err = unpopulate(val, "ConcurrencyLimit", &r.ConcurrencyLimit) + case "includedEvents": + err = unpopulate(val, "IncludedEvents", &n.IncludedEvents) delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &r.Enabled) + case "messageScope": + err = unpopulate(val, "MessageScope", &n.MessageScope) + delete(rawMsg, key) + case "notificationEndpoints": + err = unpopulate(val, "NotificationEndpoints", &n.NotificationEndpoints) + delete(rawMsg, key) + case "notificationMode": + err = unpopulate(val, "NotificationMode", &n.NotificationMode) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestRequestHeaderOptions. -func (r ResourceProviderManifestRequestHeaderOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OpenAPIConfiguration. +func (o OpenAPIConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "optInHeaders", r.OptInHeaders) + populate(objectMap, "validation", o.Validation) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestRequestHeaderOptions. -func (r *ResourceProviderManifestRequestHeaderOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenAPIConfiguration. +func (o *OpenAPIConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "optInHeaders": - err = unpopulate(val, "OptInHeaders", &r.OptInHeaders) + case "validation": + err = unpopulate(val, "Validation", &o.Validation) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceType. -func (r ResourceType) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OpenAPIValidation. +func (o OpenAPIValidation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedUnauthorizedActions", r.AllowedUnauthorizedActions) - populate(objectMap, "authorizationActionMappings", r.AuthorizationActionMappings) - populate(objectMap, "defaultApiVersion", r.DefaultAPIVersion) - populate(objectMap, "disallowedActionVerbs", r.DisallowedActionVerbs) - populate(objectMap, "endpoints", r.Endpoints) - populate(objectMap, "extendedLocations", r.ExtendedLocations) - populate(objectMap, "featuresRule", r.FeaturesRule) - populate(objectMap, "identityManagement", r.IdentityManagement) - populate(objectMap, "linkedAccessChecks", r.LinkedAccessChecks) - populate(objectMap, "linkedOperationRules", r.LinkedOperationRules) - populate(objectMap, "loggingRules", r.LoggingRules) - populate(objectMap, "marketplaceType", r.MarketplaceType) - populateAny(objectMap, "metadata", r.Metadata) - populate(objectMap, "name", r.Name) - populate(objectMap, "requestHeaderOptions", r.RequestHeaderOptions) - populate(objectMap, "requiredFeatures", r.RequiredFeatures) - populate(objectMap, "resourceDeletionPolicy", r.ResourceDeletionPolicy) - populate(objectMap, "resourceValidation", r.ResourceValidation) - populate(objectMap, "routingType", r.RoutingType) - populate(objectMap, "skuLink", r.SKULink) - populate(objectMap, "serviceTreeInfos", r.ServiceTreeInfos) - populate(objectMap, "subscriptionStateRules", r.SubscriptionStateRules) - populate(objectMap, "templateDeploymentPolicy", r.TemplateDeploymentPolicy) - populate(objectMap, "throttlingRules", r.ThrottlingRules) + populate(objectMap, "allowNoncompliantCollectionResponse", o.AllowNoncompliantCollectionResponse) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceType. -func (r *ResourceType) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenAPIValidation. +func (o *OpenAPIValidation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "allowedUnauthorizedActions": - err = unpopulate(val, "AllowedUnauthorizedActions", &r.AllowedUnauthorizedActions) - delete(rawMsg, key) - case "authorizationActionMappings": - err = unpopulate(val, "AuthorizationActionMappings", &r.AuthorizationActionMappings) - delete(rawMsg, key) - case "defaultApiVersion": - err = unpopulate(val, "DefaultAPIVersion", &r.DefaultAPIVersion) - delete(rawMsg, key) - case "disallowedActionVerbs": - err = unpopulate(val, "DisallowedActionVerbs", &r.DisallowedActionVerbs) - delete(rawMsg, key) - case "endpoints": - err = unpopulate(val, "Endpoints", &r.Endpoints) - delete(rawMsg, key) - case "extendedLocations": - err = unpopulate(val, "ExtendedLocations", &r.ExtendedLocations) - delete(rawMsg, key) - case "featuresRule": - err = unpopulate(val, "FeaturesRule", &r.FeaturesRule) - delete(rawMsg, key) - case "identityManagement": - err = unpopulate(val, "IdentityManagement", &r.IdentityManagement) - delete(rawMsg, key) - case "linkedAccessChecks": - err = unpopulate(val, "LinkedAccessChecks", &r.LinkedAccessChecks) - delete(rawMsg, key) - case "linkedOperationRules": - err = unpopulate(val, "LinkedOperationRules", &r.LinkedOperationRules) - delete(rawMsg, key) - case "loggingRules": - err = unpopulate(val, "LoggingRules", &r.LoggingRules) - delete(rawMsg, key) - case "marketplaceType": - err = unpopulate(val, "MarketplaceType", &r.MarketplaceType) - delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &r.Metadata) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "requestHeaderOptions": - err = unpopulate(val, "RequestHeaderOptions", &r.RequestHeaderOptions) - delete(rawMsg, key) - case "requiredFeatures": - err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) - delete(rawMsg, key) - case "resourceDeletionPolicy": - err = unpopulate(val, "ResourceDeletionPolicy", &r.ResourceDeletionPolicy) - delete(rawMsg, key) - case "resourceValidation": - err = unpopulate(val, "ResourceValidation", &r.ResourceValidation) - delete(rawMsg, key) - case "routingType": - err = unpopulate(val, "RoutingType", &r.RoutingType) - delete(rawMsg, key) - case "skuLink": - err = unpopulate(val, "SKULink", &r.SKULink) - delete(rawMsg, key) - case "serviceTreeInfos": - err = unpopulate(val, "ServiceTreeInfos", &r.ServiceTreeInfos) - delete(rawMsg, key) - case "subscriptionStateRules": - err = unpopulate(val, "SubscriptionStateRules", &r.SubscriptionStateRules) - delete(rawMsg, key) - case "templateDeploymentPolicy": - err = unpopulate(val, "TemplateDeploymentPolicy", &r.TemplateDeploymentPolicy) - delete(rawMsg, key) - case "throttlingRules": - err = unpopulate(val, "ThrottlingRules", &r.ThrottlingRules) + case "allowNoncompliantCollectionResponse": + err = unpopulate(val, "AllowNoncompliantCollectionResponse", &o.AllowNoncompliantCollectionResponse) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeEndpoint. -func (r ResourceTypeEndpoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationsContent. +func (o OperationsContent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "apiVersions", r.APIVersions) - populate(objectMap, "enabled", r.Enabled) - populate(objectMap, "extensions", r.Extensions) - populate(objectMap, "featuresRule", r.FeaturesRule) - populate(objectMap, "locations", r.Locations) - populate(objectMap, "requiredFeatures", r.RequiredFeatures) - populate(objectMap, "timeout", r.Timeout) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "type", o.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeEndpoint. -func (r *ResourceTypeEndpoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsContent. +func (o *OperationsContent) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "apiVersions": - err = unpopulate(val, "APIVersions", &r.APIVersions) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &r.Enabled) - delete(rawMsg, key) - case "extensions": - err = unpopulate(val, "Extensions", &r.Extensions) + case "id": + err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) - case "featuresRule": - err = unpopulate(val, "FeaturesRule", &r.FeaturesRule) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "locations": - err = unpopulate(val, "Locations", &r.Locations) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) - case "requiredFeatures": - err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) + case "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &r.Timeout) + case "type": + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeEndpointFeaturesRule. -func (r ResourceTypeEndpointFeaturesRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationsContentProperties. +func (o OperationsContentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "requiredFeaturesPolicy", r.RequiredFeaturesPolicy) + populate(objectMap, "contents", o.Contents) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeEndpointFeaturesRule. -func (r *ResourceTypeEndpointFeaturesRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsContentProperties. +func (o *OperationsContentProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "requiredFeaturesPolicy": - err = unpopulate(val, "RequiredFeaturesPolicy", &r.RequiredFeaturesPolicy) + case "contents": + err = unpopulate(val, "Contents", &o.Contents) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeExtension. -func (r ResourceTypeExtension) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationsDefinition. +func (o OperationsDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "endpointUri", r.EndpointURI) - populate(objectMap, "extensionCategories", r.ExtensionCategories) - populate(objectMap, "timeout", r.Timeout) + populate(objectMap, "actionType", o.ActionType) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populateAny(objectMap, "properties", o.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeExtension. -func (r *ResourceTypeExtension) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsDefinition. +func (o *OperationsDefinition) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "endpointUri": - err = unpopulate(val, "EndpointURI", &r.EndpointURI) + case "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) delete(rawMsg, key) - case "extensionCategories": - err = unpopulate(val, "ExtensionCategories", &r.ExtensionCategories) + case "display": + err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &r.Timeout) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeExtensionOptions. -func (r ResourceTypeExtensionOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationsDefinitionArrayResponseWithContinuation. +func (o OperationsDefinitionArrayResponseWithContinuation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "resourceCreationBegin", r.ResourceCreationBegin) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeExtensionOptions. -func (r *ResourceTypeExtensionOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsDefinitionArrayResponseWithContinuation. +func (o *OperationsDefinitionArrayResponseWithContinuation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "resourceCreationBegin": - err = unpopulate(val, "ResourceCreationBegin", &r.ResourceCreationBegin) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeExtensionOptionsResourceCreationBegin. -func (r ResourceTypeExtensionOptionsResourceCreationBegin) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationsDefinitionDisplay. +func (o OperationsDefinitionDisplay) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "request", r.Request) - populate(objectMap, "response", r.Response) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeExtensionOptionsResourceCreationBegin. -func (r *ResourceTypeExtensionOptionsResourceCreationBegin) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsDefinitionDisplay. +func (o *OperationsDefinitionDisplay) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "request": - err = unpopulate(val, "Request", &r.Request) + case "description": + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "response": - err = unpopulate(val, "Response", &r.Response) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeFeaturesRule. -func (r ResourceTypeFeaturesRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationsDisplayDefinition. +func (o OperationsDisplayDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "requiredFeaturesPolicy", r.RequiredFeaturesPolicy) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeFeaturesRule. -func (r *ResourceTypeFeaturesRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsDisplayDefinition. +func (o *OperationsDisplayDefinition) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "requiredFeaturesPolicy": - err = unpopulate(val, "RequiredFeaturesPolicy", &r.RequiredFeaturesPolicy) + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeIdentityManagement. -func (r ResourceTypeIdentityManagement) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationsPutContent. +func (o OperationsPutContent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "type", r.Type) + populate(objectMap, "contents", o.Contents) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "type", o.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeIdentityManagement. -func (r *ResourceTypeIdentityManagement) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsPutContent. +func (o *OperationsPutContent) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { + case "contents": + err = unpopulate(val, "Contents", &o.Contents) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) + delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &r.Type) + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistration. -func (r ResourceTypeRegistration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationsPutContentProperties. +func (o OperationsPutContentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) + populate(objectMap, "contents", o.Contents) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistration. -func (r *ResourceTypeRegistration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsPutContentProperties. +func (o *OperationsPutContentProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "contents": + err = unpopulate(val, "Contents", &o.Contents) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateResourceProviderConfiguration. +func (p PrivateResourceProviderConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedSubscriptions", p.AllowedSubscriptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateResourceProviderConfiguration. +func (p *PrivateResourceProviderConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowedSubscriptions": + err = unpopulate(val, "AllowedSubscriptions", &p.AllowedSubscriptions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProviderMonitorSetting. +func (p ProviderMonitorSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderMonitorSetting. +func (p *ProviderMonitorSetting) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &r.ID) + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &r.Name) + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &r.Properties) + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &r.Type) + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationArrayResponseWithContinuation. -func (r ResourceTypeRegistrationArrayResponseWithContinuation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProviderMonitorSettingArrayResponseWithContinuation. +func (p ProviderMonitorSettingArrayResponseWithContinuation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationArrayResponseWithContinuation. -func (r *ResourceTypeRegistrationArrayResponseWithContinuation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderMonitorSettingArrayResponseWithContinuation. +func (p *ProviderMonitorSettingArrayResponseWithContinuation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &r.Value) + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationProperties. -func (r ResourceTypeRegistrationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProviderMonitorSettingProperties. +func (p ProviderMonitorSettingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedUnauthorizedActions", r.AllowedUnauthorizedActions) - populate(objectMap, "authorizationActionMappings", r.AuthorizationActionMappings) - populate(objectMap, "checkNameAvailabilitySpecifications", r.CheckNameAvailabilitySpecifications) - populate(objectMap, "defaultApiVersion", r.DefaultAPIVersion) - populate(objectMap, "disallowedActionVerbs", r.DisallowedActionVerbs) - populate(objectMap, "enableAsyncOperation", r.EnableAsyncOperation) - populate(objectMap, "enableThirdPartyS2S", r.EnableThirdPartyS2S) - populate(objectMap, "endpoints", r.Endpoints) - populate(objectMap, "extendedLocations", r.ExtendedLocations) - populate(objectMap, "extensionOptions", r.ExtensionOptions) - populate(objectMap, "featuresRule", r.FeaturesRule) - populate(objectMap, "identityManagement", r.IdentityManagement) - populate(objectMap, "isPureProxy", r.IsPureProxy) - populate(objectMap, "linkedAccessChecks", r.LinkedAccessChecks) - populate(objectMap, "loggingRules", r.LoggingRules) - populate(objectMap, "marketplaceType", r.MarketplaceType) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "regionality", r.Regionality) - populate(objectMap, "requestHeaderOptions", r.RequestHeaderOptions) - populate(objectMap, "requiredFeatures", r.RequiredFeatures) - populate(objectMap, "resourceDeletionPolicy", r.ResourceDeletionPolicy) - populate(objectMap, "resourceMovePolicy", r.ResourceMovePolicy) - populate(objectMap, "routingType", r.RoutingType) - populate(objectMap, "serviceTreeInfos", r.ServiceTreeInfos) - populate(objectMap, "subscriptionLifecycleNotificationSpecifications", r.SubscriptionLifecycleNotificationSpecifications) - populate(objectMap, "subscriptionStateRules", r.SubscriptionStateRules) - populate(objectMap, "swaggerSpecifications", r.SwaggerSpecifications) - populate(objectMap, "templateDeploymentOptions", r.TemplateDeploymentOptions) - populate(objectMap, "throttlingRules", r.ThrottlingRules) + populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationProperties. -func (r *ResourceTypeRegistrationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderMonitorSettingProperties. +func (p *ProviderMonitorSettingProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "allowedUnauthorizedActions": - err = unpopulate(val, "AllowedUnauthorizedActions", &r.AllowedUnauthorizedActions) - delete(rawMsg, key) - case "authorizationActionMappings": - err = unpopulate(val, "AuthorizationActionMappings", &r.AuthorizationActionMappings) - delete(rawMsg, key) - case "checkNameAvailabilitySpecifications": - err = unpopulate(val, "CheckNameAvailabilitySpecifications", &r.CheckNameAvailabilitySpecifications) - delete(rawMsg, key) - case "defaultApiVersion": - err = unpopulate(val, "DefaultAPIVersion", &r.DefaultAPIVersion) - delete(rawMsg, key) - case "disallowedActionVerbs": - err = unpopulate(val, "DisallowedActionVerbs", &r.DisallowedActionVerbs) - delete(rawMsg, key) - case "enableAsyncOperation": - err = unpopulate(val, "EnableAsyncOperation", &r.EnableAsyncOperation) - delete(rawMsg, key) - case "enableThirdPartyS2S": - err = unpopulate(val, "EnableThirdPartyS2S", &r.EnableThirdPartyS2S) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) - case "endpoints": - err = unpopulate(val, "Endpoints", &r.Endpoints) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProviderRegistration. +func (p ProviderRegistration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "kind", p.Kind) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderRegistration. +func (p *ProviderRegistration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "extendedLocations": - err = unpopulate(val, "ExtendedLocations", &r.ExtendedLocations) + case "kind": + err = unpopulate(val, "Kind", &p.Kind) delete(rawMsg, key) - case "extensionOptions": - err = unpopulate(val, "ExtensionOptions", &r.ExtensionOptions) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "featuresRule": - err = unpopulate(val, "FeaturesRule", &r.FeaturesRule) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "identityManagement": - err = unpopulate(val, "IdentityManagement", &r.IdentityManagement) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) - case "isPureProxy": - err = unpopulate(val, "IsPureProxy", &r.IsPureProxy) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) - case "linkedAccessChecks": - err = unpopulate(val, "LinkedAccessChecks", &r.LinkedAccessChecks) - delete(rawMsg, key) - case "loggingRules": - err = unpopulate(val, "LoggingRules", &r.LoggingRules) - delete(rawMsg, key) - case "marketplaceType": - err = unpopulate(val, "MarketplaceType", &r.MarketplaceType) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "regionality": - err = unpopulate(val, "Regionality", &r.Regionality) - delete(rawMsg, key) - case "requestHeaderOptions": - err = unpopulate(val, "RequestHeaderOptions", &r.RequestHeaderOptions) - delete(rawMsg, key) - case "requiredFeatures": - err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) - delete(rawMsg, key) - case "resourceDeletionPolicy": - err = unpopulate(val, "ResourceDeletionPolicy", &r.ResourceDeletionPolicy) - delete(rawMsg, key) - case "resourceMovePolicy": - err = unpopulate(val, "ResourceMovePolicy", &r.ResourceMovePolicy) - delete(rawMsg, key) - case "routingType": - err = unpopulate(val, "RoutingType", &r.RoutingType) - delete(rawMsg, key) - case "serviceTreeInfos": - err = unpopulate(val, "ServiceTreeInfos", &r.ServiceTreeInfos) - delete(rawMsg, key) - case "subscriptionLifecycleNotificationSpecifications": - err = unpopulate(val, "SubscriptionLifecycleNotificationSpecifications", &r.SubscriptionLifecycleNotificationSpecifications) - delete(rawMsg, key) - case "subscriptionStateRules": - err = unpopulate(val, "SubscriptionStateRules", &r.SubscriptionStateRules) - delete(rawMsg, key) - case "swaggerSpecifications": - err = unpopulate(val, "SwaggerSpecifications", &r.SwaggerSpecifications) - delete(rawMsg, key) - case "templateDeploymentOptions": - err = unpopulate(val, "TemplateDeploymentOptions", &r.TemplateDeploymentOptions) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProviderRegistrationArrayResponseWithContinuation. +func (p ProviderRegistrationArrayResponseWithContinuation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderRegistrationArrayResponseWithContinuation. +func (p *ProviderRegistrationArrayResponseWithContinuation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "throttlingRules": - err = unpopulate(val, "ThrottlingRules", &r.ThrottlingRules) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesAutoGenerated. -func (r ResourceTypeRegistrationPropertiesAutoGenerated) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProviderRegistrationProperties. +func (p ProviderRegistrationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedUnauthorizedActions", r.AllowedUnauthorizedActions) - populate(objectMap, "authorizationActionMappings", r.AuthorizationActionMappings) - populate(objectMap, "checkNameAvailabilitySpecifications", r.CheckNameAvailabilitySpecifications) - populate(objectMap, "defaultApiVersion", r.DefaultAPIVersion) - populate(objectMap, "disallowedActionVerbs", r.DisallowedActionVerbs) - populate(objectMap, "enableAsyncOperation", r.EnableAsyncOperation) - populate(objectMap, "enableThirdPartyS2S", r.EnableThirdPartyS2S) - populate(objectMap, "endpoints", r.Endpoints) - populate(objectMap, "extendedLocations", r.ExtendedLocations) - populate(objectMap, "extensionOptions", r.ExtensionOptions) - populate(objectMap, "featuresRule", r.FeaturesRule) - populate(objectMap, "identityManagement", r.IdentityManagement) - populate(objectMap, "isPureProxy", r.IsPureProxy) - populate(objectMap, "linkedAccessChecks", r.LinkedAccessChecks) - populate(objectMap, "loggingRules", r.LoggingRules) - populate(objectMap, "marketplaceType", r.MarketplaceType) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "regionality", r.Regionality) - populate(objectMap, "requestHeaderOptions", r.RequestHeaderOptions) - populate(objectMap, "requiredFeatures", r.RequiredFeatures) - populate(objectMap, "resourceDeletionPolicy", r.ResourceDeletionPolicy) - populate(objectMap, "resourceMovePolicy", r.ResourceMovePolicy) - populate(objectMap, "routingType", r.RoutingType) - populate(objectMap, "serviceTreeInfos", r.ServiceTreeInfos) - populate(objectMap, "subscriptionLifecycleNotificationSpecifications", r.SubscriptionLifecycleNotificationSpecifications) - populate(objectMap, "subscriptionStateRules", r.SubscriptionStateRules) - populate(objectMap, "swaggerSpecifications", r.SwaggerSpecifications) - populate(objectMap, "templateDeploymentOptions", r.TemplateDeploymentOptions) - populate(objectMap, "throttlingRules", r.ThrottlingRules) + populate(objectMap, "capabilities", p.Capabilities) + populate(objectMap, "crossTenantTokenValidation", p.CrossTenantTokenValidation) + populate(objectMap, "customManifestVersion", p.CustomManifestVersion) + populate(objectMap, "dstsConfiguration", p.DstsConfiguration) + populate(objectMap, "enableTenantLinkedNotification", p.EnableTenantLinkedNotification) + populate(objectMap, "featuresRule", p.FeaturesRule) + populate(objectMap, "globalNotificationEndpoints", p.GlobalNotificationEndpoints) + populate(objectMap, "legacyNamespace", p.LegacyNamespace) + populate(objectMap, "legacyRegistrations", p.LegacyRegistrations) + populate(objectMap, "linkedNotificationRules", p.LinkedNotificationRules) + populate(objectMap, "management", p.Management) + populate(objectMap, "managementGroupGlobalNotificationEndpoints", p.ManagementGroupGlobalNotificationEndpoints) + populateAny(objectMap, "metadata", p.Metadata) + populate(objectMap, "namespace", p.Namespace) + populate(objectMap, "notificationOptions", p.NotificationOptions) + populate(objectMap, "notificationSettings", p.NotificationSettings) + populate(objectMap, "notifications", p.Notifications) + populate(objectMap, "optionalFeatures", p.OptionalFeatures) + populate(objectMap, "privateResourceProviderConfiguration", p.PrivateResourceProviderConfiguration) + populate(objectMap, "providerAuthentication", p.ProviderAuthentication) + populate(objectMap, "providerAuthorizations", p.ProviderAuthorizations) + populate(objectMap, "providerHubMetadata", p.ProviderHubMetadata) + populate(objectMap, "providerType", p.ProviderType) + populate(objectMap, "providerVersion", p.ProviderVersion) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "requestHeaderOptions", p.RequestHeaderOptions) + populate(objectMap, "requiredFeatures", p.RequiredFeatures) + populate(objectMap, "resourceGroupLockOptionDuringMove", p.ResourceGroupLockOptionDuringMove) + populate(objectMap, "resourceHydrationAccounts", p.ResourceHydrationAccounts) + populate(objectMap, "resourceProviderAuthorizationRules", p.ResourceProviderAuthorizationRules) + populate(objectMap, "responseOptions", p.ResponseOptions) + populate(objectMap, "serviceName", p.ServiceName) + populate(objectMap, "services", p.Services) + populate(objectMap, "subscriptionLifecycleNotificationSpecifications", p.SubscriptionLifecycleNotificationSpecifications) + populate(objectMap, "templateDeploymentOptions", p.TemplateDeploymentOptions) + populate(objectMap, "tokenAuthConfiguration", p.TokenAuthConfiguration) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesAutoGenerated. -func (r *ResourceTypeRegistrationPropertiesAutoGenerated) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderRegistrationProperties. +func (p *ProviderRegistrationProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "allowedUnauthorizedActions": - err = unpopulate(val, "AllowedUnauthorizedActions", &r.AllowedUnauthorizedActions) + case "capabilities": + err = unpopulate(val, "Capabilities", &p.Capabilities) delete(rawMsg, key) - case "authorizationActionMappings": - err = unpopulate(val, "AuthorizationActionMappings", &r.AuthorizationActionMappings) + case "crossTenantTokenValidation": + err = unpopulate(val, "CrossTenantTokenValidation", &p.CrossTenantTokenValidation) delete(rawMsg, key) - case "checkNameAvailabilitySpecifications": - err = unpopulate(val, "CheckNameAvailabilitySpecifications", &r.CheckNameAvailabilitySpecifications) + case "customManifestVersion": + err = unpopulate(val, "CustomManifestVersion", &p.CustomManifestVersion) delete(rawMsg, key) - case "defaultApiVersion": - err = unpopulate(val, "DefaultAPIVersion", &r.DefaultAPIVersion) + case "dstsConfiguration": + err = unpopulate(val, "DstsConfiguration", &p.DstsConfiguration) delete(rawMsg, key) - case "disallowedActionVerbs": - err = unpopulate(val, "DisallowedActionVerbs", &r.DisallowedActionVerbs) + case "enableTenantLinkedNotification": + err = unpopulate(val, "EnableTenantLinkedNotification", &p.EnableTenantLinkedNotification) delete(rawMsg, key) - case "enableAsyncOperation": - err = unpopulate(val, "EnableAsyncOperation", &r.EnableAsyncOperation) + case "featuresRule": + err = unpopulate(val, "FeaturesRule", &p.FeaturesRule) delete(rawMsg, key) - case "enableThirdPartyS2S": - err = unpopulate(val, "EnableThirdPartyS2S", &r.EnableThirdPartyS2S) + case "globalNotificationEndpoints": + err = unpopulate(val, "GlobalNotificationEndpoints", &p.GlobalNotificationEndpoints) delete(rawMsg, key) - case "endpoints": - err = unpopulate(val, "Endpoints", &r.Endpoints) + case "legacyNamespace": + err = unpopulate(val, "LegacyNamespace", &p.LegacyNamespace) delete(rawMsg, key) - case "extendedLocations": - err = unpopulate(val, "ExtendedLocations", &r.ExtendedLocations) + case "legacyRegistrations": + err = unpopulate(val, "LegacyRegistrations", &p.LegacyRegistrations) delete(rawMsg, key) - case "extensionOptions": - err = unpopulate(val, "ExtensionOptions", &r.ExtensionOptions) + case "linkedNotificationRules": + err = unpopulate(val, "LinkedNotificationRules", &p.LinkedNotificationRules) delete(rawMsg, key) - case "featuresRule": - err = unpopulate(val, "FeaturesRule", &r.FeaturesRule) + case "management": + err = unpopulate(val, "Management", &p.Management) delete(rawMsg, key) - case "identityManagement": - err = unpopulate(val, "IdentityManagement", &r.IdentityManagement) + case "managementGroupGlobalNotificationEndpoints": + err = unpopulate(val, "ManagementGroupGlobalNotificationEndpoints", &p.ManagementGroupGlobalNotificationEndpoints) delete(rawMsg, key) - case "isPureProxy": - err = unpopulate(val, "IsPureProxy", &r.IsPureProxy) + case "metadata": + err = unpopulate(val, "Metadata", &p.Metadata) delete(rawMsg, key) - case "linkedAccessChecks": - err = unpopulate(val, "LinkedAccessChecks", &r.LinkedAccessChecks) + case "namespace": + err = unpopulate(val, "Namespace", &p.Namespace) delete(rawMsg, key) - case "loggingRules": - err = unpopulate(val, "LoggingRules", &r.LoggingRules) + case "notificationOptions": + err = unpopulate(val, "NotificationOptions", &p.NotificationOptions) delete(rawMsg, key) - case "marketplaceType": - err = unpopulate(val, "MarketplaceType", &r.MarketplaceType) + case "notificationSettings": + err = unpopulate(val, "NotificationSettings", &p.NotificationSettings) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + case "notifications": + err = unpopulate(val, "Notifications", &p.Notifications) delete(rawMsg, key) - case "regionality": - err = unpopulate(val, "Regionality", &r.Regionality) + case "optionalFeatures": + err = unpopulate(val, "OptionalFeatures", &p.OptionalFeatures) + delete(rawMsg, key) + case "privateResourceProviderConfiguration": + err = unpopulate(val, "PrivateResourceProviderConfiguration", &p.PrivateResourceProviderConfiguration) + delete(rawMsg, key) + case "providerAuthentication": + err = unpopulate(val, "ProviderAuthentication", &p.ProviderAuthentication) + delete(rawMsg, key) + case "providerAuthorizations": + err = unpopulate(val, "ProviderAuthorizations", &p.ProviderAuthorizations) + delete(rawMsg, key) + case "providerHubMetadata": + err = unpopulate(val, "ProviderHubMetadata", &p.ProviderHubMetadata) + delete(rawMsg, key) + case "providerType": + err = unpopulate(val, "ProviderType", &p.ProviderType) + delete(rawMsg, key) + case "providerVersion": + err = unpopulate(val, "ProviderVersion", &p.ProviderVersion) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) case "requestHeaderOptions": - err = unpopulate(val, "RequestHeaderOptions", &r.RequestHeaderOptions) + err = unpopulate(val, "RequestHeaderOptions", &p.RequestHeaderOptions) delete(rawMsg, key) case "requiredFeatures": - err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) + err = unpopulate(val, "RequiredFeatures", &p.RequiredFeatures) delete(rawMsg, key) - case "resourceDeletionPolicy": - err = unpopulate(val, "ResourceDeletionPolicy", &r.ResourceDeletionPolicy) + case "resourceGroupLockOptionDuringMove": + err = unpopulate(val, "ResourceGroupLockOptionDuringMove", &p.ResourceGroupLockOptionDuringMove) delete(rawMsg, key) - case "resourceMovePolicy": - err = unpopulate(val, "ResourceMovePolicy", &r.ResourceMovePolicy) + case "resourceHydrationAccounts": + err = unpopulate(val, "ResourceHydrationAccounts", &p.ResourceHydrationAccounts) delete(rawMsg, key) - case "routingType": - err = unpopulate(val, "RoutingType", &r.RoutingType) + case "resourceProviderAuthorizationRules": + err = unpopulate(val, "ResourceProviderAuthorizationRules", &p.ResourceProviderAuthorizationRules) delete(rawMsg, key) - case "serviceTreeInfos": - err = unpopulate(val, "ServiceTreeInfos", &r.ServiceTreeInfos) + case "responseOptions": + err = unpopulate(val, "ResponseOptions", &p.ResponseOptions) delete(rawMsg, key) - case "subscriptionLifecycleNotificationSpecifications": - err = unpopulate(val, "SubscriptionLifecycleNotificationSpecifications", &r.SubscriptionLifecycleNotificationSpecifications) + case "serviceName": + err = unpopulate(val, "ServiceName", &p.ServiceName) delete(rawMsg, key) - case "subscriptionStateRules": - err = unpopulate(val, "SubscriptionStateRules", &r.SubscriptionStateRules) + case "services": + err = unpopulate(val, "Services", &p.Services) delete(rawMsg, key) - case "swaggerSpecifications": - err = unpopulate(val, "SwaggerSpecifications", &r.SwaggerSpecifications) + case "subscriptionLifecycleNotificationSpecifications": + err = unpopulate(val, "SubscriptionLifecycleNotificationSpecifications", &p.SubscriptionLifecycleNotificationSpecifications) delete(rawMsg, key) case "templateDeploymentOptions": - err = unpopulate(val, "TemplateDeploymentOptions", &r.TemplateDeploymentOptions) + err = unpopulate(val, "TemplateDeploymentOptions", &p.TemplateDeploymentOptions) + delete(rawMsg, key) + case "tokenAuthConfiguration": + err = unpopulate(val, "TokenAuthConfiguration", &p.TokenAuthConfiguration) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProviderRegistrationPropertiesPrivateResourceProviderConfiguration. +func (p ProviderRegistrationPropertiesPrivateResourceProviderConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedSubscriptions", p.AllowedSubscriptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderRegistrationPropertiesPrivateResourceProviderConfiguration. +func (p *ProviderRegistrationPropertiesPrivateResourceProviderConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowedSubscriptions": + err = unpopulate(val, "AllowedSubscriptions", &p.AllowedSubscriptions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProviderRegistrationPropertiesProviderHubMetadata. +func (p ProviderRegistrationPropertiesProviderHubMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "directRpRoleDefinitionId", p.DirectRpRoleDefinitionID) + populate(objectMap, "globalAsyncOperationResourceTypeName", p.GlobalAsyncOperationResourceTypeName) + populate(objectMap, "providerAuthentication", p.ProviderAuthentication) + populate(objectMap, "providerAuthorizations", p.ProviderAuthorizations) + populate(objectMap, "regionalAsyncOperationResourceTypeName", p.RegionalAsyncOperationResourceTypeName) + populate(objectMap, "thirdPartyProviderAuthorization", p.ThirdPartyProviderAuthorization) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderRegistrationPropertiesProviderHubMetadata. +func (p *ProviderRegistrationPropertiesProviderHubMetadata) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "directRpRoleDefinitionId": + err = unpopulate(val, "DirectRpRoleDefinitionID", &p.DirectRpRoleDefinitionID) + delete(rawMsg, key) + case "globalAsyncOperationResourceTypeName": + err = unpopulate(val, "GlobalAsyncOperationResourceTypeName", &p.GlobalAsyncOperationResourceTypeName) + delete(rawMsg, key) + case "providerAuthentication": + err = unpopulate(val, "ProviderAuthentication", &p.ProviderAuthentication) + delete(rawMsg, key) + case "providerAuthorizations": + err = unpopulate(val, "ProviderAuthorizations", &p.ProviderAuthorizations) + delete(rawMsg, key) + case "regionalAsyncOperationResourceTypeName": + err = unpopulate(val, "RegionalAsyncOperationResourceTypeName", &p.RegionalAsyncOperationResourceTypeName) + delete(rawMsg, key) + case "thirdPartyProviderAuthorization": + err = unpopulate(val, "ThirdPartyProviderAuthorization", &p.ThirdPartyProviderAuthorization) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications. +func (p ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "softDeleteTTL", p.SoftDeleteTTL) + populate(objectMap, "subscriptionStateOverrideActions", p.SubscriptionStateOverrideActions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications. +func (p *ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "softDeleteTTL": + err = unpopulate(val, "SoftDeleteTTL", &p.SoftDeleteTTL) + delete(rawMsg, key) + case "subscriptionStateOverrideActions": + err = unpopulate(val, "SubscriptionStateOverrideActions", &p.SubscriptionStateOverrideActions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QuotaRule. +func (q QuotaRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "locationRules", q.LocationRules) + populate(objectMap, "quotaPolicy", q.QuotaPolicy) + populate(objectMap, "requiredFeatures", q.RequiredFeatures) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRule. +func (q *QuotaRule) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "locationRules": + err = unpopulate(val, "LocationRules", &q.LocationRules) + delete(rawMsg, key) + case "quotaPolicy": + err = unpopulate(val, "QuotaPolicy", &q.QuotaPolicy) + delete(rawMsg, key) + case "requiredFeatures": + err = unpopulate(val, "RequiredFeatures", &q.RequiredFeatures) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReRegisterSubscriptionMetadata. +func (r ReRegisterSubscriptionMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "concurrencyLimit", r.ConcurrencyLimit) + populate(objectMap, "enabled", r.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReRegisterSubscriptionMetadata. +func (r *ReRegisterSubscriptionMetadata) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "concurrencyLimit": + err = unpopulate(val, "ConcurrencyLimit", &r.ConcurrencyLimit) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &r.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RequestHeaderOptions. +func (r RequestHeaderOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "optInHeaders", r.OptInHeaders) + populate(objectMap, "optOutHeaders", r.OptOutHeaders) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestHeaderOptions. +func (r *RequestHeaderOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "optInHeaders": + err = unpopulate(val, "OptInHeaders", &r.OptInHeaders) + delete(rawMsg, key) + case "optOutHeaders": + err = unpopulate(val, "OptOutHeaders", &r.OptOutHeaders) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceAccessRole. +func (r ResourceAccessRole) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actions", r.Actions) + populate(objectMap, "allowedGroupClaims", r.AllowedGroupClaims) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAccessRole. +func (r *ResourceAccessRole) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actions": + err = unpopulate(val, "Actions", &r.Actions) + delete(rawMsg, key) + case "allowedGroupClaims": + err = unpopulate(val, "AllowedGroupClaims", &r.AllowedGroupClaims) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceConcurrencyControlOption. +func (r ResourceConcurrencyControlOption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "policy", r.Policy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceConcurrencyControlOption. +func (r *ResourceConcurrencyControlOption) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "policy": + err = unpopulate(val, "Policy", &r.Policy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceGraphConfiguration. +func (r ResourceGraphConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiVersion", r.APIVersion) + populate(objectMap, "enabled", r.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGraphConfiguration. +func (r *ResourceGraphConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiVersion": + err = unpopulate(val, "APIVersion", &r.APIVersion) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &r.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceHydrationAccount. +func (r ResourceHydrationAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accountName", r.AccountName) + populate(objectMap, "encryptedKey", r.EncryptedKey) + populate(objectMap, "maxChildResourceConsistencyJobLimit", r.MaxChildResourceConsistencyJobLimit) + populate(objectMap, "subscriptionId", r.SubscriptionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceHydrationAccount. +func (r *ResourceHydrationAccount) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accountName": + err = unpopulate(val, "AccountName", &r.AccountName) + delete(rawMsg, key) + case "encryptedKey": + err = unpopulate(val, "EncryptedKey", &r.EncryptedKey) + delete(rawMsg, key) + case "maxChildResourceConsistencyJobLimit": + err = unpopulate(val, "MaxChildResourceConsistencyJobLimit", &r.MaxChildResourceConsistencyJobLimit) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &r.SubscriptionID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceManagementAction. +func (r ResourceManagementAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resources", r.Resources) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceManagementAction. +func (r *ResourceManagementAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resources": + err = unpopulate(val, "Resources", &r.Resources) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceManagementEntity. +func (r ResourceManagementEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "homeTenantId", r.HomeTenantID) + populate(objectMap, "location", r.Location) + populate(objectMap, "resourceId", r.ResourceID) + populate(objectMap, "status", r.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceManagementEntity. +func (r *ResourceManagementEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "homeTenantId": + err = unpopulate(val, "HomeTenantID", &r.HomeTenantID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &r.ResourceID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &r.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceMovePolicy. +func (r ResourceMovePolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "crossResourceGroupMoveEnabled", r.CrossResourceGroupMoveEnabled) + populate(objectMap, "crossSubscriptionMoveEnabled", r.CrossSubscriptionMoveEnabled) + populate(objectMap, "validationRequired", r.ValidationRequired) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceMovePolicy. +func (r *ResourceMovePolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "crossResourceGroupMoveEnabled": + err = unpopulate(val, "CrossResourceGroupMoveEnabled", &r.CrossResourceGroupMoveEnabled) + delete(rawMsg, key) + case "crossSubscriptionMoveEnabled": + err = unpopulate(val, "CrossSubscriptionMoveEnabled", &r.CrossSubscriptionMoveEnabled) + delete(rawMsg, key) + case "validationRequired": + err = unpopulate(val, "ValidationRequired", &r.ValidationRequired) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderAuthentication. +func (r ResourceProviderAuthentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedAudiences", r.AllowedAudiences) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderAuthentication. +func (r *ResourceProviderAuthentication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowedAudiences": + err = unpopulate(val, "AllowedAudiences", &r.AllowedAudiences) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderAuthorization. +func (r ResourceProviderAuthorization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedThirdPartyExtensions", r.AllowedThirdPartyExtensions) + populate(objectMap, "applicationId", r.ApplicationID) + populate(objectMap, "groupingTag", r.GroupingTag) + populate(objectMap, "managedByAuthorization", r.ManagedByAuthorization) + populate(objectMap, "managedByRoleDefinitionId", r.ManagedByRoleDefinitionID) + populate(objectMap, "roleDefinitionId", r.RoleDefinitionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderAuthorization. +func (r *ResourceProviderAuthorization) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowedThirdPartyExtensions": + err = unpopulate(val, "AllowedThirdPartyExtensions", &r.AllowedThirdPartyExtensions) + delete(rawMsg, key) + case "applicationId": + err = unpopulate(val, "ApplicationID", &r.ApplicationID) + delete(rawMsg, key) + case "groupingTag": + err = unpopulate(val, "GroupingTag", &r.GroupingTag) + delete(rawMsg, key) + case "managedByAuthorization": + err = unpopulate(val, "ManagedByAuthorization", &r.ManagedByAuthorization) + delete(rawMsg, key) + case "managedByRoleDefinitionId": + err = unpopulate(val, "ManagedByRoleDefinitionID", &r.ManagedByRoleDefinitionID) + delete(rawMsg, key) + case "roleDefinitionId": + err = unpopulate(val, "RoleDefinitionID", &r.RoleDefinitionID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderAuthorizationManagedByAuthorization. +func (r ResourceProviderAuthorizationManagedByAuthorization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalAuthorizations", r.AdditionalAuthorizations) + populate(objectMap, "allowManagedByInheritance", r.AllowManagedByInheritance) + populate(objectMap, "managedByResourceRoleDefinitionId", r.ManagedByResourceRoleDefinitionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderAuthorizationManagedByAuthorization. +func (r *ResourceProviderAuthorizationManagedByAuthorization) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalAuthorizations": + err = unpopulate(val, "AdditionalAuthorizations", &r.AdditionalAuthorizations) + delete(rawMsg, key) + case "allowManagedByInheritance": + err = unpopulate(val, "AllowManagedByInheritance", &r.AllowManagedByInheritance) + delete(rawMsg, key) + case "managedByResourceRoleDefinitionId": + err = unpopulate(val, "ManagedByResourceRoleDefinitionID", &r.ManagedByResourceRoleDefinitionID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderAuthorizationRules. +func (r ResourceProviderAuthorizationRules) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "asyncOperationPollingRules", r.AsyncOperationPollingRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderAuthorizationRules. +func (r *ResourceProviderAuthorizationRules) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "asyncOperationPollingRules": + err = unpopulate(val, "AsyncOperationPollingRules", &r.AsyncOperationPollingRules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderCapabilities. +func (r ResourceProviderCapabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "effect", r.Effect) + populate(objectMap, "quotaId", r.QuotaID) + populate(objectMap, "requiredFeatures", r.RequiredFeatures) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderCapabilities. +func (r *ResourceProviderCapabilities) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "effect": + err = unpopulate(val, "Effect", &r.Effect) + delete(rawMsg, key) + case "quotaId": + err = unpopulate(val, "QuotaID", &r.QuotaID) + delete(rawMsg, key) + case "requiredFeatures": + err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderEndpoint. +func (r ResourceProviderEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiVersions", r.APIVersions) + populate(objectMap, "enabled", r.Enabled) + populate(objectMap, "endpointType", r.EndpointType) + populate(objectMap, "endpointUri", r.EndpointURI) + populate(objectMap, "featuresRule", r.FeaturesRule) + populate(objectMap, "locations", r.Locations) + populate(objectMap, "requiredFeatures", r.RequiredFeatures) + populate(objectMap, "skuLink", r.SKULink) + populate(objectMap, "timeout", r.Timeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderEndpoint. +func (r *ResourceProviderEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiVersions": + err = unpopulate(val, "APIVersions", &r.APIVersions) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &r.Enabled) + delete(rawMsg, key) + case "endpointType": + err = unpopulate(val, "EndpointType", &r.EndpointType) + delete(rawMsg, key) + case "endpointUri": + err = unpopulate(val, "EndpointURI", &r.EndpointURI) + delete(rawMsg, key) + case "featuresRule": + err = unpopulate(val, "FeaturesRule", &r.FeaturesRule) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &r.Locations) + delete(rawMsg, key) + case "requiredFeatures": + err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) + delete(rawMsg, key) + case "skuLink": + err = unpopulate(val, "SKULink", &r.SKULink) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &r.Timeout) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderEndpointFeaturesRule. +func (r ResourceProviderEndpointFeaturesRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "requiredFeaturesPolicy", r.RequiredFeaturesPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderEndpointFeaturesRule. +func (r *ResourceProviderEndpointFeaturesRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "requiredFeaturesPolicy": + err = unpopulate(val, "RequiredFeaturesPolicy", &r.RequiredFeaturesPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManagement. +func (r ResourceProviderManagement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationOwners", r.AuthorizationOwners) + populate(objectMap, "canaryManifestOwners", r.CanaryManifestOwners) + populate(objectMap, "errorResponseMessageOptions", r.ErrorResponseMessageOptions) + populate(objectMap, "expeditedRolloutMetadata", r.ExpeditedRolloutMetadata) + populate(objectMap, "expeditedRolloutSubmitters", r.ExpeditedRolloutSubmitters) + populate(objectMap, "incidentContactEmail", r.IncidentContactEmail) + populate(objectMap, "incidentRoutingService", r.IncidentRoutingService) + populate(objectMap, "incidentRoutingTeam", r.IncidentRoutingTeam) + populate(objectMap, "manifestOwners", r.ManifestOwners) + populate(objectMap, "pcCode", r.PcCode) + populate(objectMap, "profitCenterProgramId", r.ProfitCenterProgramID) + populate(objectMap, "resourceAccessPolicy", r.ResourceAccessPolicy) + populate(objectMap, "resourceAccessRoles", r.ResourceAccessRoles) + populate(objectMap, "schemaOwners", r.SchemaOwners) + populate(objectMap, "serviceTreeInfos", r.ServiceTreeInfos) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManagement. +func (r *ResourceProviderManagement) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authorizationOwners": + err = unpopulate(val, "AuthorizationOwners", &r.AuthorizationOwners) + delete(rawMsg, key) + case "canaryManifestOwners": + err = unpopulate(val, "CanaryManifestOwners", &r.CanaryManifestOwners) + delete(rawMsg, key) + case "errorResponseMessageOptions": + err = unpopulate(val, "ErrorResponseMessageOptions", &r.ErrorResponseMessageOptions) + delete(rawMsg, key) + case "expeditedRolloutMetadata": + err = unpopulate(val, "ExpeditedRolloutMetadata", &r.ExpeditedRolloutMetadata) + delete(rawMsg, key) + case "expeditedRolloutSubmitters": + err = unpopulate(val, "ExpeditedRolloutSubmitters", &r.ExpeditedRolloutSubmitters) + delete(rawMsg, key) + case "incidentContactEmail": + err = unpopulate(val, "IncidentContactEmail", &r.IncidentContactEmail) + delete(rawMsg, key) + case "incidentRoutingService": + err = unpopulate(val, "IncidentRoutingService", &r.IncidentRoutingService) + delete(rawMsg, key) + case "incidentRoutingTeam": + err = unpopulate(val, "IncidentRoutingTeam", &r.IncidentRoutingTeam) + delete(rawMsg, key) + case "manifestOwners": + err = unpopulate(val, "ManifestOwners", &r.ManifestOwners) + delete(rawMsg, key) + case "pcCode": + err = unpopulate(val, "PcCode", &r.PcCode) + delete(rawMsg, key) + case "profitCenterProgramId": + err = unpopulate(val, "ProfitCenterProgramID", &r.ProfitCenterProgramID) + delete(rawMsg, key) + case "resourceAccessPolicy": + err = unpopulate(val, "ResourceAccessPolicy", &r.ResourceAccessPolicy) + delete(rawMsg, key) + case "resourceAccessRoles": + err = unpopulate(val, "ResourceAccessRoles", &r.ResourceAccessRoles) + delete(rawMsg, key) + case "schemaOwners": + err = unpopulate(val, "SchemaOwners", &r.SchemaOwners) + delete(rawMsg, key) + case "serviceTreeInfos": + err = unpopulate(val, "ServiceTreeInfos", &r.ServiceTreeInfos) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManagementErrorResponseMessageOptions. +func (r ResourceProviderManagementErrorResponseMessageOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serverFailureResponseMessageType", r.ServerFailureResponseMessageType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManagementErrorResponseMessageOptions. +func (r *ResourceProviderManagementErrorResponseMessageOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serverFailureResponseMessageType": + err = unpopulate(val, "ServerFailureResponseMessageType", &r.ServerFailureResponseMessageType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManagementExpeditedRolloutMetadata. +func (r ResourceProviderManagementExpeditedRolloutMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", r.Enabled) + populate(objectMap, "expeditedRolloutIntent", r.ExpeditedRolloutIntent) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManagementExpeditedRolloutMetadata. +func (r *ResourceProviderManagementExpeditedRolloutMetadata) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &r.Enabled) + delete(rawMsg, key) + case "expeditedRolloutIntent": + err = unpopulate(val, "ExpeditedRolloutIntent", &r.ExpeditedRolloutIntent) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifest. +func (r ResourceProviderManifest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capabilities", r.Capabilities) + populate(objectMap, "crossTenantTokenValidation", r.CrossTenantTokenValidation) + populate(objectMap, "enableTenantLinkedNotification", r.EnableTenantLinkedNotification) + populate(objectMap, "featuresRule", r.FeaturesRule) + populate(objectMap, "globalNotificationEndpoints", r.GlobalNotificationEndpoints) + populate(objectMap, "linkedNotificationRules", r.LinkedNotificationRules) + populate(objectMap, "management", r.Management) + populateAny(objectMap, "metadata", r.Metadata) + populate(objectMap, "namespace", r.Namespace) + populate(objectMap, "notifications", r.Notifications) + populate(objectMap, "providerAuthentication", r.ProviderAuthentication) + populate(objectMap, "providerAuthorizations", r.ProviderAuthorizations) + populate(objectMap, "providerType", r.ProviderType) + populate(objectMap, "providerVersion", r.ProviderVersion) + populate(objectMap, "reRegisterSubscriptionMetadata", r.ReRegisterSubscriptionMetadata) + populate(objectMap, "requestHeaderOptions", r.RequestHeaderOptions) + populate(objectMap, "requiredFeatures", r.RequiredFeatures) + populate(objectMap, "resourceProviderAuthorizationRules", r.ResourceProviderAuthorizationRules) + populate(objectMap, "resourceTypes", r.ResourceTypes) + populate(objectMap, "serviceName", r.ServiceName) + populate(objectMap, "services", r.Services) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifest. +func (r *ResourceProviderManifest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capabilities": + err = unpopulate(val, "Capabilities", &r.Capabilities) + delete(rawMsg, key) + case "crossTenantTokenValidation": + err = unpopulate(val, "CrossTenantTokenValidation", &r.CrossTenantTokenValidation) + delete(rawMsg, key) + case "enableTenantLinkedNotification": + err = unpopulate(val, "EnableTenantLinkedNotification", &r.EnableTenantLinkedNotification) + delete(rawMsg, key) + case "featuresRule": + err = unpopulate(val, "FeaturesRule", &r.FeaturesRule) + delete(rawMsg, key) + case "globalNotificationEndpoints": + err = unpopulate(val, "GlobalNotificationEndpoints", &r.GlobalNotificationEndpoints) + delete(rawMsg, key) + case "linkedNotificationRules": + err = unpopulate(val, "LinkedNotificationRules", &r.LinkedNotificationRules) + delete(rawMsg, key) + case "management": + err = unpopulate(val, "Management", &r.Management) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &r.Metadata) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &r.Namespace) + delete(rawMsg, key) + case "notifications": + err = unpopulate(val, "Notifications", &r.Notifications) + delete(rawMsg, key) + case "providerAuthentication": + err = unpopulate(val, "ProviderAuthentication", &r.ProviderAuthentication) + delete(rawMsg, key) + case "providerAuthorizations": + err = unpopulate(val, "ProviderAuthorizations", &r.ProviderAuthorizations) + delete(rawMsg, key) + case "providerType": + err = unpopulate(val, "ProviderType", &r.ProviderType) + delete(rawMsg, key) + case "providerVersion": + err = unpopulate(val, "ProviderVersion", &r.ProviderVersion) + delete(rawMsg, key) + case "reRegisterSubscriptionMetadata": + err = unpopulate(val, "ReRegisterSubscriptionMetadata", &r.ReRegisterSubscriptionMetadata) + delete(rawMsg, key) + case "requestHeaderOptions": + err = unpopulate(val, "RequestHeaderOptions", &r.RequestHeaderOptions) + delete(rawMsg, key) + case "requiredFeatures": + err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) + delete(rawMsg, key) + case "resourceProviderAuthorizationRules": + err = unpopulate(val, "ResourceProviderAuthorizationRules", &r.ResourceProviderAuthorizationRules) + delete(rawMsg, key) + case "resourceTypes": + err = unpopulate(val, "ResourceTypes", &r.ResourceTypes) + delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &r.ServiceName) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &r.Services) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestFeaturesRule. +func (r ResourceProviderManifestFeaturesRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "requiredFeaturesPolicy", r.RequiredFeaturesPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestFeaturesRule. +func (r *ResourceProviderManifestFeaturesRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "requiredFeaturesPolicy": + err = unpopulate(val, "RequiredFeaturesPolicy", &r.RequiredFeaturesPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestManagement. +func (r ResourceProviderManifestManagement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationOwners", r.AuthorizationOwners) + populate(objectMap, "canaryManifestOwners", r.CanaryManifestOwners) + populate(objectMap, "errorResponseMessageOptions", r.ErrorResponseMessageOptions) + populate(objectMap, "expeditedRolloutMetadata", r.ExpeditedRolloutMetadata) + populate(objectMap, "expeditedRolloutSubmitters", r.ExpeditedRolloutSubmitters) + populate(objectMap, "incidentContactEmail", r.IncidentContactEmail) + populate(objectMap, "incidentRoutingService", r.IncidentRoutingService) + populate(objectMap, "incidentRoutingTeam", r.IncidentRoutingTeam) + populate(objectMap, "manifestOwners", r.ManifestOwners) + populate(objectMap, "pcCode", r.PcCode) + populate(objectMap, "profitCenterProgramId", r.ProfitCenterProgramID) + populate(objectMap, "resourceAccessPolicy", r.ResourceAccessPolicy) + populate(objectMap, "resourceAccessRoles", r.ResourceAccessRoles) + populate(objectMap, "schemaOwners", r.SchemaOwners) + populate(objectMap, "serviceTreeInfos", r.ServiceTreeInfos) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestManagement. +func (r *ResourceProviderManifestManagement) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authorizationOwners": + err = unpopulate(val, "AuthorizationOwners", &r.AuthorizationOwners) + delete(rawMsg, key) + case "canaryManifestOwners": + err = unpopulate(val, "CanaryManifestOwners", &r.CanaryManifestOwners) + delete(rawMsg, key) + case "errorResponseMessageOptions": + err = unpopulate(val, "ErrorResponseMessageOptions", &r.ErrorResponseMessageOptions) + delete(rawMsg, key) + case "expeditedRolloutMetadata": + err = unpopulate(val, "ExpeditedRolloutMetadata", &r.ExpeditedRolloutMetadata) + delete(rawMsg, key) + case "expeditedRolloutSubmitters": + err = unpopulate(val, "ExpeditedRolloutSubmitters", &r.ExpeditedRolloutSubmitters) + delete(rawMsg, key) + case "incidentContactEmail": + err = unpopulate(val, "IncidentContactEmail", &r.IncidentContactEmail) + delete(rawMsg, key) + case "incidentRoutingService": + err = unpopulate(val, "IncidentRoutingService", &r.IncidentRoutingService) + delete(rawMsg, key) + case "incidentRoutingTeam": + err = unpopulate(val, "IncidentRoutingTeam", &r.IncidentRoutingTeam) + delete(rawMsg, key) + case "manifestOwners": + err = unpopulate(val, "ManifestOwners", &r.ManifestOwners) + delete(rawMsg, key) + case "pcCode": + err = unpopulate(val, "PcCode", &r.PcCode) + delete(rawMsg, key) + case "profitCenterProgramId": + err = unpopulate(val, "ProfitCenterProgramID", &r.ProfitCenterProgramID) + delete(rawMsg, key) + case "resourceAccessPolicy": + err = unpopulate(val, "ResourceAccessPolicy", &r.ResourceAccessPolicy) + delete(rawMsg, key) + case "resourceAccessRoles": + err = unpopulate(val, "ResourceAccessRoles", &r.ResourceAccessRoles) + delete(rawMsg, key) + case "schemaOwners": + err = unpopulate(val, "SchemaOwners", &r.SchemaOwners) + delete(rawMsg, key) + case "serviceTreeInfos": + err = unpopulate(val, "ServiceTreeInfos", &r.ServiceTreeInfos) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestProperties. +func (r ResourceProviderManifestProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capabilities", r.Capabilities) + populate(objectMap, "crossTenantTokenValidation", r.CrossTenantTokenValidation) + populate(objectMap, "customManifestVersion", r.CustomManifestVersion) + populate(objectMap, "dstsConfiguration", r.DstsConfiguration) + populate(objectMap, "enableTenantLinkedNotification", r.EnableTenantLinkedNotification) + populate(objectMap, "featuresRule", r.FeaturesRule) + populate(objectMap, "globalNotificationEndpoints", r.GlobalNotificationEndpoints) + populate(objectMap, "legacyNamespace", r.LegacyNamespace) + populate(objectMap, "legacyRegistrations", r.LegacyRegistrations) + populate(objectMap, "linkedNotificationRules", r.LinkedNotificationRules) + populate(objectMap, "management", r.Management) + populate(objectMap, "managementGroupGlobalNotificationEndpoints", r.ManagementGroupGlobalNotificationEndpoints) + populateAny(objectMap, "metadata", r.Metadata) + populate(objectMap, "namespace", r.Namespace) + populate(objectMap, "notificationOptions", r.NotificationOptions) + populate(objectMap, "notificationSettings", r.NotificationSettings) + populate(objectMap, "notifications", r.Notifications) + populate(objectMap, "optionalFeatures", r.OptionalFeatures) + populate(objectMap, "providerAuthentication", r.ProviderAuthentication) + populate(objectMap, "providerAuthorizations", r.ProviderAuthorizations) + populate(objectMap, "providerType", r.ProviderType) + populate(objectMap, "providerVersion", r.ProviderVersion) + populate(objectMap, "requestHeaderOptions", r.RequestHeaderOptions) + populate(objectMap, "requiredFeatures", r.RequiredFeatures) + populate(objectMap, "resourceGroupLockOptionDuringMove", r.ResourceGroupLockOptionDuringMove) + populate(objectMap, "resourceHydrationAccounts", r.ResourceHydrationAccounts) + populate(objectMap, "resourceProviderAuthorizationRules", r.ResourceProviderAuthorizationRules) + populate(objectMap, "responseOptions", r.ResponseOptions) + populate(objectMap, "serviceName", r.ServiceName) + populate(objectMap, "services", r.Services) + populate(objectMap, "templateDeploymentOptions", r.TemplateDeploymentOptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestProperties. +func (r *ResourceProviderManifestProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capabilities": + err = unpopulate(val, "Capabilities", &r.Capabilities) + delete(rawMsg, key) + case "crossTenantTokenValidation": + err = unpopulate(val, "CrossTenantTokenValidation", &r.CrossTenantTokenValidation) + delete(rawMsg, key) + case "customManifestVersion": + err = unpopulate(val, "CustomManifestVersion", &r.CustomManifestVersion) + delete(rawMsg, key) + case "dstsConfiguration": + err = unpopulate(val, "DstsConfiguration", &r.DstsConfiguration) + delete(rawMsg, key) + case "enableTenantLinkedNotification": + err = unpopulate(val, "EnableTenantLinkedNotification", &r.EnableTenantLinkedNotification) + delete(rawMsg, key) + case "featuresRule": + err = unpopulate(val, "FeaturesRule", &r.FeaturesRule) + delete(rawMsg, key) + case "globalNotificationEndpoints": + err = unpopulate(val, "GlobalNotificationEndpoints", &r.GlobalNotificationEndpoints) + delete(rawMsg, key) + case "legacyNamespace": + err = unpopulate(val, "LegacyNamespace", &r.LegacyNamespace) + delete(rawMsg, key) + case "legacyRegistrations": + err = unpopulate(val, "LegacyRegistrations", &r.LegacyRegistrations) + delete(rawMsg, key) + case "linkedNotificationRules": + err = unpopulate(val, "LinkedNotificationRules", &r.LinkedNotificationRules) + delete(rawMsg, key) + case "management": + err = unpopulate(val, "Management", &r.Management) + delete(rawMsg, key) + case "managementGroupGlobalNotificationEndpoints": + err = unpopulate(val, "ManagementGroupGlobalNotificationEndpoints", &r.ManagementGroupGlobalNotificationEndpoints) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &r.Metadata) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &r.Namespace) + delete(rawMsg, key) + case "notificationOptions": + err = unpopulate(val, "NotificationOptions", &r.NotificationOptions) + delete(rawMsg, key) + case "notificationSettings": + err = unpopulate(val, "NotificationSettings", &r.NotificationSettings) + delete(rawMsg, key) + case "notifications": + err = unpopulate(val, "Notifications", &r.Notifications) + delete(rawMsg, key) + case "optionalFeatures": + err = unpopulate(val, "OptionalFeatures", &r.OptionalFeatures) + delete(rawMsg, key) + case "providerAuthentication": + err = unpopulate(val, "ProviderAuthentication", &r.ProviderAuthentication) + delete(rawMsg, key) + case "providerAuthorizations": + err = unpopulate(val, "ProviderAuthorizations", &r.ProviderAuthorizations) + delete(rawMsg, key) + case "providerType": + err = unpopulate(val, "ProviderType", &r.ProviderType) + delete(rawMsg, key) + case "providerVersion": + err = unpopulate(val, "ProviderVersion", &r.ProviderVersion) + delete(rawMsg, key) + case "requestHeaderOptions": + err = unpopulate(val, "RequestHeaderOptions", &r.RequestHeaderOptions) + delete(rawMsg, key) + case "requiredFeatures": + err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) + delete(rawMsg, key) + case "resourceGroupLockOptionDuringMove": + err = unpopulate(val, "ResourceGroupLockOptionDuringMove", &r.ResourceGroupLockOptionDuringMove) + delete(rawMsg, key) + case "resourceHydrationAccounts": + err = unpopulate(val, "ResourceHydrationAccounts", &r.ResourceHydrationAccounts) + delete(rawMsg, key) + case "resourceProviderAuthorizationRules": + err = unpopulate(val, "ResourceProviderAuthorizationRules", &r.ResourceProviderAuthorizationRules) + delete(rawMsg, key) + case "responseOptions": + err = unpopulate(val, "ResponseOptions", &r.ResponseOptions) + delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &r.ServiceName) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &r.Services) + delete(rawMsg, key) + case "templateDeploymentOptions": + err = unpopulate(val, "TemplateDeploymentOptions", &r.TemplateDeploymentOptions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestPropertiesDstsConfiguration. +func (r ResourceProviderManifestPropertiesDstsConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceDnsName", r.ServiceDNSName) + populate(objectMap, "serviceName", r.ServiceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestPropertiesDstsConfiguration. +func (r *ResourceProviderManifestPropertiesDstsConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceDnsName": + err = unpopulate(val, "ServiceDNSName", &r.ServiceDNSName) + delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &r.ServiceName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestPropertiesFeaturesRule. +func (r ResourceProviderManifestPropertiesFeaturesRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "requiredFeaturesPolicy", r.RequiredFeaturesPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestPropertiesFeaturesRule. +func (r *ResourceProviderManifestPropertiesFeaturesRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "requiredFeaturesPolicy": + err = unpopulate(val, "RequiredFeaturesPolicy", &r.RequiredFeaturesPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestPropertiesManagement. +func (r ResourceProviderManifestPropertiesManagement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationOwners", r.AuthorizationOwners) + populate(objectMap, "canaryManifestOwners", r.CanaryManifestOwners) + populate(objectMap, "errorResponseMessageOptions", r.ErrorResponseMessageOptions) + populate(objectMap, "expeditedRolloutMetadata", r.ExpeditedRolloutMetadata) + populate(objectMap, "expeditedRolloutSubmitters", r.ExpeditedRolloutSubmitters) + populate(objectMap, "incidentContactEmail", r.IncidentContactEmail) + populate(objectMap, "incidentRoutingService", r.IncidentRoutingService) + populate(objectMap, "incidentRoutingTeam", r.IncidentRoutingTeam) + populate(objectMap, "manifestOwners", r.ManifestOwners) + populate(objectMap, "pcCode", r.PcCode) + populate(objectMap, "profitCenterProgramId", r.ProfitCenterProgramID) + populate(objectMap, "resourceAccessPolicy", r.ResourceAccessPolicy) + populate(objectMap, "resourceAccessRoles", r.ResourceAccessRoles) + populate(objectMap, "schemaOwners", r.SchemaOwners) + populate(objectMap, "serviceTreeInfos", r.ServiceTreeInfos) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestPropertiesManagement. +func (r *ResourceProviderManifestPropertiesManagement) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authorizationOwners": + err = unpopulate(val, "AuthorizationOwners", &r.AuthorizationOwners) + delete(rawMsg, key) + case "canaryManifestOwners": + err = unpopulate(val, "CanaryManifestOwners", &r.CanaryManifestOwners) + delete(rawMsg, key) + case "errorResponseMessageOptions": + err = unpopulate(val, "ErrorResponseMessageOptions", &r.ErrorResponseMessageOptions) + delete(rawMsg, key) + case "expeditedRolloutMetadata": + err = unpopulate(val, "ExpeditedRolloutMetadata", &r.ExpeditedRolloutMetadata) + delete(rawMsg, key) + case "expeditedRolloutSubmitters": + err = unpopulate(val, "ExpeditedRolloutSubmitters", &r.ExpeditedRolloutSubmitters) + delete(rawMsg, key) + case "incidentContactEmail": + err = unpopulate(val, "IncidentContactEmail", &r.IncidentContactEmail) + delete(rawMsg, key) + case "incidentRoutingService": + err = unpopulate(val, "IncidentRoutingService", &r.IncidentRoutingService) + delete(rawMsg, key) + case "incidentRoutingTeam": + err = unpopulate(val, "IncidentRoutingTeam", &r.IncidentRoutingTeam) + delete(rawMsg, key) + case "manifestOwners": + err = unpopulate(val, "ManifestOwners", &r.ManifestOwners) + delete(rawMsg, key) + case "pcCode": + err = unpopulate(val, "PcCode", &r.PcCode) + delete(rawMsg, key) + case "profitCenterProgramId": + err = unpopulate(val, "ProfitCenterProgramID", &r.ProfitCenterProgramID) + delete(rawMsg, key) + case "resourceAccessPolicy": + err = unpopulate(val, "ResourceAccessPolicy", &r.ResourceAccessPolicy) + delete(rawMsg, key) + case "resourceAccessRoles": + err = unpopulate(val, "ResourceAccessRoles", &r.ResourceAccessRoles) + delete(rawMsg, key) + case "schemaOwners": + err = unpopulate(val, "SchemaOwners", &r.SchemaOwners) + delete(rawMsg, key) + case "serviceTreeInfos": + err = unpopulate(val, "ServiceTreeInfos", &r.ServiceTreeInfos) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestPropertiesNotificationSettings. +func (r ResourceProviderManifestPropertiesNotificationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "subscriberSettings", r.SubscriberSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestPropertiesNotificationSettings. +func (r *ResourceProviderManifestPropertiesNotificationSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "subscriberSettings": + err = unpopulate(val, "SubscriberSettings", &r.SubscriberSettings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestPropertiesProviderAuthentication. +func (r ResourceProviderManifestPropertiesProviderAuthentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedAudiences", r.AllowedAudiences) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestPropertiesProviderAuthentication. +func (r *ResourceProviderManifestPropertiesProviderAuthentication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowedAudiences": + err = unpopulate(val, "AllowedAudiences", &r.AllowedAudiences) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestPropertiesRequestHeaderOptions. +func (r ResourceProviderManifestPropertiesRequestHeaderOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "optInHeaders", r.OptInHeaders) + populate(objectMap, "optOutHeaders", r.OptOutHeaders) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestPropertiesRequestHeaderOptions. +func (r *ResourceProviderManifestPropertiesRequestHeaderOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "optInHeaders": + err = unpopulate(val, "OptInHeaders", &r.OptInHeaders) + delete(rawMsg, key) + case "optOutHeaders": + err = unpopulate(val, "OptOutHeaders", &r.OptOutHeaders) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestPropertiesResourceGroupLockOptionDuringMove. +func (r ResourceProviderManifestPropertiesResourceGroupLockOptionDuringMove) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blockActionVerb", r.BlockActionVerb) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestPropertiesResourceGroupLockOptionDuringMove. +func (r *ResourceProviderManifestPropertiesResourceGroupLockOptionDuringMove) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blockActionVerb": + err = unpopulate(val, "BlockActionVerb", &r.BlockActionVerb) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestPropertiesResponseOptions. +func (r ResourceProviderManifestPropertiesResponseOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceClientOptionsType", r.ServiceClientOptionsType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestPropertiesResponseOptions. +func (r *ResourceProviderManifestPropertiesResponseOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceClientOptionsType": + err = unpopulate(val, "ServiceClientOptionsType", &r.ServiceClientOptionsType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestPropertiesTemplateDeploymentOptions. +func (r ResourceProviderManifestPropertiesTemplateDeploymentOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "preflightOptions", r.PreflightOptions) + populate(objectMap, "preflightSupported", r.PreflightSupported) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestPropertiesTemplateDeploymentOptions. +func (r *ResourceProviderManifestPropertiesTemplateDeploymentOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "preflightOptions": + err = unpopulate(val, "PreflightOptions", &r.PreflightOptions) + delete(rawMsg, key) + case "preflightSupported": + err = unpopulate(val, "PreflightSupported", &r.PreflightSupported) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestProviderAuthentication. +func (r ResourceProviderManifestProviderAuthentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedAudiences", r.AllowedAudiences) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestProviderAuthentication. +func (r *ResourceProviderManifestProviderAuthentication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowedAudiences": + err = unpopulate(val, "AllowedAudiences", &r.AllowedAudiences) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestReRegisterSubscriptionMetadata. +func (r ResourceProviderManifestReRegisterSubscriptionMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "concurrencyLimit", r.ConcurrencyLimit) + populate(objectMap, "enabled", r.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestReRegisterSubscriptionMetadata. +func (r *ResourceProviderManifestReRegisterSubscriptionMetadata) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "concurrencyLimit": + err = unpopulate(val, "ConcurrencyLimit", &r.ConcurrencyLimit) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &r.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderManifestRequestHeaderOptions. +func (r ResourceProviderManifestRequestHeaderOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "optInHeaders", r.OptInHeaders) + populate(objectMap, "optOutHeaders", r.OptOutHeaders) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderManifestRequestHeaderOptions. +func (r *ResourceProviderManifestRequestHeaderOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "optInHeaders": + err = unpopulate(val, "OptInHeaders", &r.OptInHeaders) + delete(rawMsg, key) + case "optOutHeaders": + err = unpopulate(val, "OptOutHeaders", &r.OptOutHeaders) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderService. +func (r ResourceProviderService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceName", r.ServiceName) + populate(objectMap, "status", r.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderService. +func (r *ResourceProviderService) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceName": + err = unpopulate(val, "ServiceName", &r.ServiceName) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &r.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceType. +func (r ResourceType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalOptions", r.AdditionalOptions) + populate(objectMap, "allowedUnauthorizedActions", r.AllowedUnauthorizedActions) + populate(objectMap, "allowedUnauthorizedActionsExtensions", r.AllowedUnauthorizedActionsExtensions) + populate(objectMap, "authorizationActionMappings", r.AuthorizationActionMappings) + populate(objectMap, "crossTenantTokenValidation", r.CrossTenantTokenValidation) + populate(objectMap, "defaultApiVersion", r.DefaultAPIVersion) + populate(objectMap, "disallowedActionVerbs", r.DisallowedActionVerbs) + populate(objectMap, "endpoints", r.Endpoints) + populate(objectMap, "extendedLocations", r.ExtendedLocations) + populate(objectMap, "featuresRule", r.FeaturesRule) + populate(objectMap, "identityManagement", r.IdentityManagement) + populate(objectMap, "linkedAccessChecks", r.LinkedAccessChecks) + populate(objectMap, "linkedNotificationRules", r.LinkedNotificationRules) + populate(objectMap, "linkedOperationRules", r.LinkedOperationRules) + populate(objectMap, "loggingRules", r.LoggingRules) + populate(objectMap, "marketplaceType", r.MarketplaceType) + populateAny(objectMap, "metadata", r.Metadata) + populate(objectMap, "name", r.Name) + populate(objectMap, "notifications", r.Notifications) + populate(objectMap, "quotaRule", r.QuotaRule) + populate(objectMap, "requestHeaderOptions", r.RequestHeaderOptions) + populate(objectMap, "requiredFeatures", r.RequiredFeatures) + populate(objectMap, "resourceDeletionPolicy", r.ResourceDeletionPolicy) + populate(objectMap, "resourceProviderAuthorizationRules", r.ResourceProviderAuthorizationRules) + populate(objectMap, "resourceValidation", r.ResourceValidation) + populate(objectMap, "routingType", r.RoutingType) + populate(objectMap, "skuLink", r.SKULink) + populate(objectMap, "serviceTreeInfos", r.ServiceTreeInfos) + populate(objectMap, "subscriptionStateRules", r.SubscriptionStateRules) + populate(objectMap, "templateDeploymentPolicy", r.TemplateDeploymentPolicy) + populate(objectMap, "throttlingRules", r.ThrottlingRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceType. +func (r *ResourceType) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalOptions": + err = unpopulate(val, "AdditionalOptions", &r.AdditionalOptions) + delete(rawMsg, key) + case "allowedUnauthorizedActions": + err = unpopulate(val, "AllowedUnauthorizedActions", &r.AllowedUnauthorizedActions) + delete(rawMsg, key) + case "allowedUnauthorizedActionsExtensions": + err = unpopulate(val, "AllowedUnauthorizedActionsExtensions", &r.AllowedUnauthorizedActionsExtensions) + delete(rawMsg, key) + case "authorizationActionMappings": + err = unpopulate(val, "AuthorizationActionMappings", &r.AuthorizationActionMappings) + delete(rawMsg, key) + case "crossTenantTokenValidation": + err = unpopulate(val, "CrossTenantTokenValidation", &r.CrossTenantTokenValidation) + delete(rawMsg, key) + case "defaultApiVersion": + err = unpopulate(val, "DefaultAPIVersion", &r.DefaultAPIVersion) + delete(rawMsg, key) + case "disallowedActionVerbs": + err = unpopulate(val, "DisallowedActionVerbs", &r.DisallowedActionVerbs) + delete(rawMsg, key) + case "endpoints": + err = unpopulate(val, "Endpoints", &r.Endpoints) + delete(rawMsg, key) + case "extendedLocations": + err = unpopulate(val, "ExtendedLocations", &r.ExtendedLocations) + delete(rawMsg, key) + case "featuresRule": + err = unpopulate(val, "FeaturesRule", &r.FeaturesRule) + delete(rawMsg, key) + case "identityManagement": + err = unpopulate(val, "IdentityManagement", &r.IdentityManagement) + delete(rawMsg, key) + case "linkedAccessChecks": + err = unpopulate(val, "LinkedAccessChecks", &r.LinkedAccessChecks) + delete(rawMsg, key) + case "linkedNotificationRules": + err = unpopulate(val, "LinkedNotificationRules", &r.LinkedNotificationRules) + delete(rawMsg, key) + case "linkedOperationRules": + err = unpopulate(val, "LinkedOperationRules", &r.LinkedOperationRules) + delete(rawMsg, key) + case "loggingRules": + err = unpopulate(val, "LoggingRules", &r.LoggingRules) + delete(rawMsg, key) + case "marketplaceType": + err = unpopulate(val, "MarketplaceType", &r.MarketplaceType) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &r.Metadata) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "notifications": + err = unpopulate(val, "Notifications", &r.Notifications) + delete(rawMsg, key) + case "quotaRule": + err = unpopulate(val, "QuotaRule", &r.QuotaRule) + delete(rawMsg, key) + case "requestHeaderOptions": + err = unpopulate(val, "RequestHeaderOptions", &r.RequestHeaderOptions) + delete(rawMsg, key) + case "requiredFeatures": + err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) + delete(rawMsg, key) + case "resourceDeletionPolicy": + err = unpopulate(val, "ResourceDeletionPolicy", &r.ResourceDeletionPolicy) + delete(rawMsg, key) + case "resourceProviderAuthorizationRules": + err = unpopulate(val, "ResourceProviderAuthorizationRules", &r.ResourceProviderAuthorizationRules) + delete(rawMsg, key) + case "resourceValidation": + err = unpopulate(val, "ResourceValidation", &r.ResourceValidation) + delete(rawMsg, key) + case "routingType": + err = unpopulate(val, "RoutingType", &r.RoutingType) + delete(rawMsg, key) + case "skuLink": + err = unpopulate(val, "SKULink", &r.SKULink) + delete(rawMsg, key) + case "serviceTreeInfos": + err = unpopulate(val, "ServiceTreeInfos", &r.ServiceTreeInfos) + delete(rawMsg, key) + case "subscriptionStateRules": + err = unpopulate(val, "SubscriptionStateRules", &r.SubscriptionStateRules) + delete(rawMsg, key) + case "templateDeploymentPolicy": + err = unpopulate(val, "TemplateDeploymentPolicy", &r.TemplateDeploymentPolicy) + delete(rawMsg, key) + case "throttlingRules": + err = unpopulate(val, "ThrottlingRules", &r.ThrottlingRules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeEndpoint. +func (r ResourceTypeEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiVersion", r.APIVersion) + populate(objectMap, "apiVersions", r.APIVersions) + populate(objectMap, "dataBoundary", r.DataBoundary) + populate(objectMap, "dstsConfiguration", r.DstsConfiguration) + populate(objectMap, "enabled", r.Enabled) + populate(objectMap, "endpointType", r.EndpointType) + populate(objectMap, "endpointUri", r.EndpointURI) + populate(objectMap, "extensions", r.Extensions) + populate(objectMap, "featuresRule", r.FeaturesRule) + populate(objectMap, "kind", r.Kind) + populate(objectMap, "locations", r.Locations) + populate(objectMap, "requiredFeatures", r.RequiredFeatures) + populate(objectMap, "skuLink", r.SKULink) + populate(objectMap, "timeout", r.Timeout) + populate(objectMap, "tokenAuthConfiguration", r.TokenAuthConfiguration) + populate(objectMap, "zones", r.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeEndpoint. +func (r *ResourceTypeEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiVersion": + err = unpopulate(val, "APIVersion", &r.APIVersion) + delete(rawMsg, key) + case "apiVersions": + err = unpopulate(val, "APIVersions", &r.APIVersions) + delete(rawMsg, key) + case "dataBoundary": + err = unpopulate(val, "DataBoundary", &r.DataBoundary) + delete(rawMsg, key) + case "dstsConfiguration": + err = unpopulate(val, "DstsConfiguration", &r.DstsConfiguration) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &r.Enabled) + delete(rawMsg, key) + case "endpointType": + err = unpopulate(val, "EndpointType", &r.EndpointType) + delete(rawMsg, key) + case "endpointUri": + err = unpopulate(val, "EndpointURI", &r.EndpointURI) + delete(rawMsg, key) + case "extensions": + err = unpopulate(val, "Extensions", &r.Extensions) + delete(rawMsg, key) + case "featuresRule": + err = unpopulate(val, "FeaturesRule", &r.FeaturesRule) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &r.Kind) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &r.Locations) + delete(rawMsg, key) + case "requiredFeatures": + err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) + delete(rawMsg, key) + case "skuLink": + err = unpopulate(val, "SKULink", &r.SKULink) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &r.Timeout) + delete(rawMsg, key) + case "tokenAuthConfiguration": + err = unpopulate(val, "TokenAuthConfiguration", &r.TokenAuthConfiguration) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &r.Zones) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeEndpointBase. +func (r ResourceTypeEndpointBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiVersion", r.APIVersion) + populate(objectMap, "apiVersions", r.APIVersions) + populate(objectMap, "dstsConfiguration", r.DstsConfiguration) + populate(objectMap, "enabled", r.Enabled) + populate(objectMap, "endpointType", r.EndpointType) + populate(objectMap, "endpointUri", r.EndpointURI) + populate(objectMap, "featuresRule", r.FeaturesRule) + populate(objectMap, "locations", r.Locations) + populate(objectMap, "requiredFeatures", r.RequiredFeatures) + populate(objectMap, "skuLink", r.SKULink) + populate(objectMap, "timeout", r.Timeout) + populate(objectMap, "zones", r.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeEndpointBase. +func (r *ResourceTypeEndpointBase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiVersion": + err = unpopulate(val, "APIVersion", &r.APIVersion) + delete(rawMsg, key) + case "apiVersions": + err = unpopulate(val, "APIVersions", &r.APIVersions) + delete(rawMsg, key) + case "dstsConfiguration": + err = unpopulate(val, "DstsConfiguration", &r.DstsConfiguration) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &r.Enabled) + delete(rawMsg, key) + case "endpointType": + err = unpopulate(val, "EndpointType", &r.EndpointType) + delete(rawMsg, key) + case "endpointUri": + err = unpopulate(val, "EndpointURI", &r.EndpointURI) + delete(rawMsg, key) + case "featuresRule": + err = unpopulate(val, "FeaturesRule", &r.FeaturesRule) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &r.Locations) + delete(rawMsg, key) + case "requiredFeatures": + err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) + delete(rawMsg, key) + case "skuLink": + err = unpopulate(val, "SKULink", &r.SKULink) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &r.Timeout) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &r.Zones) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeEndpointBaseDstsConfiguration. +func (r ResourceTypeEndpointBaseDstsConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceDnsName", r.ServiceDNSName) + populate(objectMap, "serviceName", r.ServiceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeEndpointBaseDstsConfiguration. +func (r *ResourceTypeEndpointBaseDstsConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceDnsName": + err = unpopulate(val, "ServiceDNSName", &r.ServiceDNSName) + delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &r.ServiceName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeEndpointBaseFeaturesRule. +func (r ResourceTypeEndpointBaseFeaturesRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "requiredFeaturesPolicy", r.RequiredFeaturesPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeEndpointBaseFeaturesRule. +func (r *ResourceTypeEndpointBaseFeaturesRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "requiredFeaturesPolicy": + err = unpopulate(val, "RequiredFeaturesPolicy", &r.RequiredFeaturesPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeEndpointDstsConfiguration. +func (r ResourceTypeEndpointDstsConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceDnsName", r.ServiceDNSName) + populate(objectMap, "serviceName", r.ServiceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeEndpointDstsConfiguration. +func (r *ResourceTypeEndpointDstsConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceDnsName": + err = unpopulate(val, "ServiceDNSName", &r.ServiceDNSName) + delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &r.ServiceName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeEndpointFeaturesRule. +func (r ResourceTypeEndpointFeaturesRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "requiredFeaturesPolicy", r.RequiredFeaturesPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeEndpointFeaturesRule. +func (r *ResourceTypeEndpointFeaturesRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "requiredFeaturesPolicy": + err = unpopulate(val, "RequiredFeaturesPolicy", &r.RequiredFeaturesPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeExtension. +func (r ResourceTypeExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "endpointUri", r.EndpointURI) + populate(objectMap, "extensionCategories", r.ExtensionCategories) + populate(objectMap, "timeout", r.Timeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeExtension. +func (r *ResourceTypeExtension) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endpointUri": + err = unpopulate(val, "EndpointURI", &r.EndpointURI) + delete(rawMsg, key) + case "extensionCategories": + err = unpopulate(val, "ExtensionCategories", &r.ExtensionCategories) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &r.Timeout) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeExtensionOptions. +func (r ResourceTypeExtensionOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceCreationBegin", r.ResourceCreationBegin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeExtensionOptions. +func (r *ResourceTypeExtensionOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceCreationBegin": + err = unpopulate(val, "ResourceCreationBegin", &r.ResourceCreationBegin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeExtensionOptionsResourceCreationBegin. +func (r ResourceTypeExtensionOptionsResourceCreationBegin) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "request", r.Request) + populate(objectMap, "response", r.Response) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeExtensionOptionsResourceCreationBegin. +func (r *ResourceTypeExtensionOptionsResourceCreationBegin) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "request": + err = unpopulate(val, "Request", &r.Request) + delete(rawMsg, key) + case "response": + err = unpopulate(val, "Response", &r.Response) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeFeaturesRule. +func (r ResourceTypeFeaturesRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "requiredFeaturesPolicy", r.RequiredFeaturesPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeFeaturesRule. +func (r *ResourceTypeFeaturesRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "requiredFeaturesPolicy": + err = unpopulate(val, "RequiredFeaturesPolicy", &r.RequiredFeaturesPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeIdentityManagement. +func (r ResourceTypeIdentityManagement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeIdentityManagement. +func (r *ResourceTypeIdentityManagement) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeOnBehalfOfToken. +func (r ResourceTypeOnBehalfOfToken) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionName", r.ActionName) + populate(objectMap, "lifeTime", r.LifeTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeOnBehalfOfToken. +func (r *ResourceTypeOnBehalfOfToken) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionName": + err = unpopulate(val, "ActionName", &r.ActionName) + delete(rawMsg, key) + case "lifeTime": + err = unpopulate(val, "LifeTime", &r.LifeTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistration. +func (r ResourceTypeRegistration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "kind", r.Kind) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistration. +func (r *ResourceTypeRegistration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &r.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationArrayResponseWithContinuation. +func (r ResourceTypeRegistrationArrayResponseWithContinuation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationArrayResponseWithContinuation. +func (r *ResourceTypeRegistrationArrayResponseWithContinuation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationProperties. +func (r ResourceTypeRegistrationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiProfiles", r.APIProfiles) + populate(objectMap, "addResourceListTargetLocations", r.AddResourceListTargetLocations) + populate(objectMap, "additionalOptions", r.AdditionalOptions) + populate(objectMap, "allowEmptyRoleAssignments", r.AllowEmptyRoleAssignments) + populate(objectMap, "allowedResourceNames", r.AllowedResourceNames) + populate(objectMap, "allowedTemplateDeploymentReferenceActions", r.AllowedTemplateDeploymentReferenceActions) + populate(objectMap, "allowedUnauthorizedActions", r.AllowedUnauthorizedActions) + populate(objectMap, "allowedUnauthorizedActionsExtensions", r.AllowedUnauthorizedActionsExtensions) + populate(objectMap, "asyncOperationResourceTypeName", r.AsyncOperationResourceTypeName) + populate(objectMap, "asyncTimeoutRules", r.AsyncTimeoutRules) + populate(objectMap, "authorizationActionMappings", r.AuthorizationActionMappings) + populate(objectMap, "availabilityZoneRule", r.AvailabilityZoneRule) + populate(objectMap, "capacityRule", r.CapacityRule) + populate(objectMap, "category", r.Category) + populate(objectMap, "checkNameAvailabilitySpecifications", r.CheckNameAvailabilitySpecifications) + populate(objectMap, "commonApiVersions", r.CommonAPIVersions) + populate(objectMap, "crossTenantTokenValidation", r.CrossTenantTokenValidation) + populate(objectMap, "defaultApiVersion", r.DefaultAPIVersion) + populate(objectMap, "disallowedActionVerbs", r.DisallowedActionVerbs) + populate(objectMap, "disallowedEndUserOperations", r.DisallowedEndUserOperations) + populate(objectMap, "dstsConfiguration", r.DstsConfiguration) + populate(objectMap, "enableAsyncOperation", r.EnableAsyncOperation) + populate(objectMap, "enableThirdPartyS2S", r.EnableThirdPartyS2S) + populate(objectMap, "endpoints", r.Endpoints) + populate(objectMap, "extendedLocations", r.ExtendedLocations) + populate(objectMap, "extensionOptions", r.ExtensionOptions) + populate(objectMap, "featuresRule", r.FeaturesRule) + populate(objectMap, "frontdoorRequestMode", r.FrontdoorRequestMode) + populate(objectMap, "groupingTag", r.GroupingTag) + populate(objectMap, "identityManagement", r.IdentityManagement) + populate(objectMap, "isPureProxy", r.IsPureProxy) + populate(objectMap, "legacyName", r.LegacyName) + populate(objectMap, "legacyNames", r.LegacyNames) + populate(objectMap, "legacyPolicy", r.LegacyPolicy) + populate(objectMap, "linkedAccessChecks", r.LinkedAccessChecks) + populate(objectMap, "linkedNotificationRules", r.LinkedNotificationRules) + populate(objectMap, "linkedOperationRules", r.LinkedOperationRules) + populate(objectMap, "loggingRules", r.LoggingRules) + populate(objectMap, "management", r.Management) + populate(objectMap, "manifestLink", r.ManifestLink) + populate(objectMap, "marketplaceOptions", r.MarketplaceOptions) + populate(objectMap, "marketplaceType", r.MarketplaceType) + populate(objectMap, "metadata", r.Metadata) + populate(objectMap, "notifications", r.Notifications) + populate(objectMap, "onBehalfOfTokens", r.OnBehalfOfTokens) + populate(objectMap, "openApiConfiguration", r.OpenAPIConfiguration) + populate(objectMap, "policyExecutionType", r.PolicyExecutionType) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "quotaRule", r.QuotaRule) + populate(objectMap, "regionality", r.Regionality) + populate(objectMap, "requestHeaderOptions", r.RequestHeaderOptions) + populate(objectMap, "requiredFeatures", r.RequiredFeatures) + populate(objectMap, "resourceCache", r.ResourceCache) + populate(objectMap, "resourceConcurrencyControlOptions", r.ResourceConcurrencyControlOptions) + populate(objectMap, "resourceDeletionPolicy", r.ResourceDeletionPolicy) + populate(objectMap, "resourceGraphConfiguration", r.ResourceGraphConfiguration) + populate(objectMap, "resourceManagementOptions", r.ResourceManagementOptions) + populate(objectMap, "resourceMovePolicy", r.ResourceMovePolicy) + populate(objectMap, "resourceProviderAuthorizationRules", r.ResourceProviderAuthorizationRules) + populate(objectMap, "resourceQueryManagement", r.ResourceQueryManagement) + populate(objectMap, "resourceSubType", r.ResourceSubType) + populate(objectMap, "resourceTypeCommonAttributeManagement", r.ResourceTypeCommonAttributeManagement) + populate(objectMap, "resourceValidation", r.ResourceValidation) + populate(objectMap, "routingRule", r.RoutingRule) + populate(objectMap, "routingType", r.RoutingType) + populate(objectMap, "skuLink", r.SKULink) + populate(objectMap, "serviceTreeInfos", r.ServiceTreeInfos) + populate(objectMap, "subscriptionLifecycleNotificationSpecifications", r.SubscriptionLifecycleNotificationSpecifications) + populate(objectMap, "subscriptionStateRules", r.SubscriptionStateRules) + populate(objectMap, "supportsTags", r.SupportsTags) + populate(objectMap, "swaggerSpecifications", r.SwaggerSpecifications) + populate(objectMap, "templateDeploymentOptions", r.TemplateDeploymentOptions) + populate(objectMap, "templateDeploymentPolicy", r.TemplateDeploymentPolicy) + populate(objectMap, "throttlingRules", r.ThrottlingRules) + populate(objectMap, "tokenAuthConfiguration", r.TokenAuthConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationProperties. +func (r *ResourceTypeRegistrationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiProfiles": + err = unpopulate(val, "APIProfiles", &r.APIProfiles) + delete(rawMsg, key) + case "addResourceListTargetLocations": + err = unpopulate(val, "AddResourceListTargetLocations", &r.AddResourceListTargetLocations) + delete(rawMsg, key) + case "additionalOptions": + err = unpopulate(val, "AdditionalOptions", &r.AdditionalOptions) + delete(rawMsg, key) + case "allowEmptyRoleAssignments": + err = unpopulate(val, "AllowEmptyRoleAssignments", &r.AllowEmptyRoleAssignments) + delete(rawMsg, key) + case "allowedResourceNames": + err = unpopulate(val, "AllowedResourceNames", &r.AllowedResourceNames) + delete(rawMsg, key) + case "allowedTemplateDeploymentReferenceActions": + err = unpopulate(val, "AllowedTemplateDeploymentReferenceActions", &r.AllowedTemplateDeploymentReferenceActions) + delete(rawMsg, key) + case "allowedUnauthorizedActions": + err = unpopulate(val, "AllowedUnauthorizedActions", &r.AllowedUnauthorizedActions) + delete(rawMsg, key) + case "allowedUnauthorizedActionsExtensions": + err = unpopulate(val, "AllowedUnauthorizedActionsExtensions", &r.AllowedUnauthorizedActionsExtensions) + delete(rawMsg, key) + case "asyncOperationResourceTypeName": + err = unpopulate(val, "AsyncOperationResourceTypeName", &r.AsyncOperationResourceTypeName) + delete(rawMsg, key) + case "asyncTimeoutRules": + err = unpopulate(val, "AsyncTimeoutRules", &r.AsyncTimeoutRules) + delete(rawMsg, key) + case "authorizationActionMappings": + err = unpopulate(val, "AuthorizationActionMappings", &r.AuthorizationActionMappings) + delete(rawMsg, key) + case "availabilityZoneRule": + err = unpopulate(val, "AvailabilityZoneRule", &r.AvailabilityZoneRule) + delete(rawMsg, key) + case "capacityRule": + err = unpopulate(val, "CapacityRule", &r.CapacityRule) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &r.Category) + delete(rawMsg, key) + case "checkNameAvailabilitySpecifications": + err = unpopulate(val, "CheckNameAvailabilitySpecifications", &r.CheckNameAvailabilitySpecifications) + delete(rawMsg, key) + case "commonApiVersions": + err = unpopulate(val, "CommonAPIVersions", &r.CommonAPIVersions) + delete(rawMsg, key) + case "crossTenantTokenValidation": + err = unpopulate(val, "CrossTenantTokenValidation", &r.CrossTenantTokenValidation) + delete(rawMsg, key) + case "defaultApiVersion": + err = unpopulate(val, "DefaultAPIVersion", &r.DefaultAPIVersion) + delete(rawMsg, key) + case "disallowedActionVerbs": + err = unpopulate(val, "DisallowedActionVerbs", &r.DisallowedActionVerbs) + delete(rawMsg, key) + case "disallowedEndUserOperations": + err = unpopulate(val, "DisallowedEndUserOperations", &r.DisallowedEndUserOperations) + delete(rawMsg, key) + case "dstsConfiguration": + err = unpopulate(val, "DstsConfiguration", &r.DstsConfiguration) + delete(rawMsg, key) + case "enableAsyncOperation": + err = unpopulate(val, "EnableAsyncOperation", &r.EnableAsyncOperation) + delete(rawMsg, key) + case "enableThirdPartyS2S": + err = unpopulate(val, "EnableThirdPartyS2S", &r.EnableThirdPartyS2S) + delete(rawMsg, key) + case "endpoints": + err = unpopulate(val, "Endpoints", &r.Endpoints) + delete(rawMsg, key) + case "extendedLocations": + err = unpopulate(val, "ExtendedLocations", &r.ExtendedLocations) + delete(rawMsg, key) + case "extensionOptions": + err = unpopulate(val, "ExtensionOptions", &r.ExtensionOptions) + delete(rawMsg, key) + case "featuresRule": + err = unpopulate(val, "FeaturesRule", &r.FeaturesRule) + delete(rawMsg, key) + case "frontdoorRequestMode": + err = unpopulate(val, "FrontdoorRequestMode", &r.FrontdoorRequestMode) + delete(rawMsg, key) + case "groupingTag": + err = unpopulate(val, "GroupingTag", &r.GroupingTag) + delete(rawMsg, key) + case "identityManagement": + err = unpopulate(val, "IdentityManagement", &r.IdentityManagement) + delete(rawMsg, key) + case "isPureProxy": + err = unpopulate(val, "IsPureProxy", &r.IsPureProxy) + delete(rawMsg, key) + case "legacyName": + err = unpopulate(val, "LegacyName", &r.LegacyName) + delete(rawMsg, key) + case "legacyNames": + err = unpopulate(val, "LegacyNames", &r.LegacyNames) + delete(rawMsg, key) + case "legacyPolicy": + err = unpopulate(val, "LegacyPolicy", &r.LegacyPolicy) + delete(rawMsg, key) + case "linkedAccessChecks": + err = unpopulate(val, "LinkedAccessChecks", &r.LinkedAccessChecks) + delete(rawMsg, key) + case "linkedNotificationRules": + err = unpopulate(val, "LinkedNotificationRules", &r.LinkedNotificationRules) + delete(rawMsg, key) + case "linkedOperationRules": + err = unpopulate(val, "LinkedOperationRules", &r.LinkedOperationRules) + delete(rawMsg, key) + case "loggingRules": + err = unpopulate(val, "LoggingRules", &r.LoggingRules) + delete(rawMsg, key) + case "management": + err = unpopulate(val, "Management", &r.Management) + delete(rawMsg, key) + case "manifestLink": + err = unpopulate(val, "ManifestLink", &r.ManifestLink) + delete(rawMsg, key) + case "marketplaceOptions": + err = unpopulate(val, "MarketplaceOptions", &r.MarketplaceOptions) + delete(rawMsg, key) + case "marketplaceType": + err = unpopulate(val, "MarketplaceType", &r.MarketplaceType) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &r.Metadata) + delete(rawMsg, key) + case "notifications": + err = unpopulate(val, "Notifications", &r.Notifications) + delete(rawMsg, key) + case "onBehalfOfTokens": + err = unpopulate(val, "OnBehalfOfTokens", &r.OnBehalfOfTokens) + delete(rawMsg, key) + case "openApiConfiguration": + err = unpopulate(val, "OpenAPIConfiguration", &r.OpenAPIConfiguration) + delete(rawMsg, key) + case "policyExecutionType": + err = unpopulate(val, "PolicyExecutionType", &r.PolicyExecutionType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "quotaRule": + err = unpopulate(val, "QuotaRule", &r.QuotaRule) + delete(rawMsg, key) + case "regionality": + err = unpopulate(val, "Regionality", &r.Regionality) + delete(rawMsg, key) + case "requestHeaderOptions": + err = unpopulate(val, "RequestHeaderOptions", &r.RequestHeaderOptions) + delete(rawMsg, key) + case "requiredFeatures": + err = unpopulate(val, "RequiredFeatures", &r.RequiredFeatures) + delete(rawMsg, key) + case "resourceCache": + err = unpopulate(val, "ResourceCache", &r.ResourceCache) + delete(rawMsg, key) + case "resourceConcurrencyControlOptions": + err = unpopulate(val, "ResourceConcurrencyControlOptions", &r.ResourceConcurrencyControlOptions) + delete(rawMsg, key) + case "resourceDeletionPolicy": + err = unpopulate(val, "ResourceDeletionPolicy", &r.ResourceDeletionPolicy) + delete(rawMsg, key) + case "resourceGraphConfiguration": + err = unpopulate(val, "ResourceGraphConfiguration", &r.ResourceGraphConfiguration) + delete(rawMsg, key) + case "resourceManagementOptions": + err = unpopulate(val, "ResourceManagementOptions", &r.ResourceManagementOptions) + delete(rawMsg, key) + case "resourceMovePolicy": + err = unpopulate(val, "ResourceMovePolicy", &r.ResourceMovePolicy) + delete(rawMsg, key) + case "resourceProviderAuthorizationRules": + err = unpopulate(val, "ResourceProviderAuthorizationRules", &r.ResourceProviderAuthorizationRules) + delete(rawMsg, key) + case "resourceQueryManagement": + err = unpopulate(val, "ResourceQueryManagement", &r.ResourceQueryManagement) + delete(rawMsg, key) + case "resourceSubType": + err = unpopulate(val, "ResourceSubType", &r.ResourceSubType) + delete(rawMsg, key) + case "resourceTypeCommonAttributeManagement": + err = unpopulate(val, "ResourceTypeCommonAttributeManagement", &r.ResourceTypeCommonAttributeManagement) + delete(rawMsg, key) + case "resourceValidation": + err = unpopulate(val, "ResourceValidation", &r.ResourceValidation) + delete(rawMsg, key) + case "routingRule": + err = unpopulate(val, "RoutingRule", &r.RoutingRule) + delete(rawMsg, key) + case "routingType": + err = unpopulate(val, "RoutingType", &r.RoutingType) + delete(rawMsg, key) + case "skuLink": + err = unpopulate(val, "SKULink", &r.SKULink) + delete(rawMsg, key) + case "serviceTreeInfos": + err = unpopulate(val, "ServiceTreeInfos", &r.ServiceTreeInfos) + delete(rawMsg, key) + case "subscriptionLifecycleNotificationSpecifications": + err = unpopulate(val, "SubscriptionLifecycleNotificationSpecifications", &r.SubscriptionLifecycleNotificationSpecifications) + delete(rawMsg, key) + case "subscriptionStateRules": + err = unpopulate(val, "SubscriptionStateRules", &r.SubscriptionStateRules) + delete(rawMsg, key) + case "supportsTags": + err = unpopulate(val, "SupportsTags", &r.SupportsTags) + delete(rawMsg, key) + case "swaggerSpecifications": + err = unpopulate(val, "SwaggerSpecifications", &r.SwaggerSpecifications) + delete(rawMsg, key) + case "templateDeploymentOptions": + err = unpopulate(val, "TemplateDeploymentOptions", &r.TemplateDeploymentOptions) + delete(rawMsg, key) + case "templateDeploymentPolicy": + err = unpopulate(val, "TemplateDeploymentPolicy", &r.TemplateDeploymentPolicy) + delete(rawMsg, key) + case "throttlingRules": + err = unpopulate(val, "ThrottlingRules", &r.ThrottlingRules) + delete(rawMsg, key) + case "tokenAuthConfiguration": + err = unpopulate(val, "TokenAuthConfiguration", &r.TokenAuthConfiguration) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesAvailabilityZoneRule. +func (r ResourceTypeRegistrationPropertiesAvailabilityZoneRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "availabilityZonePolicy", r.AvailabilityZonePolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesAvailabilityZoneRule. +func (r *ResourceTypeRegistrationPropertiesAvailabilityZoneRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "availabilityZonePolicy": + err = unpopulate(val, "AvailabilityZonePolicy", &r.AvailabilityZonePolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesCapacityRule. +func (r ResourceTypeRegistrationPropertiesCapacityRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capacityPolicy", r.CapacityPolicy) + populate(objectMap, "skuAlias", r.SKUAlias) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesCapacityRule. +func (r *ResourceTypeRegistrationPropertiesCapacityRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacityPolicy": + err = unpopulate(val, "CapacityPolicy", &r.CapacityPolicy) + delete(rawMsg, key) + case "skuAlias": + err = unpopulate(val, "SKUAlias", &r.SKUAlias) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications. +func (r ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enableDefaultValidation", r.EnableDefaultValidation) + populate(objectMap, "resourceTypesWithCustomValidation", r.ResourceTypesWithCustomValidation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications. +func (r *ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enableDefaultValidation": + err = unpopulate(val, "EnableDefaultValidation", &r.EnableDefaultValidation) + delete(rawMsg, key) + case "resourceTypesWithCustomValidation": + err = unpopulate(val, "ResourceTypesWithCustomValidation", &r.ResourceTypesWithCustomValidation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesDstsConfiguration. +func (r ResourceTypeRegistrationPropertiesDstsConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceDnsName", r.ServiceDNSName) + populate(objectMap, "serviceName", r.ServiceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesDstsConfiguration. +func (r *ResourceTypeRegistrationPropertiesDstsConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceDnsName": + err = unpopulate(val, "ServiceDNSName", &r.ServiceDNSName) + delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &r.ServiceName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesExtensionOptions. +func (r ResourceTypeRegistrationPropertiesExtensionOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceCreationBegin", r.ResourceCreationBegin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesExtensionOptions. +func (r *ResourceTypeRegistrationPropertiesExtensionOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceCreationBegin": + err = unpopulate(val, "ResourceCreationBegin", &r.ResourceCreationBegin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesFeaturesRule. +func (r ResourceTypeRegistrationPropertiesFeaturesRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "requiredFeaturesPolicy", r.RequiredFeaturesPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesFeaturesRule. +func (r *ResourceTypeRegistrationPropertiesFeaturesRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "requiredFeaturesPolicy": + err = unpopulate(val, "RequiredFeaturesPolicy", &r.RequiredFeaturesPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesIdentityManagement. +func (r ResourceTypeRegistrationPropertiesIdentityManagement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationId", r.ApplicationID) + populate(objectMap, "applicationIds", r.ApplicationIDs) + populate(objectMap, "delegationAppIds", r.DelegationAppIDs) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesIdentityManagement. +func (r *ResourceTypeRegistrationPropertiesIdentityManagement) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "applicationId": + err = unpopulate(val, "ApplicationID", &r.ApplicationID) + delete(rawMsg, key) + case "applicationIds": + err = unpopulate(val, "ApplicationIDs", &r.ApplicationIDs) + delete(rawMsg, key) + case "delegationAppIds": + err = unpopulate(val, "DelegationAppIDs", &r.DelegationAppIDs) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesLegacyPolicy. +func (r ResourceTypeRegistrationPropertiesLegacyPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "disallowedConditions", r.DisallowedConditions) + populate(objectMap, "disallowedLegacyOperations", r.DisallowedLegacyOperations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesLegacyPolicy. +func (r *ResourceTypeRegistrationPropertiesLegacyPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "disallowedConditions": + err = unpopulate(val, "DisallowedConditions", &r.DisallowedConditions) + delete(rawMsg, key) + case "disallowedLegacyOperations": + err = unpopulate(val, "DisallowedLegacyOperations", &r.DisallowedLegacyOperations) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesManagement. +func (r ResourceTypeRegistrationPropertiesManagement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationOwners", r.AuthorizationOwners) + populate(objectMap, "canaryManifestOwners", r.CanaryManifestOwners) + populate(objectMap, "errorResponseMessageOptions", r.ErrorResponseMessageOptions) + populate(objectMap, "expeditedRolloutMetadata", r.ExpeditedRolloutMetadata) + populate(objectMap, "expeditedRolloutSubmitters", r.ExpeditedRolloutSubmitters) + populate(objectMap, "incidentContactEmail", r.IncidentContactEmail) + populate(objectMap, "incidentRoutingService", r.IncidentRoutingService) + populate(objectMap, "incidentRoutingTeam", r.IncidentRoutingTeam) + populate(objectMap, "manifestOwners", r.ManifestOwners) + populate(objectMap, "pcCode", r.PcCode) + populate(objectMap, "profitCenterProgramId", r.ProfitCenterProgramID) + populate(objectMap, "resourceAccessPolicy", r.ResourceAccessPolicy) + populate(objectMap, "resourceAccessRoles", r.ResourceAccessRoles) + populate(objectMap, "schemaOwners", r.SchemaOwners) + populate(objectMap, "serviceTreeInfos", r.ServiceTreeInfos) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesManagement. +func (r *ResourceTypeRegistrationPropertiesManagement) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authorizationOwners": + err = unpopulate(val, "AuthorizationOwners", &r.AuthorizationOwners) + delete(rawMsg, key) + case "canaryManifestOwners": + err = unpopulate(val, "CanaryManifestOwners", &r.CanaryManifestOwners) + delete(rawMsg, key) + case "errorResponseMessageOptions": + err = unpopulate(val, "ErrorResponseMessageOptions", &r.ErrorResponseMessageOptions) + delete(rawMsg, key) + case "expeditedRolloutMetadata": + err = unpopulate(val, "ExpeditedRolloutMetadata", &r.ExpeditedRolloutMetadata) + delete(rawMsg, key) + case "expeditedRolloutSubmitters": + err = unpopulate(val, "ExpeditedRolloutSubmitters", &r.ExpeditedRolloutSubmitters) + delete(rawMsg, key) + case "incidentContactEmail": + err = unpopulate(val, "IncidentContactEmail", &r.IncidentContactEmail) + delete(rawMsg, key) + case "incidentRoutingService": + err = unpopulate(val, "IncidentRoutingService", &r.IncidentRoutingService) + delete(rawMsg, key) + case "incidentRoutingTeam": + err = unpopulate(val, "IncidentRoutingTeam", &r.IncidentRoutingTeam) + delete(rawMsg, key) + case "manifestOwners": + err = unpopulate(val, "ManifestOwners", &r.ManifestOwners) + delete(rawMsg, key) + case "pcCode": + err = unpopulate(val, "PcCode", &r.PcCode) + delete(rawMsg, key) + case "profitCenterProgramId": + err = unpopulate(val, "ProfitCenterProgramID", &r.ProfitCenterProgramID) + delete(rawMsg, key) + case "resourceAccessPolicy": + err = unpopulate(val, "ResourceAccessPolicy", &r.ResourceAccessPolicy) + delete(rawMsg, key) + case "resourceAccessRoles": + err = unpopulate(val, "ResourceAccessRoles", &r.ResourceAccessRoles) + delete(rawMsg, key) + case "schemaOwners": + err = unpopulate(val, "SchemaOwners", &r.SchemaOwners) + delete(rawMsg, key) + case "serviceTreeInfos": + err = unpopulate(val, "ServiceTreeInfos", &r.ServiceTreeInfos) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesMarketplaceOptions. +func (r ResourceTypeRegistrationPropertiesMarketplaceOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addOnPlanConversionAllowed", r.AddOnPlanConversionAllowed) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesMarketplaceOptions. +func (r *ResourceTypeRegistrationPropertiesMarketplaceOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "addOnPlanConversionAllowed": + err = unpopulate(val, "AddOnPlanConversionAllowed", &r.AddOnPlanConversionAllowed) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesRequestHeaderOptions. +func (r ResourceTypeRegistrationPropertiesRequestHeaderOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "optInHeaders", r.OptInHeaders) + populate(objectMap, "optOutHeaders", r.OptOutHeaders) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesRequestHeaderOptions. +func (r *ResourceTypeRegistrationPropertiesRequestHeaderOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "optInHeaders": + err = unpopulate(val, "OptInHeaders", &r.OptInHeaders) + delete(rawMsg, key) + case "optOutHeaders": + err = unpopulate(val, "OptOutHeaders", &r.OptOutHeaders) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesResourceCache. +func (r ResourceTypeRegistrationPropertiesResourceCache) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enableResourceCache", r.EnableResourceCache) + populate(objectMap, "resourceCacheExpirationTimespan", r.ResourceCacheExpirationTimespan) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesResourceCache. +func (r *ResourceTypeRegistrationPropertiesResourceCache) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enableResourceCache": + err = unpopulate(val, "EnableResourceCache", &r.EnableResourceCache) + delete(rawMsg, key) + case "resourceCacheExpirationTimespan": + err = unpopulate(val, "ResourceCacheExpirationTimespan", &r.ResourceCacheExpirationTimespan) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesResourceGraphConfiguration. +func (r ResourceTypeRegistrationPropertiesResourceGraphConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiVersion", r.APIVersion) + populate(objectMap, "enabled", r.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesResourceGraphConfiguration. +func (r *ResourceTypeRegistrationPropertiesResourceGraphConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiVersion": + err = unpopulate(val, "APIVersion", &r.APIVersion) delete(rawMsg, key) - case "throttlingRules": - err = unpopulate(val, "ThrottlingRules", &r.ThrottlingRules) + case "enabled": + err = unpopulate(val, "Enabled", &r.Enabled) delete(rawMsg, key) } if err != nil { @@ -4051,16 +7824,17 @@ func (r *ResourceTypeRegistrationPropertiesAutoGenerated) UnmarshalJSON(data []b return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications. -func (r ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesResourceManagementOptions. +func (r ResourceTypeRegistrationPropertiesResourceManagementOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enableDefaultValidation", r.EnableDefaultValidation) - populate(objectMap, "resourceTypesWithCustomValidation", r.ResourceTypesWithCustomValidation) + populate(objectMap, "batchProvisioningSupport", r.BatchProvisioningSupport) + populate(objectMap, "deleteDependencies", r.DeleteDependencies) + populate(objectMap, "nestedProvisioningSupport", r.NestedProvisioningSupport) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications. -func (r *ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesResourceManagementOptions. +func (r *ResourceTypeRegistrationPropertiesResourceManagementOptions) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -4068,11 +7842,14 @@ func (r *ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications) for key, val := range rawMsg { var err error switch key { - case "enableDefaultValidation": - err = unpopulate(val, "EnableDefaultValidation", &r.EnableDefaultValidation) + case "batchProvisioningSupport": + err = unpopulate(val, "BatchProvisioningSupport", &r.BatchProvisioningSupport) delete(rawMsg, key) - case "resourceTypesWithCustomValidation": - err = unpopulate(val, "ResourceTypesWithCustomValidation", &r.ResourceTypesWithCustomValidation) + case "deleteDependencies": + err = unpopulate(val, "DeleteDependencies", &r.DeleteDependencies) + delete(rawMsg, key) + case "nestedProvisioningSupport": + err = unpopulate(val, "NestedProvisioningSupport", &r.NestedProvisioningSupport) delete(rawMsg, key) } if err != nil { @@ -4082,15 +7859,15 @@ func (r *ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications) return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesExtensionOptions. -func (r ResourceTypeRegistrationPropertiesExtensionOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesResourceManagementOptionsBatchProvisioningSupport. +func (r ResourceTypeRegistrationPropertiesResourceManagementOptionsBatchProvisioningSupport) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "resourceCreationBegin", r.ResourceCreationBegin) + populate(objectMap, "supportedOperations", r.SupportedOperations) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesExtensionOptions. -func (r *ResourceTypeRegistrationPropertiesExtensionOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesResourceManagementOptionsBatchProvisioningSupport. +func (r *ResourceTypeRegistrationPropertiesResourceManagementOptionsBatchProvisioningSupport) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -4098,8 +7875,8 @@ func (r *ResourceTypeRegistrationPropertiesExtensionOptions) UnmarshalJSON(data for key, val := range rawMsg { var err error switch key { - case "resourceCreationBegin": - err = unpopulate(val, "ResourceCreationBegin", &r.ResourceCreationBegin) + case "supportedOperations": + err = unpopulate(val, "SupportedOperations", &r.SupportedOperations) delete(rawMsg, key) } if err != nil { @@ -4109,15 +7886,15 @@ func (r *ResourceTypeRegistrationPropertiesExtensionOptions) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesFeaturesRule. -func (r ResourceTypeRegistrationPropertiesFeaturesRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesResourceManagementOptionsNestedProvisioningSupport. +func (r ResourceTypeRegistrationPropertiesResourceManagementOptionsNestedProvisioningSupport) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "requiredFeaturesPolicy", r.RequiredFeaturesPolicy) + populate(objectMap, "minimumApiVersion", r.MinimumAPIVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesFeaturesRule. -func (r *ResourceTypeRegistrationPropertiesFeaturesRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesResourceManagementOptionsNestedProvisioningSupport. +func (r *ResourceTypeRegistrationPropertiesResourceManagementOptionsNestedProvisioningSupport) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -4125,8 +7902,8 @@ func (r *ResourceTypeRegistrationPropertiesFeaturesRule) UnmarshalJSON(data []by for key, val := range rawMsg { var err error switch key { - case "requiredFeaturesPolicy": - err = unpopulate(val, "RequiredFeaturesPolicy", &r.RequiredFeaturesPolicy) + case "minimumApiVersion": + err = unpopulate(val, "MinimumAPIVersion", &r.MinimumAPIVersion) delete(rawMsg, key) } if err != nil { @@ -4136,16 +7913,17 @@ func (r *ResourceTypeRegistrationPropertiesFeaturesRule) UnmarshalJSON(data []by return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesIdentityManagement. -func (r ResourceTypeRegistrationPropertiesIdentityManagement) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesResourceMovePolicy. +func (r ResourceTypeRegistrationPropertiesResourceMovePolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "applicationId", r.ApplicationID) - populate(objectMap, "type", r.Type) + populate(objectMap, "crossResourceGroupMoveEnabled", r.CrossResourceGroupMoveEnabled) + populate(objectMap, "crossSubscriptionMoveEnabled", r.CrossSubscriptionMoveEnabled) + populate(objectMap, "validationRequired", r.ValidationRequired) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesIdentityManagement. -func (r *ResourceTypeRegistrationPropertiesIdentityManagement) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesResourceMovePolicy. +func (r *ResourceTypeRegistrationPropertiesResourceMovePolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -4153,11 +7931,14 @@ func (r *ResourceTypeRegistrationPropertiesIdentityManagement) UnmarshalJSON(dat for key, val := range rawMsg { var err error switch key { - case "applicationId": - err = unpopulate(val, "ApplicationID", &r.ApplicationID) + case "crossResourceGroupMoveEnabled": + err = unpopulate(val, "CrossResourceGroupMoveEnabled", &r.CrossResourceGroupMoveEnabled) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "crossSubscriptionMoveEnabled": + err = unpopulate(val, "CrossSubscriptionMoveEnabled", &r.CrossSubscriptionMoveEnabled) + delete(rawMsg, key) + case "validationRequired": + err = unpopulate(val, "ValidationRequired", &r.ValidationRequired) delete(rawMsg, key) } if err != nil { @@ -4167,15 +7948,15 @@ func (r *ResourceTypeRegistrationPropertiesIdentityManagement) UnmarshalJSON(dat return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesRequestHeaderOptions. -func (r ResourceTypeRegistrationPropertiesRequestHeaderOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesResourceQueryManagement. +func (r ResourceTypeRegistrationPropertiesResourceQueryManagement) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "optInHeaders", r.OptInHeaders) + populate(objectMap, "filterOption", r.FilterOption) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesRequestHeaderOptions. -func (r *ResourceTypeRegistrationPropertiesRequestHeaderOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesResourceQueryManagement. +func (r *ResourceTypeRegistrationPropertiesResourceQueryManagement) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -4183,8 +7964,8 @@ func (r *ResourceTypeRegistrationPropertiesRequestHeaderOptions) UnmarshalJSON(d for key, val := range rawMsg { var err error switch key { - case "optInHeaders": - err = unpopulate(val, "OptInHeaders", &r.OptInHeaders) + case "filterOption": + err = unpopulate(val, "FilterOption", &r.FilterOption) delete(rawMsg, key) } if err != nil { @@ -4194,17 +7975,15 @@ func (r *ResourceTypeRegistrationPropertiesRequestHeaderOptions) UnmarshalJSON(d return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesResourceMovePolicy. -func (r ResourceTypeRegistrationPropertiesResourceMovePolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesResourceTypeCommonAttributeManagement. +func (r ResourceTypeRegistrationPropertiesResourceTypeCommonAttributeManagement) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "crossResourceGroupMoveEnabled", r.CrossResourceGroupMoveEnabled) - populate(objectMap, "crossSubscriptionMoveEnabled", r.CrossSubscriptionMoveEnabled) - populate(objectMap, "validationRequired", r.ValidationRequired) + populate(objectMap, "commonApiVersionsMergeMode", r.CommonAPIVersionsMergeMode) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesResourceMovePolicy. -func (r *ResourceTypeRegistrationPropertiesResourceMovePolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesResourceTypeCommonAttributeManagement. +func (r *ResourceTypeRegistrationPropertiesResourceTypeCommonAttributeManagement) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -4212,14 +7991,35 @@ func (r *ResourceTypeRegistrationPropertiesResourceMovePolicy) UnmarshalJSON(dat for key, val := range rawMsg { var err error switch key { - case "crossResourceGroupMoveEnabled": - err = unpopulate(val, "CrossResourceGroupMoveEnabled", &r.CrossResourceGroupMoveEnabled) - delete(rawMsg, key) - case "crossSubscriptionMoveEnabled": - err = unpopulate(val, "CrossSubscriptionMoveEnabled", &r.CrossSubscriptionMoveEnabled) + case "commonApiVersionsMergeMode": + err = unpopulate(val, "CommonAPIVersionsMergeMode", &r.CommonAPIVersionsMergeMode) delete(rawMsg, key) - case "validationRequired": - err = unpopulate(val, "ValidationRequired", &r.ValidationRequired) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesRoutingRule. +func (r ResourceTypeRegistrationPropertiesRoutingRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hostResourceType", r.HostResourceType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesRoutingRule. +func (r *ResourceTypeRegistrationPropertiesRoutingRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hostResourceType": + err = unpopulate(val, "HostResourceType", &r.HostResourceType) delete(rawMsg, key) } if err != nil { @@ -4291,10 +8091,46 @@ func (r *ResourceTypeRegistrationPropertiesTemplateDeploymentOptions) UnmarshalJ return nil } +// MarshalJSON implements the json.Marshaller interface for type ResourceTypeRegistrationPropertiesTemplateDeploymentPolicy. +func (r ResourceTypeRegistrationPropertiesTemplateDeploymentPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capabilities", r.Capabilities) + populate(objectMap, "preflightNotifications", r.PreflightNotifications) + populate(objectMap, "preflightOptions", r.PreflightOptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTypeRegistrationPropertiesTemplateDeploymentPolicy. +func (r *ResourceTypeRegistrationPropertiesTemplateDeploymentPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capabilities": + err = unpopulate(val, "Capabilities", &r.Capabilities) + delete(rawMsg, key) + case "preflightNotifications": + err = unpopulate(val, "PreflightNotifications", &r.PreflightNotifications) + delete(rawMsg, key) + case "preflightOptions": + err = unpopulate(val, "PreflightOptions", &r.PreflightOptions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ResourceTypeRequestHeaderOptions. func (r ResourceTypeRequestHeaderOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "optInHeaders", r.OptInHeaders) + populate(objectMap, "optOutHeaders", r.OptOutHeaders) return json.Marshal(objectMap) } @@ -4310,6 +8146,9 @@ func (r *ResourceTypeRequestHeaderOptions) UnmarshalJSON(data []byte) error { case "optInHeaders": err = unpopulate(val, "OptInHeaders", &r.OptInHeaders) delete(rawMsg, key) + case "optOutHeaders": + err = unpopulate(val, "OptOutHeaders", &r.OptOutHeaders) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -4353,6 +8192,7 @@ func (r *ResourceTypeSKU) UnmarshalJSON(data []byte) error { func (r ResourceTypeTemplateDeploymentPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "capabilities", r.Capabilities) + populate(objectMap, "preflightNotifications", r.PreflightNotifications) populate(objectMap, "preflightOptions", r.PreflightOptions) return json.Marshal(objectMap) } @@ -4369,6 +8209,9 @@ func (r *ResourceTypeTemplateDeploymentPolicy) UnmarshalJSON(data []byte) error case "capabilities": err = unpopulate(val, "Capabilities", &r.Capabilities) delete(rawMsg, key) + case "preflightNotifications": + err = unpopulate(val, "PreflightNotifications", &r.PreflightNotifications) + delete(rawMsg, key) case "preflightOptions": err = unpopulate(val, "PreflightOptions", &r.PreflightOptions) delete(rawMsg, key) @@ -4565,6 +8408,7 @@ func (s SKUResource) MarshalJSON() ([]byte, error) { populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } @@ -4587,6 +8431,9 @@ func (s *SKUResource) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) @@ -4805,6 +8652,7 @@ func (s *SKUZoneDetail) UnmarshalJSON(data []byte) error { func (s ServiceTreeInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "componentId", s.ComponentID) + populate(objectMap, "readiness", s.Readiness) populate(objectMap, "serviceId", s.ServiceID) return json.Marshal(objectMap) } @@ -4821,6 +8669,9 @@ func (s *ServiceTreeInfo) UnmarshalJSON(data []byte) error { case "componentId": err = unpopulate(val, "ComponentID", &s.ComponentID) delete(rawMsg, key) + case "readiness": + err = unpopulate(val, "Readiness", &s.Readiness) + delete(rawMsg, key) case "serviceId": err = unpopulate(val, "ServiceID", &s.ServiceID) delete(rawMsg, key) @@ -4832,6 +8683,33 @@ func (s *ServiceTreeInfo) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SubscriberSetting. +func (s SubscriberSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "filterRules", s.FilterRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriberSetting. +func (s *SubscriberSetting) 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 "filterRules": + err = unpopulate(val, "FilterRules", &s.FilterRules) + 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 SubscriptionLifecycleNotificationSpecifications. func (s SubscriptionLifecycleNotificationSpecifications) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4956,6 +8834,53 @@ func (s *SwaggerSpecification) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TemplateDeploymentOptions. func (t TemplateDeploymentOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4991,6 +8916,7 @@ func (t *TemplateDeploymentOptions) UnmarshalJSON(data []byte) error { func (t TemplateDeploymentPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "capabilities", t.Capabilities) + populate(objectMap, "preflightNotifications", t.PreflightNotifications) populate(objectMap, "preflightOptions", t.PreflightOptions) return json.Marshal(objectMap) } @@ -5007,6 +8933,9 @@ func (t *TemplateDeploymentPolicy) UnmarshalJSON(data []byte) error { case "capabilities": err = unpopulate(val, "Capabilities", &t.Capabilities) delete(rawMsg, key) + case "preflightNotifications": + err = unpopulate(val, "PreflightNotifications", &t.PreflightNotifications) + delete(rawMsg, key) case "preflightOptions": err = unpopulate(val, "PreflightOptions", &t.PreflightOptions) delete(rawMsg, key) @@ -5018,6 +8947,33 @@ func (t *TemplateDeploymentPolicy) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ThirdPartyExtension. +func (t ThirdPartyExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", t.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ThirdPartyExtension. +func (t *ThirdPartyExtension) 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 "name": + err = unpopulate(val, "Name", &t.Name) + 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 ThirdPartyProviderAuthorization. func (t ThirdPartyProviderAuthorization) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5088,6 +9044,7 @@ func (t *ThrottlingMetric) UnmarshalJSON(data []byte) error { func (t ThrottlingRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "action", t.Action) + populate(objectMap, "applicationId", t.ApplicationID) populate(objectMap, "metrics", t.Metrics) populate(objectMap, "requiredFeatures", t.RequiredFeatures) return json.Marshal(objectMap) @@ -5105,6 +9062,9 @@ func (t *ThrottlingRule) UnmarshalJSON(data []byte) error { case "action": err = unpopulate(val, "Action", &t.Action) delete(rawMsg, key) + case "applicationId": + err = unpopulate(val, "ApplicationID", &t.ApplicationID) + delete(rawMsg, key) case "metrics": err = unpopulate(val, "Metrics", &t.Metrics) delete(rawMsg, key) @@ -5119,6 +9079,88 @@ func (t *ThrottlingRule) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TokenAuthConfiguration. +func (t TokenAuthConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authenticationScheme", t.AuthenticationScheme) + populate(objectMap, "disableCertificateAuthenticationFallback", t.DisableCertificateAuthenticationFallback) + populate(objectMap, "signedRequestScope", t.SignedRequestScope) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TokenAuthConfiguration. +func (t *TokenAuthConfiguration) 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 "authenticationScheme": + err = unpopulate(val, "AuthenticationScheme", &t.AuthenticationScheme) + delete(rawMsg, key) + case "disableCertificateAuthenticationFallback": + err = unpopulate(val, "DisableCertificateAuthenticationFallback", &t.DisableCertificateAuthenticationFallback) + delete(rawMsg, key) + case "signedRequestScope": + err = unpopulate(val, "SignedRequestScope", &t.SignedRequestScope) + 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]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TrafficRegionRolloutConfiguration. func (t TrafficRegionRolloutConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5229,7 +9271,7 @@ func populateAny(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/providerhub/armproviderhub/newregionfrontloadrelease_client.go b/sdk/resourcemanager/providerhub/armproviderhub/newregionfrontloadrelease_client.go new file mode 100644 index 000000000000..f88cf797e7f7 --- /dev/null +++ b/sdk/resourcemanager/providerhub/armproviderhub/newregionfrontloadrelease_client.go @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armproviderhub + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// NewRegionFrontloadReleaseClient contains the methods for the NewRegionFrontloadRelease group. +// Don't use this type directly, use NewNewRegionFrontloadReleaseClient() instead. +type NewRegionFrontloadReleaseClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNewRegionFrontloadReleaseClient creates a new instance of NewRegionFrontloadReleaseClient 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 NewNewRegionFrontloadReleaseClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NewRegionFrontloadReleaseClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NewRegionFrontloadReleaseClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a new region frontload release. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +// - providerNamespace - The name of the resource provider hosted within ProviderHub. +// - releaseName - The name of the release. +// - options - NewRegionFrontloadReleaseClientCreateOrUpdateOptions contains the optional parameters for the NewRegionFrontloadReleaseClient.CreateOrUpdate +// method. +func (client *NewRegionFrontloadReleaseClient) CreateOrUpdate(ctx context.Context, providerNamespace string, releaseName string, properties FrontloadPayload, options *NewRegionFrontloadReleaseClientCreateOrUpdateOptions) (NewRegionFrontloadReleaseClientCreateOrUpdateResponse, error) { + var err error + const operationName = "NewRegionFrontloadReleaseClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, providerNamespace, releaseName, properties, options) + if err != nil { + return NewRegionFrontloadReleaseClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NewRegionFrontloadReleaseClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return NewRegionFrontloadReleaseClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *NewRegionFrontloadReleaseClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, releaseName string, properties FrontloadPayload, _ *NewRegionFrontloadReleaseClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/newRegionFrontloadRelease/{releaseName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if providerNamespace == "" { + return nil, errors.New("parameter providerNamespace cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerNamespace}", url.PathEscape(providerNamespace)) + if releaseName == "" { + return nil, errors.New("parameter releaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{releaseName}", url.PathEscape(releaseName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *NewRegionFrontloadReleaseClient) createOrUpdateHandleResponse(resp *http.Response) (NewRegionFrontloadReleaseClientCreateOrUpdateResponse, error) { + result := NewRegionFrontloadReleaseClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DefaultRollout); err != nil { + return NewRegionFrontloadReleaseClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// GenerateManifest - Generates the new region frontload manifest. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +// - providerNamespace - The name of the resource provider hosted within ProviderHub. +// - options - NewRegionFrontloadReleaseClientGenerateManifestOptions contains the optional parameters for the NewRegionFrontloadReleaseClient.GenerateManifest +// method. +func (client *NewRegionFrontloadReleaseClient) GenerateManifest(ctx context.Context, providerNamespace string, properties FrontloadPayload, options *NewRegionFrontloadReleaseClientGenerateManifestOptions) (NewRegionFrontloadReleaseClientGenerateManifestResponse, error) { + var err error + const operationName = "NewRegionFrontloadReleaseClient.GenerateManifest" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.generateManifestCreateRequest(ctx, providerNamespace, properties, options) + if err != nil { + return NewRegionFrontloadReleaseClientGenerateManifestResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NewRegionFrontloadReleaseClientGenerateManifestResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NewRegionFrontloadReleaseClientGenerateManifestResponse{}, err + } + resp, err := client.generateManifestHandleResponse(httpResp) + return resp, err +} + +// generateManifestCreateRequest creates the GenerateManifest request. +func (client *NewRegionFrontloadReleaseClient) generateManifestCreateRequest(ctx context.Context, providerNamespace string, properties FrontloadPayload, _ *NewRegionFrontloadReleaseClientGenerateManifestOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/generateNewRegionFrontloadManifest" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if providerNamespace == "" { + return nil, errors.New("parameter providerNamespace cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerNamespace}", url.PathEscape(providerNamespace)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil +} + +// generateManifestHandleResponse handles the GenerateManifest response. +func (client *NewRegionFrontloadReleaseClient) generateManifestHandleResponse(resp *http.Response) (NewRegionFrontloadReleaseClientGenerateManifestResponse, error) { + result := NewRegionFrontloadReleaseClientGenerateManifestResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceProviderManifest); err != nil { + return NewRegionFrontloadReleaseClientGenerateManifestResponse{}, err + } + return result, nil +} + +// Get - Gets a new region frontload release. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +// - providerNamespace - The name of the resource provider hosted within ProviderHub. +// - releaseName - The name of the release. +// - options - NewRegionFrontloadReleaseClientGetOptions contains the optional parameters for the NewRegionFrontloadReleaseClient.Get +// method. +func (client *NewRegionFrontloadReleaseClient) Get(ctx context.Context, providerNamespace string, releaseName string, options *NewRegionFrontloadReleaseClientGetOptions) (NewRegionFrontloadReleaseClientGetResponse, error) { + var err error + const operationName = "NewRegionFrontloadReleaseClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, providerNamespace, releaseName, options) + if err != nil { + return NewRegionFrontloadReleaseClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NewRegionFrontloadReleaseClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NewRegionFrontloadReleaseClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *NewRegionFrontloadReleaseClient) getCreateRequest(ctx context.Context, providerNamespace string, releaseName string, _ *NewRegionFrontloadReleaseClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/newRegionFrontloadRelease/{releaseName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if providerNamespace == "" { + return nil, errors.New("parameter providerNamespace cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerNamespace}", url.PathEscape(providerNamespace)) + if releaseName == "" { + return nil, errors.New("parameter releaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{releaseName}", url.PathEscape(releaseName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *NewRegionFrontloadReleaseClient) getHandleResponse(resp *http.Response) (NewRegionFrontloadReleaseClientGetResponse, error) { + result := NewRegionFrontloadReleaseClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DefaultRollout); err != nil { + return NewRegionFrontloadReleaseClientGetResponse{}, err + } + return result, nil +} + +// Stop - Stops a new region frontload release. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +// - providerNamespace - The name of the resource provider hosted within ProviderHub. +// - releaseName - The name of the release. +// - options - NewRegionFrontloadReleaseClientStopOptions contains the optional parameters for the NewRegionFrontloadReleaseClient.Stop +// method. +func (client *NewRegionFrontloadReleaseClient) Stop(ctx context.Context, providerNamespace string, releaseName string, options *NewRegionFrontloadReleaseClientStopOptions) (NewRegionFrontloadReleaseClientStopResponse, error) { + var err error + const operationName = "NewRegionFrontloadReleaseClient.Stop" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.stopCreateRequest(ctx, providerNamespace, releaseName, options) + if err != nil { + return NewRegionFrontloadReleaseClientStopResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NewRegionFrontloadReleaseClientStopResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NewRegionFrontloadReleaseClientStopResponse{}, err + } + return NewRegionFrontloadReleaseClientStopResponse{}, nil +} + +// stopCreateRequest creates the Stop request. +func (client *NewRegionFrontloadReleaseClient) stopCreateRequest(ctx context.Context, providerNamespace string, releaseName string, _ *NewRegionFrontloadReleaseClientStopOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/newRegionFrontloadRelease/{releaseName}/stop" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if providerNamespace == "" { + return nil, errors.New("parameter providerNamespace cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerNamespace}", url.PathEscape(providerNamespace)) + if releaseName == "" { + return nil, errors.New("parameter releaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{releaseName}", url.PathEscape(releaseName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// ValidateManifest - Validates the manifest has been applied in all regions. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +// - providerNamespace - The name of the resource provider hosted within ProviderHub. +// - options - NewRegionFrontloadReleaseClientValidateManifestOptions contains the optional parameters for the NewRegionFrontloadReleaseClient.ValidateManifest +// method. +func (client *NewRegionFrontloadReleaseClient) ValidateManifest(ctx context.Context, providerNamespace string, options *NewRegionFrontloadReleaseClientValidateManifestOptions) (NewRegionFrontloadReleaseClientValidateManifestResponse, error) { + var err error + const operationName = "NewRegionFrontloadReleaseClient.ValidateManifest" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.validateManifestCreateRequest(ctx, providerNamespace, options) + if err != nil { + return NewRegionFrontloadReleaseClientValidateManifestResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NewRegionFrontloadReleaseClientValidateManifestResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NewRegionFrontloadReleaseClientValidateManifestResponse{}, err + } + resp, err := client.validateManifestHandleResponse(httpResp) + return resp, err +} + +// validateManifestCreateRequest creates the ValidateManifest request. +func (client *NewRegionFrontloadReleaseClient) validateManifestCreateRequest(ctx context.Context, providerNamespace string, _ *NewRegionFrontloadReleaseClientValidateManifestOptions) (*policy.Request, error) { + urlPath := "/providers/{providerNamespace}/validateManifestAppliedInAllRegions" + if providerNamespace == "" { + return nil, errors.New("parameter providerNamespace cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerNamespace}", url.PathEscape(providerNamespace)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// validateManifestHandleResponse handles the ValidateManifest response. +func (client *NewRegionFrontloadReleaseClient) validateManifestHandleResponse(resp *http.Response) (NewRegionFrontloadReleaseClientValidateManifestResponse, error) { + result := NewRegionFrontloadReleaseClientValidateManifestResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil { + return NewRegionFrontloadReleaseClientValidateManifestResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/notificationregistrations_client.go b/sdk/resourcemanager/providerhub/armproviderhub/notificationregistrations_client.go index 119ddc5bd03b..56c05f33a479 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/notificationregistrations_client.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/notificationregistrations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewNotificationRegistrationsClient(subscriptionID string, credential azcore // CreateOrUpdate - Creates or updates a notification registration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - notificationRegistrationName - The notification registration. // - properties - The required body parameters supplied to the notification registration operation. @@ -75,7 +72,7 @@ func (client *NotificationRegistrationsClient) CreateOrUpdate(ctx context.Contex } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *NotificationRegistrationsClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, notificationRegistrationName string, properties NotificationRegistration, options *NotificationRegistrationsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *NotificationRegistrationsClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, notificationRegistrationName string, properties NotificationRegistration, _ *NotificationRegistrationsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations/{notificationRegistrationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -94,7 +91,7 @@ func (client *NotificationRegistrationsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { @@ -115,7 +112,7 @@ func (client *NotificationRegistrationsClient) createOrUpdateHandleResponse(resp // Delete - Deletes a notification registration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - notificationRegistrationName - The notification registration. // - options - NotificationRegistrationsClientDeleteOptions contains the optional parameters for the NotificationRegistrationsClient.Delete @@ -142,7 +139,7 @@ func (client *NotificationRegistrationsClient) Delete(ctx context.Context, provi } // deleteCreateRequest creates the Delete request. -func (client *NotificationRegistrationsClient) deleteCreateRequest(ctx context.Context, providerNamespace string, notificationRegistrationName string, options *NotificationRegistrationsClientDeleteOptions) (*policy.Request, error) { +func (client *NotificationRegistrationsClient) deleteCreateRequest(ctx context.Context, providerNamespace string, notificationRegistrationName string, _ *NotificationRegistrationsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations/{notificationRegistrationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -161,7 +158,7 @@ func (client *NotificationRegistrationsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,7 +167,7 @@ func (client *NotificationRegistrationsClient) deleteCreateRequest(ctx context.C // Get - Gets the notification registration details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - notificationRegistrationName - The notification registration. // - options - NotificationRegistrationsClientGetOptions contains the optional parameters for the NotificationRegistrationsClient.Get @@ -198,7 +195,7 @@ func (client *NotificationRegistrationsClient) Get(ctx context.Context, provider } // getCreateRequest creates the Get request. -func (client *NotificationRegistrationsClient) getCreateRequest(ctx context.Context, providerNamespace string, notificationRegistrationName string, options *NotificationRegistrationsClientGetOptions) (*policy.Request, error) { +func (client *NotificationRegistrationsClient) getCreateRequest(ctx context.Context, providerNamespace string, notificationRegistrationName string, _ *NotificationRegistrationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations/{notificationRegistrationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -217,7 +214,7 @@ func (client *NotificationRegistrationsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +231,7 @@ func (client *NotificationRegistrationsClient) getHandleResponse(resp *http.Resp // NewListByProviderRegistrationPager - Gets the list of the notification registrations for the given provider. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - options - NotificationRegistrationsClientListByProviderRegistrationOptions contains the optional parameters for the NotificationRegistrationsClient.NewListByProviderRegistrationPager // method. @@ -262,7 +259,7 @@ func (client *NotificationRegistrationsClient) NewListByProviderRegistrationPage } // listByProviderRegistrationCreateRequest creates the ListByProviderRegistration request. -func (client *NotificationRegistrationsClient) listByProviderRegistrationCreateRequest(ctx context.Context, providerNamespace string, options *NotificationRegistrationsClientListByProviderRegistrationOptions) (*policy.Request, error) { +func (client *NotificationRegistrationsClient) listByProviderRegistrationCreateRequest(ctx context.Context, providerNamespace string, _ *NotificationRegistrationsClientListByProviderRegistrationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -277,7 +274,7 @@ func (client *NotificationRegistrationsClient) listByProviderRegistrationCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/providerhub/armproviderhub/notificationregistrations_client_example_test.go b/sdk/resourcemanager/providerhub/armproviderhub/notificationregistrations_client_example_test.go deleted file mode 100644 index 09845a2b1385..000000000000 --- a/sdk/resourcemanager/providerhub/armproviderhub/notificationregistrations_client_example_test.go +++ /dev/null @@ -1,209 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armproviderhub_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/providerhub/armproviderhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/NotificationRegistrations_Get.json -func ExampleNotificationRegistrationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNotificationRegistrationsClient().Get(ctx, "Microsoft.Contoso", "fooNotificationRegistration", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NotificationRegistration = armproviderhub.NotificationRegistration{ - // Name: to.Ptr("fooNotificationRegistration"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/notificationregistrations"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/notificationregistrations/fooNotificationRegistration"), - // Properties: &armproviderhub.NotificationRegistrationProperties{ - // IncludedEvents: []*string{ - // to.Ptr("*/write"), - // to.Ptr("Microsoft.Contoso/employees/delete")}, - // MessageScope: to.Ptr(armproviderhub.MessageScopeRegisteredSubscriptions), - // NotificationEndpoints: []*armproviderhub.NotificationEndpoint{ - // { - // Locations: []*string{ - // to.Ptr(""), - // to.Ptr("East US")}, - // NotificationDestination: to.Ptr("/subscriptions/ac6bcfb5-3dc1-491f-95a6-646b89bf3e88/resourceGroups/mgmtexp-eastus/providers/Microsoft.EventHub/namespaces/unitedstates-mgmtexpint/eventhubs/armlinkednotifications"), - // }, - // { - // Locations: []*string{ - // to.Ptr("North Europe")}, - // NotificationDestination: to.Ptr("/subscriptions/ac6bcfb5-3dc1-491f-95a6-646b89bf3e88/resourceGroups/mgmtexp-northeurope/providers/Microsoft.EventHub/namespaces/europe-mgmtexpint/eventhubs/armlinkednotifications"), - // }}, - // NotificationMode: to.Ptr(armproviderhub.NotificationModeEventHub), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/NotificationRegistrations_CreateOrUpdate.json -func ExampleNotificationRegistrationsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNotificationRegistrationsClient().CreateOrUpdate(ctx, "Microsoft.Contoso", "fooNotificationRegistration", armproviderhub.NotificationRegistration{ - Properties: &armproviderhub.NotificationRegistrationProperties{ - IncludedEvents: []*string{ - to.Ptr("*/write"), - to.Ptr("Microsoft.Contoso/employees/delete")}, - MessageScope: to.Ptr(armproviderhub.MessageScopeRegisteredSubscriptions), - NotificationEndpoints: []*armproviderhub.NotificationEndpoint{ - { - Locations: []*string{ - to.Ptr(""), - to.Ptr("East US")}, - NotificationDestination: to.Ptr("/subscriptions/ac6bcfb5-3dc1-491f-95a6-646b89bf3e88/resourceGroups/mgmtexp-eastus/providers/Microsoft.EventHub/namespaces/unitedstates-mgmtexpint/eventhubs/armlinkednotifications"), - }, - { - Locations: []*string{ - to.Ptr("North Europe")}, - NotificationDestination: to.Ptr("/subscriptions/ac6bcfb5-3dc1-491f-95a6-646b89bf3e88/resourceGroups/mgmtexp-northeurope/providers/Microsoft.EventHub/namespaces/europe-mgmtexpint/eventhubs/armlinkednotifications"), - }}, - NotificationMode: to.Ptr(armproviderhub.NotificationModeEventHub), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NotificationRegistration = armproviderhub.NotificationRegistration{ - // Name: to.Ptr("fooNotificationRegistration"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/notificationregistrations"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/notificationregistrations/fooNotificationRegistration"), - // Properties: &armproviderhub.NotificationRegistrationProperties{ - // IncludedEvents: []*string{ - // to.Ptr("*/write"), - // to.Ptr("Microsoft.Contoso/employees/delete")}, - // MessageScope: to.Ptr(armproviderhub.MessageScopeRegisteredSubscriptions), - // NotificationEndpoints: []*armproviderhub.NotificationEndpoint{ - // { - // Locations: []*string{ - // to.Ptr(""), - // to.Ptr("East US")}, - // NotificationDestination: to.Ptr("/subscriptions/ac6bcfb5-3dc1-491f-95a6-646b89bf3e88/resourceGroups/mgmtexp-eastus/providers/Microsoft.EventHub/namespaces/unitedstates-mgmtexpint/eventhubs/armlinkednotifications"), - // }, - // { - // Locations: []*string{ - // to.Ptr("North Europe")}, - // NotificationDestination: to.Ptr("/subscriptions/ac6bcfb5-3dc1-491f-95a6-646b89bf3e88/resourceGroups/mgmtexp-northeurope/providers/Microsoft.EventHub/namespaces/europe-mgmtexpint/eventhubs/armlinkednotifications"), - // }}, - // NotificationMode: to.Ptr(armproviderhub.NotificationModeEventHub), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/NotificationRegistrations_Delete.json -func ExampleNotificationRegistrationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewNotificationRegistrationsClient().Delete(ctx, "Microsoft.Contoso", "fooNotificationRegistration", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/NotificationRegistrations_ListByProviderRegistration.json -func ExampleNotificationRegistrationsClient_NewListByProviderRegistrationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNotificationRegistrationsClient().NewListByProviderRegistrationPager("Microsoft.Contoso", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NotificationRegistrationArrayResponseWithContinuation = armproviderhub.NotificationRegistrationArrayResponseWithContinuation{ - // Value: []*armproviderhub.NotificationRegistration{ - // { - // Name: to.Ptr("fooNotificationRegistration"), - // Properties: &armproviderhub.NotificationRegistrationProperties{ - // IncludedEvents: []*string{ - // to.Ptr("*/write"), - // to.Ptr("Microsoft.Contoso/employees/delete")}, - // MessageScope: to.Ptr(armproviderhub.MessageScopeRegisteredSubscriptions), - // NotificationEndpoints: []*armproviderhub.NotificationEndpoint{ - // { - // Locations: []*string{ - // to.Ptr(""), - // to.Ptr("East US")}, - // NotificationDestination: to.Ptr("/subscriptions/ac6bcfb5-3dc1-491f-95a6-646b89bf3e88/resourceGroups/mgmtexp-eastus/providers/Microsoft.EventHub/namespaces/unitedstates-mgmtexpint/eventhubs/armlinkednotifications"), - // }, - // { - // Locations: []*string{ - // to.Ptr("North Europe")}, - // NotificationDestination: to.Ptr("/subscriptions/ac6bcfb5-3dc1-491f-95a6-646b89bf3e88/resourceGroups/mgmtexp-northeurope/providers/Microsoft.EventHub/namespaces/europe-mgmtexpint/eventhubs/armlinkednotifications"), - // }}, - // NotificationMode: to.Ptr(armproviderhub.NotificationModeEventHub), - // }, - // }, - // { - // Name: to.Ptr("barNotificationRegistration"), - // Properties: &armproviderhub.NotificationRegistrationProperties{ - // IncludedEvents: []*string{ - // to.Ptr("*/delete")}, - // MessageScope: to.Ptr(armproviderhub.MessageScopeRegisteredSubscriptions), - // NotificationEndpoints: []*armproviderhub.NotificationEndpoint{ - // { - // Locations: []*string{ - // to.Ptr("")}, - // NotificationDestination: to.Ptr("/subscriptions/ac6bcfb5-3dc1-491f-95a6-646b89bf3e88/resourceGroups/mgmtexp-eastus/providers/Microsoft.EventHub/namespaces/unitedstates-mgmtexpint/eventhubs/armlinkednotifications"), - // }}, - // NotificationMode: to.Ptr(armproviderhub.NotificationModeEventHub), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/operations_client.go b/sdk/resourcemanager/providerhub/armproviderhub/operations_client.go index 12d1baaa0b63..a3b667ec0093 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/operations_client.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/operations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewOperationsClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Creates or updates the operation supported by the given provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - operationsPutContent - The operations content properties supplied to the CreateOrUpdate operation. // - options - OperationsClientCreateOrUpdateOptions contains the optional parameters for the OperationsClient.CreateOrUpdate @@ -74,7 +71,7 @@ func (client *OperationsClient) CreateOrUpdate(ctx context.Context, providerName } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *OperationsClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, operationsPutContent OperationsPutContent, options *OperationsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *OperationsClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, operationsPutContent OperationsPutContent, _ *OperationsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/operations/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -89,7 +86,7 @@ func (client *OperationsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, operationsPutContent); err != nil { @@ -101,7 +98,7 @@ func (client *OperationsClient) createOrUpdateCreateRequest(ctx context.Context, // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *OperationsClient) createOrUpdateHandleResponse(resp *http.Response) (OperationsClientCreateOrUpdateResponse, error) { result := OperationsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OperationsContent); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.OperationsPutContent); err != nil { return OperationsClientCreateOrUpdateResponse{}, err } return result, nil @@ -110,7 +107,7 @@ func (client *OperationsClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes an operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - options - OperationsClientDeleteOptions contains the optional parameters for the OperationsClient.Delete method. func (client *OperationsClient) Delete(ctx context.Context, providerNamespace string, options *OperationsClientDeleteOptions) (OperationsClientDeleteResponse, error) { @@ -135,7 +132,7 @@ func (client *OperationsClient) Delete(ctx context.Context, providerNamespace st } // deleteCreateRequest creates the Delete request. -func (client *OperationsClient) deleteCreateRequest(ctx context.Context, providerNamespace string, options *OperationsClientDeleteOptions) (*policy.Request, error) { +func (client *OperationsClient) deleteCreateRequest(ctx context.Context, providerNamespace string, _ *OperationsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/operations/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -150,7 +147,7 @@ func (client *OperationsClient) deleteCreateRequest(ctx context.Context, provide return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -158,7 +155,7 @@ func (client *OperationsClient) deleteCreateRequest(ctx context.Context, provide // NewListPager - Lists all the operations supported by Microsoft.ProviderHub. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -184,7 +181,7 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.ProviderHub/operations" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { @@ -206,7 +203,7 @@ func (client *OperationsClient) listHandleResponse(resp *http.Response) (Operati // ListByProviderRegistration - Gets the operations supported by the given provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - options - OperationsClientListByProviderRegistrationOptions contains the optional parameters for the OperationsClient.ListByProviderRegistration // method. @@ -233,7 +230,7 @@ func (client *OperationsClient) ListByProviderRegistration(ctx context.Context, } // listByProviderRegistrationCreateRequest creates the ListByProviderRegistration request. -func (client *OperationsClient) listByProviderRegistrationCreateRequest(ctx context.Context, providerNamespace string, options *OperationsClientListByProviderRegistrationOptions) (*policy.Request, error) { +func (client *OperationsClient) listByProviderRegistrationCreateRequest(ctx context.Context, providerNamespace string, _ *OperationsClientListByProviderRegistrationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/operations/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -248,7 +245,7 @@ func (client *OperationsClient) listByProviderRegistrationCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/providerhub/armproviderhub/operations_client_example_test.go b/sdk/resourcemanager/providerhub/armproviderhub/operations_client_example_test.go deleted file mode 100644 index 8384ecd38897..000000000000 --- a/sdk/resourcemanager/providerhub/armproviderhub/operations_client_example_test.go +++ /dev/null @@ -1,239 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armproviderhub_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/providerhub/armproviderhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/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() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationsDefinitionArrayResponseWithContinuation = armproviderhub.OperationsDefinitionArrayResponseWithContinuation{ - // Value: []*armproviderhub.OperationsDefinition{ - // { - // Name: to.Ptr("Microsoft.ProviderHub/register/action"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Registers the specified subscription with Microsoft.ProviderHub resource provider"), - // Operation: to.Ptr("Register for Microsoft.ProviderHub"), - // Provider: to.Ptr("Microsoft ProviderHub"), - // Resource: to.Ptr("register"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ProviderHub/defaultRollouts/write"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Creates or Updates any rollout"), - // Operation: to.Ptr("Create or Update rollout"), - // Provider: to.Ptr("Microsoft ProviderHub"), - // Resource: to.Ptr("defaultRollouts"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ProviderHub/defaultRollouts/read"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Reads any rollout"), - // Operation: to.Ptr("Read rollout"), - // Provider: to.Ptr("Microsoft ProviderHub"), - // Resource: to.Ptr("defaultRollouts"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ProviderHub/defaultRollouts/delete"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Deletes any rollout"), - // Operation: to.Ptr("Delete rollout"), - // Provider: to.Ptr("Microsoft ProviderHub"), - // Resource: to.Ptr("defaultRollouts"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ProviderHub/defaultRollouts/stop/action"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Deletes any rollout"), - // Operation: to.Ptr("Delete rollout"), - // Provider: to.Ptr("Microsoft ProviderHub"), - // Resource: to.Ptr("defaultRollouts"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ProviderHub/customRollouts/write"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Creates or Updates any rollout"), - // Operation: to.Ptr("Create or Update rollout"), - // Provider: to.Ptr("Microsoft ProviderHub"), - // Resource: to.Ptr("customRollouts"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ProviderHub/customRollouts/read"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Reads any rollout"), - // Operation: to.Ptr("Read rollout"), - // Provider: to.Ptr("Microsoft ProviderHub"), - // Resource: to.Ptr("customRollouts"), - // }, - // IsDataAction: to.Ptr(false), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Operations_ListByProviderRegistration.json -func ExampleOperationsClient_ListByProviderRegistration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationsClient().ListByProviderRegistration(ctx, "Microsoft.Contoso", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationsDefinitionArray = []*armproviderhub.OperationsDefinition{ - // { - // Name: to.Ptr("Microsoft.Contoso/Employees/Read"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Read employees"), - // Operation: to.Ptr("Gets/List employee resources"), - // Provider: to.Ptr("Microsoft.Contoso"), - // Resource: to.Ptr("Employees"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Contoso/Employees/Write"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Writes employees"), - // Operation: to.Ptr("Create/update employee resources"), - // Provider: to.Ptr("Microsoft.Contoso"), - // Resource: to.Ptr("Employees"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Contoso/Employees/Delete"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Deletes employees"), - // Operation: to.Ptr("Deletes employee resource"), - // Provider: to.Ptr("Microsoft.Contoso"), - // Resource: to.Ptr("Employees"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr(armproviderhub.OperationsDefinitionOriginUser), - // }, - // { - // Name: to.Ptr("Microsoft.Contoso/Employees/Action"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Writes employees"), - // Operation: to.Ptr("Create/update employee resources"), - // Provider: to.Ptr("Microsoft.Contoso"), - // Resource: to.Ptr("Employees"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr(armproviderhub.OperationsDefinitionOriginSystem), - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Operations_CreateOrUpdate.json -func ExampleOperationsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationsClient().CreateOrUpdate(ctx, "Microsoft.Contoso", armproviderhub.OperationsPutContent{ - Contents: []*armproviderhub.OperationsDefinition{ - { - Name: to.Ptr("Microsoft.Contoso/Employees/Read"), - Display: &armproviderhub.OperationsDefinitionDisplay{ - Description: to.Ptr("Read employees"), - Operation: to.Ptr("Gets/List employee resources"), - Provider: to.Ptr("Microsoft.Contoso"), - Resource: to.Ptr("Employees"), - }, - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationsContent = armproviderhub.OperationsContent{ - // Properties: &armproviderhub.OperationsDefinition{ - // Name: to.Ptr("Microsoft.Contoso/Employees/Read"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Read employees"), - // Operation: to.Ptr("Gets/List employee resources"), - // Provider: to.Ptr("Microsoft.Contoso"), - // Resource: to.Ptr("Employees"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Operations_Delete.json -func ExampleOperationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewOperationsClient().Delete(ctx, "Microsoft.Contoso", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/options.go b/sdk/resourcemanager/providerhub/armproviderhub/options.go index 3007fe476b69..1f753fa0b7e1 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/options.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/options.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -8,6 +5,30 @@ package armproviderhub +// AuthorizedApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the AuthorizedApplicationsClient.BeginCreateOrUpdate +// method. +type AuthorizedApplicationsClientBeginCreateOrUpdateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// AuthorizedApplicationsClientDeleteOptions contains the optional parameters for the AuthorizedApplicationsClient.Delete +// method. +type AuthorizedApplicationsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AuthorizedApplicationsClientGetOptions contains the optional parameters for the AuthorizedApplicationsClient.Get method. +type AuthorizedApplicationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AuthorizedApplicationsClientListOptions contains the optional parameters for the AuthorizedApplicationsClient.NewListPager +// method. +type AuthorizedApplicationsClientListOptions struct { + // placeholder for future optional parameters +} + // ClientCheckinManifestOptions contains the optional parameters for the Client.CheckinManifest method. type ClientCheckinManifestOptions struct { // placeholder for future optional parameters @@ -18,9 +39,15 @@ type ClientGenerateManifestOptions struct { // placeholder for future optional parameters } -// CustomRolloutsClientCreateOrUpdateOptions contains the optional parameters for the CustomRolloutsClient.CreateOrUpdate +// CustomRolloutsClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomRolloutsClient.BeginCreateOrUpdate // method. -type CustomRolloutsClientCreateOrUpdateOptions struct { +type CustomRolloutsClientBeginCreateOrUpdateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// CustomRolloutsClientDeleteOptions contains the optional parameters for the CustomRolloutsClient.Delete method. +type CustomRolloutsClientDeleteOptions struct { // placeholder for future optional parameters } @@ -35,10 +62,15 @@ type CustomRolloutsClientListByProviderRegistrationOptions struct { // placeholder for future optional parameters } +// CustomRolloutsClientStopOptions contains the optional parameters for the CustomRolloutsClient.Stop method. +type CustomRolloutsClientStopOptions struct { + // placeholder for future optional parameters +} + // DefaultRolloutsClientBeginCreateOrUpdateOptions contains the optional parameters for the DefaultRolloutsClient.BeginCreateOrUpdate // method. type DefaultRolloutsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -63,6 +95,36 @@ type DefaultRolloutsClientStopOptions struct { // placeholder for future optional parameters } +// NewRegionFrontloadReleaseClientCreateOrUpdateOptions contains the optional parameters for the NewRegionFrontloadReleaseClient.CreateOrUpdate +// method. +type NewRegionFrontloadReleaseClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// NewRegionFrontloadReleaseClientGenerateManifestOptions contains the optional parameters for the NewRegionFrontloadReleaseClient.GenerateManifest +// method. +type NewRegionFrontloadReleaseClientGenerateManifestOptions struct { + // placeholder for future optional parameters +} + +// NewRegionFrontloadReleaseClientGetOptions contains the optional parameters for the NewRegionFrontloadReleaseClient.Get +// method. +type NewRegionFrontloadReleaseClientGetOptions struct { + // placeholder for future optional parameters +} + +// NewRegionFrontloadReleaseClientStopOptions contains the optional parameters for the NewRegionFrontloadReleaseClient.Stop +// method. +type NewRegionFrontloadReleaseClientStopOptions struct { + // placeholder for future optional parameters +} + +// NewRegionFrontloadReleaseClientValidateManifestOptions contains the optional parameters for the NewRegionFrontloadReleaseClient.ValidateManifest +// method. +type NewRegionFrontloadReleaseClientValidateManifestOptions struct { + // placeholder for future optional parameters +} + // NotificationRegistrationsClientCreateOrUpdateOptions contains the optional parameters for the NotificationRegistrationsClient.CreateOrUpdate // method. type NotificationRegistrationsClientCreateOrUpdateOptions struct { @@ -108,10 +170,46 @@ type OperationsClientListOptions struct { // placeholder for future optional parameters } +// ProviderMonitorSettingsClientBeginCreateOptions contains the optional parameters for the ProviderMonitorSettingsClient.BeginCreate +// method. +type ProviderMonitorSettingsClientBeginCreateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ProviderMonitorSettingsClientDeleteOptions contains the optional parameters for the ProviderMonitorSettingsClient.Delete +// method. +type ProviderMonitorSettingsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ProviderMonitorSettingsClientGetOptions contains the optional parameters for the ProviderMonitorSettingsClient.Get method. +type ProviderMonitorSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProviderMonitorSettingsClientListByResourceGroupOptions contains the optional parameters for the ProviderMonitorSettingsClient.NewListByResourceGroupPager +// method. +type ProviderMonitorSettingsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ProviderMonitorSettingsClientListBySubscriptionOptions contains the optional parameters for the ProviderMonitorSettingsClient.NewListBySubscriptionPager +// method. +type ProviderMonitorSettingsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// ProviderMonitorSettingsClientUpdateOptions contains the optional parameters for the ProviderMonitorSettingsClient.Update +// method. +type ProviderMonitorSettingsClientUpdateOptions struct { + // placeholder for future optional parameters +} + // ProviderRegistrationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ProviderRegistrationsClient.BeginCreateOrUpdate // method. type ProviderRegistrationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -137,17 +235,25 @@ type ProviderRegistrationsClientListOptions struct { // placeholder for future optional parameters } +// ResourceActionsClientBeginDeleteResourcesOptions contains the optional parameters for the ResourceActionsClient.BeginDeleteResources +// method. +type ResourceActionsClientBeginDeleteResourcesOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + // ResourceTypeRegistrationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ResourceTypeRegistrationsClient.BeginCreateOrUpdate // method. type ResourceTypeRegistrationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } -// ResourceTypeRegistrationsClientDeleteOptions contains the optional parameters for the ResourceTypeRegistrationsClient.Delete +// ResourceTypeRegistrationsClientBeginDeleteOptions contains the optional parameters for the ResourceTypeRegistrationsClient.BeginDelete // method. -type ResourceTypeRegistrationsClientDeleteOptions struct { - // placeholder for future optional parameters +type ResourceTypeRegistrationsClientBeginDeleteOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string } // ResourceTypeRegistrationsClientGetOptions contains the optional parameters for the ResourceTypeRegistrationsClient.Get diff --git a/sdk/resourcemanager/providerhub/armproviderhub/providermonitorsettings_client.go b/sdk/resourcemanager/providerhub/armproviderhub/providermonitorsettings_client.go new file mode 100644 index 000000000000..c2a9e01dac96 --- /dev/null +++ b/sdk/resourcemanager/providerhub/armproviderhub/providermonitorsettings_client.go @@ -0,0 +1,423 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armproviderhub + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ProviderMonitorSettingsClient contains the methods for the ProviderMonitorSettings group. +// Don't use this type directly, use NewProviderMonitorSettingsClient() instead. +type ProviderMonitorSettingsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewProviderMonitorSettingsClient creates a new instance of ProviderMonitorSettingsClient 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 NewProviderMonitorSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProviderMonitorSettingsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ProviderMonitorSettingsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Creates the provider monitor setting. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - providerMonitorSettingName - The name of the provider monitor setting. +// - properties - The provider monitor setting properties supplied to the create operation. +// - options - ProviderMonitorSettingsClientBeginCreateOptions contains the optional parameters for the ProviderMonitorSettingsClient.BeginCreate +// method. +func (client *ProviderMonitorSettingsClient) BeginCreate(ctx context.Context, resourceGroupName string, providerMonitorSettingName string, properties ProviderMonitorSetting, options *ProviderMonitorSettingsClientBeginCreateOptions) (*runtime.Poller[ProviderMonitorSettingsClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, providerMonitorSettingName, properties, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ProviderMonitorSettingsClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ProviderMonitorSettingsClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Create - Creates the provider monitor setting. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +func (client *ProviderMonitorSettingsClient) create(ctx context.Context, resourceGroupName string, providerMonitorSettingName string, properties ProviderMonitorSetting, options *ProviderMonitorSettingsClientBeginCreateOptions) (*http.Response, error) { + var err error + const operationName = "ProviderMonitorSettingsClient.BeginCreate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createCreateRequest(ctx, resourceGroupName, providerMonitorSettingName, properties, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createCreateRequest creates the Create request. +func (client *ProviderMonitorSettingsClient) createCreateRequest(ctx context.Context, resourceGroupName string, providerMonitorSettingName string, properties ProviderMonitorSetting, _ *ProviderMonitorSettingsClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProviderHub/providerMonitorSettings/{providerMonitorSettingName}" + 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 providerMonitorSettingName == "" { + return nil, errors.New("parameter providerMonitorSettingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerMonitorSettingName}", url.PathEscape(providerMonitorSettingName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil +} + +// Delete - Deletes a provider monitor setting. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - providerMonitorSettingName - The name of the provider monitor setting. +// - options - ProviderMonitorSettingsClientDeleteOptions contains the optional parameters for the ProviderMonitorSettingsClient.Delete +// method. +func (client *ProviderMonitorSettingsClient) Delete(ctx context.Context, resourceGroupName string, providerMonitorSettingName string, options *ProviderMonitorSettingsClientDeleteOptions) (ProviderMonitorSettingsClientDeleteResponse, error) { + var err error + const operationName = "ProviderMonitorSettingsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, providerMonitorSettingName, options) + if err != nil { + return ProviderMonitorSettingsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProviderMonitorSettingsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ProviderMonitorSettingsClientDeleteResponse{}, err + } + return ProviderMonitorSettingsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ProviderMonitorSettingsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, providerMonitorSettingName string, _ *ProviderMonitorSettingsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProviderHub/providerMonitorSettings/{providerMonitorSettingName}" + 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 providerMonitorSettingName == "" { + return nil, errors.New("parameter providerMonitorSettingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerMonitorSettingName}", url.PathEscape(providerMonitorSettingName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the provider monitor setting details. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - providerMonitorSettingName - The name of the provider monitor setting. +// - options - ProviderMonitorSettingsClientGetOptions contains the optional parameters for the ProviderMonitorSettingsClient.Get +// method. +func (client *ProviderMonitorSettingsClient) Get(ctx context.Context, resourceGroupName string, providerMonitorSettingName string, options *ProviderMonitorSettingsClientGetOptions) (ProviderMonitorSettingsClientGetResponse, error) { + var err error + const operationName = "ProviderMonitorSettingsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, providerMonitorSettingName, options) + if err != nil { + return ProviderMonitorSettingsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProviderMonitorSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProviderMonitorSettingsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ProviderMonitorSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, providerMonitorSettingName string, _ *ProviderMonitorSettingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProviderHub/providerMonitorSettings/{providerMonitorSettingName}" + 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 providerMonitorSettingName == "" { + return nil, errors.New("parameter providerMonitorSettingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerMonitorSettingName}", url.PathEscape(providerMonitorSettingName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ProviderMonitorSettingsClient) getHandleResponse(resp *http.Response) (ProviderMonitorSettingsClientGetResponse, error) { + result := ProviderMonitorSettingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ProviderMonitorSetting); err != nil { + return ProviderMonitorSettingsClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Gets the list of the provider monitor settings in the resource group. +// +// Generated from API version 2024-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - ProviderMonitorSettingsClientListByResourceGroupOptions contains the optional parameters for the ProviderMonitorSettingsClient.NewListByResourceGroupPager +// method. +func (client *ProviderMonitorSettingsClient) NewListByResourceGroupPager(resourceGroupName string, options *ProviderMonitorSettingsClientListByResourceGroupOptions) *runtime.Pager[ProviderMonitorSettingsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[ProviderMonitorSettingsClientListByResourceGroupResponse]{ + More: func(page ProviderMonitorSettingsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ProviderMonitorSettingsClientListByResourceGroupResponse) (ProviderMonitorSettingsClientListByResourceGroupResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ProviderMonitorSettingsClient.NewListByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return ProviderMonitorSettingsClientListByResourceGroupResponse{}, err + } + return client.listByResourceGroupHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ProviderMonitorSettingsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ProviderMonitorSettingsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProviderHub/providerMonitorSettings" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *ProviderMonitorSettingsClient) listByResourceGroupHandleResponse(resp *http.Response) (ProviderMonitorSettingsClientListByResourceGroupResponse, error) { + result := ProviderMonitorSettingsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ProviderMonitorSettingArrayResponseWithContinuation); err != nil { + return ProviderMonitorSettingsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Gets the list of the provider monitor settings in the subscription. +// +// Generated from API version 2024-09-01 +// - options - ProviderMonitorSettingsClientListBySubscriptionOptions contains the optional parameters for the ProviderMonitorSettingsClient.NewListBySubscriptionPager +// method. +func (client *ProviderMonitorSettingsClient) NewListBySubscriptionPager(options *ProviderMonitorSettingsClientListBySubscriptionOptions) *runtime.Pager[ProviderMonitorSettingsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[ProviderMonitorSettingsClientListBySubscriptionResponse]{ + More: func(page ProviderMonitorSettingsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ProviderMonitorSettingsClientListBySubscriptionResponse) (ProviderMonitorSettingsClientListBySubscriptionResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ProviderMonitorSettingsClient.NewListBySubscriptionPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listBySubscriptionCreateRequest(ctx, options) + }, nil) + if err != nil { + return ProviderMonitorSettingsClientListBySubscriptionResponse{}, err + } + return client.listBySubscriptionHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *ProviderMonitorSettingsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *ProviderMonitorSettingsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerMonitorSettings" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *ProviderMonitorSettingsClient) listBySubscriptionHandleResponse(resp *http.Response) (ProviderMonitorSettingsClientListBySubscriptionResponse, error) { + result := ProviderMonitorSettingsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ProviderMonitorSettingArrayResponseWithContinuation); err != nil { + return ProviderMonitorSettingsClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// Update - Updates the provider monitor setting properties as specified in the request body. Update fails if the specified +// provider monitor setting does not already exist. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - providerMonitorSettingName - The name of the provider monitor setting. +// - options - ProviderMonitorSettingsClientUpdateOptions contains the optional parameters for the ProviderMonitorSettingsClient.Update +// method. +func (client *ProviderMonitorSettingsClient) Update(ctx context.Context, resourceGroupName string, providerMonitorSettingName string, options *ProviderMonitorSettingsClientUpdateOptions) (ProviderMonitorSettingsClientUpdateResponse, error) { + var err error + const operationName = "ProviderMonitorSettingsClient.Update" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, providerMonitorSettingName, options) + if err != nil { + return ProviderMonitorSettingsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProviderMonitorSettingsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProviderMonitorSettingsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *ProviderMonitorSettingsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, providerMonitorSettingName string, _ *ProviderMonitorSettingsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProviderHub/providerMonitorSettings/{providerMonitorSettingName}" + 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 providerMonitorSettingName == "" { + return nil, errors.New("parameter providerMonitorSettingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerMonitorSettingName}", url.PathEscape(providerMonitorSettingName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *ProviderMonitorSettingsClient) updateHandleResponse(resp *http.Response) (ProviderMonitorSettingsClientUpdateResponse, error) { + result := ProviderMonitorSettingsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ProviderMonitorSetting); err != nil { + return ProviderMonitorSettingsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/providerregistrations_client.go b/sdk/resourcemanager/providerhub/armproviderhub/providerregistrations_client.go index 4c87a1b8aa59..5157aa20d361 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/providerregistrations_client.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/providerregistrations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewProviderRegistrationsClient(subscriptionID string, credential azcore.Tok // BeginCreateOrUpdate - Creates or updates the provider registration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - properties - The provider registration properties supplied to the CreateOrUpdate operation. // - options - ProviderRegistrationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ProviderRegistrationsClient.BeginCreateOrUpdate @@ -72,7 +69,7 @@ func (client *ProviderRegistrationsClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Creates or updates the provider registration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 func (client *ProviderRegistrationsClient) createOrUpdate(ctx context.Context, providerNamespace string, properties ProviderRegistration, options *ProviderRegistrationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ProviderRegistrationsClient.BeginCreateOrUpdate" @@ -95,7 +92,7 @@ func (client *ProviderRegistrationsClient) createOrUpdate(ctx context.Context, p } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ProviderRegistrationsClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, properties ProviderRegistration, options *ProviderRegistrationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ProviderRegistrationsClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, properties ProviderRegistration, _ *ProviderRegistrationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -110,7 +107,7 @@ func (client *ProviderRegistrationsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { @@ -122,7 +119,7 @@ func (client *ProviderRegistrationsClient) createOrUpdateCreateRequest(ctx conte // Delete - Deletes a provider registration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - options - ProviderRegistrationsClientDeleteOptions contains the optional parameters for the ProviderRegistrationsClient.Delete // method. @@ -148,7 +145,7 @@ func (client *ProviderRegistrationsClient) Delete(ctx context.Context, providerN } // deleteCreateRequest creates the Delete request. -func (client *ProviderRegistrationsClient) deleteCreateRequest(ctx context.Context, providerNamespace string, options *ProviderRegistrationsClientDeleteOptions) (*policy.Request, error) { +func (client *ProviderRegistrationsClient) deleteCreateRequest(ctx context.Context, providerNamespace string, _ *ProviderRegistrationsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -163,7 +160,7 @@ func (client *ProviderRegistrationsClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +169,7 @@ func (client *ProviderRegistrationsClient) deleteCreateRequest(ctx context.Conte // GenerateOperations - Generates the operations api for the given provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - options - ProviderRegistrationsClientGenerateOperationsOptions contains the optional parameters for the ProviderRegistrationsClient.GenerateOperations // method. @@ -199,7 +196,7 @@ func (client *ProviderRegistrationsClient) GenerateOperations(ctx context.Contex } // generateOperationsCreateRequest creates the GenerateOperations request. -func (client *ProviderRegistrationsClient) generateOperationsCreateRequest(ctx context.Context, providerNamespace string, options *ProviderRegistrationsClientGenerateOperationsOptions) (*policy.Request, error) { +func (client *ProviderRegistrationsClient) generateOperationsCreateRequest(ctx context.Context, providerNamespace string, _ *ProviderRegistrationsClientGenerateOperationsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/generateOperations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -214,7 +211,7 @@ func (client *ProviderRegistrationsClient) generateOperationsCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,7 +229,7 @@ func (client *ProviderRegistrationsClient) generateOperationsHandleResponse(resp // Get - Gets the provider registration details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - options - ProviderRegistrationsClientGetOptions contains the optional parameters for the ProviderRegistrationsClient.Get // method. @@ -259,7 +256,7 @@ func (client *ProviderRegistrationsClient) Get(ctx context.Context, providerName } // getCreateRequest creates the Get request. -func (client *ProviderRegistrationsClient) getCreateRequest(ctx context.Context, providerNamespace string, options *ProviderRegistrationsClientGetOptions) (*policy.Request, error) { +func (client *ProviderRegistrationsClient) getCreateRequest(ctx context.Context, providerNamespace string, _ *ProviderRegistrationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -274,7 +271,7 @@ func (client *ProviderRegistrationsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -291,7 +288,7 @@ func (client *ProviderRegistrationsClient) getHandleResponse(resp *http.Response // NewListPager - Gets the list of the provider registrations in the subscription. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - options - ProviderRegistrationsClientListOptions contains the optional parameters for the ProviderRegistrationsClient.NewListPager // method. func (client *ProviderRegistrationsClient) NewListPager(options *ProviderRegistrationsClientListOptions) *runtime.Pager[ProviderRegistrationsClientListResponse] { @@ -318,7 +315,7 @@ func (client *ProviderRegistrationsClient) NewListPager(options *ProviderRegistr } // listCreateRequest creates the List request. -func (client *ProviderRegistrationsClient) listCreateRequest(ctx context.Context, options *ProviderRegistrationsClientListOptions) (*policy.Request, error) { +func (client *ProviderRegistrationsClient) listCreateRequest(ctx context.Context, _ *ProviderRegistrationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -329,7 +326,7 @@ func (client *ProviderRegistrationsClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/providerhub/armproviderhub/providerregistrations_client_example_test.go b/sdk/resourcemanager/providerhub/armproviderhub/providerregistrations_client_example_test.go deleted file mode 100644 index 5608df2d54f1..000000000000 --- a/sdk/resourcemanager/providerhub/armproviderhub/providerregistrations_client_example_test.go +++ /dev/null @@ -1,295 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armproviderhub_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/providerhub/armproviderhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/ProviderRegistrations_Get.json -func ExampleProviderRegistrationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProviderRegistrationsClient().Get(ctx, "Microsoft.Contoso", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProviderRegistration = armproviderhub.ProviderRegistration{ - // Properties: &armproviderhub.ProviderRegistrationProperties{ - // Capabilities: []*armproviderhub.ResourceProviderCapabilities{ - // { - // Effect: to.Ptr(armproviderhub.ResourceProviderCapabilitiesEffectAllow), - // QuotaID: to.Ptr("CSP_2015-05-01"), - // }, - // { - // Effect: to.Ptr(armproviderhub.ResourceProviderCapabilitiesEffectAllow), - // QuotaID: to.Ptr("CSP_MG_2017-12-01"), - // }}, - // Management: &armproviderhub.ResourceProviderManifestPropertiesManagement{ - // IncidentContactEmail: to.Ptr("helpme@contoso.com"), - // IncidentRoutingService: to.Ptr(""), - // IncidentRoutingTeam: to.Ptr(""), - // ManifestOwners: []*string{ - // to.Ptr("SPARTA-PlatformServiceAdministrator")}, - // ResourceAccessPolicy: to.Ptr(armproviderhub.ResourceProviderManagementResourceAccessPolicyNotSpecified), - // }, - // Namespace: to.Ptr("microsoft.contoso"), - // ProviderAuthorizations: []*armproviderhub.ResourceProviderAuthorization{ - // { - // ApplicationID: to.Ptr("1a3b5c7d-8e9f-10g1-1h12-i13j14k1"), - // RoleDefinitionID: to.Ptr("123456bf-gkur-2098-b890-98da392a00b2"), - // }}, - // ProviderType: to.Ptr(armproviderhub.ResourceProviderType("Internal, Hidden")), - // ProviderVersion: to.Ptr("2.0"), - // ProviderHubMetadata: &armproviderhub.ProviderRegistrationPropertiesProviderHubMetadata{ - // ProviderAuthentication: &armproviderhub.MetadataProviderAuthentication{ - // AllowedAudiences: []*string{ - // to.Ptr("https://management.core.windows.net/")}, - // }, - // }, - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/ProviderRegistrations_CreateOrUpdate.json -func ExampleProviderRegistrationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProviderRegistrationsClient().BeginCreateOrUpdate(ctx, "Microsoft.Contoso", armproviderhub.ProviderRegistration{ - Properties: &armproviderhub.ProviderRegistrationProperties{ - Capabilities: []*armproviderhub.ResourceProviderCapabilities{ - { - Effect: to.Ptr(armproviderhub.ResourceProviderCapabilitiesEffectAllow), - QuotaID: to.Ptr("CSP_2015-05-01"), - }, - { - Effect: to.Ptr(armproviderhub.ResourceProviderCapabilitiesEffectAllow), - QuotaID: to.Ptr("CSP_MG_2017-12-01"), - }}, - Management: &armproviderhub.ResourceProviderManifestPropertiesManagement{ - IncidentContactEmail: to.Ptr("helpme@contoso.com"), - IncidentRoutingService: to.Ptr("Contoso Resource Provider"), - IncidentRoutingTeam: to.Ptr("Contoso Triage"), - }, - ProviderType: to.Ptr(armproviderhub.ResourceProviderTypeInternal), - ProviderVersion: to.Ptr("2.0"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProviderRegistration = armproviderhub.ProviderRegistration{ - // Properties: &armproviderhub.ProviderRegistrationProperties{ - // Capabilities: []*armproviderhub.ResourceProviderCapabilities{ - // { - // Effect: to.Ptr(armproviderhub.ResourceProviderCapabilitiesEffectAllow), - // QuotaID: to.Ptr("CSP_2015-05-01"), - // }, - // { - // Effect: to.Ptr(armproviderhub.ResourceProviderCapabilitiesEffectAllow), - // QuotaID: to.Ptr("CSP_MG_2017-12-01"), - // }}, - // Management: &armproviderhub.ResourceProviderManifestPropertiesManagement{ - // IncidentContactEmail: to.Ptr("helpme@contoso.com"), - // IncidentRoutingService: to.Ptr(""), - // IncidentRoutingTeam: to.Ptr(""), - // ManifestOwners: []*string{ - // to.Ptr("manifestOwners-group")}, - // ResourceAccessPolicy: to.Ptr(armproviderhub.ResourceProviderManagementResourceAccessPolicyNotSpecified), - // }, - // Metadata: map[string]any{ - // "onboardedVia": "ProviderHub", - // }, - // Namespace: to.Ptr("Microsoft.Contoso"), - // ProviderAuthorizations: []*armproviderhub.ResourceProviderAuthorization{ - // { - // ApplicationID: to.Ptr("1a3b5c7d-8e9f-10g1-1h12-i13j14k1"), - // RoleDefinitionID: to.Ptr("123456bf-gkur-2098-b890-98da392a00b2"), - // }}, - // ProviderType: to.Ptr(armproviderhub.ResourceProviderType("Internal, Hidden")), - // ProviderVersion: to.Ptr("2.0"), - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/ProviderRegistrations_Delete.json -func ExampleProviderRegistrationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewProviderRegistrationsClient().Delete(ctx, "Microsoft.Contoso", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/ProviderRegistrations_List.json -func ExampleProviderRegistrationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProviderRegistrationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProviderRegistrationArrayResponseWithContinuation = armproviderhub.ProviderRegistrationArrayResponseWithContinuation{ - // Value: []*armproviderhub.ProviderRegistration{ - // { - // Properties: &armproviderhub.ProviderRegistrationProperties{ - // Capabilities: []*armproviderhub.ResourceProviderCapabilities{ - // { - // Effect: to.Ptr(armproviderhub.ResourceProviderCapabilitiesEffectAllow), - // QuotaID: to.Ptr("CSP_2015-05-01"), - // }, - // { - // Effect: to.Ptr(armproviderhub.ResourceProviderCapabilitiesEffectAllow), - // QuotaID: to.Ptr("CSP_MG_2017-12-01"), - // }}, - // Management: &armproviderhub.ResourceProviderManifestPropertiesManagement{ - // IncidentContactEmail: to.Ptr("helpme@contoso.com"), - // IncidentRoutingService: to.Ptr(""), - // IncidentRoutingTeam: to.Ptr(""), - // ManifestOwners: []*string{ - // to.Ptr("manifestOwners-group")}, - // ResourceAccessPolicy: to.Ptr(armproviderhub.ResourceProviderManagementResourceAccessPolicyNotSpecified), - // }, - // Namespace: to.Ptr("microsoft.contoso"), - // ProviderAuthorizations: []*armproviderhub.ResourceProviderAuthorization{ - // { - // ApplicationID: to.Ptr("1a3b5c7d-8e9f-10g1-1h12-i13j14k1"), - // RoleDefinitionID: to.Ptr("123456bf-gkur-2098-b890-98da392a00b2"), - // }}, - // ProviderType: to.Ptr(armproviderhub.ResourceProviderType("Internal, Hidden")), - // ProviderVersion: to.Ptr("2.0"), - // ProviderHubMetadata: &armproviderhub.ProviderRegistrationPropertiesProviderHubMetadata{ - // ProviderAuthentication: &armproviderhub.MetadataProviderAuthentication{ - // AllowedAudiences: []*string{ - // to.Ptr("https://management.core.windows.net/")}, - // }, - // }, - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/ProviderRegistrations_GenerateOperations.json -func ExampleProviderRegistrationsClient_GenerateOperations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProviderRegistrationsClient().GenerateOperations(ctx, "Microsoft.Contoso", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationsDefinitionArray = []*armproviderhub.OperationsDefinition{ - // { - // Name: to.Ptr("Microsoft.Contoso/Employees/Read"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Read employees"), - // Operation: to.Ptr("Gets/List employee resources"), - // Provider: to.Ptr("Microsoft.Contoso"), - // Resource: to.Ptr("Employees"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Contoso/Employees/Write"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Writes employees"), - // Operation: to.Ptr("Create/update employee resources"), - // Provider: to.Ptr("Microsoft.Contoso"), - // Resource: to.Ptr("Employees"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Contoso/Employees/Delete"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Deletes employees"), - // Operation: to.Ptr("Deletes employee resource"), - // Provider: to.Ptr("Microsoft.Contoso"), - // Resource: to.Ptr("Employees"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr(armproviderhub.OperationsDefinitionOriginUser), - // }, - // { - // Name: to.Ptr("Microsoft.Contoso/Employees/Action"), - // Display: &armproviderhub.OperationsDefinitionDisplay{ - // Description: to.Ptr("Writes employees"), - // Operation: to.Ptr("Create/update employee resources"), - // Provider: to.Ptr("Microsoft.Contoso"), - // Resource: to.Ptr("Employees"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr(armproviderhub.OperationsDefinitionOriginSystem), - // }} -} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/resourceactions_client.go b/sdk/resourcemanager/providerhub/armproviderhub/resourceactions_client.go new file mode 100644 index 000000000000..3c970a2f62da --- /dev/null +++ b/sdk/resourcemanager/providerhub/armproviderhub/resourceactions_client.go @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armproviderhub + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ResourceActionsClient contains the methods for the ResourceActions group. +// Don't use this type directly, use NewResourceActionsClient() instead. +type ResourceActionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewResourceActionsClient creates a new instance of ResourceActionsClient 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 NewResourceActionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceActionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ResourceActionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginDeleteResources - Deletes resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +// - providerNamespace - The name of the resource provider hosted within ProviderHub. +// - resourceActionName - The resource action name. +// - properties - The properties supplied to the DeleteResources operation. +// - options - ResourceActionsClientBeginDeleteResourcesOptions contains the optional parameters for the ResourceActionsClient.BeginDeleteResources +// method. +func (client *ResourceActionsClient) BeginDeleteResources(ctx context.Context, providerNamespace string, resourceActionName string, properties ResourceManagementAction, options *ResourceActionsClientBeginDeleteResourcesOptions) (*runtime.Poller[ResourceActionsClientDeleteResourcesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteResources(ctx, providerNamespace, resourceActionName, properties, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ResourceActionsClientDeleteResourcesResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ResourceActionsClientDeleteResourcesResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// DeleteResources - Deletes resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +func (client *ResourceActionsClient) deleteResources(ctx context.Context, providerNamespace string, resourceActionName string, properties ResourceManagementAction, options *ResourceActionsClientBeginDeleteResourcesOptions) (*http.Response, error) { + var err error + const operationName = "ResourceActionsClient.BeginDeleteResources" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteResourcesCreateRequest(ctx, providerNamespace, resourceActionName, properties, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteResourcesCreateRequest creates the DeleteResources request. +func (client *ResourceActionsClient) deleteResourcesCreateRequest(ctx context.Context, providerNamespace string, resourceActionName string, properties ResourceManagementAction, _ *ResourceActionsClientBeginDeleteResourcesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourceActions/{resourceActionName}/deleteResources" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if providerNamespace == "" { + return nil, errors.New("parameter providerNamespace cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerNamespace}", url.PathEscape(providerNamespace)) + if resourceActionName == "" { + return nil, errors.New("parameter resourceActionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceActionName}", url.PathEscape(resourceActionName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/resourcetyperegistrations_client.go b/sdk/resourcemanager/providerhub/armproviderhub/resourcetyperegistrations_client.go index 202cb6fb4bce..f31ce80b3cf5 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/resourcetyperegistrations_client.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/resourcetyperegistrations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewResourceTypeRegistrationsClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Creates or updates a resource type. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - properties - The required request body parameters supplied to the resource type registration CreateOrUpdate operation. @@ -73,7 +70,7 @@ func (client *ResourceTypeRegistrationsClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Creates or updates a resource type. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 func (client *ResourceTypeRegistrationsClient) createOrUpdate(ctx context.Context, providerNamespace string, resourceType string, properties ResourceTypeRegistration, options *ResourceTypeRegistrationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ResourceTypeRegistrationsClient.BeginCreateOrUpdate" @@ -96,7 +93,7 @@ func (client *ResourceTypeRegistrationsClient) createOrUpdate(ctx context.Contex } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ResourceTypeRegistrationsClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, resourceType string, properties ResourceTypeRegistration, options *ResourceTypeRegistrationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ResourceTypeRegistrationsClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, resourceType string, properties ResourceTypeRegistration, _ *ResourceTypeRegistrationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -115,7 +112,7 @@ func (client *ResourceTypeRegistrationsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { @@ -124,37 +121,59 @@ func (client *ResourceTypeRegistrationsClient) createOrUpdateCreateRequest(ctx c return req, nil } -// Delete - Deletes a resource type +// BeginDelete - Deletes a resource type // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. -// - options - ResourceTypeRegistrationsClientDeleteOptions contains the optional parameters for the ResourceTypeRegistrationsClient.Delete +// - options - ResourceTypeRegistrationsClientBeginDeleteOptions contains the optional parameters for the ResourceTypeRegistrationsClient.BeginDelete // method. -func (client *ResourceTypeRegistrationsClient) Delete(ctx context.Context, providerNamespace string, resourceType string, options *ResourceTypeRegistrationsClientDeleteOptions) (ResourceTypeRegistrationsClientDeleteResponse, error) { +func (client *ResourceTypeRegistrationsClient) BeginDelete(ctx context.Context, providerNamespace string, resourceType string, options *ResourceTypeRegistrationsClientBeginDeleteOptions) (*runtime.Poller[ResourceTypeRegistrationsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, providerNamespace, resourceType, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ResourceTypeRegistrationsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ResourceTypeRegistrationsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a resource type +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-09-01 +func (client *ResourceTypeRegistrationsClient) deleteOperation(ctx context.Context, providerNamespace string, resourceType string, options *ResourceTypeRegistrationsClientBeginDeleteOptions) (*http.Response, error) { var err error - const operationName = "ResourceTypeRegistrationsClient.Delete" + const operationName = "ResourceTypeRegistrationsClient.BeginDelete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, providerNamespace, resourceType, options) if err != nil { - return ResourceTypeRegistrationsClientDeleteResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return ResourceTypeRegistrationsClientDeleteResponse{}, err + return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) - return ResourceTypeRegistrationsClientDeleteResponse{}, err + return nil, err } - return ResourceTypeRegistrationsClientDeleteResponse{}, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. -func (client *ResourceTypeRegistrationsClient) deleteCreateRequest(ctx context.Context, providerNamespace string, resourceType string, options *ResourceTypeRegistrationsClientDeleteOptions) (*policy.Request, error) { +func (client *ResourceTypeRegistrationsClient) deleteCreateRequest(ctx context.Context, providerNamespace string, resourceType string, _ *ResourceTypeRegistrationsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -173,7 +192,7 @@ func (client *ResourceTypeRegistrationsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +201,7 @@ func (client *ResourceTypeRegistrationsClient) deleteCreateRequest(ctx context.C // Get - Gets a resource type details in the given subscription and provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - options - ResourceTypeRegistrationsClientGetOptions contains the optional parameters for the ResourceTypeRegistrationsClient.Get @@ -210,7 +229,7 @@ func (client *ResourceTypeRegistrationsClient) Get(ctx context.Context, provider } // getCreateRequest creates the Get request. -func (client *ResourceTypeRegistrationsClient) getCreateRequest(ctx context.Context, providerNamespace string, resourceType string, options *ResourceTypeRegistrationsClientGetOptions) (*policy.Request, error) { +func (client *ResourceTypeRegistrationsClient) getCreateRequest(ctx context.Context, providerNamespace string, resourceType string, _ *ResourceTypeRegistrationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -229,7 +248,7 @@ func (client *ResourceTypeRegistrationsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,7 +265,7 @@ func (client *ResourceTypeRegistrationsClient) getHandleResponse(resp *http.Resp // NewListByProviderRegistrationPager - Gets the list of the resource types for the given provider. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - options - ResourceTypeRegistrationsClientListByProviderRegistrationOptions contains the optional parameters for the ResourceTypeRegistrationsClient.NewListByProviderRegistrationPager // method. @@ -274,7 +293,7 @@ func (client *ResourceTypeRegistrationsClient) NewListByProviderRegistrationPage } // listByProviderRegistrationCreateRequest creates the ListByProviderRegistration request. -func (client *ResourceTypeRegistrationsClient) listByProviderRegistrationCreateRequest(ctx context.Context, providerNamespace string, options *ResourceTypeRegistrationsClientListByProviderRegistrationOptions) (*policy.Request, error) { +func (client *ResourceTypeRegistrationsClient) listByProviderRegistrationCreateRequest(ctx context.Context, providerNamespace string, _ *ResourceTypeRegistrationsClientListByProviderRegistrationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -289,7 +308,7 @@ func (client *ResourceTypeRegistrationsClient) listByProviderRegistrationCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/providerhub/armproviderhub/resourcetyperegistrations_client_example_test.go b/sdk/resourcemanager/providerhub/armproviderhub/resourcetyperegistrations_client_example_test.go deleted file mode 100644 index 226eae35f0f3..000000000000 --- a/sdk/resourcemanager/providerhub/armproviderhub/resourcetyperegistrations_client_example_test.go +++ /dev/null @@ -1,245 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armproviderhub_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/providerhub/armproviderhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/ResourceTypeRegistrations_Get.json -func ExampleResourceTypeRegistrationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceTypeRegistrationsClient().Get(ctx, "Microsoft.Contoso", "employees", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceTypeRegistration = armproviderhub.ResourceTypeRegistration{ - // Name: to.Ptr("employees"), - // Properties: &armproviderhub.ResourceTypeRegistrationProperties{ - // EnableAsyncOperation: to.Ptr(false), - // EnableThirdPartyS2S: to.Ptr(false), - // Endpoints: []*armproviderhub.ResourceTypeEndpoint{ - // { - // APIVersions: []*string{ - // to.Ptr("2018-11-01-preview"), - // to.Ptr("2020-01-01-preview"), - // to.Ptr("2019-01-01")}, - // Locations: []*string{ - // to.Ptr("East Asia"), - // to.Ptr("East US"), - // to.Ptr("North Europe"), - // to.Ptr("Southeast Asia"), - // to.Ptr("East US 2 EUAP"), - // to.Ptr("Central US EUAP"), - // to.Ptr("West Europe"), - // to.Ptr("West US"), - // to.Ptr("West Central US"), - // to.Ptr("West US 2")}, - // RequiredFeatures: []*string{ - // to.Ptr("Microsoft.Contoso/RPaaSSampleApp")}, - // }}, - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // Regionality: to.Ptr(armproviderhub.RegionalityRegional), - // RoutingType: to.Ptr(armproviderhub.RoutingTypeDefault), - // SwaggerSpecifications: []*armproviderhub.SwaggerSpecification{ - // { - // APIVersions: []*string{ - // to.Ptr("2018-11-01-preview"), - // to.Ptr("2020-01-01-preview"), - // to.Ptr("2019-01-01")}, - // SwaggerSpecFolderURI: to.Ptr("https://github.com/Azure/azure-rest-api-specs/blob/feature/azure/contoso/specification/contoso/resource-manager/Microsoft.SampleRP/"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/ResourceTypeRegistrations_CreateOrUpdate.json -func ExampleResourceTypeRegistrationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewResourceTypeRegistrationsClient().BeginCreateOrUpdate(ctx, "Microsoft.Contoso", "employees", armproviderhub.ResourceTypeRegistration{ - Properties: &armproviderhub.ResourceTypeRegistrationProperties{ - Endpoints: []*armproviderhub.ResourceTypeEndpoint{ - { - APIVersions: []*string{ - to.Ptr("2020-06-01-preview")}, - Locations: []*string{ - to.Ptr("West US"), - to.Ptr("East US"), - to.Ptr("North Europe")}, - RequiredFeatures: []*string{ - to.Ptr("")}, - }}, - Regionality: to.Ptr(armproviderhub.RegionalityRegional), - RoutingType: to.Ptr(armproviderhub.RoutingTypeDefault), - SwaggerSpecifications: []*armproviderhub.SwaggerSpecification{ - { - APIVersions: []*string{ - to.Ptr("2020-06-01-preview")}, - SwaggerSpecFolderURI: to.Ptr("https://github.com/Azure/azure-rest-api-specs/blob/feature/azure/contoso/specification/contoso/resource-manager/Microsoft.SampleRP/"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceTypeRegistration = armproviderhub.ResourceTypeRegistration{ - // Name: to.Ptr("employees"), - // Properties: &armproviderhub.ResourceTypeRegistrationProperties{ - // EnableAsyncOperation: to.Ptr(false), - // EnableThirdPartyS2S: to.Ptr(false), - // Endpoints: []*armproviderhub.ResourceTypeEndpoint{ - // { - // APIVersions: []*string{ - // to.Ptr("2018-11-01-preview"), - // to.Ptr("2020-01-01-preview"), - // to.Ptr("2019-01-01")}, - // Locations: []*string{ - // to.Ptr("East Asia"), - // to.Ptr("East US"), - // to.Ptr("North Europe"), - // to.Ptr("Southeast Asia"), - // to.Ptr("East US 2 EUAP"), - // to.Ptr("Central US EUAP"), - // to.Ptr("West Europe"), - // to.Ptr("West US"), - // to.Ptr("West Central US"), - // to.Ptr("West US 2")}, - // RequiredFeatures: []*string{ - // to.Ptr("Microsoft.Contoso/RPaaSSampleApp")}, - // }}, - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // Regionality: to.Ptr(armproviderhub.RegionalityRegional), - // ResourceDeletionPolicy: to.Ptr(armproviderhub.ResourceDeletionPolicyCascadeDeleteProxyOnlyChildren), - // RoutingType: to.Ptr(armproviderhub.RoutingTypeDefault), - // SwaggerSpecifications: []*armproviderhub.SwaggerSpecification{ - // { - // APIVersions: []*string{ - // to.Ptr("2018-11-01-preview"), - // to.Ptr("2020-01-01-preview"), - // to.Ptr("2019-01-01")}, - // SwaggerSpecFolderURI: to.Ptr("https://github.com/Azure/azure-rest-api-specs/blob/feature/azure/contoso/specification/contoso/resource-manager/Microsoft.SampleRP/"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/ResourceTypeRegistrations_Delete.json -func ExampleResourceTypeRegistrationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewResourceTypeRegistrationsClient().Delete(ctx, "Microsoft.Contoso", "testResourceType", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/ResourceTypeRegistrations_ListByProviderRegistration.json -func ExampleResourceTypeRegistrationsClient_NewListByProviderRegistrationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceTypeRegistrationsClient().NewListByProviderRegistrationPager("Microsoft.Contoso", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceTypeRegistrationArrayResponseWithContinuation = armproviderhub.ResourceTypeRegistrationArrayResponseWithContinuation{ - // Value: []*armproviderhub.ResourceTypeRegistration{ - // { - // Name: to.Ptr("employees"), - // Properties: &armproviderhub.ResourceTypeRegistrationProperties{ - // EnableAsyncOperation: to.Ptr(false), - // EnableThirdPartyS2S: to.Ptr(false), - // Endpoints: []*armproviderhub.ResourceTypeEndpoint{ - // { - // APIVersions: []*string{ - // to.Ptr("2018-11-01-preview"), - // to.Ptr("2020-01-01-preview"), - // to.Ptr("2019-01-01")}, - // Locations: []*string{ - // to.Ptr("East Asia"), - // to.Ptr("East US"), - // to.Ptr("North Europe"), - // to.Ptr("Southeast Asia"), - // to.Ptr("East US 2 EUAP"), - // to.Ptr("Central US EUAP"), - // to.Ptr("West Europe"), - // to.Ptr("West US"), - // to.Ptr("West Central US"), - // to.Ptr("West US 2")}, - // RequiredFeatures: []*string{ - // to.Ptr("Microsoft.Contoso/RPaaSSampleApp")}, - // }}, - // ProvisioningState: to.Ptr(armproviderhub.ProvisioningStateSucceeded), - // Regionality: to.Ptr(armproviderhub.RegionalityRegional), - // RoutingType: to.Ptr(armproviderhub.RoutingTypeDefault), - // SwaggerSpecifications: []*armproviderhub.SwaggerSpecification{ - // { - // APIVersions: []*string{ - // to.Ptr("2018-11-01-preview"), - // to.Ptr("2020-01-01-preview"), - // to.Ptr("2019-01-01")}, - // SwaggerSpecFolderURI: to.Ptr("https://github.com/Azure/azure-rest-api-specs/blob/feature/azure/contoso/specification/contoso/resource-manager/Microsoft.SampleRP/"), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/response_types.go b/sdk/resourcemanager/providerhub/armproviderhub/responses.go similarity index 70% rename from sdk/resourcemanager/providerhub/armproviderhub/response_types.go rename to sdk/resourcemanager/providerhub/armproviderhub/responses.go index 736c6a02154c..2db0fb4bbe0d 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/response_types.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/responses.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -8,6 +5,26 @@ package armproviderhub +// AuthorizedApplicationsClientCreateOrUpdateResponse contains the response from method AuthorizedApplicationsClient.BeginCreateOrUpdate. +type AuthorizedApplicationsClientCreateOrUpdateResponse struct { + AuthorizedApplication +} + +// AuthorizedApplicationsClientDeleteResponse contains the response from method AuthorizedApplicationsClient.Delete. +type AuthorizedApplicationsClientDeleteResponse struct { + // placeholder for future response values +} + +// AuthorizedApplicationsClientGetResponse contains the response from method AuthorizedApplicationsClient.Get. +type AuthorizedApplicationsClientGetResponse struct { + AuthorizedApplication +} + +// AuthorizedApplicationsClientListResponse contains the response from method AuthorizedApplicationsClient.NewListPager. +type AuthorizedApplicationsClientListResponse struct { + AuthorizedApplicationArrayResponseWithContinuation +} + // ClientCheckinManifestResponse contains the response from method Client.CheckinManifest. type ClientCheckinManifestResponse struct { CheckinManifestInfo @@ -18,15 +35,18 @@ type ClientGenerateManifestResponse struct { ResourceProviderManifest } -// CustomRolloutsClientCreateOrUpdateResponse contains the response from method CustomRolloutsClient.CreateOrUpdate. +// CustomRolloutsClientCreateOrUpdateResponse contains the response from method CustomRolloutsClient.BeginCreateOrUpdate. type CustomRolloutsClientCreateOrUpdateResponse struct { - // Rollout details. CustomRollout } +// CustomRolloutsClientDeleteResponse contains the response from method CustomRolloutsClient.Delete. +type CustomRolloutsClientDeleteResponse struct { + // placeholder for future response values +} + // CustomRolloutsClientGetResponse contains the response from method CustomRolloutsClient.Get. type CustomRolloutsClientGetResponse struct { - // Rollout details. CustomRollout } @@ -35,9 +55,13 @@ type CustomRolloutsClientListByProviderRegistrationResponse struct { CustomRolloutArrayResponseWithContinuation } +// CustomRolloutsClientStopResponse contains the response from method CustomRolloutsClient.Stop. +type CustomRolloutsClientStopResponse struct { + // placeholder for future response values +} + // DefaultRolloutsClientCreateOrUpdateResponse contains the response from method DefaultRolloutsClient.BeginCreateOrUpdate. type DefaultRolloutsClientCreateOrUpdateResponse struct { - // Default rollout definition. DefaultRollout } @@ -48,7 +72,6 @@ type DefaultRolloutsClientDeleteResponse struct { // DefaultRolloutsClientGetResponse contains the response from method DefaultRolloutsClient.Get. type DefaultRolloutsClientGetResponse struct { - // Default rollout definition. DefaultRollout } @@ -62,9 +85,33 @@ type DefaultRolloutsClientStopResponse struct { // placeholder for future response values } +// NewRegionFrontloadReleaseClientCreateOrUpdateResponse contains the response from method NewRegionFrontloadReleaseClient.CreateOrUpdate. +type NewRegionFrontloadReleaseClientCreateOrUpdateResponse struct { + DefaultRollout +} + +// NewRegionFrontloadReleaseClientGenerateManifestResponse contains the response from method NewRegionFrontloadReleaseClient.GenerateManifest. +type NewRegionFrontloadReleaseClientGenerateManifestResponse struct { + ResourceProviderManifest +} + +// NewRegionFrontloadReleaseClientGetResponse contains the response from method NewRegionFrontloadReleaseClient.Get. +type NewRegionFrontloadReleaseClientGetResponse struct { + DefaultRollout +} + +// NewRegionFrontloadReleaseClientStopResponse contains the response from method NewRegionFrontloadReleaseClient.Stop. +type NewRegionFrontloadReleaseClientStopResponse struct { + // placeholder for future response values +} + +// NewRegionFrontloadReleaseClientValidateManifestResponse contains the response from method NewRegionFrontloadReleaseClient.ValidateManifest. +type NewRegionFrontloadReleaseClientValidateManifestResponse struct { + Value *string +} + // NotificationRegistrationsClientCreateOrUpdateResponse contains the response from method NotificationRegistrationsClient.CreateOrUpdate. type NotificationRegistrationsClientCreateOrUpdateResponse struct { - // The notification registration definition. NotificationRegistration } @@ -75,7 +122,6 @@ type NotificationRegistrationsClientDeleteResponse struct { // NotificationRegistrationsClientGetResponse contains the response from method NotificationRegistrationsClient.Get. type NotificationRegistrationsClientGetResponse struct { - // The notification registration definition. NotificationRegistration } @@ -86,7 +132,7 @@ type NotificationRegistrationsClientListByProviderRegistrationResponse struct { // OperationsClientCreateOrUpdateResponse contains the response from method OperationsClient.CreateOrUpdate. type OperationsClientCreateOrUpdateResponse struct { - OperationsContent + OperationsPutContent } // OperationsClientDeleteResponse contains the response from method OperationsClient.Delete. @@ -105,6 +151,36 @@ type OperationsClientListResponse struct { OperationsDefinitionArrayResponseWithContinuation } +// ProviderMonitorSettingsClientCreateResponse contains the response from method ProviderMonitorSettingsClient.BeginCreate. +type ProviderMonitorSettingsClientCreateResponse struct { + ProviderMonitorSetting +} + +// ProviderMonitorSettingsClientDeleteResponse contains the response from method ProviderMonitorSettingsClient.Delete. +type ProviderMonitorSettingsClientDeleteResponse struct { + // placeholder for future response values +} + +// ProviderMonitorSettingsClientGetResponse contains the response from method ProviderMonitorSettingsClient.Get. +type ProviderMonitorSettingsClientGetResponse struct { + ProviderMonitorSetting +} + +// ProviderMonitorSettingsClientListByResourceGroupResponse contains the response from method ProviderMonitorSettingsClient.NewListByResourceGroupPager. +type ProviderMonitorSettingsClientListByResourceGroupResponse struct { + ProviderMonitorSettingArrayResponseWithContinuation +} + +// ProviderMonitorSettingsClientListBySubscriptionResponse contains the response from method ProviderMonitorSettingsClient.NewListBySubscriptionPager. +type ProviderMonitorSettingsClientListBySubscriptionResponse struct { + ProviderMonitorSettingArrayResponseWithContinuation +} + +// ProviderMonitorSettingsClientUpdateResponse contains the response from method ProviderMonitorSettingsClient.Update. +type ProviderMonitorSettingsClientUpdateResponse struct { + ProviderMonitorSetting +} + // ProviderRegistrationsClientCreateOrUpdateResponse contains the response from method ProviderRegistrationsClient.BeginCreateOrUpdate. type ProviderRegistrationsClientCreateOrUpdateResponse struct { ProviderRegistration @@ -131,12 +207,17 @@ type ProviderRegistrationsClientListResponse struct { ProviderRegistrationArrayResponseWithContinuation } +// ResourceActionsClientDeleteResourcesResponse contains the response from method ResourceActionsClient.BeginDeleteResources. +type ResourceActionsClientDeleteResourcesResponse struct { + // placeholder for future response values +} + // ResourceTypeRegistrationsClientCreateOrUpdateResponse contains the response from method ResourceTypeRegistrationsClient.BeginCreateOrUpdate. type ResourceTypeRegistrationsClientCreateOrUpdateResponse struct { ResourceTypeRegistration } -// ResourceTypeRegistrationsClientDeleteResponse contains the response from method ResourceTypeRegistrationsClient.Delete. +// ResourceTypeRegistrationsClientDeleteResponse contains the response from method ResourceTypeRegistrationsClient.BeginDelete. type ResourceTypeRegistrationsClientDeleteResponse struct { // placeholder for future response values } diff --git a/sdk/resourcemanager/providerhub/armproviderhub/skus_client.go b/sdk/resourcemanager/providerhub/armproviderhub/skus_client.go index 1a9faf05ff5f..a979870da723 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/skus_client.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/skus_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, opt // CreateOrUpdate - Creates or updates the resource type skus in the given resource type. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - sku - The SKU. @@ -75,7 +72,7 @@ func (client *SKUsClient) CreateOrUpdate(ctx context.Context, providerNamespace } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SKUsClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, resourceType string, sku string, properties SKUResource, options *SKUsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *SKUsClient) createOrUpdateCreateRequest(ctx context.Context, providerNamespace string, resourceType string, sku string, properties SKUResource, _ *SKUsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus/{sku}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -98,7 +95,7 @@ func (client *SKUsClient) createOrUpdateCreateRequest(ctx context.Context, provi return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { @@ -119,7 +116,7 @@ func (client *SKUsClient) createOrUpdateHandleResponse(resp *http.Response) (SKU // CreateOrUpdateNestedResourceTypeFirst - Creates or updates the resource type skus in the given resource type. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - nestedResourceTypeFirst - The first child resource type. @@ -150,7 +147,7 @@ func (client *SKUsClient) CreateOrUpdateNestedResourceTypeFirst(ctx context.Cont } // createOrUpdateNestedResourceTypeFirstCreateRequest creates the CreateOrUpdateNestedResourceTypeFirst request. -func (client *SKUsClient) createOrUpdateNestedResourceTypeFirstCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, sku string, properties SKUResource, options *SKUsClientCreateOrUpdateNestedResourceTypeFirstOptions) (*policy.Request, error) { +func (client *SKUsClient) createOrUpdateNestedResourceTypeFirstCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, sku string, properties SKUResource, _ *SKUsClientCreateOrUpdateNestedResourceTypeFirstOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus/{sku}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -177,7 +174,7 @@ func (client *SKUsClient) createOrUpdateNestedResourceTypeFirstCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { @@ -198,7 +195,7 @@ func (client *SKUsClient) createOrUpdateNestedResourceTypeFirstHandleResponse(re // CreateOrUpdateNestedResourceTypeSecond - Creates or updates the resource type skus in the given resource type. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - nestedResourceTypeFirst - The first child resource type. @@ -230,7 +227,7 @@ func (client *SKUsClient) CreateOrUpdateNestedResourceTypeSecond(ctx context.Con } // createOrUpdateNestedResourceTypeSecondCreateRequest creates the CreateOrUpdateNestedResourceTypeSecond request. -func (client *SKUsClient) createOrUpdateNestedResourceTypeSecondCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, sku string, properties SKUResource, options *SKUsClientCreateOrUpdateNestedResourceTypeSecondOptions) (*policy.Request, error) { +func (client *SKUsClient) createOrUpdateNestedResourceTypeSecondCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, sku string, properties SKUResource, _ *SKUsClientCreateOrUpdateNestedResourceTypeSecondOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -261,7 +258,7 @@ func (client *SKUsClient) createOrUpdateNestedResourceTypeSecondCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { @@ -282,7 +279,7 @@ func (client *SKUsClient) createOrUpdateNestedResourceTypeSecondHandleResponse(r // CreateOrUpdateNestedResourceTypeThird - Creates or updates the resource type skus in the given resource type. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - nestedResourceTypeFirst - The first child resource type. @@ -315,7 +312,7 @@ func (client *SKUsClient) CreateOrUpdateNestedResourceTypeThird(ctx context.Cont } // createOrUpdateNestedResourceTypeThirdCreateRequest creates the CreateOrUpdateNestedResourceTypeThird request. -func (client *SKUsClient) createOrUpdateNestedResourceTypeThirdCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, sku string, properties SKUResource, options *SKUsClientCreateOrUpdateNestedResourceTypeThirdOptions) (*policy.Request, error) { +func (client *SKUsClient) createOrUpdateNestedResourceTypeThirdCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, sku string, properties SKUResource, _ *SKUsClientCreateOrUpdateNestedResourceTypeThirdOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus/{sku}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -350,7 +347,7 @@ func (client *SKUsClient) createOrUpdateNestedResourceTypeThirdCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { @@ -371,7 +368,7 @@ func (client *SKUsClient) createOrUpdateNestedResourceTypeThirdHandleResponse(re // Delete - Deletes a resource type sku. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - sku - The SKU. @@ -398,7 +395,7 @@ func (client *SKUsClient) Delete(ctx context.Context, providerNamespace string, } // deleteCreateRequest creates the Delete request. -func (client *SKUsClient) deleteCreateRequest(ctx context.Context, providerNamespace string, resourceType string, sku string, options *SKUsClientDeleteOptions) (*policy.Request, error) { +func (client *SKUsClient) deleteCreateRequest(ctx context.Context, providerNamespace string, resourceType string, sku string, _ *SKUsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus/{sku}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -421,7 +418,7 @@ func (client *SKUsClient) deleteCreateRequest(ctx context.Context, providerNames return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -430,7 +427,7 @@ func (client *SKUsClient) deleteCreateRequest(ctx context.Context, providerNames // DeleteNestedResourceTypeFirst - Deletes a resource type sku. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - nestedResourceTypeFirst - The first child resource type. @@ -459,7 +456,7 @@ func (client *SKUsClient) DeleteNestedResourceTypeFirst(ctx context.Context, pro } // deleteNestedResourceTypeFirstCreateRequest creates the DeleteNestedResourceTypeFirst request. -func (client *SKUsClient) deleteNestedResourceTypeFirstCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, sku string, options *SKUsClientDeleteNestedResourceTypeFirstOptions) (*policy.Request, error) { +func (client *SKUsClient) deleteNestedResourceTypeFirstCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, sku string, _ *SKUsClientDeleteNestedResourceTypeFirstOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus/{sku}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -486,7 +483,7 @@ func (client *SKUsClient) deleteNestedResourceTypeFirstCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -495,7 +492,7 @@ func (client *SKUsClient) deleteNestedResourceTypeFirstCreateRequest(ctx context // DeleteNestedResourceTypeSecond - Deletes a resource type sku. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - nestedResourceTypeFirst - The first child resource type. @@ -525,7 +522,7 @@ func (client *SKUsClient) DeleteNestedResourceTypeSecond(ctx context.Context, pr } // deleteNestedResourceTypeSecondCreateRequest creates the DeleteNestedResourceTypeSecond request. -func (client *SKUsClient) deleteNestedResourceTypeSecondCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, sku string, options *SKUsClientDeleteNestedResourceTypeSecondOptions) (*policy.Request, error) { +func (client *SKUsClient) deleteNestedResourceTypeSecondCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, sku string, _ *SKUsClientDeleteNestedResourceTypeSecondOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -556,7 +553,7 @@ func (client *SKUsClient) deleteNestedResourceTypeSecondCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -565,7 +562,7 @@ func (client *SKUsClient) deleteNestedResourceTypeSecondCreateRequest(ctx contex // DeleteNestedResourceTypeThird - Deletes a resource type sku. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - nestedResourceTypeFirst - The first child resource type. @@ -596,7 +593,7 @@ func (client *SKUsClient) DeleteNestedResourceTypeThird(ctx context.Context, pro } // deleteNestedResourceTypeThirdCreateRequest creates the DeleteNestedResourceTypeThird request. -func (client *SKUsClient) deleteNestedResourceTypeThirdCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, sku string, options *SKUsClientDeleteNestedResourceTypeThirdOptions) (*policy.Request, error) { +func (client *SKUsClient) deleteNestedResourceTypeThirdCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, sku string, _ *SKUsClientDeleteNestedResourceTypeThirdOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus/{sku}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -631,7 +628,7 @@ func (client *SKUsClient) deleteNestedResourceTypeThirdCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -640,7 +637,7 @@ func (client *SKUsClient) deleteNestedResourceTypeThirdCreateRequest(ctx context // Get - Gets the sku details for the given resource type and sku name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - sku - The SKU. @@ -668,7 +665,7 @@ func (client *SKUsClient) Get(ctx context.Context, providerNamespace string, res } // getCreateRequest creates the Get request. -func (client *SKUsClient) getCreateRequest(ctx context.Context, providerNamespace string, resourceType string, sku string, options *SKUsClientGetOptions) (*policy.Request, error) { +func (client *SKUsClient) getCreateRequest(ctx context.Context, providerNamespace string, resourceType string, sku string, _ *SKUsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus/{sku}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -691,7 +688,7 @@ func (client *SKUsClient) getCreateRequest(ctx context.Context, providerNamespac return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -709,7 +706,7 @@ func (client *SKUsClient) getHandleResponse(resp *http.Response) (SKUsClientGetR // GetNestedResourceTypeFirst - Gets the sku details for the given resource type and sku name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - nestedResourceTypeFirst - The first child resource type. @@ -739,7 +736,7 @@ func (client *SKUsClient) GetNestedResourceTypeFirst(ctx context.Context, provid } // getNestedResourceTypeFirstCreateRequest creates the GetNestedResourceTypeFirst request. -func (client *SKUsClient) getNestedResourceTypeFirstCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, sku string, options *SKUsClientGetNestedResourceTypeFirstOptions) (*policy.Request, error) { +func (client *SKUsClient) getNestedResourceTypeFirstCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, sku string, _ *SKUsClientGetNestedResourceTypeFirstOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus/{sku}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -766,7 +763,7 @@ func (client *SKUsClient) getNestedResourceTypeFirstCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -784,7 +781,7 @@ func (client *SKUsClient) getNestedResourceTypeFirstHandleResponse(resp *http.Re // GetNestedResourceTypeSecond - Gets the sku details for the given resource type and sku name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - nestedResourceTypeFirst - The first child resource type. @@ -815,7 +812,7 @@ func (client *SKUsClient) GetNestedResourceTypeSecond(ctx context.Context, provi } // getNestedResourceTypeSecondCreateRequest creates the GetNestedResourceTypeSecond request. -func (client *SKUsClient) getNestedResourceTypeSecondCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, sku string, options *SKUsClientGetNestedResourceTypeSecondOptions) (*policy.Request, error) { +func (client *SKUsClient) getNestedResourceTypeSecondCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, sku string, _ *SKUsClientGetNestedResourceTypeSecondOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -846,7 +843,7 @@ func (client *SKUsClient) getNestedResourceTypeSecondCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -864,7 +861,7 @@ func (client *SKUsClient) getNestedResourceTypeSecondHandleResponse(resp *http.R // GetNestedResourceTypeThird - Gets the sku details for the given resource type and sku name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - nestedResourceTypeFirst - The first child resource type. @@ -896,7 +893,7 @@ func (client *SKUsClient) GetNestedResourceTypeThird(ctx context.Context, provid } // getNestedResourceTypeThirdCreateRequest creates the GetNestedResourceTypeThird request. -func (client *SKUsClient) getNestedResourceTypeThirdCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, sku string, options *SKUsClientGetNestedResourceTypeThirdOptions) (*policy.Request, error) { +func (client *SKUsClient) getNestedResourceTypeThirdCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, sku string, _ *SKUsClientGetNestedResourceTypeThirdOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus/{sku}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -931,7 +928,7 @@ func (client *SKUsClient) getNestedResourceTypeThirdCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -948,7 +945,7 @@ func (client *SKUsClient) getNestedResourceTypeThirdHandleResponse(resp *http.Re // NewListByResourceTypeRegistrationsPager - Gets the list of skus for the given resource type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - options - SKUsClientListByResourceTypeRegistrationsOptions contains the optional parameters for the SKUsClient.NewListByResourceTypeRegistrationsPager @@ -977,7 +974,7 @@ func (client *SKUsClient) NewListByResourceTypeRegistrationsPager(providerNamesp } // listByResourceTypeRegistrationsCreateRequest creates the ListByResourceTypeRegistrations request. -func (client *SKUsClient) listByResourceTypeRegistrationsCreateRequest(ctx context.Context, providerNamespace string, resourceType string, options *SKUsClientListByResourceTypeRegistrationsOptions) (*policy.Request, error) { +func (client *SKUsClient) listByResourceTypeRegistrationsCreateRequest(ctx context.Context, providerNamespace string, resourceType string, _ *SKUsClientListByResourceTypeRegistrationsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -996,7 +993,7 @@ func (client *SKUsClient) listByResourceTypeRegistrationsCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1013,7 +1010,7 @@ func (client *SKUsClient) listByResourceTypeRegistrationsHandleResponse(resp *ht // NewListByResourceTypeRegistrationsNestedResourceTypeFirstPager - Gets the list of skus for the given resource type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - nestedResourceTypeFirst - The first child resource type. @@ -1043,7 +1040,7 @@ func (client *SKUsClient) NewListByResourceTypeRegistrationsNestedResourceTypeFi } // listByResourceTypeRegistrationsNestedResourceTypeFirstCreateRequest creates the ListByResourceTypeRegistrationsNestedResourceTypeFirst request. -func (client *SKUsClient) listByResourceTypeRegistrationsNestedResourceTypeFirstCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, options *SKUsClientListByResourceTypeRegistrationsNestedResourceTypeFirstOptions) (*policy.Request, error) { +func (client *SKUsClient) listByResourceTypeRegistrationsNestedResourceTypeFirstCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, _ *SKUsClientListByResourceTypeRegistrationsNestedResourceTypeFirstOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -1066,7 +1063,7 @@ func (client *SKUsClient) listByResourceTypeRegistrationsNestedResourceTypeFirst return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1083,7 +1080,7 @@ func (client *SKUsClient) listByResourceTypeRegistrationsNestedResourceTypeFirst // NewListByResourceTypeRegistrationsNestedResourceTypeSecondPager - Gets the list of skus for the given resource type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - nestedResourceTypeFirst - The first child resource type. @@ -1114,7 +1111,7 @@ func (client *SKUsClient) NewListByResourceTypeRegistrationsNestedResourceTypeSe } // listByResourceTypeRegistrationsNestedResourceTypeSecondCreateRequest creates the ListByResourceTypeRegistrationsNestedResourceTypeSecond request. -func (client *SKUsClient) listByResourceTypeRegistrationsNestedResourceTypeSecondCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, options *SKUsClientListByResourceTypeRegistrationsNestedResourceTypeSecondOptions) (*policy.Request, error) { +func (client *SKUsClient) listByResourceTypeRegistrationsNestedResourceTypeSecondCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, _ *SKUsClientListByResourceTypeRegistrationsNestedResourceTypeSecondOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -1141,7 +1138,7 @@ func (client *SKUsClient) listByResourceTypeRegistrationsNestedResourceTypeSecon return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1158,7 +1155,7 @@ func (client *SKUsClient) listByResourceTypeRegistrationsNestedResourceTypeSecon // NewListByResourceTypeRegistrationsNestedResourceTypeThirdPager - Gets the list of skus for the given resource type. // -// Generated from API version 2020-11-20 +// Generated from API version 2024-09-01 // - providerNamespace - The name of the resource provider hosted within ProviderHub. // - resourceType - The resource type. // - nestedResourceTypeFirst - The first child resource type. @@ -1190,7 +1187,7 @@ func (client *SKUsClient) NewListByResourceTypeRegistrationsNestedResourceTypeTh } // listByResourceTypeRegistrationsNestedResourceTypeThirdCreateRequest creates the ListByResourceTypeRegistrationsNestedResourceTypeThird request. -func (client *SKUsClient) listByResourceTypeRegistrationsNestedResourceTypeThirdCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, options *SKUsClientListByResourceTypeRegistrationsNestedResourceTypeThirdOptions) (*policy.Request, error) { +func (client *SKUsClient) listByResourceTypeRegistrationsNestedResourceTypeThirdCreateRequest(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, _ *SKUsClientListByResourceTypeRegistrationsNestedResourceTypeThirdOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -1221,7 +1218,7 @@ func (client *SKUsClient) listByResourceTypeRegistrationsNestedResourceTypeThird return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-20") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/providerhub/armproviderhub/skus_client_example_test.go b/sdk/resourcemanager/providerhub/armproviderhub/skus_client_example_test.go deleted file mode 100644 index 8cc03d469b26..000000000000 --- a/sdk/resourcemanager/providerhub/armproviderhub/skus_client_example_test.go +++ /dev/null @@ -1,611 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armproviderhub_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/providerhub/armproviderhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_Get.json -func ExampleSKUsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSKUsClient().Get(ctx, "Microsoft.Contoso", "testResourceType", "testSku", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SKUResource = armproviderhub.SKUResource{ - // Name: to.Ptr("testSku"), - // Properties: &armproviderhub.SKUResourceProperties{ - // SKUSettings: []*armproviderhub.SKUSetting{ - // { - // Name: to.Ptr("freeSku"), - // Kind: to.Ptr("Standard"), - // Tier: to.Ptr("Tier1"), - // }, - // { - // Name: to.Ptr("premiumSku"), - // Costs: []*armproviderhub.SKUCost{ - // { - // MeterID: to.Ptr("xxx"), - // }}, - // Kind: to.Ptr("Premium"), - // Tier: to.Ptr("Tier2"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_CreateOrUpdate.json -func ExampleSKUsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSKUsClient().CreateOrUpdate(ctx, "Microsoft.Contoso", "testResourceType", "testSku", armproviderhub.SKUResource{ - Properties: &armproviderhub.SKUResourceProperties{ - SKUSettings: []*armproviderhub.SKUSetting{ - { - Name: to.Ptr("freeSku"), - Kind: to.Ptr("Standard"), - Tier: to.Ptr("Tier1"), - }, - { - Name: to.Ptr("premiumSku"), - Costs: []*armproviderhub.SKUCost{ - { - MeterID: to.Ptr("xxx"), - }}, - Kind: to.Ptr("Premium"), - Tier: to.Ptr("Tier2"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SKUResource = armproviderhub.SKUResource{ - // Name: to.Ptr("Microsoft.Contoso/"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_Delete.json -func ExampleSKUsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSKUsClient().Delete(ctx, "Microsoft.Contoso", "testResourceType", "testSku", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_GetNestedResourceTypeFirst.json -func ExampleSKUsClient_GetNestedResourceTypeFirst() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSKUsClient().GetNestedResourceTypeFirst(ctx, "Microsoft.Contoso", "testResourceType", "nestedResourceTypeFirst", "testSku", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SKUResource = armproviderhub.SKUResource{ - // Name: to.Ptr("testSku"), - // Properties: &armproviderhub.SKUResourceProperties{ - // SKUSettings: []*armproviderhub.SKUSetting{ - // { - // Name: to.Ptr("freeSku"), - // Kind: to.Ptr("Standard"), - // Tier: to.Ptr("Tier1"), - // }, - // { - // Name: to.Ptr("premiumSku"), - // Costs: []*armproviderhub.SKUCost{ - // { - // MeterID: to.Ptr("xxx"), - // }}, - // Kind: to.Ptr("Premium"), - // Tier: to.Ptr("Tier2"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_CreateOrUpdateNestedResourceTypeFirst.json -func ExampleSKUsClient_CreateOrUpdateNestedResourceTypeFirst() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSKUsClient().CreateOrUpdateNestedResourceTypeFirst(ctx, "Microsoft.Contoso", "testResourceType", "nestedResourceTypeFirst", "testSku", armproviderhub.SKUResource{ - Properties: &armproviderhub.SKUResourceProperties{ - SKUSettings: []*armproviderhub.SKUSetting{ - { - Name: to.Ptr("freeSku"), - Kind: to.Ptr("Standard"), - Tier: to.Ptr("Tier1"), - }, - { - Name: to.Ptr("premiumSku"), - Costs: []*armproviderhub.SKUCost{ - { - MeterID: to.Ptr("xxx"), - }}, - Kind: to.Ptr("Premium"), - Tier: to.Ptr("Tier2"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SKUResource = armproviderhub.SKUResource{ - // Name: to.Ptr("Microsoft.Contoso/"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_DeleteNestedResourceTypeFirst.json -func ExampleSKUsClient_DeleteNestedResourceTypeFirst() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSKUsClient().DeleteNestedResourceTypeFirst(ctx, "Microsoft.Contoso", "testResourceType", "nestedResourceTypeFirst", "testSku", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_GetNestedResourceTypeSecond.json -func ExampleSKUsClient_GetNestedResourceTypeSecond() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSKUsClient().GetNestedResourceTypeSecond(ctx, "Microsoft.Contoso", "testResourceType", "nestedResourceTypeFirst", "nestedResourceTypeSecond", "testSku", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SKUResource = armproviderhub.SKUResource{ - // Name: to.Ptr("testSku"), - // Properties: &armproviderhub.SKUResourceProperties{ - // SKUSettings: []*armproviderhub.SKUSetting{ - // { - // Name: to.Ptr("freeSku"), - // Kind: to.Ptr("Standard"), - // Tier: to.Ptr("Tier1"), - // }, - // { - // Name: to.Ptr("premiumSku"), - // Costs: []*armproviderhub.SKUCost{ - // { - // MeterID: to.Ptr("xxx"), - // }}, - // Kind: to.Ptr("Premium"), - // Tier: to.Ptr("Tier2"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_CreateOrUpdateNestedResourceTypeSecond.json -func ExampleSKUsClient_CreateOrUpdateNestedResourceTypeSecond() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSKUsClient().CreateOrUpdateNestedResourceTypeSecond(ctx, "Microsoft.Contoso", "testResourceType", "nestedResourceTypeFirst", "nestedResourceTypeSecond", "testSku", armproviderhub.SKUResource{ - Properties: &armproviderhub.SKUResourceProperties{ - SKUSettings: []*armproviderhub.SKUSetting{ - { - Name: to.Ptr("freeSku"), - Kind: to.Ptr("Standard"), - Tier: to.Ptr("Tier1"), - }, - { - Name: to.Ptr("premiumSku"), - Costs: []*armproviderhub.SKUCost{ - { - MeterID: to.Ptr("xxx"), - }}, - Kind: to.Ptr("Premium"), - Tier: to.Ptr("Tier2"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SKUResource = armproviderhub.SKUResource{ - // Name: to.Ptr("Microsoft.Contoso/"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_DeleteNestedResourceTypeSecond.json -func ExampleSKUsClient_DeleteNestedResourceTypeSecond() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSKUsClient().DeleteNestedResourceTypeSecond(ctx, "Microsoft.Contoso", "testResourceType", "nestedResourceTypeFirst", "nestedResourceTypeSecond", "testSku", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_GetNestedResourceTypeThird.json -func ExampleSKUsClient_GetNestedResourceTypeThird() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSKUsClient().GetNestedResourceTypeThird(ctx, "Microsoft.Contoso", "testResourceType", "nestedResourceTypeFirst", "nestedResourceTypeSecond", "nestedResourceTypeThird", "testSku", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SKUResource = armproviderhub.SKUResource{ - // Name: to.Ptr("testSku"), - // Properties: &armproviderhub.SKUResourceProperties{ - // SKUSettings: []*armproviderhub.SKUSetting{ - // { - // Name: to.Ptr("freeSku"), - // Kind: to.Ptr("Standard"), - // Tier: to.Ptr("Tier1"), - // }, - // { - // Name: to.Ptr("premiumSku"), - // Costs: []*armproviderhub.SKUCost{ - // { - // MeterID: to.Ptr("xxx"), - // }}, - // Kind: to.Ptr("Premium"), - // Tier: to.Ptr("Tier2"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_CreateOrUpdateNestedResourceTypeThird.json -func ExampleSKUsClient_CreateOrUpdateNestedResourceTypeThird() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSKUsClient().CreateOrUpdateNestedResourceTypeThird(ctx, "Microsoft.Contoso", "testResourceType", "nestedResourceTypeFirst", "nestedResourceTypeSecond", "nestedResourceTypeThird", "testSku", armproviderhub.SKUResource{ - Properties: &armproviderhub.SKUResourceProperties{ - SKUSettings: []*armproviderhub.SKUSetting{ - { - Name: to.Ptr("freeSku"), - Kind: to.Ptr("Standard"), - Tier: to.Ptr("Tier1"), - }, - { - Name: to.Ptr("premiumSku"), - Costs: []*armproviderhub.SKUCost{ - { - MeterID: to.Ptr("xxx"), - }}, - Kind: to.Ptr("Premium"), - Tier: to.Ptr("Tier2"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SKUResource = armproviderhub.SKUResource{ - // Name: to.Ptr("Microsoft.Contoso/"), - // Type: to.Ptr("Microsoft.ProviderHub/providerRegistrations/"), - // ID: to.Ptr("/subscriptions/ab7a8701-f7ef-471a-a2f4-d0ebbf494f77providers/Microsoft.ProviderHub/providerRegistrations/Microsoft.Contoso/"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_DeleteNestedResourceTypeThird.json -func ExampleSKUsClient_DeleteNestedResourceTypeThird() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSKUsClient().DeleteNestedResourceTypeThird(ctx, "Microsoft.Contoso", "testResourceType", "nestedResourceTypeFirst", "nestedResourceTypeSecond", "nestedResourceTypeThird", "testSku", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_ListByResourceTypeRegistrations.json -func ExampleSKUsClient_NewListByResourceTypeRegistrationsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSKUsClient().NewListByResourceTypeRegistrationsPager("Microsoft.Contoso", "testResourceType", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SKUResourceArrayResponseWithContinuation = armproviderhub.SKUResourceArrayResponseWithContinuation{ - // Value: []*armproviderhub.SKUResource{ - // { - // Name: to.Ptr("testSku"), - // Properties: &armproviderhub.SKUResourceProperties{ - // SKUSettings: []*armproviderhub.SKUSetting{ - // { - // Name: to.Ptr("freeSku"), - // Kind: to.Ptr("Standard"), - // Tier: to.Ptr("Tier1"), - // }, - // { - // Name: to.Ptr("premiumSku"), - // Costs: []*armproviderhub.SKUCost{ - // { - // MeterID: to.Ptr("xxx"), - // }}, - // Kind: to.Ptr("Premium"), - // Tier: to.Ptr("Tier2"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_ListByResourceTypeRegistrationsNestedResourceTypeFirst.json -func ExampleSKUsClient_NewListByResourceTypeRegistrationsNestedResourceTypeFirstPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSKUsClient().NewListByResourceTypeRegistrationsNestedResourceTypeFirstPager("Microsoft.Contoso", "testResourceType", "nestedResourceTypeFirst", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SKUResourceArrayResponseWithContinuation = armproviderhub.SKUResourceArrayResponseWithContinuation{ - // Value: []*armproviderhub.SKUResource{ - // { - // Name: to.Ptr("testSku"), - // Properties: &armproviderhub.SKUResourceProperties{ - // SKUSettings: []*armproviderhub.SKUSetting{ - // { - // Name: to.Ptr("freeSku"), - // Kind: to.Ptr("Standard"), - // Tier: to.Ptr("Tier1"), - // }, - // { - // Name: to.Ptr("premiumSku"), - // Costs: []*armproviderhub.SKUCost{ - // { - // MeterID: to.Ptr("xxx"), - // }}, - // Kind: to.Ptr("Premium"), - // Tier: to.Ptr("Tier2"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_ListByResourceTypeRegistrationsNestedResourceTypeSecond.json -func ExampleSKUsClient_NewListByResourceTypeRegistrationsNestedResourceTypeSecondPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSKUsClient().NewListByResourceTypeRegistrationsNestedResourceTypeSecondPager("Microsoft.Contoso", "testResourceType", "nestedResourceTypeFirst", "nestedResourceTypeSecond", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SKUResourceArrayResponseWithContinuation = armproviderhub.SKUResourceArrayResponseWithContinuation{ - // Value: []*armproviderhub.SKUResource{ - // { - // Name: to.Ptr("testSku"), - // Properties: &armproviderhub.SKUResourceProperties{ - // SKUSettings: []*armproviderhub.SKUSetting{ - // { - // Name: to.Ptr("freeSku"), - // Kind: to.Ptr("Standard"), - // Tier: to.Ptr("Tier1"), - // }, - // { - // Name: to.Ptr("premiumSku"), - // Costs: []*armproviderhub.SKUCost{ - // { - // MeterID: to.Ptr("xxx"), - // }}, - // Kind: to.Ptr("Premium"), - // Tier: to.Ptr("Tier2"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/examples/Skus_ListByResourceTypeRegistrationsNestedResourceTypeThird.json -func ExampleSKUsClient_NewListByResourceTypeRegistrationsNestedResourceTypeThirdPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armproviderhub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSKUsClient().NewListByResourceTypeRegistrationsNestedResourceTypeThirdPager("Microsoft.Contoso", "testResourceType", "nestedResourceTypeFirst", "nestedResourceTypeSecond", "nestedResourceTypeThird", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SKUResourceArrayResponseWithContinuation = armproviderhub.SKUResourceArrayResponseWithContinuation{ - // Value: []*armproviderhub.SKUResource{ - // { - // Name: to.Ptr("testSku"), - // Properties: &armproviderhub.SKUResourceProperties{ - // SKUSettings: []*armproviderhub.SKUSetting{ - // { - // Name: to.Ptr("freeSku"), - // Kind: to.Ptr("Standard"), - // Tier: to.Ptr("Tier1"), - // }, - // { - // Name: to.Ptr("premiumSku"), - // Costs: []*armproviderhub.SKUCost{ - // { - // MeterID: to.Ptr("xxx"), - // }}, - // Kind: to.Ptr("Premium"), - // Tier: to.Ptr("Tier2"), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/providerhub/armproviderhub/time_rfc3339.go b/sdk/resourcemanager/providerhub/armproviderhub/time_rfc3339.go index c2e7b08b8c59..5d343e62ddc5 100644 --- a/sdk/resourcemanager/providerhub/armproviderhub/time_rfc3339.go +++ b/sdk/resourcemanager/providerhub/armproviderhub/time_rfc3339.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -19,12 +16,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +41,36 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + if len(data) == 0 { + return nil + } + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339