diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/CHANGELOG.md b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/CHANGELOG.md index 719044fdabec..907beb8c0bc9 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/CHANGELOG.md +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/CHANGELOG.md @@ -1,5 +1,408 @@ # Release History +## 2.0.0 (2023-10-25) +### Breaking Changes + +- Type of `NetworkFunction.Properties` has been changed from `*NetworkFunctionPropertiesFormat` to `NetworkFunctionPropertiesFormatClassification` +- `StatusDeleted`, `StatusNotRegistered`, `StatusRegistered` from enum `Status` has been removed +- Enum `DeviceType` has been removed +- Enum `DiskCreateOptionTypes` has been removed +- Enum `IPAllocationMethod` has been removed +- Enum `IPVersion` has been removed +- Enum `NetworkFunctionRoleConfigurationType` has been removed +- Enum `OperatingSystemTypes` has been removed +- Enum `OperationalState` has been removed +- Enum `SKUDeploymentMode` has been removed +- Enum `SKUType` has been removed +- Enum `VMSwitchType` has been removed +- Enum `VendorProvisioningState` has been removed +- Enum `VirtualMachineSizeTypes` has been removed +- Function `*AzureStackEdgeFormat.GetDevicePropertiesFormat` has been removed +- Function `*ClientFactory.NewDevicesClient` has been removed +- Function `*ClientFactory.NewNetworkFunctionVendorSKUsClient` has been removed +- Function `*ClientFactory.NewNetworkFunctionVendorsClient` has been removed +- Function `*ClientFactory.NewRoleInstancesClient` has been removed +- Function `*ClientFactory.NewVendorNetworkFunctionsClient` has been removed +- Function `*ClientFactory.NewVendorSKUPreviewClient` has been removed +- Function `*ClientFactory.NewVendorSKUsClient` has been removed +- Function `*ClientFactory.NewVendorsClient` has been removed +- Function `*DevicePropertiesFormat.GetDevicePropertiesFormat` has been removed +- Function `NewDevicesClient` has been removed +- Function `*DevicesClient.BeginCreateOrUpdate` has been removed +- Function `*DevicesClient.BeginDelete` has been removed +- Function `*DevicesClient.Get` has been removed +- Function `*DevicesClient.NewListByResourceGroupPager` has been removed +- Function `*DevicesClient.NewListBySubscriptionPager` has been removed +- Function `*DevicesClient.ListRegistrationKey` has been removed +- Function `*DevicesClient.UpdateTags` has been removed +- Function `NewRoleInstancesClient` has been removed +- Function `*RoleInstancesClient.Get` has been removed +- Function `*RoleInstancesClient.NewListPager` has been removed +- Function `*RoleInstancesClient.BeginRestart` has been removed +- Function `*RoleInstancesClient.BeginStart` has been removed +- Function `*RoleInstancesClient.BeginStop` has been removed +- Function `NewVendorNetworkFunctionsClient` has been removed +- Function `*VendorNetworkFunctionsClient.BeginCreateOrUpdate` has been removed +- Function `*VendorNetworkFunctionsClient.Get` has been removed +- Function `*VendorNetworkFunctionsClient.NewListPager` has been removed +- Function `NewVendorSKUPreviewClient` has been removed +- Function `*VendorSKUPreviewClient.BeginCreateOrUpdate` has been removed +- Function `*VendorSKUPreviewClient.BeginDelete` has been removed +- Function `*VendorSKUPreviewClient.Get` has been removed +- Function `*VendorSKUPreviewClient.NewListPager` has been removed +- Function `NewVendorSKUsClient` has been removed +- Function `*VendorSKUsClient.BeginCreateOrUpdate` has been removed +- Function `*VendorSKUsClient.BeginDelete` has been removed +- Function `*VendorSKUsClient.Get` has been removed +- Function `*VendorSKUsClient.NewListPager` has been removed +- Function `NewVendorsClient` has been removed +- Function `*VendorsClient.BeginCreateOrUpdate` has been removed +- Function `*VendorsClient.BeginDelete` has been removed +- Function `*VendorsClient.Get` has been removed +- Function `*VendorsClient.NewListBySubscriptionPager` has been removed +- Function `NewNetworkFunctionVendorSKUsClient` has been removed +- Function `*NetworkFunctionVendorSKUsClient.NewListBySKUPager` has been removed +- Function `*NetworkFunctionVendorSKUsClient.NewListByVendorPager` has been removed +- Function `NewNetworkFunctionVendorsClient` has been removed +- Function `*NetworkFunctionVendorsClient.NewListPager` has been removed +- Struct `AzureStackEdgeFormat` has been removed +- Struct `CustomProfile` has been removed +- Struct `DataDisk` has been removed +- Struct `Device` has been removed +- Struct `DeviceListResult` has been removed +- Struct `DeviceRegistrationKey` has been removed +- Struct `ImageReference` has been removed +- Struct `LinuxConfiguration` has been removed +- Struct `NetworkFunctionRoleConfiguration` has been removed +- Struct `NetworkFunctionRoleInstanceListResult` has been removed +- Struct `NetworkFunctionSKUDetails` has been removed +- Struct `NetworkFunctionSKUListResult` has been removed +- Struct `NetworkFunctionSKURoleDetails` has been removed +- Struct `NetworkFunctionTemplate` has been removed +- Struct `NetworkFunctionUserConfiguration` has been removed +- Struct `NetworkFunctionUserConfigurationOsProfile` has been removed +- Struct `NetworkFunctionVendor` has been removed +- Struct `NetworkFunctionVendorConfiguration` has been removed +- Struct `NetworkFunctionVendorListResult` has been removed +- Struct `NetworkInterface` has been removed +- Struct `NetworkInterfaceIPConfiguration` has been removed +- Struct `OperationList` has been removed +- Struct `OsDisk` has been removed +- Struct `OsProfile` has been removed +- Struct `PreviewSubscription` has been removed +- Struct `PreviewSubscriptionProperties` has been removed +- Struct `PreviewSubscriptionsList` has been removed +- Struct `RoleInstance` has been removed +- Struct `RoleInstanceProperties` has been removed +- Struct `SKUOverview` has been removed +- Struct `SSHConfiguration` has been removed +- Struct `SSHPublicKey` has been removed +- Struct `StorageProfile` has been removed +- Struct `SubResource` has been removed +- Struct `Vendor` has been removed +- Struct `VendorDetails` has been removed +- Struct `VendorListResult` has been removed +- Struct `VendorNetworkFunction` has been removed +- Struct `VendorNetworkFunctionListResult` has been removed +- Struct `VendorNetworkFunctionPropertiesFormat` has been removed +- Struct `VendorPropertiesFormat` has been removed +- Struct `VendorSKU` has been removed +- Struct `VendorSKUListResult` has been removed +- Struct `VendorSKUPropertiesFormat` has been removed +- Struct `VirtualHardDisk` has been removed +- Field `Device`, `ManagedApplication`, `ManagedApplicationParameters`, `NetworkFunctionContainerConfigurations`, `NetworkFunctionUserConfigurations`, `SKUName`, `SKUType`, `ServiceKey`, `VendorName`, `VendorProvisioningState` of struct `NetworkFunctionPropertiesFormat` has been removed +- Field `OperationList` of struct `OperationsClientListResponse` has been removed + +### Features Added + +- New value `ProvisioningStateConverging` added to enum type `ProvisioningState` +- New value `StatusDeployed`, `StatusDownloading`, `StatusFailed`, `StatusInstalling`, `StatusPendingInstall`, `StatusPendingRollback`, `StatusPendingUpgrade`, `StatusReinstalling`, `StatusRollingback`, `StatusSuperseded`, `StatusUninstalled`, `StatusUninstalling`, `StatusUpgrading` added to enum type `Status` +- New enum type `ActionType` with values `ActionTypeInternal` +- New enum type `ApplicationEnablement` with values `ApplicationEnablementDisabled`, `ApplicationEnablementEnabled`, `ApplicationEnablementUnknown` +- New enum type `ArtifactManifestState` with values `ArtifactManifestStateSucceeded`, `ArtifactManifestStateUnknown`, `ArtifactManifestStateUploaded`, `ArtifactManifestStateUploading`, `ArtifactManifestStateValidating`, `ArtifactManifestStateValidationFailed` +- New enum type `ArtifactReplicationStrategy` with values `ArtifactReplicationStrategySingleReplication`, `ArtifactReplicationStrategyUnknown` +- New enum type `ArtifactState` with values `ArtifactStateActive`, `ArtifactStateDeprecated`, `ArtifactStatePreview`, `ArtifactStateUnknown` +- New enum type `ArtifactStoreType` with values `ArtifactStoreTypeAzureContainerRegistry`, `ArtifactStoreTypeAzureStorageAccount`, `ArtifactStoreTypeUnknown` +- New enum type `ArtifactType` with values `ArtifactTypeArmTemplate`, `ArtifactTypeImageFile`, `ArtifactTypeOCIArtifact`, `ArtifactTypeUnknown`, `ArtifactTypeVhdImageFile` +- New enum type `AzureArcKubernetesArtifactType` with values `AzureArcKubernetesArtifactTypeHelmPackage`, `AzureArcKubernetesArtifactTypeUnknown` +- New enum type `AzureCoreArtifactType` with values `AzureCoreArtifactTypeArmTemplate`, `AzureCoreArtifactTypeUnknown`, `AzureCoreArtifactTypeVhdImageFile` +- New enum type `AzureOperatorNexusArtifactType` with values `AzureOperatorNexusArtifactTypeArmTemplate`, `AzureOperatorNexusArtifactTypeImageFile`, `AzureOperatorNexusArtifactTypeUnknown` +- New enum type `ConfigurationGenerationType` with values `ConfigurationGenerationTypeHandlebarTemplate`, `ConfigurationGenerationTypeUnknown` +- New enum type `ConfigurationGroupValueConfigurationType` with values `ConfigurationGroupValueConfigurationTypeOpen`, `ConfigurationGroupValueConfigurationTypeSecret`, `ConfigurationGroupValueConfigurationTypeUnknown` +- New enum type `ContainerizedNetworkFunctionNFVIType` with values `ContainerizedNetworkFunctionNFVITypeAzureArcKubernetes`, `ContainerizedNetworkFunctionNFVITypeUnknown` +- New enum type `CredentialType` with values `CredentialTypeAzureContainerRegistryScopedToken`, `CredentialTypeAzureStorageAccountToken`, `CredentialTypeUnknown` +- New enum type `HTTPMethod` with values `HTTPMethodDelete`, `HTTPMethodGet`, `HTTPMethodPatch`, `HTTPMethodPost`, `HTTPMethodPut`, `HTTPMethodUnknown` +- New enum type `IDType` with values `IDTypeOpen`, `IDTypeSecret`, `IDTypeUnknown` +- New enum type `ManagedServiceIdentityType` with values `ManagedServiceIdentityTypeNone`, `ManagedServiceIdentityTypeSystemAssigned`, `ManagedServiceIdentityTypeSystemAssignedUserAssigned`, `ManagedServiceIdentityTypeUserAssigned` +- New enum type `NFVIType` with values `NFVITypeAzureArcKubernetes`, `NFVITypeAzureCore`, `NFVITypeAzureOperatorNexus`, `NFVITypeUnknown` +- New enum type `NetworkFunctionConfigurationType` with values `NetworkFunctionConfigurationTypeOpen`, `NetworkFunctionConfigurationTypeSecret`, `NetworkFunctionConfigurationTypeUnknown` +- New enum type `Origin` with values `OriginSystem`, `OriginUser`, `OriginUserSystem` +- New enum type `PodEventType` with values `PodEventTypeNormal`, `PodEventTypeWarning` +- New enum type `PodStatus` with values `PodStatusFailed`, `PodStatusNotReady`, `PodStatusPending`, `PodStatusRunning`, `PodStatusSucceeded`, `PodStatusTerminating`, `PodStatusUnknown` +- New enum type `PublisherScope` with values `PublisherScopePrivate`, `PublisherScopeUnknown` +- New enum type `SKUName` with values `SKUNameBasic`, `SKUNameStandard` +- New enum type `SKUTier` with values `SKUTierBasic`, `SKUTierStandard` +- New enum type `TemplateType` with values `TemplateTypeArmTemplate`, `TemplateTypeUnknown` +- New enum type `Type` with values `TypeArmResourceDefinition`, `TypeNetworkFunctionDefinition`, `TypeUnknown` +- New enum type `VersionState` with values `VersionStateActive`, `VersionStateDeprecated`, `VersionStatePreview`, `VersionStateUnknown`, `VersionStateValidating`, `VersionStateValidationFailed` +- New enum type `VirtualNetworkFunctionNFVIType` with values `VirtualNetworkFunctionNFVITypeAzureCore`, `VirtualNetworkFunctionNFVITypeAzureOperatorNexus`, `VirtualNetworkFunctionNFVITypeUnknown` +- New function `*ArmResourceDefinitionResourceElementTemplateDetails.GetResourceElementTemplate() *ResourceElementTemplate` +- New function `*ArtifactAccessCredential.GetArtifactAccessCredential() *ArtifactAccessCredential` +- New function `NewArtifactManifestsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ArtifactManifestsClient, error)` +- New function `*ArtifactManifestsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, ArtifactManifest, *ArtifactManifestsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ArtifactManifestsClientCreateOrUpdateResponse], error)` +- New function `*ArtifactManifestsClient.BeginDelete(context.Context, string, string, string, string, *ArtifactManifestsClientBeginDeleteOptions) (*runtime.Poller[ArtifactManifestsClientDeleteResponse], error)` +- New function `*ArtifactManifestsClient.Get(context.Context, string, string, string, string, *ArtifactManifestsClientGetOptions) (ArtifactManifestsClientGetResponse, error)` +- New function `*ArtifactManifestsClient.NewListByArtifactStorePager(string, string, string, *ArtifactManifestsClientListByArtifactStoreOptions) *runtime.Pager[ArtifactManifestsClientListByArtifactStoreResponse]` +- New function `*ArtifactManifestsClient.ListCredential(context.Context, string, string, string, string, *ArtifactManifestsClientListCredentialOptions) (ArtifactManifestsClientListCredentialResponse, error)` +- New function `*ArtifactManifestsClient.Update(context.Context, string, string, string, string, TagsObject, *ArtifactManifestsClientUpdateOptions) (ArtifactManifestsClientUpdateResponse, error)` +- New function `*ArtifactManifestsClient.BeginUpdateState(context.Context, string, string, string, string, ArtifactManifestUpdateState, *ArtifactManifestsClientBeginUpdateStateOptions) (*runtime.Poller[ArtifactManifestsClientUpdateStateResponse], error)` +- New function `NewArtifactStoresClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ArtifactStoresClient, error)` +- New function `*ArtifactStoresClient.BeginCreateOrUpdate(context.Context, string, string, string, ArtifactStore, *ArtifactStoresClientBeginCreateOrUpdateOptions) (*runtime.Poller[ArtifactStoresClientCreateOrUpdateResponse], error)` +- New function `*ArtifactStoresClient.BeginDelete(context.Context, string, string, string, *ArtifactStoresClientBeginDeleteOptions) (*runtime.Poller[ArtifactStoresClientDeleteResponse], error)` +- New function `*ArtifactStoresClient.Get(context.Context, string, string, string, *ArtifactStoresClientGetOptions) (ArtifactStoresClientGetResponse, error)` +- New function `*ArtifactStoresClient.NewListByPublisherPager(string, string, *ArtifactStoresClientListByPublisherOptions) *runtime.Pager[ArtifactStoresClientListByPublisherResponse]` +- New function `*ArtifactStoresClient.Update(context.Context, string, string, string, TagsObject, *ArtifactStoresClientUpdateOptions) (ArtifactStoresClientUpdateResponse, error)` +- New function `*AzureArcK8SClusterNFVIDetails.GetNFVIs() *NFVIs` +- New function `*AzureArcKubernetesHelmApplication.GetAzureArcKubernetesNetworkFunctionApplication() *AzureArcKubernetesNetworkFunctionApplication` +- New function `*AzureArcKubernetesNetworkFunctionApplication.GetAzureArcKubernetesNetworkFunctionApplication() *AzureArcKubernetesNetworkFunctionApplication` +- New function `*AzureArcKubernetesNetworkFunctionTemplate.GetContainerizedNetworkFunctionTemplate() *ContainerizedNetworkFunctionTemplate` +- New function `*AzureContainerRegistryScopedTokenCredential.GetArtifactAccessCredential() *ArtifactAccessCredential` +- New function `*AzureCoreNFVIDetails.GetNFVIs() *NFVIs` +- New function `*AzureCoreNetworkFunctionApplication.GetAzureCoreNetworkFunctionApplication() *AzureCoreNetworkFunctionApplication` +- New function `*AzureCoreNetworkFunctionArmTemplateApplication.GetAzureCoreNetworkFunctionApplication() *AzureCoreNetworkFunctionApplication` +- New function `*AzureCoreNetworkFunctionTemplate.GetVirtualNetworkFunctionTemplate() *VirtualNetworkFunctionTemplate` +- New function `*AzureCoreNetworkFunctionVhdApplication.GetAzureCoreNetworkFunctionApplication() *AzureCoreNetworkFunctionApplication` +- New function `*AzureOperatorNexusClusterNFVIDetails.GetNFVIs() *NFVIs` +- New function `*AzureOperatorNexusNetworkFunctionApplication.GetAzureOperatorNexusNetworkFunctionApplication() *AzureOperatorNexusNetworkFunctionApplication` +- New function `*AzureOperatorNexusNetworkFunctionArmTemplateApplication.GetAzureOperatorNexusNetworkFunctionApplication() *AzureOperatorNexusNetworkFunctionApplication` +- New function `*AzureOperatorNexusNetworkFunctionImageApplication.GetAzureOperatorNexusNetworkFunctionApplication() *AzureOperatorNexusNetworkFunctionApplication` +- New function `*AzureOperatorNexusNetworkFunctionTemplate.GetVirtualNetworkFunctionTemplate() *VirtualNetworkFunctionTemplate` +- New function `*AzureStorageAccountCredential.GetArtifactAccessCredential() *ArtifactAccessCredential` +- New function `*ClientFactory.NewArtifactManifestsClient() *ArtifactManifestsClient` +- New function `*ClientFactory.NewArtifactStoresClient() *ArtifactStoresClient` +- New function `*ClientFactory.NewComponentsClient() *ComponentsClient` +- New function `*ClientFactory.NewConfigurationGroupSchemasClient() *ConfigurationGroupSchemasClient` +- New function `*ClientFactory.NewConfigurationGroupValuesClient() *ConfigurationGroupValuesClient` +- New function `*ClientFactory.NewNetworkFunctionDefinitionGroupsClient() *NetworkFunctionDefinitionGroupsClient` +- New function `*ClientFactory.NewNetworkFunctionDefinitionVersionsClient() *NetworkFunctionDefinitionVersionsClient` +- New function `*ClientFactory.NewNetworkServiceDesignGroupsClient() *NetworkServiceDesignGroupsClient` +- New function `*ClientFactory.NewNetworkServiceDesignVersionsClient() *NetworkServiceDesignVersionsClient` +- New function `*ClientFactory.NewProxyArtifactClient() *ProxyArtifactClient` +- New function `*ClientFactory.NewPublishersClient() *PublishersClient` +- New function `*ClientFactory.NewSiteNetworkServicesClient() *SiteNetworkServicesClient` +- New function `*ClientFactory.NewSitesClient() *SitesClient` +- New function `NewComponentsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ComponentsClient, error)` +- New function `*ComponentsClient.Get(context.Context, string, string, string, *ComponentsClientGetOptions) (ComponentsClientGetResponse, error)` +- New function `*ComponentsClient.NewListByNetworkFunctionPager(string, string, *ComponentsClientListByNetworkFunctionOptions) *runtime.Pager[ComponentsClientListByNetworkFunctionResponse]` +- New function `NewConfigurationGroupSchemasClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ConfigurationGroupSchemasClient, error)` +- New function `*ConfigurationGroupSchemasClient.BeginCreateOrUpdate(context.Context, string, string, string, ConfigurationGroupSchema, *ConfigurationGroupSchemasClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConfigurationGroupSchemasClientCreateOrUpdateResponse], error)` +- New function `*ConfigurationGroupSchemasClient.BeginDelete(context.Context, string, string, string, *ConfigurationGroupSchemasClientBeginDeleteOptions) (*runtime.Poller[ConfigurationGroupSchemasClientDeleteResponse], error)` +- New function `*ConfigurationGroupSchemasClient.Get(context.Context, string, string, string, *ConfigurationGroupSchemasClientGetOptions) (ConfigurationGroupSchemasClientGetResponse, error)` +- New function `*ConfigurationGroupSchemasClient.NewListByPublisherPager(string, string, *ConfigurationGroupSchemasClientListByPublisherOptions) *runtime.Pager[ConfigurationGroupSchemasClientListByPublisherResponse]` +- New function `*ConfigurationGroupSchemasClient.Update(context.Context, string, string, string, TagsObject, *ConfigurationGroupSchemasClientUpdateOptions) (ConfigurationGroupSchemasClientUpdateResponse, error)` +- New function `*ConfigurationGroupSchemasClient.BeginUpdateState(context.Context, string, string, string, ConfigurationGroupSchemaVersionUpdateState, *ConfigurationGroupSchemasClientBeginUpdateStateOptions) (*runtime.Poller[ConfigurationGroupSchemasClientUpdateStateResponse], error)` +- New function `*ConfigurationGroupValuePropertiesFormat.GetConfigurationGroupValuePropertiesFormat() *ConfigurationGroupValuePropertiesFormat` +- New function `NewConfigurationGroupValuesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ConfigurationGroupValuesClient, error)` +- New function `*ConfigurationGroupValuesClient.BeginCreateOrUpdate(context.Context, string, string, ConfigurationGroupValue, *ConfigurationGroupValuesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConfigurationGroupValuesClientCreateOrUpdateResponse], error)` +- New function `*ConfigurationGroupValuesClient.BeginDelete(context.Context, string, string, *ConfigurationGroupValuesClientBeginDeleteOptions) (*runtime.Poller[ConfigurationGroupValuesClientDeleteResponse], error)` +- New function `*ConfigurationGroupValuesClient.Get(context.Context, string, string, *ConfigurationGroupValuesClientGetOptions) (ConfigurationGroupValuesClientGetResponse, error)` +- New function `*ConfigurationGroupValuesClient.NewListByResourceGroupPager(string, *ConfigurationGroupValuesClientListByResourceGroupOptions) *runtime.Pager[ConfigurationGroupValuesClientListByResourceGroupResponse]` +- New function `*ConfigurationGroupValuesClient.NewListBySubscriptionPager(*ConfigurationGroupValuesClientListBySubscriptionOptions) *runtime.Pager[ConfigurationGroupValuesClientListBySubscriptionResponse]` +- New function `*ConfigurationGroupValuesClient.UpdateTags(context.Context, string, string, TagsObject, *ConfigurationGroupValuesClientUpdateTagsOptions) (ConfigurationGroupValuesClientUpdateTagsResponse, error)` +- New function `*ConfigurationValueWithSecrets.GetConfigurationGroupValuePropertiesFormat() *ConfigurationGroupValuePropertiesFormat` +- New function `*ConfigurationValueWithoutSecrets.GetConfigurationGroupValuePropertiesFormat() *ConfigurationGroupValuePropertiesFormat` +- New function `*ContainerizedNetworkFunctionDefinitionVersion.GetNetworkFunctionDefinitionVersionPropertiesFormat() *NetworkFunctionDefinitionVersionPropertiesFormat` +- New function `*ContainerizedNetworkFunctionTemplate.GetContainerizedNetworkFunctionTemplate() *ContainerizedNetworkFunctionTemplate` +- New function `*DeploymentResourceIDReference.GetDeploymentResourceIDReference() *DeploymentResourceIDReference` +- New function `*NFVIs.GetNFVIs() *NFVIs` +- New function `*OpenDeploymentResourceReference.GetDeploymentResourceIDReference() *DeploymentResourceIDReference` +- New function `NewProxyArtifactClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ProxyArtifactClient, error)` +- New function `*ProxyArtifactClient.NewGetPager(string, string, string, string, *ProxyArtifactClientGetOptions) *runtime.Pager[ProxyArtifactClientGetResponse]` +- New function `*ProxyArtifactClient.NewListPager(string, string, string, *ProxyArtifactClientListOptions) *runtime.Pager[ProxyArtifactClientListResponse]` +- New function `*ProxyArtifactClient.BeginUpdateState(context.Context, string, string, string, string, string, ArtifactChangeState, *ProxyArtifactClientBeginUpdateStateOptions) (*runtime.Poller[ProxyArtifactClientUpdateStateResponse], error)` +- New function `NewPublishersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PublishersClient, error)` +- New function `*PublishersClient.BeginCreateOrUpdate(context.Context, string, string, *PublishersClientBeginCreateOrUpdateOptions) (*runtime.Poller[PublishersClientCreateOrUpdateResponse], error)` +- New function `*PublishersClient.BeginDelete(context.Context, string, string, *PublishersClientBeginDeleteOptions) (*runtime.Poller[PublishersClientDeleteResponse], error)` +- New function `*PublishersClient.Get(context.Context, string, string, *PublishersClientGetOptions) (PublishersClientGetResponse, error)` +- New function `*PublishersClient.NewListByResourceGroupPager(string, *PublishersClientListByResourceGroupOptions) *runtime.Pager[PublishersClientListByResourceGroupResponse]` +- New function `*PublishersClient.NewListBySubscriptionPager(*PublishersClientListBySubscriptionOptions) *runtime.Pager[PublishersClientListBySubscriptionResponse]` +- New function `*PublishersClient.Update(context.Context, string, string, *PublishersClientUpdateOptions) (PublishersClientUpdateResponse, error)` +- New function `*ResourceElementTemplate.GetResourceElementTemplate() *ResourceElementTemplate` +- New function `*SecretDeploymentResourceReference.GetDeploymentResourceIDReference() *DeploymentResourceIDReference` +- New function `NewSiteNetworkServicesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SiteNetworkServicesClient, error)` +- New function `*SiteNetworkServicesClient.BeginCreateOrUpdate(context.Context, string, string, SiteNetworkService, *SiteNetworkServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SiteNetworkServicesClientCreateOrUpdateResponse], error)` +- New function `*SiteNetworkServicesClient.BeginDelete(context.Context, string, string, *SiteNetworkServicesClientBeginDeleteOptions) (*runtime.Poller[SiteNetworkServicesClientDeleteResponse], error)` +- New function `*SiteNetworkServicesClient.Get(context.Context, string, string, *SiteNetworkServicesClientGetOptions) (SiteNetworkServicesClientGetResponse, error)` +- New function `*SiteNetworkServicesClient.NewListByResourceGroupPager(string, *SiteNetworkServicesClientListByResourceGroupOptions) *runtime.Pager[SiteNetworkServicesClientListByResourceGroupResponse]` +- New function `*SiteNetworkServicesClient.NewListBySubscriptionPager(*SiteNetworkServicesClientListBySubscriptionOptions) *runtime.Pager[SiteNetworkServicesClientListBySubscriptionResponse]` +- New function `*SiteNetworkServicesClient.UpdateTags(context.Context, string, string, TagsObject, *SiteNetworkServicesClientUpdateTagsOptions) (SiteNetworkServicesClientUpdateTagsResponse, error)` +- New function `NewSitesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SitesClient, error)` +- New function `*SitesClient.BeginCreateOrUpdate(context.Context, string, string, Site, *SitesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SitesClientCreateOrUpdateResponse], error)` +- New function `*SitesClient.BeginDelete(context.Context, string, string, *SitesClientBeginDeleteOptions) (*runtime.Poller[SitesClientDeleteResponse], error)` +- New function `*SitesClient.Get(context.Context, string, string, *SitesClientGetOptions) (SitesClientGetResponse, error)` +- New function `*SitesClient.NewListByResourceGroupPager(string, *SitesClientListByResourceGroupOptions) *runtime.Pager[SitesClientListByResourceGroupResponse]` +- New function `*SitesClient.NewListBySubscriptionPager(*SitesClientListBySubscriptionOptions) *runtime.Pager[SitesClientListBySubscriptionResponse]` +- New function `*SitesClient.UpdateTags(context.Context, string, string, TagsObject, *SitesClientUpdateTagsOptions) (SitesClientUpdateTagsResponse, error)` +- New function `*VirtualNetworkFunctionDefinitionVersion.GetNetworkFunctionDefinitionVersionPropertiesFormat() *NetworkFunctionDefinitionVersionPropertiesFormat` +- New function `*VirtualNetworkFunctionTemplate.GetVirtualNetworkFunctionTemplate() *VirtualNetworkFunctionTemplate` +- New function `NewNetworkFunctionDefinitionGroupsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NetworkFunctionDefinitionGroupsClient, error)` +- New function `*NetworkFunctionDefinitionGroupsClient.BeginCreateOrUpdate(context.Context, string, string, string, NetworkFunctionDefinitionGroup, *NetworkFunctionDefinitionGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[NetworkFunctionDefinitionGroupsClientCreateOrUpdateResponse], error)` +- New function `*NetworkFunctionDefinitionGroupsClient.BeginDelete(context.Context, string, string, string, *NetworkFunctionDefinitionGroupsClientBeginDeleteOptions) (*runtime.Poller[NetworkFunctionDefinitionGroupsClientDeleteResponse], error)` +- New function `*NetworkFunctionDefinitionGroupsClient.Get(context.Context, string, string, string, *NetworkFunctionDefinitionGroupsClientGetOptions) (NetworkFunctionDefinitionGroupsClientGetResponse, error)` +- New function `*NetworkFunctionDefinitionGroupsClient.NewListByPublisherPager(string, string, *NetworkFunctionDefinitionGroupsClientListByPublisherOptions) *runtime.Pager[NetworkFunctionDefinitionGroupsClientListByPublisherResponse]` +- New function `*NetworkFunctionDefinitionGroupsClient.Update(context.Context, string, string, string, TagsObject, *NetworkFunctionDefinitionGroupsClientUpdateOptions) (NetworkFunctionDefinitionGroupsClientUpdateResponse, error)` +- New function `*NetworkFunctionDefinitionResourceElementTemplateDetails.GetResourceElementTemplate() *ResourceElementTemplate` +- New function `*NetworkFunctionDefinitionVersionPropertiesFormat.GetNetworkFunctionDefinitionVersionPropertiesFormat() *NetworkFunctionDefinitionVersionPropertiesFormat` +- New function `NewNetworkFunctionDefinitionVersionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NetworkFunctionDefinitionVersionsClient, error)` +- New function `*NetworkFunctionDefinitionVersionsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, NetworkFunctionDefinitionVersion, *NetworkFunctionDefinitionVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[NetworkFunctionDefinitionVersionsClientCreateOrUpdateResponse], error)` +- New function `*NetworkFunctionDefinitionVersionsClient.BeginDelete(context.Context, string, string, string, string, *NetworkFunctionDefinitionVersionsClientBeginDeleteOptions) (*runtime.Poller[NetworkFunctionDefinitionVersionsClientDeleteResponse], error)` +- New function `*NetworkFunctionDefinitionVersionsClient.Get(context.Context, string, string, string, string, *NetworkFunctionDefinitionVersionsClientGetOptions) (NetworkFunctionDefinitionVersionsClientGetResponse, error)` +- New function `*NetworkFunctionDefinitionVersionsClient.NewListByNetworkFunctionDefinitionGroupPager(string, string, string, *NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupOptions) *runtime.Pager[NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupResponse]` +- New function `*NetworkFunctionDefinitionVersionsClient.Update(context.Context, string, string, string, string, TagsObject, *NetworkFunctionDefinitionVersionsClientUpdateOptions) (NetworkFunctionDefinitionVersionsClientUpdateResponse, error)` +- New function `*NetworkFunctionDefinitionVersionsClient.BeginUpdateState(context.Context, string, string, string, string, NetworkFunctionDefinitionVersionUpdateState, *NetworkFunctionDefinitionVersionsClientBeginUpdateStateOptions) (*runtime.Poller[NetworkFunctionDefinitionVersionsClientUpdateStateResponse], error)` +- New function `*NetworkFunctionPropertiesFormat.GetNetworkFunctionPropertiesFormat() *NetworkFunctionPropertiesFormat` +- New function `*NetworkFunctionValueWithSecrets.GetNetworkFunctionPropertiesFormat() *NetworkFunctionPropertiesFormat` +- New function `*NetworkFunctionValueWithoutSecrets.GetNetworkFunctionPropertiesFormat() *NetworkFunctionPropertiesFormat` +- New function `*NetworkFunctionsClient.BeginExecuteRequest(context.Context, string, string, ExecuteRequestParameters, *NetworkFunctionsClientBeginExecuteRequestOptions) (*runtime.Poller[NetworkFunctionsClientExecuteRequestResponse], error)` +- New function `NewNetworkServiceDesignGroupsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NetworkServiceDesignGroupsClient, error)` +- New function `*NetworkServiceDesignGroupsClient.BeginCreateOrUpdate(context.Context, string, string, string, NetworkServiceDesignGroup, *NetworkServiceDesignGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[NetworkServiceDesignGroupsClientCreateOrUpdateResponse], error)` +- New function `*NetworkServiceDesignGroupsClient.BeginDelete(context.Context, string, string, string, *NetworkServiceDesignGroupsClientBeginDeleteOptions) (*runtime.Poller[NetworkServiceDesignGroupsClientDeleteResponse], error)` +- New function `*NetworkServiceDesignGroupsClient.Get(context.Context, string, string, string, *NetworkServiceDesignGroupsClientGetOptions) (NetworkServiceDesignGroupsClientGetResponse, error)` +- New function `*NetworkServiceDesignGroupsClient.NewListByPublisherPager(string, string, *NetworkServiceDesignGroupsClientListByPublisherOptions) *runtime.Pager[NetworkServiceDesignGroupsClientListByPublisherResponse]` +- New function `*NetworkServiceDesignGroupsClient.Update(context.Context, string, string, string, TagsObject, *NetworkServiceDesignGroupsClientUpdateOptions) (NetworkServiceDesignGroupsClientUpdateResponse, error)` +- New function `NewNetworkServiceDesignVersionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NetworkServiceDesignVersionsClient, error)` +- New function `*NetworkServiceDesignVersionsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, NetworkServiceDesignVersion, *NetworkServiceDesignVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[NetworkServiceDesignVersionsClientCreateOrUpdateResponse], error)` +- New function `*NetworkServiceDesignVersionsClient.BeginDelete(context.Context, string, string, string, string, *NetworkServiceDesignVersionsClientBeginDeleteOptions) (*runtime.Poller[NetworkServiceDesignVersionsClientDeleteResponse], error)` +- New function `*NetworkServiceDesignVersionsClient.Get(context.Context, string, string, string, string, *NetworkServiceDesignVersionsClientGetOptions) (NetworkServiceDesignVersionsClientGetResponse, error)` +- New function `*NetworkServiceDesignVersionsClient.NewListByNetworkServiceDesignGroupPager(string, string, string, *NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupOptions) *runtime.Pager[NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupResponse]` +- New function `*NetworkServiceDesignVersionsClient.Update(context.Context, string, string, string, string, TagsObject, *NetworkServiceDesignVersionsClientUpdateOptions) (NetworkServiceDesignVersionsClientUpdateResponse, error)` +- New function `*NetworkServiceDesignVersionsClient.BeginUpdateState(context.Context, string, string, string, string, NetworkServiceDesignVersionUpdateState, *NetworkServiceDesignVersionsClientBeginUpdateStateOptions) (*runtime.Poller[NetworkServiceDesignVersionsClientUpdateStateResponse], error)` +- New struct `ArmResourceDefinitionResourceElementTemplate` +- New struct `ArmResourceDefinitionResourceElementTemplateDetails` +- New struct `ArmTemplateArtifactProfile` +- New struct `ArmTemplateMappingRuleProfile` +- New struct `ArtifactChangeState` +- New struct `ArtifactChangeStateProperties` +- New struct `ArtifactManifest` +- New struct `ArtifactManifestListResult` +- New struct `ArtifactManifestPropertiesFormat` +- New struct `ArtifactManifestUpdateState` +- New struct `ArtifactProfile` +- New struct `ArtifactStore` +- New struct `ArtifactStoreListResult` +- New struct `ArtifactStorePropertiesFormat` +- New struct `ArtifactStorePropertiesFormatManagedResourceGroupConfiguration` +- New struct `AzureArcK8SClusterNFVIDetails` +- New struct `AzureArcKubernetesArtifactProfile` +- New struct `AzureArcKubernetesDeployMappingRuleProfile` +- New struct `AzureArcKubernetesHelmApplication` +- New struct `AzureArcKubernetesNetworkFunctionTemplate` +- New struct `AzureContainerRegistryScopedTokenCredential` +- New struct `AzureCoreArmTemplateArtifactProfile` +- New struct `AzureCoreArmTemplateDeployMappingRuleProfile` +- New struct `AzureCoreNFVIDetails` +- New struct `AzureCoreNetworkFunctionArmTemplateApplication` +- New struct `AzureCoreNetworkFunctionTemplate` +- New struct `AzureCoreNetworkFunctionVhdApplication` +- New struct `AzureCoreVhdImageArtifactProfile` +- New struct `AzureCoreVhdImageDeployMappingRuleProfile` +- New struct `AzureOperatorNexusArmTemplateArtifactProfile` +- New struct `AzureOperatorNexusArmTemplateDeployMappingRuleProfile` +- New struct `AzureOperatorNexusClusterNFVIDetails` +- New struct `AzureOperatorNexusImageArtifactProfile` +- New struct `AzureOperatorNexusImageDeployMappingRuleProfile` +- New struct `AzureOperatorNexusNetworkFunctionArmTemplateApplication` +- New struct `AzureOperatorNexusNetworkFunctionImageApplication` +- New struct `AzureOperatorNexusNetworkFunctionTemplate` +- New struct `AzureStorageAccountContainerCredential` +- New struct `AzureStorageAccountCredential` +- New struct `Component` +- New struct `ComponentListResult` +- New struct `ComponentProperties` +- New struct `ConfigurationGroupSchema` +- New struct `ConfigurationGroupSchemaListResult` +- New struct `ConfigurationGroupSchemaPropertiesFormat` +- New struct `ConfigurationGroupSchemaVersionUpdateState` +- New struct `ConfigurationGroupValue` +- New struct `ConfigurationGroupValueListResult` +- New struct `ConfigurationValueWithSecrets` +- New struct `ConfigurationValueWithoutSecrets` +- New struct `ContainerizedNetworkFunctionDefinitionVersion` +- New struct `CustomLocationResourceID` +- New struct `DaemonSet` +- New struct `DependsOnProfile` +- New struct `Deployment` +- New struct `DeploymentStatusProperties` +- New struct `ExecuteRequestParameters` +- New struct `HelmArtifactProfile` +- New struct `HelmInstallOptions` +- New struct `HelmMappingRuleProfile` +- New struct `HelmMappingRuleProfileOptions` +- New struct `HelmUpgradeOptions` +- New struct `ImageArtifactProfile` +- New struct `ImageMappingRuleProfile` +- New struct `ManagedResourceGroupConfiguration` +- New struct `ManagedServiceIdentity` +- New struct `ManifestArtifactFormat` +- New struct `MappingRuleProfile` +- New struct `NSDArtifactProfile` +- New struct `NetworkFunctionApplication` +- New struct `NetworkFunctionDefinitionGroup` +- New struct `NetworkFunctionDefinitionGroupListResult` +- New struct `NetworkFunctionDefinitionGroupPropertiesFormat` +- New struct `NetworkFunctionDefinitionResourceElementTemplateDetails` +- New struct `NetworkFunctionDefinitionVersion` +- New struct `NetworkFunctionDefinitionVersionListResult` +- New struct `NetworkFunctionDefinitionVersionUpdateState` +- New struct `NetworkFunctionValueWithSecrets` +- New struct `NetworkFunctionValueWithoutSecrets` +- New struct `NetworkServiceDesignGroup` +- New struct `NetworkServiceDesignGroupListResult` +- New struct `NetworkServiceDesignGroupPropertiesFormat` +- New struct `NetworkServiceDesignVersion` +- New struct `NetworkServiceDesignVersionListResult` +- New struct `NetworkServiceDesignVersionPropertiesFormat` +- New struct `NetworkServiceDesignVersionUpdateState` +- New struct `NfviDetails` +- New struct `OpenDeploymentResourceReference` +- New struct `OperationListResult` +- New struct `Pod` +- New struct `PodEvent` +- New struct `ProxyArtifactListOverview` +- New struct `ProxyArtifactOverview` +- New struct `ProxyArtifactOverviewListResult` +- New struct `ProxyArtifactOverviewPropertiesFormat` +- New struct `ProxyArtifactOverviewPropertiesValue` +- New struct `ProxyArtifactVersionsListOverview` +- New struct `ProxyArtifactVersionsOverviewListResult` +- New struct `Publisher` +- New struct `PublisherListResult` +- New struct `PublisherPropertiesFormat` +- New struct `ReferencedResource` +- New struct `ReplicaSet` +- New struct `RequestMetadata` +- New struct `Resources` +- New struct `SKU` +- New struct `SecretDeploymentResourceReference` +- New struct `Site` +- New struct `SiteListResult` +- New struct `SiteNetworkService` +- New struct `SiteNetworkServiceListResult` +- New struct `SiteNetworkServicePropertiesFormat` +- New struct `SitePropertiesFormat` +- New struct `StatefulSet` +- New struct `UserAssignedIdentity` +- New struct `VhdImageArtifactProfile` +- New struct `VhdImageMappingRuleProfile` +- New struct `VirtualNetworkFunctionDefinitionVersion` +- New field `Identity` in struct `NetworkFunction` +- New field `ActionType`, `IsDataAction`, `Origin` in struct `Operation` +- New anonymous field `OperationListResult` in struct `OperationsClientListResponse` +- New field `SystemData` in struct `ProxyResource` +- New field `SystemData` in struct `Resource` +- New field `SystemData` in struct `TrackedResource` + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/artifactmanifests_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/artifactmanifests_client.go new file mode 100644 index 000000000000..aecd179a0df6 --- /dev/null +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/artifactmanifests_client.go @@ -0,0 +1,583 @@ +//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 armhybridnetwork + +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" +) + +// ArtifactManifestsClient contains the methods for the ArtifactManifests group. +// Don't use this type directly, use NewArtifactManifestsClient() instead. +type ArtifactManifestsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewArtifactManifestsClient creates a new instance of ArtifactManifestsClient 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 NewArtifactManifestsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ArtifactManifestsClient, error) { + cl, err := arm.NewClient(moduleName+".ArtifactManifestsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ArtifactManifestsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a artifact manifest. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - artifactStoreName - The name of the artifact store. +// - artifactManifestName - The name of the artifact manifest. +// - parameters - Parameters supplied to the create or update artifact manifest operation. +// - options - ArtifactManifestsClientBeginCreateOrUpdateOptions contains the optional parameters for the ArtifactManifestsClient.BeginCreateOrUpdate +// method. +func (client *ArtifactManifestsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactManifestName string, parameters ArtifactManifest, options *ArtifactManifestsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ArtifactManifestsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ArtifactManifestsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ArtifactManifestsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a artifact manifest. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *ArtifactManifestsClient) createOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactManifestName string, parameters ArtifactManifest, options *ArtifactManifestsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, 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 *ArtifactManifestsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactManifestName string, parameters ArtifactManifest, options *ArtifactManifestsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if artifactStoreName == "" { + return nil, errors.New("parameter artifactStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactStoreName}", url.PathEscape(artifactStoreName)) + if artifactManifestName == "" { + return nil, errors.New("parameter artifactManifestName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactManifestName}", url.PathEscape(artifactManifestName)) + 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes the specified artifact manifest. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - artifactStoreName - The name of the artifact store. +// - artifactManifestName - The name of the artifact manifest. +// - options - ArtifactManifestsClientBeginDeleteOptions contains the optional parameters for the ArtifactManifestsClient.BeginDelete +// method. +func (client *ArtifactManifestsClient) BeginDelete(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactManifestName string, options *ArtifactManifestsClientBeginDeleteOptions) (*runtime.Poller[ArtifactManifestsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, publisherName, artifactStoreName, artifactManifestName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ArtifactManifestsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ArtifactManifestsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified artifact manifest. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *ArtifactManifestsClient) deleteOperation(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactManifestName string, options *ArtifactManifestsClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, publisherName, artifactStoreName, artifactManifestName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ArtifactManifestsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactManifestName string, options *ArtifactManifestsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if artifactStoreName == "" { + return nil, errors.New("parameter artifactStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactStoreName}", url.PathEscape(artifactStoreName)) + if artifactManifestName == "" { + return nil, errors.New("parameter artifactManifestName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactManifestName}", url.PathEscape(artifactManifestName)) + 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about a artifact manifest resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - artifactStoreName - The name of the artifact store. +// - artifactManifestName - The name of the artifact manifest. +// - options - ArtifactManifestsClientGetOptions contains the optional parameters for the ArtifactManifestsClient.Get method. +func (client *ArtifactManifestsClient) Get(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactManifestName string, options *ArtifactManifestsClientGetOptions) (ArtifactManifestsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, publisherName, artifactStoreName, artifactManifestName, options) + if err != nil { + return ArtifactManifestsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ArtifactManifestsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ArtifactManifestsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ArtifactManifestsClient) getCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactManifestName string, options *ArtifactManifestsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if artifactStoreName == "" { + return nil, errors.New("parameter artifactStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactStoreName}", url.PathEscape(artifactStoreName)) + if artifactManifestName == "" { + return nil, errors.New("parameter artifactManifestName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactManifestName}", url.PathEscape(artifactManifestName)) + 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", "2023-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 *ArtifactManifestsClient) getHandleResponse(resp *http.Response) (ArtifactManifestsClientGetResponse, error) { + result := ArtifactManifestsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ArtifactManifest); err != nil { + return ArtifactManifestsClientGetResponse{}, err + } + return result, nil +} + +// NewListByArtifactStorePager - Gets information about the artifact manifest. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - artifactStoreName - The name of the artifact store. +// - options - ArtifactManifestsClientListByArtifactStoreOptions contains the optional parameters for the ArtifactManifestsClient.NewListByArtifactStorePager +// method. +func (client *ArtifactManifestsClient) NewListByArtifactStorePager(resourceGroupName string, publisherName string, artifactStoreName string, options *ArtifactManifestsClientListByArtifactStoreOptions) *runtime.Pager[ArtifactManifestsClientListByArtifactStoreResponse] { + return runtime.NewPager(runtime.PagingHandler[ArtifactManifestsClientListByArtifactStoreResponse]{ + More: func(page ArtifactManifestsClientListByArtifactStoreResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ArtifactManifestsClientListByArtifactStoreResponse) (ArtifactManifestsClientListByArtifactStoreResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByArtifactStoreCreateRequest(ctx, resourceGroupName, publisherName, artifactStoreName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ArtifactManifestsClientListByArtifactStoreResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ArtifactManifestsClientListByArtifactStoreResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ArtifactManifestsClientListByArtifactStoreResponse{}, runtime.NewResponseError(resp) + } + return client.listByArtifactStoreHandleResponse(resp) + }, + }) +} + +// listByArtifactStoreCreateRequest creates the ListByArtifactStore request. +func (client *ArtifactManifestsClient) listByArtifactStoreCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, options *ArtifactManifestsClientListByArtifactStoreOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if artifactStoreName == "" { + return nil, errors.New("parameter artifactStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactStoreName}", url.PathEscape(artifactStoreName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByArtifactStoreHandleResponse handles the ListByArtifactStore response. +func (client *ArtifactManifestsClient) listByArtifactStoreHandleResponse(resp *http.Response) (ArtifactManifestsClientListByArtifactStoreResponse, error) { + result := ArtifactManifestsClientListByArtifactStoreResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ArtifactManifestListResult); err != nil { + return ArtifactManifestsClientListByArtifactStoreResponse{}, err + } + return result, nil +} + +// ListCredential - List credential for publishing artifacts defined in artifact manifest. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - artifactStoreName - The name of the artifact store. +// - artifactManifestName - The name of the artifact manifest. +// - options - ArtifactManifestsClientListCredentialOptions contains the optional parameters for the ArtifactManifestsClient.ListCredential +// method. +func (client *ArtifactManifestsClient) ListCredential(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactManifestName string, options *ArtifactManifestsClientListCredentialOptions) (ArtifactManifestsClientListCredentialResponse, error) { + var err error + req, err := client.listCredentialCreateRequest(ctx, resourceGroupName, publisherName, artifactStoreName, artifactManifestName, options) + if err != nil { + return ArtifactManifestsClientListCredentialResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ArtifactManifestsClientListCredentialResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ArtifactManifestsClientListCredentialResponse{}, err + } + resp, err := client.listCredentialHandleResponse(httpResp) + return resp, err +} + +// listCredentialCreateRequest creates the ListCredential request. +func (client *ArtifactManifestsClient) listCredentialCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactManifestName string, options *ArtifactManifestsClientListCredentialOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/listCredential" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if artifactStoreName == "" { + return nil, errors.New("parameter artifactStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactStoreName}", url.PathEscape(artifactStoreName)) + if artifactManifestName == "" { + return nil, errors.New("parameter artifactManifestName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactManifestName}", url.PathEscape(artifactManifestName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listCredentialHandleResponse handles the ListCredential response. +func (client *ArtifactManifestsClient) listCredentialHandleResponse(resp *http.Response) (ArtifactManifestsClientListCredentialResponse, error) { + result := ArtifactManifestsClientListCredentialResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return ArtifactManifestsClientListCredentialResponse{}, err + } + return result, nil +} + +// Update - Updates a artifact manifest resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - artifactStoreName - The name of the artifact store. +// - artifactManifestName - The name of the artifact manifest. +// - parameters - Parameters supplied to the create or update artifact manifest operation. +// - options - ArtifactManifestsClientUpdateOptions contains the optional parameters for the ArtifactManifestsClient.Update +// method. +func (client *ArtifactManifestsClient) Update(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactManifestName string, parameters TagsObject, options *ArtifactManifestsClientUpdateOptions) (ArtifactManifestsClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, options) + if err != nil { + return ArtifactManifestsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ArtifactManifestsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ArtifactManifestsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *ArtifactManifestsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactManifestName string, parameters TagsObject, options *ArtifactManifestsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if artifactStoreName == "" { + return nil, errors.New("parameter artifactStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactStoreName}", url.PathEscape(artifactStoreName)) + if artifactManifestName == "" { + return nil, errors.New("parameter artifactManifestName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactManifestName}", url.PathEscape(artifactManifestName)) + 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.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *ArtifactManifestsClient) updateHandleResponse(resp *http.Response) (ArtifactManifestsClientUpdateResponse, error) { + result := ArtifactManifestsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ArtifactManifest); err != nil { + return ArtifactManifestsClientUpdateResponse{}, err + } + return result, nil +} + +// BeginUpdateState - Update state for artifact manifest. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - artifactStoreName - The name of the artifact store. +// - artifactManifestName - The name of the artifact manifest. +// - parameters - Parameters supplied to update the state of artifact manifest. +// - options - ArtifactManifestsClientBeginUpdateStateOptions contains the optional parameters for the ArtifactManifestsClient.BeginUpdateState +// method. +func (client *ArtifactManifestsClient) BeginUpdateState(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactManifestName string, parameters ArtifactManifestUpdateState, options *ArtifactManifestsClientBeginUpdateStateOptions) (*runtime.Poller[ArtifactManifestsClientUpdateStateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateState(ctx, resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ArtifactManifestsClientUpdateStateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ArtifactManifestsClientUpdateStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateState - Update state for artifact manifest. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *ArtifactManifestsClient) updateState(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactManifestName string, parameters ArtifactManifestUpdateState, options *ArtifactManifestsClientBeginUpdateStateOptions) (*http.Response, error) { + var err error + req, err := client.updateStateCreateRequest(ctx, resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateStateCreateRequest creates the UpdateState request. +func (client *ArtifactManifestsClient) updateStateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactManifestName string, parameters ArtifactManifestUpdateState, options *ArtifactManifestsClientBeginUpdateStateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/updateState" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if artifactStoreName == "" { + return nil, errors.New("parameter artifactStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactStoreName}", url.PathEscape(artifactStoreName)) + if artifactManifestName == "" { + return nil, errors.New("parameter artifactManifestName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactManifestName}", url.PathEscape(artifactManifestName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/artifactstores_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/artifactstores_client.go new file mode 100644 index 000000000000..2f9cce8d6c00 --- /dev/null +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/artifactstores_client.go @@ -0,0 +1,402 @@ +//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 armhybridnetwork + +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" +) + +// ArtifactStoresClient contains the methods for the ArtifactStores group. +// Don't use this type directly, use NewArtifactStoresClient() instead. +type ArtifactStoresClient struct { + internal *arm.Client + subscriptionID string +} + +// NewArtifactStoresClient creates a new instance of ArtifactStoresClient 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 NewArtifactStoresClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ArtifactStoresClient, error) { + cl, err := arm.NewClient(moduleName+".ArtifactStoresClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ArtifactStoresClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a artifact store. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - artifactStoreName - The name of the artifact store. +// - parameters - Parameters supplied to the create or update application group operation. +// - options - ArtifactStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the ArtifactStoresClient.BeginCreateOrUpdate +// method. +func (client *ArtifactStoresClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, parameters ArtifactStore, options *ArtifactStoresClientBeginCreateOrUpdateOptions) (*runtime.Poller[ArtifactStoresClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, publisherName, artifactStoreName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ArtifactStoresClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ArtifactStoresClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a artifact store. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *ArtifactStoresClient) createOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, parameters ArtifactStore, options *ArtifactStoresClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, publisherName, artifactStoreName, parameters, 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 *ArtifactStoresClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, parameters ArtifactStore, options *ArtifactStoresClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if artifactStoreName == "" { + return nil, errors.New("parameter artifactStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactStoreName}", url.PathEscape(artifactStoreName)) + 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes the specified artifact store. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - artifactStoreName - The name of the artifact store. +// - options - ArtifactStoresClientBeginDeleteOptions contains the optional parameters for the ArtifactStoresClient.BeginDelete +// method. +func (client *ArtifactStoresClient) BeginDelete(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, options *ArtifactStoresClientBeginDeleteOptions) (*runtime.Poller[ArtifactStoresClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, publisherName, artifactStoreName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ArtifactStoresClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ArtifactStoresClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified artifact store. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *ArtifactStoresClient) deleteOperation(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, options *ArtifactStoresClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, publisherName, artifactStoreName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ArtifactStoresClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, options *ArtifactStoresClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if artifactStoreName == "" { + return nil, errors.New("parameter artifactStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactStoreName}", url.PathEscape(artifactStoreName)) + 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about the specified artifact store. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - artifactStoreName - The name of the artifact store. +// - options - ArtifactStoresClientGetOptions contains the optional parameters for the ArtifactStoresClient.Get method. +func (client *ArtifactStoresClient) Get(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, options *ArtifactStoresClientGetOptions) (ArtifactStoresClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, publisherName, artifactStoreName, options) + if err != nil { + return ArtifactStoresClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ArtifactStoresClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ArtifactStoresClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ArtifactStoresClient) getCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, options *ArtifactStoresClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if artifactStoreName == "" { + return nil, errors.New("parameter artifactStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactStoreName}", url.PathEscape(artifactStoreName)) + 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", "2023-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 *ArtifactStoresClient) getHandleResponse(resp *http.Response) (ArtifactStoresClientGetResponse, error) { + result := ArtifactStoresClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ArtifactStore); err != nil { + return ArtifactStoresClientGetResponse{}, err + } + return result, nil +} + +// NewListByPublisherPager - Gets information of the ArtifactStores under publisher. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - options - ArtifactStoresClientListByPublisherOptions contains the optional parameters for the ArtifactStoresClient.NewListByPublisherPager +// method. +func (client *ArtifactStoresClient) NewListByPublisherPager(resourceGroupName string, publisherName string, options *ArtifactStoresClientListByPublisherOptions) *runtime.Pager[ArtifactStoresClientListByPublisherResponse] { + return runtime.NewPager(runtime.PagingHandler[ArtifactStoresClientListByPublisherResponse]{ + More: func(page ArtifactStoresClientListByPublisherResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ArtifactStoresClientListByPublisherResponse) (ArtifactStoresClientListByPublisherResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByPublisherCreateRequest(ctx, resourceGroupName, publisherName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ArtifactStoresClientListByPublisherResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ArtifactStoresClientListByPublisherResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ArtifactStoresClientListByPublisherResponse{}, runtime.NewResponseError(resp) + } + return client.listByPublisherHandleResponse(resp) + }, + }) +} + +// listByPublisherCreateRequest creates the ListByPublisher request. +func (client *ArtifactStoresClient) listByPublisherCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, options *ArtifactStoresClientListByPublisherOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByPublisherHandleResponse handles the ListByPublisher response. +func (client *ArtifactStoresClient) listByPublisherHandleResponse(resp *http.Response) (ArtifactStoresClientListByPublisherResponse, error) { + result := ArtifactStoresClientListByPublisherResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ArtifactStoreListResult); err != nil { + return ArtifactStoresClientListByPublisherResponse{}, err + } + return result, nil +} + +// Update - Update artifact store resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - artifactStoreName - The name of the artifact store. +// - parameters - Parameters supplied to the create or update application group operation. +// - options - ArtifactStoresClientUpdateOptions contains the optional parameters for the ArtifactStoresClient.Update method. +func (client *ArtifactStoresClient) Update(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, parameters TagsObject, options *ArtifactStoresClientUpdateOptions) (ArtifactStoresClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, publisherName, artifactStoreName, parameters, options) + if err != nil { + return ArtifactStoresClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ArtifactStoresClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ArtifactStoresClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *ArtifactStoresClient) updateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, parameters TagsObject, options *ArtifactStoresClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if artifactStoreName == "" { + return nil, errors.New("parameter artifactStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactStoreName}", url.PathEscape(artifactStoreName)) + 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.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *ArtifactStoresClient) updateHandleResponse(resp *http.Response) (ArtifactStoresClientUpdateResponse, error) { + result := ArtifactStoresClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ArtifactStore); err != nil { + return ArtifactStoresClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/autorest.md b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/autorest.md index c6dc76027d79..a2e2a6c5e680 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/autorest.md +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hybridnetwork/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hybridnetwork/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.1 -tag: package-2021-05-01 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/client_factory.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/client_factory.go index 84408867682e..de0db0875842 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/client_factory.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/client_factory.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armhybridnetwork @@ -38,52 +37,77 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewNetworkFunctionsClient() *NetworkFunctionsClient { - subClient, _ := NewNetworkFunctionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewArtifactManifestsClient() *ArtifactManifestsClient { + subClient, _ := NewArtifactManifestsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDevicesClient() *DevicesClient { - subClient, _ := NewDevicesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewArtifactStoresClient() *ArtifactStoresClient { + subClient, _ := NewArtifactStoresClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewComponentsClient() *ComponentsClient { + subClient, _ := NewComponentsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewConfigurationGroupSchemasClient() *ConfigurationGroupSchemasClient { + subClient, _ := NewConfigurationGroupSchemasClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewConfigurationGroupValuesClient() *ConfigurationGroupValuesClient { + subClient, _ := NewConfigurationGroupValuesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVendorsClient() *VendorsClient { - subClient, _ := NewVendorsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewNetworkFunctionDefinitionGroupsClient() *NetworkFunctionDefinitionGroupsClient { + subClient, _ := NewNetworkFunctionDefinitionGroupsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVendorSKUsClient() *VendorSKUsClient { - subClient, _ := NewVendorSKUsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewNetworkFunctionDefinitionVersionsClient() *NetworkFunctionDefinitionVersionsClient { + subClient, _ := NewNetworkFunctionDefinitionVersionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVendorSKUPreviewClient() *VendorSKUPreviewClient { - subClient, _ := NewVendorSKUPreviewClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewNetworkFunctionsClient() *NetworkFunctionsClient { + subClient, _ := NewNetworkFunctionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewNetworkServiceDesignGroupsClient() *NetworkServiceDesignGroupsClient { + subClient, _ := NewNetworkServiceDesignGroupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewNetworkServiceDesignVersionsClient() *NetworkServiceDesignVersionsClient { + subClient, _ := NewNetworkServiceDesignVersionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewNetworkFunctionVendorsClient() *NetworkFunctionVendorsClient { - subClient, _ := NewNetworkFunctionVendorsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProxyArtifactClient() *ProxyArtifactClient { + subClient, _ := NewProxyArtifactClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewNetworkFunctionVendorSKUsClient() *NetworkFunctionVendorSKUsClient { - subClient, _ := NewNetworkFunctionVendorSKUsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPublishersClient() *PublishersClient { + subClient, _ := NewPublishersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVendorNetworkFunctionsClient() *VendorNetworkFunctionsClient { - subClient, _ := NewVendorNetworkFunctionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSiteNetworkServicesClient() *SiteNetworkServicesClient { + subClient, _ := NewSiteNetworkServicesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewRoleInstancesClient() *RoleInstancesClient { - subClient, _ := NewRoleInstancesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSitesClient() *SitesClient { + subClient, _ := NewSitesClient(c.subscriptionID, c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/components_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/components_client.go new file mode 100644 index 000000000000..403bf0bd00f2 --- /dev/null +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/components_client.go @@ -0,0 +1,179 @@ +//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 armhybridnetwork + +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" +) + +// ComponentsClient contains the methods for the Components group. +// Don't use this type directly, use NewComponentsClient() instead. +type ComponentsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewComponentsClient creates a new instance of ComponentsClient 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 NewComponentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ComponentsClient, error) { + cl, err := arm.NewClient(moduleName+".ComponentsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ComponentsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets information about the specified application instance resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFunctionName - The name of the network function. +// - componentName - The name of the component. +// - options - ComponentsClientGetOptions contains the optional parameters for the ComponentsClient.Get method. +func (client *ComponentsClient) Get(ctx context.Context, resourceGroupName string, networkFunctionName string, componentName string, options *ComponentsClientGetOptions) (ComponentsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, networkFunctionName, componentName, options) + if err != nil { + return ComponentsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ComponentsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ComponentsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ComponentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkFunctionName string, componentName string, options *ComponentsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components/{componentName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFunctionName == "" { + return nil, errors.New("parameter networkFunctionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionName}", url.PathEscape(networkFunctionName)) + if componentName == "" { + return nil, errors.New("parameter componentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{componentName}", url.PathEscape(componentName)) + 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", "2023-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 *ComponentsClient) getHandleResponse(resp *http.Response) (ComponentsClientGetResponse, error) { + result := ComponentsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Component); err != nil { + return ComponentsClientGetResponse{}, err + } + return result, nil +} + +// NewListByNetworkFunctionPager - Lists all the component resources in a network function. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFunctionName - The name of the network function. +// - options - ComponentsClientListByNetworkFunctionOptions contains the optional parameters for the ComponentsClient.NewListByNetworkFunctionPager +// method. +func (client *ComponentsClient) NewListByNetworkFunctionPager(resourceGroupName string, networkFunctionName string, options *ComponentsClientListByNetworkFunctionOptions) *runtime.Pager[ComponentsClientListByNetworkFunctionResponse] { + return runtime.NewPager(runtime.PagingHandler[ComponentsClientListByNetworkFunctionResponse]{ + More: func(page ComponentsClientListByNetworkFunctionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ComponentsClientListByNetworkFunctionResponse) (ComponentsClientListByNetworkFunctionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByNetworkFunctionCreateRequest(ctx, resourceGroupName, networkFunctionName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ComponentsClientListByNetworkFunctionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ComponentsClientListByNetworkFunctionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ComponentsClientListByNetworkFunctionResponse{}, runtime.NewResponseError(resp) + } + return client.listByNetworkFunctionHandleResponse(resp) + }, + }) +} + +// listByNetworkFunctionCreateRequest creates the ListByNetworkFunction request. +func (client *ComponentsClient) listByNetworkFunctionCreateRequest(ctx context.Context, resourceGroupName string, networkFunctionName string, options *ComponentsClientListByNetworkFunctionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if networkFunctionName == "" { + return nil, errors.New("parameter networkFunctionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionName}", url.PathEscape(networkFunctionName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByNetworkFunctionHandleResponse handles the ListByNetworkFunction response. +func (client *ComponentsClient) listByNetworkFunctionHandleResponse(resp *http.Response) (ComponentsClientListByNetworkFunctionResponse, error) { + result := ComponentsClientListByNetworkFunctionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ComponentListResult); err != nil { + return ComponentsClientListByNetworkFunctionResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/configurationgroupschemas_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/configurationgroupschemas_client.go new file mode 100644 index 000000000000..33257f75f94a --- /dev/null +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/configurationgroupschemas_client.go @@ -0,0 +1,483 @@ +//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 armhybridnetwork + +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" +) + +// ConfigurationGroupSchemasClient contains the methods for the ConfigurationGroupSchemas group. +// Don't use this type directly, use NewConfigurationGroupSchemasClient() instead. +type ConfigurationGroupSchemasClient struct { + internal *arm.Client + subscriptionID string +} + +// NewConfigurationGroupSchemasClient creates a new instance of ConfigurationGroupSchemasClient 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 NewConfigurationGroupSchemasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationGroupSchemasClient, error) { + cl, err := arm.NewClient(moduleName+".ConfigurationGroupSchemasClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ConfigurationGroupSchemasClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a configuration group schema. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - configurationGroupSchemaName - The name of the configuration group schema. +// - parameters - Parameters supplied to the create or update configuration group schema resource. +// - options - ConfigurationGroupSchemasClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationGroupSchemasClient.BeginCreateOrUpdate +// method. +func (client *ConfigurationGroupSchemasClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, configurationGroupSchemaName string, parameters ConfigurationGroupSchema, options *ConfigurationGroupSchemasClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConfigurationGroupSchemasClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, publisherName, configurationGroupSchemaName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationGroupSchemasClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ConfigurationGroupSchemasClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a configuration group schema. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *ConfigurationGroupSchemasClient) createOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, configurationGroupSchemaName string, parameters ConfigurationGroupSchema, options *ConfigurationGroupSchemasClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, publisherName, configurationGroupSchemaName, parameters, 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 *ConfigurationGroupSchemasClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, configurationGroupSchemaName string, parameters ConfigurationGroupSchema, options *ConfigurationGroupSchemasClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if configurationGroupSchemaName == "" { + return nil, errors.New("parameter configurationGroupSchemaName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationGroupSchemaName}", url.PathEscape(configurationGroupSchemaName)) + 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes a specified configuration group schema. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - configurationGroupSchemaName - The name of the configuration group schema. +// - options - ConfigurationGroupSchemasClientBeginDeleteOptions contains the optional parameters for the ConfigurationGroupSchemasClient.BeginDelete +// method. +func (client *ConfigurationGroupSchemasClient) BeginDelete(ctx context.Context, resourceGroupName string, publisherName string, configurationGroupSchemaName string, options *ConfigurationGroupSchemasClientBeginDeleteOptions) (*runtime.Poller[ConfigurationGroupSchemasClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, publisherName, configurationGroupSchemaName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationGroupSchemasClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ConfigurationGroupSchemasClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a specified configuration group schema. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *ConfigurationGroupSchemasClient) deleteOperation(ctx context.Context, resourceGroupName string, publisherName string, configurationGroupSchemaName string, options *ConfigurationGroupSchemasClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, publisherName, configurationGroupSchemaName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ConfigurationGroupSchemasClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, configurationGroupSchemaName string, options *ConfigurationGroupSchemasClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if configurationGroupSchemaName == "" { + return nil, errors.New("parameter configurationGroupSchemaName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationGroupSchemaName}", url.PathEscape(configurationGroupSchemaName)) + 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about the specified configuration group schema. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - configurationGroupSchemaName - The name of the configuration group schema. +// - options - ConfigurationGroupSchemasClientGetOptions contains the optional parameters for the ConfigurationGroupSchemasClient.Get +// method. +func (client *ConfigurationGroupSchemasClient) Get(ctx context.Context, resourceGroupName string, publisherName string, configurationGroupSchemaName string, options *ConfigurationGroupSchemasClientGetOptions) (ConfigurationGroupSchemasClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, publisherName, configurationGroupSchemaName, options) + if err != nil { + return ConfigurationGroupSchemasClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConfigurationGroupSchemasClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ConfigurationGroupSchemasClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ConfigurationGroupSchemasClient) getCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, configurationGroupSchemaName string, options *ConfigurationGroupSchemasClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if configurationGroupSchemaName == "" { + return nil, errors.New("parameter configurationGroupSchemaName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationGroupSchemaName}", url.PathEscape(configurationGroupSchemaName)) + 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", "2023-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 *ConfigurationGroupSchemasClient) getHandleResponse(resp *http.Response) (ConfigurationGroupSchemasClientGetResponse, error) { + result := ConfigurationGroupSchemasClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConfigurationGroupSchema); err != nil { + return ConfigurationGroupSchemasClientGetResponse{}, err + } + return result, nil +} + +// NewListByPublisherPager - Gets information of the configuration group schemas under a publisher. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - options - ConfigurationGroupSchemasClientListByPublisherOptions contains the optional parameters for the ConfigurationGroupSchemasClient.NewListByPublisherPager +// method. +func (client *ConfigurationGroupSchemasClient) NewListByPublisherPager(resourceGroupName string, publisherName string, options *ConfigurationGroupSchemasClientListByPublisherOptions) *runtime.Pager[ConfigurationGroupSchemasClientListByPublisherResponse] { + return runtime.NewPager(runtime.PagingHandler[ConfigurationGroupSchemasClientListByPublisherResponse]{ + More: func(page ConfigurationGroupSchemasClientListByPublisherResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ConfigurationGroupSchemasClientListByPublisherResponse) (ConfigurationGroupSchemasClientListByPublisherResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByPublisherCreateRequest(ctx, resourceGroupName, publisherName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ConfigurationGroupSchemasClientListByPublisherResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConfigurationGroupSchemasClientListByPublisherResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ConfigurationGroupSchemasClientListByPublisherResponse{}, runtime.NewResponseError(resp) + } + return client.listByPublisherHandleResponse(resp) + }, + }) +} + +// listByPublisherCreateRequest creates the ListByPublisher request. +func (client *ConfigurationGroupSchemasClient) listByPublisherCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, options *ConfigurationGroupSchemasClientListByPublisherOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByPublisherHandleResponse handles the ListByPublisher response. +func (client *ConfigurationGroupSchemasClient) listByPublisherHandleResponse(resp *http.Response) (ConfigurationGroupSchemasClientListByPublisherResponse, error) { + result := ConfigurationGroupSchemasClientListByPublisherResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConfigurationGroupSchemaListResult); err != nil { + return ConfigurationGroupSchemasClientListByPublisherResponse{}, err + } + return result, nil +} + +// Update - Updates a configuration group schema resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - configurationGroupSchemaName - The name of the configuration group schema. +// - parameters - Parameters supplied to the create or update network service design version operation. +// - options - ConfigurationGroupSchemasClientUpdateOptions contains the optional parameters for the ConfigurationGroupSchemasClient.Update +// method. +func (client *ConfigurationGroupSchemasClient) Update(ctx context.Context, resourceGroupName string, publisherName string, configurationGroupSchemaName string, parameters TagsObject, options *ConfigurationGroupSchemasClientUpdateOptions) (ConfigurationGroupSchemasClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, publisherName, configurationGroupSchemaName, parameters, options) + if err != nil { + return ConfigurationGroupSchemasClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConfigurationGroupSchemasClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ConfigurationGroupSchemasClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *ConfigurationGroupSchemasClient) updateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, configurationGroupSchemaName string, parameters TagsObject, options *ConfigurationGroupSchemasClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if configurationGroupSchemaName == "" { + return nil, errors.New("parameter configurationGroupSchemaName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationGroupSchemaName}", url.PathEscape(configurationGroupSchemaName)) + 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.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *ConfigurationGroupSchemasClient) updateHandleResponse(resp *http.Response) (ConfigurationGroupSchemasClientUpdateResponse, error) { + result := ConfigurationGroupSchemasClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConfigurationGroupSchema); err != nil { + return ConfigurationGroupSchemasClientUpdateResponse{}, err + } + return result, nil +} + +// BeginUpdateState - Update configuration group schema state. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - configurationGroupSchemaName - The name of the configuration group schema. +// - parameters - Parameters supplied to update the state of configuration group schema. +// - options - ConfigurationGroupSchemasClientBeginUpdateStateOptions contains the optional parameters for the ConfigurationGroupSchemasClient.BeginUpdateState +// method. +func (client *ConfigurationGroupSchemasClient) BeginUpdateState(ctx context.Context, resourceGroupName string, publisherName string, configurationGroupSchemaName string, parameters ConfigurationGroupSchemaVersionUpdateState, options *ConfigurationGroupSchemasClientBeginUpdateStateOptions) (*runtime.Poller[ConfigurationGroupSchemasClientUpdateStateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateState(ctx, resourceGroupName, publisherName, configurationGroupSchemaName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationGroupSchemasClientUpdateStateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ConfigurationGroupSchemasClientUpdateStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateState - Update configuration group schema state. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *ConfigurationGroupSchemasClient) updateState(ctx context.Context, resourceGroupName string, publisherName string, configurationGroupSchemaName string, parameters ConfigurationGroupSchemaVersionUpdateState, options *ConfigurationGroupSchemasClientBeginUpdateStateOptions) (*http.Response, error) { + var err error + req, err := client.updateStateCreateRequest(ctx, resourceGroupName, publisherName, configurationGroupSchemaName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateStateCreateRequest creates the UpdateState request. +func (client *ConfigurationGroupSchemasClient) updateStateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, configurationGroupSchemaName string, parameters ConfigurationGroupSchemaVersionUpdateState, options *ConfigurationGroupSchemasClientBeginUpdateStateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}/updateState" + 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 publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if configurationGroupSchemaName == "" { + return nil, errors.New("parameter configurationGroupSchemaName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationGroupSchemaName}", url.PathEscape(configurationGroupSchemaName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/configurationgroupvalues_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/configurationgroupvalues_client.go new file mode 100644 index 000000000000..135f847ddff6 --- /dev/null +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/configurationgroupvalues_client.go @@ -0,0 +1,439 @@ +//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 armhybridnetwork + +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" +) + +// ConfigurationGroupValuesClient contains the methods for the ConfigurationGroupValues group. +// Don't use this type directly, use NewConfigurationGroupValuesClient() instead. +type ConfigurationGroupValuesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewConfigurationGroupValuesClient creates a new instance of ConfigurationGroupValuesClient 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 NewConfigurationGroupValuesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationGroupValuesClient, error) { + cl, err := arm.NewClient(moduleName+".ConfigurationGroupValuesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ConfigurationGroupValuesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a hybrid configuration group value. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - configurationGroupValueName - The name of the configuration group value. +// - parameters - Parameters supplied to the create or update configuration group value resource. +// - options - ConfigurationGroupValuesClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationGroupValuesClient.BeginCreateOrUpdate +// method. +func (client *ConfigurationGroupValuesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, configurationGroupValueName string, parameters ConfigurationGroupValue, options *ConfigurationGroupValuesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConfigurationGroupValuesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, configurationGroupValueName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationGroupValuesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ConfigurationGroupValuesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a hybrid configuration group value. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *ConfigurationGroupValuesClient) createOrUpdate(ctx context.Context, resourceGroupName string, configurationGroupValueName string, parameters ConfigurationGroupValue, options *ConfigurationGroupValuesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, configurationGroupValueName, parameters, 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 *ConfigurationGroupValuesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, configurationGroupValueName string, parameters ConfigurationGroupValue, options *ConfigurationGroupValuesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}" + 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 configurationGroupValueName == "" { + return nil, errors.New("parameter configurationGroupValueName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationGroupValueName}", url.PathEscape(configurationGroupValueName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes the specified hybrid configuration group value. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - configurationGroupValueName - The name of the configuration group value. +// - options - ConfigurationGroupValuesClientBeginDeleteOptions contains the optional parameters for the ConfigurationGroupValuesClient.BeginDelete +// method. +func (client *ConfigurationGroupValuesClient) BeginDelete(ctx context.Context, resourceGroupName string, configurationGroupValueName string, options *ConfigurationGroupValuesClientBeginDeleteOptions) (*runtime.Poller[ConfigurationGroupValuesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, configurationGroupValueName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationGroupValuesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ConfigurationGroupValuesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified hybrid configuration group value. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *ConfigurationGroupValuesClient) deleteOperation(ctx context.Context, resourceGroupName string, configurationGroupValueName string, options *ConfigurationGroupValuesClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, configurationGroupValueName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ConfigurationGroupValuesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, configurationGroupValueName string, options *ConfigurationGroupValuesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}" + 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 configurationGroupValueName == "" { + return nil, errors.New("parameter configurationGroupValueName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationGroupValueName}", url.PathEscape(configurationGroupValueName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about the specified hybrid configuration group values. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - configurationGroupValueName - The name of the configuration group value. +// - options - ConfigurationGroupValuesClientGetOptions contains the optional parameters for the ConfigurationGroupValuesClient.Get +// method. +func (client *ConfigurationGroupValuesClient) Get(ctx context.Context, resourceGroupName string, configurationGroupValueName string, options *ConfigurationGroupValuesClientGetOptions) (ConfigurationGroupValuesClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, configurationGroupValueName, options) + if err != nil { + return ConfigurationGroupValuesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConfigurationGroupValuesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ConfigurationGroupValuesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ConfigurationGroupValuesClient) getCreateRequest(ctx context.Context, resourceGroupName string, configurationGroupValueName string, options *ConfigurationGroupValuesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}" + 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 configurationGroupValueName == "" { + return nil, errors.New("parameter configurationGroupValueName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationGroupValueName}", url.PathEscape(configurationGroupValueName)) + 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", "2023-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 *ConfigurationGroupValuesClient) getHandleResponse(resp *http.Response) (ConfigurationGroupValuesClientGetResponse, error) { + result := ConfigurationGroupValuesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConfigurationGroupValue); err != nil { + return ConfigurationGroupValuesClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all the hybrid network configurationGroupValues in a resource group. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - ConfigurationGroupValuesClientListByResourceGroupOptions contains the optional parameters for the ConfigurationGroupValuesClient.NewListByResourceGroupPager +// method. +func (client *ConfigurationGroupValuesClient) NewListByResourceGroupPager(resourceGroupName string, options *ConfigurationGroupValuesClientListByResourceGroupOptions) *runtime.Pager[ConfigurationGroupValuesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[ConfigurationGroupValuesClientListByResourceGroupResponse]{ + More: func(page ConfigurationGroupValuesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ConfigurationGroupValuesClientListByResourceGroupResponse) (ConfigurationGroupValuesClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ConfigurationGroupValuesClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConfigurationGroupValuesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ConfigurationGroupValuesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ConfigurationGroupValuesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ConfigurationGroupValuesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues" + 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", "2023-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 *ConfigurationGroupValuesClient) listByResourceGroupHandleResponse(resp *http.Response) (ConfigurationGroupValuesClientListByResourceGroupResponse, error) { + result := ConfigurationGroupValuesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConfigurationGroupValueListResult); err != nil { + return ConfigurationGroupValuesClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Lists all sites in the configuration group value in a subscription. +// +// Generated from API version 2023-09-01 +// - options - ConfigurationGroupValuesClientListBySubscriptionOptions contains the optional parameters for the ConfigurationGroupValuesClient.NewListBySubscriptionPager +// method. +func (client *ConfigurationGroupValuesClient) NewListBySubscriptionPager(options *ConfigurationGroupValuesClientListBySubscriptionOptions) *runtime.Pager[ConfigurationGroupValuesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[ConfigurationGroupValuesClientListBySubscriptionResponse]{ + More: func(page ConfigurationGroupValuesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ConfigurationGroupValuesClientListBySubscriptionResponse) (ConfigurationGroupValuesClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ConfigurationGroupValuesClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConfigurationGroupValuesClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ConfigurationGroupValuesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *ConfigurationGroupValuesClient) listBySubscriptionCreateRequest(ctx context.Context, options *ConfigurationGroupValuesClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/configurationGroupValues" + 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", "2023-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 *ConfigurationGroupValuesClient) listBySubscriptionHandleResponse(resp *http.Response) (ConfigurationGroupValuesClientListBySubscriptionResponse, error) { + result := ConfigurationGroupValuesClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConfigurationGroupValueListResult); err != nil { + return ConfigurationGroupValuesClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates a hybrid configuration group tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - configurationGroupValueName - The name of the configuration group value. +// - parameters - Parameters supplied to update configuration group values tags. +// - options - ConfigurationGroupValuesClientUpdateTagsOptions contains the optional parameters for the ConfigurationGroupValuesClient.UpdateTags +// method. +func (client *ConfigurationGroupValuesClient) UpdateTags(ctx context.Context, resourceGroupName string, configurationGroupValueName string, parameters TagsObject, options *ConfigurationGroupValuesClientUpdateTagsOptions) (ConfigurationGroupValuesClientUpdateTagsResponse, error) { + var err error + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, configurationGroupValueName, parameters, options) + if err != nil { + return ConfigurationGroupValuesClientUpdateTagsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConfigurationGroupValuesClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ConfigurationGroupValuesClientUpdateTagsResponse{}, err + } + resp, err := client.updateTagsHandleResponse(httpResp) + return resp, err +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *ConfigurationGroupValuesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, configurationGroupValueName string, parameters TagsObject, options *ConfigurationGroupValuesClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}" + 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 configurationGroupValueName == "" { + return nil, errors.New("parameter configurationGroupValueName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationGroupValueName}", url.PathEscape(configurationGroupValueName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *ConfigurationGroupValuesClient) updateTagsHandleResponse(resp *http.Response) (ConfigurationGroupValuesClientUpdateTagsResponse, error) { + result := ConfigurationGroupValuesClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConfigurationGroupValue); err != nil { + return ConfigurationGroupValuesClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/constants.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/constants.go index 12fa3a09d204..056da5687cb1 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/constants.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/constants.go @@ -3,17 +3,250 @@ // 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. +// 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. -// DO NOT EDIT. package armhybridnetwork const ( moduleName = "armhybridnetwork" - moduleVersion = "v1.1.1" + moduleVersion = "v2.0.0" ) +// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. +type ActionType string + +const ( + ActionTypeInternal ActionType = "Internal" +) + +// PossibleActionTypeValues returns the possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ + ActionTypeInternal, + } +} + +// ApplicationEnablement - The application enablement. +type ApplicationEnablement string + +const ( + ApplicationEnablementDisabled ApplicationEnablement = "Disabled" + ApplicationEnablementEnabled ApplicationEnablement = "Enabled" + ApplicationEnablementUnknown ApplicationEnablement = "Unknown" +) + +// PossibleApplicationEnablementValues returns the possible values for the ApplicationEnablement const type. +func PossibleApplicationEnablementValues() []ApplicationEnablement { + return []ApplicationEnablement{ + ApplicationEnablementDisabled, + ApplicationEnablementEnabled, + ApplicationEnablementUnknown, + } +} + +// ArtifactManifestState - The artifact manifest state. +type ArtifactManifestState string + +const ( + ArtifactManifestStateSucceeded ArtifactManifestState = "Succeeded" + ArtifactManifestStateUnknown ArtifactManifestState = "Unknown" + ArtifactManifestStateUploaded ArtifactManifestState = "Uploaded" + ArtifactManifestStateUploading ArtifactManifestState = "Uploading" + ArtifactManifestStateValidating ArtifactManifestState = "Validating" + ArtifactManifestStateValidationFailed ArtifactManifestState = "ValidationFailed" +) + +// PossibleArtifactManifestStateValues returns the possible values for the ArtifactManifestState const type. +func PossibleArtifactManifestStateValues() []ArtifactManifestState { + return []ArtifactManifestState{ + ArtifactManifestStateSucceeded, + ArtifactManifestStateUnknown, + ArtifactManifestStateUploaded, + ArtifactManifestStateUploading, + ArtifactManifestStateValidating, + ArtifactManifestStateValidationFailed, + } +} + +// ArtifactReplicationStrategy - The replication strategy. +type ArtifactReplicationStrategy string + +const ( + ArtifactReplicationStrategySingleReplication ArtifactReplicationStrategy = "SingleReplication" + ArtifactReplicationStrategyUnknown ArtifactReplicationStrategy = "Unknown" +) + +// PossibleArtifactReplicationStrategyValues returns the possible values for the ArtifactReplicationStrategy const type. +func PossibleArtifactReplicationStrategyValues() []ArtifactReplicationStrategy { + return []ArtifactReplicationStrategy{ + ArtifactReplicationStrategySingleReplication, + ArtifactReplicationStrategyUnknown, + } +} + +// ArtifactState - The artifact state. +type ArtifactState string + +const ( + ArtifactStateActive ArtifactState = "Active" + ArtifactStateDeprecated ArtifactState = "Deprecated" + ArtifactStatePreview ArtifactState = "Preview" + ArtifactStateUnknown ArtifactState = "Unknown" +) + +// PossibleArtifactStateValues returns the possible values for the ArtifactState const type. +func PossibleArtifactStateValues() []ArtifactState { + return []ArtifactState{ + ArtifactStateActive, + ArtifactStateDeprecated, + ArtifactStatePreview, + ArtifactStateUnknown, + } +} + +// ArtifactStoreType - The artifact store type. +type ArtifactStoreType string + +const ( + ArtifactStoreTypeAzureContainerRegistry ArtifactStoreType = "AzureContainerRegistry" + ArtifactStoreTypeAzureStorageAccount ArtifactStoreType = "AzureStorageAccount" + ArtifactStoreTypeUnknown ArtifactStoreType = "Unknown" +) + +// PossibleArtifactStoreTypeValues returns the possible values for the ArtifactStoreType const type. +func PossibleArtifactStoreTypeValues() []ArtifactStoreType { + return []ArtifactStoreType{ + ArtifactStoreTypeAzureContainerRegistry, + ArtifactStoreTypeAzureStorageAccount, + ArtifactStoreTypeUnknown, + } +} + +// ArtifactType - The artifact type. +type ArtifactType string + +const ( + ArtifactTypeArmTemplate ArtifactType = "ArmTemplate" + ArtifactTypeImageFile ArtifactType = "ImageFile" + ArtifactTypeOCIArtifact ArtifactType = "OCIArtifact" + ArtifactTypeUnknown ArtifactType = "Unknown" + ArtifactTypeVhdImageFile ArtifactType = "VhdImageFile" +) + +// PossibleArtifactTypeValues returns the possible values for the ArtifactType const type. +func PossibleArtifactTypeValues() []ArtifactType { + return []ArtifactType{ + ArtifactTypeArmTemplate, + ArtifactTypeImageFile, + ArtifactTypeOCIArtifact, + ArtifactTypeUnknown, + ArtifactTypeVhdImageFile, + } +} + +// AzureArcKubernetesArtifactType - The artifact type. +type AzureArcKubernetesArtifactType string + +const ( + AzureArcKubernetesArtifactTypeHelmPackage AzureArcKubernetesArtifactType = "HelmPackage" + AzureArcKubernetesArtifactTypeUnknown AzureArcKubernetesArtifactType = "Unknown" +) + +// PossibleAzureArcKubernetesArtifactTypeValues returns the possible values for the AzureArcKubernetesArtifactType const type. +func PossibleAzureArcKubernetesArtifactTypeValues() []AzureArcKubernetesArtifactType { + return []AzureArcKubernetesArtifactType{ + AzureArcKubernetesArtifactTypeHelmPackage, + AzureArcKubernetesArtifactTypeUnknown, + } +} + +// AzureCoreArtifactType - The artifact type. +type AzureCoreArtifactType string + +const ( + AzureCoreArtifactTypeArmTemplate AzureCoreArtifactType = "ArmTemplate" + AzureCoreArtifactTypeUnknown AzureCoreArtifactType = "Unknown" + AzureCoreArtifactTypeVhdImageFile AzureCoreArtifactType = "VhdImageFile" +) + +// PossibleAzureCoreArtifactTypeValues returns the possible values for the AzureCoreArtifactType const type. +func PossibleAzureCoreArtifactTypeValues() []AzureCoreArtifactType { + return []AzureCoreArtifactType{ + AzureCoreArtifactTypeArmTemplate, + AzureCoreArtifactTypeUnknown, + AzureCoreArtifactTypeVhdImageFile, + } +} + +// AzureOperatorNexusArtifactType - The artifact type. +type AzureOperatorNexusArtifactType string + +const ( + AzureOperatorNexusArtifactTypeArmTemplate AzureOperatorNexusArtifactType = "ArmTemplate" + AzureOperatorNexusArtifactTypeImageFile AzureOperatorNexusArtifactType = "ImageFile" + AzureOperatorNexusArtifactTypeUnknown AzureOperatorNexusArtifactType = "Unknown" +) + +// PossibleAzureOperatorNexusArtifactTypeValues returns the possible values for the AzureOperatorNexusArtifactType const type. +func PossibleAzureOperatorNexusArtifactTypeValues() []AzureOperatorNexusArtifactType { + return []AzureOperatorNexusArtifactType{ + AzureOperatorNexusArtifactTypeArmTemplate, + AzureOperatorNexusArtifactTypeImageFile, + AzureOperatorNexusArtifactTypeUnknown, + } +} + +// ConfigurationGenerationType - The configuration generation type. +type ConfigurationGenerationType string + +const ( + ConfigurationGenerationTypeHandlebarTemplate ConfigurationGenerationType = "HandlebarTemplate" + ConfigurationGenerationTypeUnknown ConfigurationGenerationType = "Unknown" +) + +// PossibleConfigurationGenerationTypeValues returns the possible values for the ConfigurationGenerationType const type. +func PossibleConfigurationGenerationTypeValues() []ConfigurationGenerationType { + return []ConfigurationGenerationType{ + ConfigurationGenerationTypeHandlebarTemplate, + ConfigurationGenerationTypeUnknown, + } +} + +// ConfigurationGroupValueConfigurationType - The secret type which indicates if secret or not. +type ConfigurationGroupValueConfigurationType string + +const ( + ConfigurationGroupValueConfigurationTypeOpen ConfigurationGroupValueConfigurationType = "Open" + ConfigurationGroupValueConfigurationTypeSecret ConfigurationGroupValueConfigurationType = "Secret" + ConfigurationGroupValueConfigurationTypeUnknown ConfigurationGroupValueConfigurationType = "Unknown" +) + +// PossibleConfigurationGroupValueConfigurationTypeValues returns the possible values for the ConfigurationGroupValueConfigurationType const type. +func PossibleConfigurationGroupValueConfigurationTypeValues() []ConfigurationGroupValueConfigurationType { + return []ConfigurationGroupValueConfigurationType{ + ConfigurationGroupValueConfigurationTypeOpen, + ConfigurationGroupValueConfigurationTypeSecret, + ConfigurationGroupValueConfigurationTypeUnknown, + } +} + +// ContainerizedNetworkFunctionNFVIType - The network function type. +type ContainerizedNetworkFunctionNFVIType string + +const ( + ContainerizedNetworkFunctionNFVITypeAzureArcKubernetes ContainerizedNetworkFunctionNFVIType = "AzureArcKubernetes" + ContainerizedNetworkFunctionNFVITypeUnknown ContainerizedNetworkFunctionNFVIType = "Unknown" +) + +// PossibleContainerizedNetworkFunctionNFVITypeValues returns the possible values for the ContainerizedNetworkFunctionNFVIType const type. +func PossibleContainerizedNetworkFunctionNFVITypeValues() []ContainerizedNetworkFunctionNFVIType { + return []ContainerizedNetworkFunctionNFVIType{ + ContainerizedNetworkFunctionNFVITypeAzureArcKubernetes, + ContainerizedNetworkFunctionNFVITypeUnknown, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -34,85 +267,121 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// DeviceType - The type of the device. -type DeviceType string +// CredentialType - The credential type. +type CredentialType string const ( - DeviceTypeAzureStackEdge DeviceType = "AzureStackEdge" - DeviceTypeUnknown DeviceType = "Unknown" + CredentialTypeAzureContainerRegistryScopedToken CredentialType = "AzureContainerRegistryScopedToken" + CredentialTypeAzureStorageAccountToken CredentialType = "AzureStorageAccountToken" + CredentialTypeUnknown CredentialType = "Unknown" ) -// PossibleDeviceTypeValues returns the possible values for the DeviceType const type. -func PossibleDeviceTypeValues() []DeviceType { - return []DeviceType{ - DeviceTypeAzureStackEdge, - DeviceTypeUnknown, +// PossibleCredentialTypeValues returns the possible values for the CredentialType const type. +func PossibleCredentialTypeValues() []CredentialType { + return []CredentialType{ + CredentialTypeAzureContainerRegistryScopedToken, + CredentialTypeAzureStorageAccountToken, + CredentialTypeUnknown, } } -// DiskCreateOptionTypes - Specifies how the virtual machine should be created. -type DiskCreateOptionTypes string +// HTTPMethod - The http method of the request. +type HTTPMethod string const ( - DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" - DiskCreateOptionTypesUnknown DiskCreateOptionTypes = "Unknown" + HTTPMethodDelete HTTPMethod = "Delete" + HTTPMethodGet HTTPMethod = "Get" + HTTPMethodPatch HTTPMethod = "Patch" + HTTPMethodPost HTTPMethod = "Post" + HTTPMethodPut HTTPMethod = "Put" + HTTPMethodUnknown HTTPMethod = "Unknown" ) -// PossibleDiskCreateOptionTypesValues returns the possible values for the DiskCreateOptionTypes const type. -func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { - return []DiskCreateOptionTypes{ - DiskCreateOptionTypesEmpty, - DiskCreateOptionTypesUnknown, +// PossibleHTTPMethodValues returns the possible values for the HTTPMethod const type. +func PossibleHTTPMethodValues() []HTTPMethod { + return []HTTPMethod{ + HTTPMethodDelete, + HTTPMethodGet, + HTTPMethodPatch, + HTTPMethodPost, + HTTPMethodPut, + HTTPMethodUnknown, } } -// IPAllocationMethod - IP address allocation method. -type IPAllocationMethod string +// IDType - The resource reference arm id type. +type IDType string const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" - IPAllocationMethodUnknown IPAllocationMethod = "Unknown" + IDTypeOpen IDType = "Open" + IDTypeSecret IDType = "Secret" + IDTypeUnknown IDType = "Unknown" ) -// PossibleIPAllocationMethodValues returns the possible values for the IPAllocationMethod const type. -func PossibleIPAllocationMethodValues() []IPAllocationMethod { - return []IPAllocationMethod{ - IPAllocationMethodDynamic, - IPAllocationMethodStatic, - IPAllocationMethodUnknown, +// PossibleIDTypeValues returns the possible values for the IDType const type. +func PossibleIDTypeValues() []IDType { + return []IDType{ + IDTypeOpen, + IDTypeSecret, + IDTypeUnknown, } } -// IPVersion - IP address version. -type IPVersion string +// ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). +type ManagedServiceIdentityType string const ( - IPVersionIPv4 IPVersion = "IPv4" - IPVersionUnknown IPVersion = "Unknown" + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" + ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned" + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" ) -// PossibleIPVersionValues returns the possible values for the IPVersion const type. -func PossibleIPVersionValues() []IPVersion { - return []IPVersion{ - IPVersionIPv4, - IPVersionUnknown, +// PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type. +func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { + return []ManagedServiceIdentityType{ + ManagedServiceIdentityTypeNone, + ManagedServiceIdentityTypeSystemAssigned, + ManagedServiceIdentityTypeSystemAssignedUserAssigned, + ManagedServiceIdentityTypeUserAssigned, } } -// NetworkFunctionRoleConfigurationType - Role type. -type NetworkFunctionRoleConfigurationType string +// NFVIType - The NFVI type. +type NFVIType string const ( - NetworkFunctionRoleConfigurationTypeUnknown NetworkFunctionRoleConfigurationType = "Unknown" - NetworkFunctionRoleConfigurationTypeVirtualMachine NetworkFunctionRoleConfigurationType = "VirtualMachine" + NFVITypeAzureArcKubernetes NFVIType = "AzureArcKubernetes" + NFVITypeAzureCore NFVIType = "AzureCore" + NFVITypeAzureOperatorNexus NFVIType = "AzureOperatorNexus" + NFVITypeUnknown NFVIType = "Unknown" ) -// PossibleNetworkFunctionRoleConfigurationTypeValues returns the possible values for the NetworkFunctionRoleConfigurationType const type. -func PossibleNetworkFunctionRoleConfigurationTypeValues() []NetworkFunctionRoleConfigurationType { - return []NetworkFunctionRoleConfigurationType{ - NetworkFunctionRoleConfigurationTypeUnknown, - NetworkFunctionRoleConfigurationTypeVirtualMachine, +// PossibleNFVITypeValues returns the possible values for the NFVIType const type. +func PossibleNFVITypeValues() []NFVIType { + return []NFVIType{ + NFVITypeAzureArcKubernetes, + NFVITypeAzureCore, + NFVITypeAzureOperatorNexus, + NFVITypeUnknown, + } +} + +// NetworkFunctionConfigurationType - The secret type which indicates if secret or not. +type NetworkFunctionConfigurationType string + +const ( + NetworkFunctionConfigurationTypeOpen NetworkFunctionConfigurationType = "Open" + NetworkFunctionConfigurationTypeSecret NetworkFunctionConfigurationType = "Secret" + NetworkFunctionConfigurationTypeUnknown NetworkFunctionConfigurationType = "Unknown" +) + +// PossibleNetworkFunctionConfigurationTypeValues returns the possible values for the NetworkFunctionConfigurationType const type. +func PossibleNetworkFunctionConfigurationTypeValues() []NetworkFunctionConfigurationType { + return []NetworkFunctionConfigurationType{ + NetworkFunctionConfigurationTypeOpen, + NetworkFunctionConfigurationTypeSecret, + NetworkFunctionConfigurationTypeUnknown, } } @@ -134,43 +403,64 @@ func PossibleNetworkFunctionTypeValues() []NetworkFunctionType { } } -// OperatingSystemTypes - The OS type. -type OperatingSystemTypes string +// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" +type Origin string + +const ( + OriginSystem Origin = "system" + OriginUser Origin = "user" + OriginUserSystem Origin = "user,system" +) + +// PossibleOriginValues returns the possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{ + OriginSystem, + OriginUser, + OriginUserSystem, + } +} + +// PodEventType - The type of pod event. +type PodEventType string const ( - OperatingSystemTypesLinux OperatingSystemTypes = "Linux" - OperatingSystemTypesUnknown OperatingSystemTypes = "Unknown" - OperatingSystemTypesWindows OperatingSystemTypes = "Windows" + PodEventTypeNormal PodEventType = "Normal" + PodEventTypeWarning PodEventType = "Warning" ) -// PossibleOperatingSystemTypesValues returns the possible values for the OperatingSystemTypes const type. -func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { - return []OperatingSystemTypes{ - OperatingSystemTypesLinux, - OperatingSystemTypesUnknown, - OperatingSystemTypesWindows, +// PossiblePodEventTypeValues returns the possible values for the PodEventType const type. +func PossiblePodEventTypeValues() []PodEventType { + return []PodEventType{ + PodEventTypeNormal, + PodEventTypeWarning, } } -// OperationalState - The operational state of the role instance. -type OperationalState string +// PodStatus - The status of a Pod. +type PodStatus string const ( - OperationalStateRunning OperationalState = "Running" - OperationalStateStarting OperationalState = "Starting" - OperationalStateStopped OperationalState = "Stopped" - OperationalStateStopping OperationalState = "Stopping" - OperationalStateUnknown OperationalState = "Unknown" + PodStatusFailed PodStatus = "Failed" + PodStatusNotReady PodStatus = "NotReady" + PodStatusPending PodStatus = "Pending" + PodStatusRunning PodStatus = "Running" + PodStatusSucceeded PodStatus = "Succeeded" + PodStatusTerminating PodStatus = "Terminating" + PodStatusUnknown PodStatus = "Unknown" ) -// PossibleOperationalStateValues returns the possible values for the OperationalState const type. -func PossibleOperationalStateValues() []OperationalState { - return []OperationalState{ - OperationalStateRunning, - OperationalStateStarting, - OperationalStateStopped, - OperationalStateStopping, - OperationalStateUnknown, +// PossiblePodStatusValues returns the possible values for the PodStatus const type. +func PossiblePodStatusValues() []PodStatus { + return []PodStatus{ + PodStatusFailed, + PodStatusNotReady, + PodStatusPending, + PodStatusRunning, + PodStatusSucceeded, + PodStatusTerminating, + PodStatusUnknown, } } @@ -178,13 +468,14 @@ func PossibleOperationalStateValues() []OperationalState { type ProvisioningState string const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateDeleted ProvisioningState = "Deleted" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUnknown ProvisioningState = "Unknown" + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateConverging ProvisioningState = "Converging" + ProvisioningStateDeleted ProvisioningState = "Deleted" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUnknown ProvisioningState = "Unknown" ) // PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. @@ -192,6 +483,7 @@ func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{ ProvisioningStateAccepted, ProvisioningStateCanceled, + ProvisioningStateConverging, ProvisioningStateDeleted, ProvisioningStateDeleting, ProvisioningStateFailed, @@ -200,170 +492,166 @@ func PossibleProvisioningStateValues() []ProvisioningState { } } -// SKUDeploymentMode - The sku deployment mode. -type SKUDeploymentMode string +// PublisherScope - Publisher Scope. +type PublisherScope string + +const ( + PublisherScopePrivate PublisherScope = "Private" + PublisherScopeUnknown PublisherScope = "Unknown" +) + +// PossiblePublisherScopeValues returns the possible values for the PublisherScope const type. +func PossiblePublisherScopeValues() []PublisherScope { + return []PublisherScope{ + PublisherScopePrivate, + PublisherScopeUnknown, + } +} + +// SKUName - Name of this Sku +type SKUName string const ( - SKUDeploymentModeAzure SKUDeploymentMode = "Azure" - SKUDeploymentModePrivateEdgeZone SKUDeploymentMode = "PrivateEdgeZone" - SKUDeploymentModeUnknown SKUDeploymentMode = "Unknown" + SKUNameBasic SKUName = "Basic" + SKUNameStandard SKUName = "Standard" ) -// PossibleSKUDeploymentModeValues returns the possible values for the SKUDeploymentMode const type. -func PossibleSKUDeploymentModeValues() []SKUDeploymentMode { - return []SKUDeploymentMode{ - SKUDeploymentModeAzure, - SKUDeploymentModePrivateEdgeZone, - SKUDeploymentModeUnknown, +// PossibleSKUNameValues returns the possible values for the SKUName const type. +func PossibleSKUNameValues() []SKUName { + return []SKUName{ + SKUNameBasic, + SKUNameStandard, } } -// SKUType - Sku type. -type SKUType string +// SKUTier - The SKU tier based on the SKU name. +type SKUTier string const ( - SKUTypeEvolvedPacketCore SKUType = "EvolvedPacketCore" - SKUTypeFirewall SKUType = "Firewall" - SKUTypeSDWAN SKUType = "SDWAN" - SKUTypeUnknown SKUType = "Unknown" + SKUTierBasic SKUTier = "Basic" + SKUTierStandard SKUTier = "Standard" ) -// PossibleSKUTypeValues returns the possible values for the SKUType const type. -func PossibleSKUTypeValues() []SKUType { - return []SKUType{ - SKUTypeEvolvedPacketCore, - SKUTypeFirewall, - SKUTypeSDWAN, - SKUTypeUnknown, +// PossibleSKUTierValues returns the possible values for the SKUTier const type. +func PossibleSKUTierValues() []SKUTier { + return []SKUTier{ + SKUTierBasic, + SKUTierStandard, } } -// Status - The current device status. +// Status - The component resource deployment status. type Status string const ( - StatusDeleted Status = "Deleted" - StatusNotRegistered Status = "NotRegistered" - StatusRegistered Status = "Registered" - StatusUnknown Status = "Unknown" + StatusDeployed Status = "Deployed" + StatusDownloading Status = "Downloading" + StatusFailed Status = "Failed" + StatusInstalling Status = "Installing" + StatusPendingInstall Status = "Pending-Install" + StatusPendingRollback Status = "Pending-Rollback" + StatusPendingUpgrade Status = "Pending-Upgrade" + StatusReinstalling Status = "Reinstalling" + StatusRollingback Status = "Rollingback" + StatusSuperseded Status = "Superseded" + StatusUninstalled Status = "Uninstalled" + StatusUninstalling Status = "Uninstalling" + StatusUnknown Status = "Unknown" + StatusUpgrading Status = "Upgrading" ) // PossibleStatusValues returns the possible values for the Status const type. func PossibleStatusValues() []Status { return []Status{ - StatusDeleted, - StatusNotRegistered, - StatusRegistered, + StatusDeployed, + StatusDownloading, + StatusFailed, + StatusInstalling, + StatusPendingInstall, + StatusPendingRollback, + StatusPendingUpgrade, + StatusReinstalling, + StatusRollingback, + StatusSuperseded, + StatusUninstalled, + StatusUninstalling, StatusUnknown, + StatusUpgrading, + } +} + +// TemplateType - The template type. +type TemplateType string + +const ( + TemplateTypeArmTemplate TemplateType = "ArmTemplate" + TemplateTypeUnknown TemplateType = "Unknown" +) + +// PossibleTemplateTypeValues returns the possible values for the TemplateType const type. +func PossibleTemplateTypeValues() []TemplateType { + return []TemplateType{ + TemplateTypeArmTemplate, + TemplateTypeUnknown, + } +} + +// Type - The resource element template type. +type Type string + +const ( + TypeArmResourceDefinition Type = "ArmResourceDefinition" + TypeNetworkFunctionDefinition Type = "NetworkFunctionDefinition" + TypeUnknown Type = "Unknown" +) + +// PossibleTypeValues returns the possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{ + TypeArmResourceDefinition, + TypeNetworkFunctionDefinition, + TypeUnknown, } } -// VMSwitchType - The type of the VM switch. -type VMSwitchType string - -const ( - VMSwitchTypeLan VMSwitchType = "Lan" - VMSwitchTypeManagement VMSwitchType = "Management" - VMSwitchTypeUnknown VMSwitchType = "Unknown" - VMSwitchTypeWan VMSwitchType = "Wan" -) - -// PossibleVMSwitchTypeValues returns the possible values for the VMSwitchType const type. -func PossibleVMSwitchTypeValues() []VMSwitchType { - return []VMSwitchType{ - VMSwitchTypeLan, - VMSwitchTypeManagement, - VMSwitchTypeUnknown, - VMSwitchTypeWan, - } -} - -// VendorProvisioningState - The current vendor provisioning state. -type VendorProvisioningState string - -const ( - VendorProvisioningStateDeprovisioned VendorProvisioningState = "Deprovisioned" - VendorProvisioningStateNotProvisioned VendorProvisioningState = "NotProvisioned" - VendorProvisioningStateProvisioned VendorProvisioningState = "Provisioned" - VendorProvisioningStateProvisioning VendorProvisioningState = "Provisioning" - VendorProvisioningStateUnknown VendorProvisioningState = "Unknown" - VendorProvisioningStateUserDataValidationFailed VendorProvisioningState = "UserDataValidationFailed" -) - -// PossibleVendorProvisioningStateValues returns the possible values for the VendorProvisioningState const type. -func PossibleVendorProvisioningStateValues() []VendorProvisioningState { - return []VendorProvisioningState{ - VendorProvisioningStateDeprovisioned, - VendorProvisioningStateNotProvisioned, - VendorProvisioningStateProvisioned, - VendorProvisioningStateProvisioning, - VendorProvisioningStateUnknown, - VendorProvisioningStateUserDataValidationFailed, - } -} - -// VirtualMachineSizeTypes - The size of the virtual machine. -type VirtualMachineSizeTypes string - -const ( - VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" - VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" - VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" - VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" - VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" - VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" - VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" - VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" - VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" - VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" - VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" - VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" - VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" - VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" - VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" - VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" - VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1" - VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16" - VirtualMachineSizeTypesStandardF16S VirtualMachineSizeTypes = "Standard_F16s" - VirtualMachineSizeTypesStandardF1S VirtualMachineSizeTypes = "Standard_F1s" - VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2" - VirtualMachineSizeTypesStandardF2S VirtualMachineSizeTypes = "Standard_F2s" - VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4" - VirtualMachineSizeTypesStandardF4S VirtualMachineSizeTypes = "Standard_F4s" - VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8" - VirtualMachineSizeTypesStandardF8S VirtualMachineSizeTypes = "Standard_F8s" - VirtualMachineSizeTypesUnknown VirtualMachineSizeTypes = "Unknown" -) - -// PossibleVirtualMachineSizeTypesValues returns the possible values for the VirtualMachineSizeTypes const type. -func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes { - return []VirtualMachineSizeTypes{ - VirtualMachineSizeTypesStandardD11V2, - VirtualMachineSizeTypesStandardD12V2, - VirtualMachineSizeTypesStandardD13V2, - VirtualMachineSizeTypesStandardD1V2, - VirtualMachineSizeTypesStandardD2V2, - VirtualMachineSizeTypesStandardD3V2, - VirtualMachineSizeTypesStandardD4V2, - VirtualMachineSizeTypesStandardD5V2, - VirtualMachineSizeTypesStandardDS11V2, - VirtualMachineSizeTypesStandardDS12V2, - VirtualMachineSizeTypesStandardDS13V2, - VirtualMachineSizeTypesStandardDS1V2, - VirtualMachineSizeTypesStandardDS2V2, - VirtualMachineSizeTypesStandardDS3V2, - VirtualMachineSizeTypesStandardDS4V2, - VirtualMachineSizeTypesStandardDS5V2, - VirtualMachineSizeTypesStandardF1, - VirtualMachineSizeTypesStandardF16, - VirtualMachineSizeTypesStandardF16S, - VirtualMachineSizeTypesStandardF1S, - VirtualMachineSizeTypesStandardF2, - VirtualMachineSizeTypesStandardF2S, - VirtualMachineSizeTypesStandardF4, - VirtualMachineSizeTypesStandardF4S, - VirtualMachineSizeTypesStandardF8, - VirtualMachineSizeTypesStandardF8S, - VirtualMachineSizeTypesUnknown, +// VersionState - The configuration group schema state. +type VersionState string + +const ( + VersionStateActive VersionState = "Active" + VersionStateDeprecated VersionState = "Deprecated" + VersionStatePreview VersionState = "Preview" + VersionStateUnknown VersionState = "Unknown" + VersionStateValidating VersionState = "Validating" + VersionStateValidationFailed VersionState = "ValidationFailed" +) + +// PossibleVersionStateValues returns the possible values for the VersionState const type. +func PossibleVersionStateValues() []VersionState { + return []VersionState{ + VersionStateActive, + VersionStateDeprecated, + VersionStatePreview, + VersionStateUnknown, + VersionStateValidating, + VersionStateValidationFailed, + } +} + +// VirtualNetworkFunctionNFVIType - The network function type. +type VirtualNetworkFunctionNFVIType string + +const ( + VirtualNetworkFunctionNFVITypeAzureCore VirtualNetworkFunctionNFVIType = "AzureCore" + VirtualNetworkFunctionNFVITypeAzureOperatorNexus VirtualNetworkFunctionNFVIType = "AzureOperatorNexus" + VirtualNetworkFunctionNFVITypeUnknown VirtualNetworkFunctionNFVIType = "Unknown" +) + +// PossibleVirtualNetworkFunctionNFVITypeValues returns the possible values for the VirtualNetworkFunctionNFVIType const type. +func PossibleVirtualNetworkFunctionNFVITypeValues() []VirtualNetworkFunctionNFVIType { + return []VirtualNetworkFunctionNFVIType{ + VirtualNetworkFunctionNFVITypeAzureCore, + VirtualNetworkFunctionNFVITypeAzureOperatorNexus, + VirtualNetworkFunctionNFVITypeUnknown, } } diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/devices_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/devices_client.go deleted file mode 100644 index 64c61edc3e76..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/devices_client.go +++ /dev/null @@ -1,477 +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 armhybridnetwork - -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" -) - -// DevicesClient contains the methods for the Devices group. -// Don't use this type directly, use NewDevicesClient() instead. -type DevicesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDevicesClient creates a new instance of DevicesClient 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 NewDevicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DevicesClient, error) { - cl, err := arm.NewClient(moduleName+".DevicesClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DevicesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a device. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - deviceName - Resource name for the device resource. -// - parameters - Parameters supplied to the create or update device operation. -// - options - DevicesClientBeginCreateOrUpdateOptions contains the optional parameters for the DevicesClient.BeginCreateOrUpdate -// method. -func (client *DevicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, deviceName string, parameters Device, options *DevicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[DevicesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, deviceName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DevicesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[DevicesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// CreateOrUpdate - Creates or updates a device. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -func (client *DevicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, deviceName string, parameters Device, options *DevicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, deviceName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DevicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, deviceName string, parameters Device, options *DevicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/devices/{deviceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if deviceName == "" { - return nil, errors.New("parameter deviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{deviceName}", url.PathEscape(deviceName)) - 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified device. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - deviceName - The name of the device resource. -// - options - DevicesClientBeginDeleteOptions contains the optional parameters for the DevicesClient.BeginDelete method. -func (client *DevicesClient) BeginDelete(ctx context.Context, resourceGroupName string, deviceName string, options *DevicesClientBeginDeleteOptions) (*runtime.Poller[DevicesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, deviceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DevicesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[DevicesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Delete - Deletes the specified device. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -func (client *DevicesClient) deleteOperation(ctx context.Context, resourceGroupName string, deviceName string, options *DevicesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, deviceName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DevicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, deviceName string, options *DevicesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/devices/{deviceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if deviceName == "" { - return nil, errors.New("parameter deviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{deviceName}", url.PathEscape(deviceName)) - 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about the specified device. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - deviceName - The name of the device resource. -// - options - DevicesClientGetOptions contains the optional parameters for the DevicesClient.Get method. -func (client *DevicesClient) Get(ctx context.Context, resourceGroupName string, deviceName string, options *DevicesClientGetOptions) (DevicesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, deviceName, options) - if err != nil { - return DevicesClientGetResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DevicesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DevicesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DevicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, deviceName string, options *DevicesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/devices/{deviceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if deviceName == "" { - return nil, errors.New("parameter deviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{deviceName}", url.PathEscape(deviceName)) - 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", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DevicesClient) getHandleResponse(resp *http.Response) (DevicesClientGetResponse, error) { - result := DevicesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Device); err != nil { - return DevicesClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the device resource in a resource group. -// -// Generated from API version 2021-05-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - options - DevicesClientListByResourceGroupOptions contains the optional parameters for the DevicesClient.NewListByResourceGroupPager -// method. -func (client *DevicesClient) NewListByResourceGroupPager(resourceGroupName string, options *DevicesClientListByResourceGroupOptions) *runtime.Pager[DevicesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DevicesClientListByResourceGroupResponse]{ - More: func(page DevicesClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DevicesClientListByResourceGroupResponse) (DevicesClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DevicesClientListByResourceGroupResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DevicesClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DevicesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DevicesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DevicesClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/devices" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - 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", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *DevicesClient) listByResourceGroupHandleResponse(resp *http.Response) (DevicesClientListByResourceGroupResponse, error) { - result := DevicesClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DeviceListResult); err != nil { - return DevicesClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all the devices in a subscription. -// -// Generated from API version 2021-05-01 -// - options - DevicesClientListBySubscriptionOptions contains the optional parameters for the DevicesClient.NewListBySubscriptionPager -// method. -func (client *DevicesClient) NewListBySubscriptionPager(options *DevicesClientListBySubscriptionOptions) *runtime.Pager[DevicesClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[DevicesClientListBySubscriptionResponse]{ - More: func(page DevicesClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DevicesClientListBySubscriptionResponse) (DevicesClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DevicesClientListBySubscriptionResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DevicesClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DevicesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *DevicesClient) listBySubscriptionCreateRequest(ctx context.Context, options *DevicesClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/devices" - 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", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *DevicesClient) listBySubscriptionHandleResponse(resp *http.Response) (DevicesClientListBySubscriptionResponse, error) { - result := DevicesClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DeviceListResult); err != nil { - return DevicesClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// ListRegistrationKey - List the registration key for the device. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - deviceName - The name of the device resource. -// - options - DevicesClientListRegistrationKeyOptions contains the optional parameters for the DevicesClient.ListRegistrationKey -// method. -func (client *DevicesClient) ListRegistrationKey(ctx context.Context, resourceGroupName string, deviceName string, options *DevicesClientListRegistrationKeyOptions) (DevicesClientListRegistrationKeyResponse, error) { - req, err := client.listRegistrationKeyCreateRequest(ctx, resourceGroupName, deviceName, options) - if err != nil { - return DevicesClientListRegistrationKeyResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DevicesClientListRegistrationKeyResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DevicesClientListRegistrationKeyResponse{}, runtime.NewResponseError(resp) - } - return client.listRegistrationKeyHandleResponse(resp) -} - -// listRegistrationKeyCreateRequest creates the ListRegistrationKey request. -func (client *DevicesClient) listRegistrationKeyCreateRequest(ctx context.Context, resourceGroupName string, deviceName string, options *DevicesClientListRegistrationKeyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/devices/{deviceName}/listRegistrationKey" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if deviceName == "" { - return nil, errors.New("parameter deviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{deviceName}", url.PathEscape(deviceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listRegistrationKeyHandleResponse handles the ListRegistrationKey response. -func (client *DevicesClient) listRegistrationKeyHandleResponse(resp *http.Response) (DevicesClientListRegistrationKeyResponse, error) { - result := DevicesClientListRegistrationKeyResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DeviceRegistrationKey); err != nil { - return DevicesClientListRegistrationKeyResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates device tags. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - deviceName - The name of the device resource. -// - parameters - Parameters supplied to the update device tags operation. -// - options - DevicesClientUpdateTagsOptions contains the optional parameters for the DevicesClient.UpdateTags method. -func (client *DevicesClient) UpdateTags(ctx context.Context, resourceGroupName string, deviceName string, parameters TagsObject, options *DevicesClientUpdateTagsOptions) (DevicesClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, deviceName, parameters, options) - if err != nil { - return DevicesClientUpdateTagsResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DevicesClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DevicesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *DevicesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, deviceName string, parameters TagsObject, options *DevicesClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/devices/{deviceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if deviceName == "" { - return nil, errors.New("parameter deviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{deviceName}", url.PathEscape(deviceName)) - 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.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *DevicesClient) updateTagsHandleResponse(resp *http.Response) (DevicesClientUpdateTagsResponse, error) { - result := DevicesClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Device); err != nil { - return DevicesClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/devices_client_example_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/devices_client_example_test.go deleted file mode 100644 index 0061a8229dab..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/devices_client_example_test.go +++ /dev/null @@ -1,286 +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 armhybridnetwork_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/hybridnetwork/armhybridnetwork" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceDelete.json -func ExampleDevicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDevicesClient().BeginDelete(ctx, "rg1", "TestDevice", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceGet.json -func ExampleDevicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDevicesClient().Get(ctx, "rg1", "TestDevice", 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.Device = armhybridnetwork.Device{ - // Name: to.Ptr("TestDevice"), - // Type: to.Ptr("Microsoft.HybridNetwork/devices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/devices/TestDevice"), - // Location: to.Ptr("eastus"), - // Properties: &armhybridnetwork.AzureStackEdgeFormat{ - // DeviceType: to.Ptr(armhybridnetwork.DeviceTypeAzureStackEdge), - // NetworkFunctions: []*armhybridnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.HybridNetwork/networkFunctions/TestNetworkFunction"), - // }}, - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // Status: to.Ptr(armhybridnetwork.StatusNotRegistered), - // AzureStackEdge: &armhybridnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg2/providers/Microsoft.DataboxEdge/DataboxEdgeDevices/TestDataboxEdgeDeviceName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceCreate.json -func ExampleDevicesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDevicesClient().BeginCreateOrUpdate(ctx, "rg1", "TestDevice", armhybridnetwork.Device{ - Location: to.Ptr("eastus"), - Properties: &armhybridnetwork.AzureStackEdgeFormat{ - DeviceType: to.Ptr(armhybridnetwork.DeviceTypeAzureStackEdge), - AzureStackEdge: &armhybridnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg2/providers/Microsoft.DataboxEdge/DataboxEdgeDevices/TestDataboxEdgeDeviceName"), - }, - }, - }, 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.Device = armhybridnetwork.Device{ - // Name: to.Ptr("TestDevice"), - // Type: to.Ptr("Microsoft.HybridNetwork/devices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/devices/TestDevice"), - // Location: to.Ptr("eastus"), - // Properties: &armhybridnetwork.AzureStackEdgeFormat{ - // DeviceType: to.Ptr(armhybridnetwork.DeviceTypeAzureStackEdge), - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // Status: to.Ptr(armhybridnetwork.StatusNotRegistered), - // AzureStackEdge: &armhybridnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg2/providers/Microsoft.DataboxEdge/DataboxEdgeDevices/TestDataboxEdgeDeviceName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceUpdateTags.json -func ExampleDevicesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDevicesClient().UpdateTags(ctx, "rg1", "TestDevice", armhybridnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.Device = armhybridnetwork.Device{ - // Name: to.Ptr("TestDevice"), - // Type: to.Ptr("Microsoft.HybridNetwork/devices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/devices/TestDevice"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armhybridnetwork.AzureStackEdgeFormat{ - // DeviceType: to.Ptr(armhybridnetwork.DeviceTypeAzureStackEdge), - // NetworkFunctions: []*armhybridnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.HybridNetwork/networkFunctions/TestNetworkFunction"), - // }}, - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // Status: to.Ptr(armhybridnetwork.StatusNotRegistered), - // AzureStackEdge: &armhybridnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg2/providers/Microsoft.DataboxEdge/DataboxEdgeDevices/TestDataboxEdgeDeviceName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceListBySubscription.json -func ExampleDevicesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDevicesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeviceListResult = armhybridnetwork.DeviceListResult{ - // Value: []*armhybridnetwork.Device{ - // { - // Name: to.Ptr("TestDevice"), - // Type: to.Ptr("Microsoft.HybridNetwork/devices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/devices/TestDevice"), - // Location: to.Ptr("eastus"), - // Properties: &armhybridnetwork.AzureStackEdgeFormat{ - // DeviceType: to.Ptr(armhybridnetwork.DeviceTypeAzureStackEdge), - // NetworkFunctions: []*armhybridnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.HybridNetwork/networkFunctions/TestNetworkFunction"), - // }}, - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // Status: to.Ptr(armhybridnetwork.StatusNotRegistered), - // AzureStackEdge: &armhybridnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg2/providers/Microsoft.DataboxEdge/DataboxEdgeDevices/TestDataboxEdgeDeviceName"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceListByResourceGroup.json -func ExampleDevicesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDevicesClient().NewListByResourceGroupPager("rg1", 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.DeviceListResult = armhybridnetwork.DeviceListResult{ - // Value: []*armhybridnetwork.Device{ - // { - // Name: to.Ptr("TestDevice"), - // Type: to.Ptr("Microsoft.HybridNetwork/devices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/devices/TestDevice"), - // Location: to.Ptr("eastus"), - // Properties: &armhybridnetwork.AzureStackEdgeFormat{ - // DeviceType: to.Ptr(armhybridnetwork.DeviceTypeAzureStackEdge), - // NetworkFunctions: []*armhybridnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.HybridNetwork/networkFunctions/TestVirtualNetworkFunction"), - // }}, - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // Status: to.Ptr(armhybridnetwork.StatusNotRegistered), - // AzureStackEdge: &armhybridnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg2/providers/Microsoft.DataboxEdge/DataboxEdgeDevices/TestDataboxEdgeDeviceName"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceListRegistrationKey.json -func ExampleDevicesClient_ListRegistrationKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDevicesClient().ListRegistrationKey(ctx, "rg1", "TestDevice", 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.DeviceRegistrationKey = armhybridnetwork.DeviceRegistrationKey{ - // RegistrationKey: to.Ptr("TestRegistartionKey"), - // } -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/go.mod b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/go.mod index 61346dc2c517..675e5c1f593e 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/go.mod +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/go.sum b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/go.sum index 8ba445a8c4da..5c6bee428364 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/go.sum +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/go.sum @@ -1,31 +1,15 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/interfaces.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/interfaces.go new file mode 100644 index 000000000000..da02ca4710c9 --- /dev/null +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/interfaces.go @@ -0,0 +1,117 @@ +//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 armhybridnetwork + +// ArtifactAccessCredentialClassification provides polymorphic access to related types. +// Call the interface's GetArtifactAccessCredential() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ArtifactAccessCredential, *AzureContainerRegistryScopedTokenCredential, *AzureStorageAccountCredential +type ArtifactAccessCredentialClassification interface { + // GetArtifactAccessCredential returns the ArtifactAccessCredential content of the underlying type. + GetArtifactAccessCredential() *ArtifactAccessCredential +} + +// AzureArcKubernetesNetworkFunctionApplicationClassification provides polymorphic access to related types. +// Call the interface's GetAzureArcKubernetesNetworkFunctionApplication() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureArcKubernetesHelmApplication, *AzureArcKubernetesNetworkFunctionApplication +type AzureArcKubernetesNetworkFunctionApplicationClassification interface { + // GetAzureArcKubernetesNetworkFunctionApplication returns the AzureArcKubernetesNetworkFunctionApplication content of the underlying type. + GetAzureArcKubernetesNetworkFunctionApplication() *AzureArcKubernetesNetworkFunctionApplication +} + +// AzureCoreNetworkFunctionApplicationClassification provides polymorphic access to related types. +// Call the interface's GetAzureCoreNetworkFunctionApplication() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureCoreNetworkFunctionApplication, *AzureCoreNetworkFunctionArmTemplateApplication, *AzureCoreNetworkFunctionVhdApplication +type AzureCoreNetworkFunctionApplicationClassification interface { + // GetAzureCoreNetworkFunctionApplication returns the AzureCoreNetworkFunctionApplication content of the underlying type. + GetAzureCoreNetworkFunctionApplication() *AzureCoreNetworkFunctionApplication +} + +// AzureOperatorNexusNetworkFunctionApplicationClassification provides polymorphic access to related types. +// Call the interface's GetAzureOperatorNexusNetworkFunctionApplication() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureOperatorNexusNetworkFunctionApplication, *AzureOperatorNexusNetworkFunctionArmTemplateApplication, *AzureOperatorNexusNetworkFunctionImageApplication +type AzureOperatorNexusNetworkFunctionApplicationClassification interface { + // GetAzureOperatorNexusNetworkFunctionApplication returns the AzureOperatorNexusNetworkFunctionApplication content of the underlying type. + GetAzureOperatorNexusNetworkFunctionApplication() *AzureOperatorNexusNetworkFunctionApplication +} + +// ConfigurationGroupValuePropertiesFormatClassification provides polymorphic access to related types. +// Call the interface's GetConfigurationGroupValuePropertiesFormat() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ConfigurationGroupValuePropertiesFormat, *ConfigurationValueWithSecrets, *ConfigurationValueWithoutSecrets +type ConfigurationGroupValuePropertiesFormatClassification interface { + // GetConfigurationGroupValuePropertiesFormat returns the ConfigurationGroupValuePropertiesFormat content of the underlying type. + GetConfigurationGroupValuePropertiesFormat() *ConfigurationGroupValuePropertiesFormat +} + +// ContainerizedNetworkFunctionTemplateClassification provides polymorphic access to related types. +// Call the interface's GetContainerizedNetworkFunctionTemplate() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureArcKubernetesNetworkFunctionTemplate, *ContainerizedNetworkFunctionTemplate +type ContainerizedNetworkFunctionTemplateClassification interface { + // GetContainerizedNetworkFunctionTemplate returns the ContainerizedNetworkFunctionTemplate content of the underlying type. + GetContainerizedNetworkFunctionTemplate() *ContainerizedNetworkFunctionTemplate +} + +// DeploymentResourceIDReferenceClassification provides polymorphic access to related types. +// Call the interface's GetDeploymentResourceIDReference() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DeploymentResourceIDReference, *OpenDeploymentResourceReference, *SecretDeploymentResourceReference +type DeploymentResourceIDReferenceClassification interface { + // GetDeploymentResourceIDReference returns the DeploymentResourceIDReference content of the underlying type. + GetDeploymentResourceIDReference() *DeploymentResourceIDReference +} + +// NFVIsClassification provides polymorphic access to related types. +// Call the interface's GetNFVIs() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureArcK8SClusterNFVIDetails, *AzureCoreNFVIDetails, *AzureOperatorNexusClusterNFVIDetails, *NFVIs +type NFVIsClassification interface { + // GetNFVIs returns the NFVIs content of the underlying type. + GetNFVIs() *NFVIs +} + +// NetworkFunctionDefinitionVersionPropertiesFormatClassification provides polymorphic access to related types. +// Call the interface's GetNetworkFunctionDefinitionVersionPropertiesFormat() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ContainerizedNetworkFunctionDefinitionVersion, *NetworkFunctionDefinitionVersionPropertiesFormat, *VirtualNetworkFunctionDefinitionVersion +type NetworkFunctionDefinitionVersionPropertiesFormatClassification interface { + // GetNetworkFunctionDefinitionVersionPropertiesFormat returns the NetworkFunctionDefinitionVersionPropertiesFormat content of the underlying type. + GetNetworkFunctionDefinitionVersionPropertiesFormat() *NetworkFunctionDefinitionVersionPropertiesFormat +} + +// NetworkFunctionPropertiesFormatClassification provides polymorphic access to related types. +// Call the interface's GetNetworkFunctionPropertiesFormat() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *NetworkFunctionPropertiesFormat, *NetworkFunctionValueWithSecrets, *NetworkFunctionValueWithoutSecrets +type NetworkFunctionPropertiesFormatClassification interface { + // GetNetworkFunctionPropertiesFormat returns the NetworkFunctionPropertiesFormat content of the underlying type. + GetNetworkFunctionPropertiesFormat() *NetworkFunctionPropertiesFormat +} + +// ResourceElementTemplateClassification provides polymorphic access to related types. +// Call the interface's GetResourceElementTemplate() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ArmResourceDefinitionResourceElementTemplateDetails, *NetworkFunctionDefinitionResourceElementTemplateDetails, *ResourceElementTemplate +type ResourceElementTemplateClassification interface { + // GetResourceElementTemplate returns the ResourceElementTemplate content of the underlying type. + GetResourceElementTemplate() *ResourceElementTemplate +} + +// VirtualNetworkFunctionTemplateClassification provides polymorphic access to related types. +// Call the interface's GetVirtualNetworkFunctionTemplate() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureCoreNetworkFunctionTemplate, *AzureOperatorNexusNetworkFunctionTemplate, *VirtualNetworkFunctionTemplate +type VirtualNetworkFunctionTemplateClassification interface { + // GetVirtualNetworkFunctionTemplate returns the VirtualNetworkFunctionTemplate content of the underlying type. + GetVirtualNetworkFunctionTemplate() *VirtualNetworkFunctionTemplate +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/models.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/models.go index 5c8fbb70a08d..601d117b4be1 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/models.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/models.go @@ -3,70 +3,92 @@ // 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. +// 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. -// DO NOT EDIT. package armhybridnetwork import "time" -// AzureStackEdgeFormat - The reference to the Azure stack edge device. -type AzureStackEdgeFormat struct { - // REQUIRED; The reference to the Azure stack edge device. - AzureStackEdge *SubResource +// ArmResourceDefinitionResourceElementTemplate - The arm template RE. +type ArmResourceDefinitionResourceElementTemplate struct { + // Artifact profile properties. + ArtifactProfile *NSDArtifactProfile - // REQUIRED; The type of the device. - DeviceType *DeviceType + // Name and value pairs that define the parameter values. It can be a well formed escaped JSON string. + ParameterValues *string - // READ-ONLY; The list of network functions deployed on the device. - NetworkFunctions []*SubResource + // The template type. + TemplateType *TemplateType +} - // READ-ONLY; The provisioning state of the device resource. - ProvisioningState *ProvisioningState +// ArmResourceDefinitionResourceElementTemplateDetails - The arm resource definition resource element template details. +type ArmResourceDefinitionResourceElementTemplateDetails struct { + // REQUIRED; The resource element template type. + ResourceElementType *Type - // READ-ONLY; The current device status. - Status *Status + // The resource element template type. + Configuration *ArmResourceDefinitionResourceElementTemplate + + // The depends on profile. + DependsOnProfile *DependsOnProfile + + // Name of the resource element template. + Name *string } -// GetDevicePropertiesFormat implements the DevicePropertiesFormatClassification interface for type AzureStackEdgeFormat. -func (a *AzureStackEdgeFormat) GetDevicePropertiesFormat() *DevicePropertiesFormat { - return &DevicePropertiesFormat{ - Status: a.Status, - ProvisioningState: a.ProvisioningState, - DeviceType: a.DeviceType, - NetworkFunctions: a.NetworkFunctions, +// GetResourceElementTemplate implements the ResourceElementTemplateClassification interface for type ArmResourceDefinitionResourceElementTemplateDetails. +func (a *ArmResourceDefinitionResourceElementTemplateDetails) GetResourceElementTemplate() *ResourceElementTemplate { + return &ResourceElementTemplate{ + DependsOnProfile: a.DependsOnProfile, + Name: a.Name, + ResourceElementType: a.ResourceElementType, } } -// CustomProfile - Specifies the custom settings for the virtual machine. -type CustomProfile struct { - // Path for metadata configuration. - MetadataConfigurationPath *string +// ArmTemplateArtifactProfile - Template artifact profile. +type ArmTemplateArtifactProfile struct { + // Template name. + TemplateName *string + + // Template version. + TemplateVersion *string +} + +// ArmTemplateMappingRuleProfile - Template mapping rule profile +type ArmTemplateMappingRuleProfile struct { + // List of template parameters. + TemplateParameters *string } -// DataDisk - Specifies information about the operating system disk used by the virtual machine. -// For more information about disks, see About disks and VHDs for Azure virtual machines -// [https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json]. -type DataDisk struct { - // Specifies how the virtual machine should be created. - CreateOption *DiskCreateOptionTypes +// ArtifactAccessCredential - The artifact manifest credential definition. +type ArtifactAccessCredential struct { + // REQUIRED; The credential type. + CredentialType *CredentialType +} - // Specifies the size of an empty disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual - // machine image. - DiskSizeGB *int32 +// GetArtifactAccessCredential implements the ArtifactAccessCredentialClassification interface for type ArtifactAccessCredential. +func (a *ArtifactAccessCredential) GetArtifactAccessCredential() *ArtifactAccessCredential { return a } - // The name of data disk. - Name *string +// ArtifactChangeState - The artifact updating request payload. +type ArtifactChangeState struct { + // Artifact update state properties. + Properties *ArtifactChangeStateProperties +} + +// ArtifactChangeStateProperties - The artifact update state properties. +type ArtifactChangeStateProperties struct { + // The artifact state + ArtifactState *ArtifactState } -// Device resource. -type Device struct { +// ArtifactManifest - Artifact manifest properties. +type ArtifactManifest struct { // REQUIRED; The geo-location where the resource lives Location *string - // Device properties. - Properties DevicePropertiesFormatClassification + // Artifact manifest properties. + Properties *ArtifactManifestPropertiesFormat // Resource tags. Tags map[string]*string @@ -77,165 +99,54 @@ type Device struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // 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 } -// DeviceListResult - Response for devices API service call. -type DeviceListResult struct { - // A list of devices. - Value []*Device +// ArtifactManifestListResult - A list of artifact manifests. +type ArtifactManifestListResult struct { + // A list of artifact manifests. + Value []*ArtifactManifest - // READ-ONLY; The URL to get the next set of results. + // READ-ONLY; The URI to get the next set of results. NextLink *string } -// DevicePropertiesFormatClassification provides polymorphic access to related types. -// Call the interface's GetDevicePropertiesFormat() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureStackEdgeFormat, *DevicePropertiesFormat -type DevicePropertiesFormatClassification interface { - // GetDevicePropertiesFormat returns the DevicePropertiesFormat content of the underlying type. - GetDevicePropertiesFormat() *DevicePropertiesFormat -} - -// DevicePropertiesFormat - Device properties. -type DevicePropertiesFormat struct { - // REQUIRED; The type of the device. - DeviceType *DeviceType +// ArtifactManifestPropertiesFormat - Artifact manifest properties. +type ArtifactManifestPropertiesFormat struct { + // The artifacts list. + Artifacts []*ManifestArtifactFormat - // READ-ONLY; The list of network functions deployed on the device. - NetworkFunctions []*SubResource + // READ-ONLY; The artifact manifest state. + ArtifactManifestState *ArtifactManifestState - // READ-ONLY; The provisioning state of the device resource. + // READ-ONLY; The provisioning state of the ArtifactManifest resource. ProvisioningState *ProvisioningState - - // READ-ONLY; The current device status. - Status *Status -} - -// GetDevicePropertiesFormat implements the DevicePropertiesFormatClassification interface for type DevicePropertiesFormat. -func (d *DevicePropertiesFormat) GetDevicePropertiesFormat() *DevicePropertiesFormat { return d } - -// DeviceRegistrationKey - The device registration key. -type DeviceRegistrationKey struct { - // READ-ONLY; The registration key for the device. - RegistrationKey *string -} - -// DevicesClientBeginCreateOrUpdateOptions contains the optional parameters for the DevicesClient.BeginCreateOrUpdate method. -type DevicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DevicesClientBeginDeleteOptions contains the optional parameters for the DevicesClient.BeginDelete method. -type DevicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DevicesClientGetOptions contains the optional parameters for the DevicesClient.Get method. -type DevicesClientGetOptions struct { - // placeholder for future optional parameters -} - -// DevicesClientListByResourceGroupOptions contains the optional parameters for the DevicesClient.NewListByResourceGroupPager -// method. -type DevicesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DevicesClientListBySubscriptionOptions contains the optional parameters for the DevicesClient.NewListBySubscriptionPager -// method. -type DevicesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// DevicesClientListRegistrationKeyOptions contains the optional parameters for the DevicesClient.ListRegistrationKey method. -type DevicesClientListRegistrationKeyOptions struct { - // placeholder for future optional parameters -} - -// DevicesClientUpdateTagsOptions contains the optional parameters for the DevicesClient.UpdateTags method. -type DevicesClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// 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 -} - -// ErrorDetail - The error detail. -type ErrorDetail struct { - // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo - - // READ-ONLY; The error code. - Code *string - - // READ-ONLY; The error details. - Details []*ErrorDetail - - // READ-ONLY; The error message. - Message *string - - // 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 } -// ImageReference - The image reference properties. -type ImageReference struct { - // Specifies in decimal numbers, the exact version of image used to create the virtual machine. - ExactVersion *string - - // Specifies the offer of the image used to create the virtual machine. - Offer *string - - // The image publisher. - Publisher *string - - // The image SKU. - SKU *string - - // Specifies the version of the image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. - // Major, Minor, and Build are decimal numbers. Specify 'latest' to use the - // latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update - // after deploy time even if a new version becomes available. - Version *string +// ArtifactManifestUpdateState - The artifact manifest updating request payload. Only the 'Uploaded' state is allowed for +// updates. Other states are used for internal state transitioning. +type ArtifactManifestUpdateState struct { + // The artifact manifest state. + ArtifactManifestState *ArtifactManifestState } -// LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine. -type LinuxConfiguration struct { - // Specifies the ssh key configuration for a Linux OS. - SSH *SSHConfiguration +// ArtifactProfile - Artifact profile properties. +type ArtifactProfile struct { + // The reference to artifact store. + ArtifactStore *ReferencedResource } -// NetworkFunction - Network function resource response. -type NetworkFunction struct { +// ArtifactStore - Artifact store properties. +type ArtifactStore struct { // REQUIRED; The geo-location where the resource lives Location *string - // A unique read-only string that changes whenever the resource is updated. - Etag *string - - // Network function properties. - Properties *NetworkFunctionPropertiesFormat + // ArtifactStores properties. + Properties *ArtifactStorePropertiesFormat // Resource tags. Tags map[string]*string @@ -246,591 +157,506 @@ type NetworkFunction struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // 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 } -// NetworkFunctionListResult - Response for network function API service call. -type NetworkFunctionListResult struct { - // A list of network function resources in a subscription or resource group. - Value []*NetworkFunction +// ArtifactStoreListResult - A list of artifact stores. +type ArtifactStoreListResult struct { + // A list of artifact stores. + Value []*ArtifactStore // READ-ONLY; The URL to get the next set of results. NextLink *string } -// NetworkFunctionPropertiesFormat - Network function properties. -type NetworkFunctionPropertiesFormat struct { - // The reference to the device resource. Once set, it cannot be updated. - Device *SubResource - - // The parameters for the managed application. - ManagedApplicationParameters any - - // The network function container configurations from the user. - NetworkFunctionContainerConfigurations any +// ArtifactStorePropertiesFormat - Artifact store properties. +type ArtifactStorePropertiesFormat struct { + ManagedResourceGroupConfiguration *ArtifactStorePropertiesFormatManagedResourceGroupConfiguration - // The network function configurations from the user. - NetworkFunctionUserConfigurations []*NetworkFunctionUserConfiguration + // The replication strategy. + ReplicationStrategy *ArtifactReplicationStrategy - // The sku name for the network function. Once set, it cannot be updated. - SKUName *string + // The artifact store type. + StoreType *ArtifactStoreType - // The vendor name for the network function. Once set, it cannot be updated. - VendorName *string - - // READ-ONLY; The resource URI of the managed application. - ManagedApplication *SubResource - - // READ-ONLY; The provisioning state of the network function resource. + // READ-ONLY; The provisioning state of the application groups resource. ProvisioningState *ProvisioningState - // READ-ONLY; The sku type for the network function. - SKUType *SKUType - - // READ-ONLY; The service key for the network function resource. - ServiceKey *string - - // READ-ONLY; The vendor provisioning state for the network function resource. - VendorProvisioningState *VendorProvisioningState + // READ-ONLY; The created storage resource id + StorageResourceID *string } -// NetworkFunctionRoleConfiguration - Network function role configuration. -type NetworkFunctionRoleConfiguration struct { - // Specifies the custom settings for the virtual machine. - CustomProfile *CustomProfile - - // The network interface configurations. - NetworkInterfaces []*NetworkInterface - - // Specifies the operating system settings for the role instance. This value can be updated during the deployment of network - // function. - OSProfile *OsProfile - - // The name of the network function role. - RoleName *string - - // Role type. - RoleType *NetworkFunctionRoleConfigurationType +type ArtifactStorePropertiesFormatManagedResourceGroupConfiguration struct { + // The managed resource group location. + Location *string - // Specifies the storage settings for the virtual machine disks. - StorageProfile *StorageProfile + // The managed resource group name. + Name *string +} - // The user parameters for customers. The format of user data parameters has to be matched with the provided user data template. - UserDataParameters any +// AzureArcK8SClusterNFVIDetails - The AzureArcK8sCluster NFVI detail. +type AzureArcK8SClusterNFVIDetails struct { + // REQUIRED; The NFVI type. + NfviType *NFVIType - // The user data template for customers. This is a json schema template describing the format and data type of user data parameters. - UserDataTemplate any + // The reference to the custom location. + CustomLocationReference *ReferencedResource - // The size of the virtual machine. - VirtualMachineSize *VirtualMachineSizeTypes + // Name of the nfvi. + Name *string } -// NetworkFunctionRoleInstanceListResult - List of role instances of vendor network function. -type NetworkFunctionRoleInstanceListResult struct { - // READ-ONLY; The URL to get the next set of results. - NextLink *string - - // READ-ONLY; A list of role instances. - Value []*RoleInstance +// GetNFVIs implements the NFVIsClassification interface for type AzureArcK8SClusterNFVIDetails. +func (a *AzureArcK8SClusterNFVIDetails) GetNFVIs() *NFVIs { + return &NFVIs{ + Name: a.Name, + NfviType: a.NfviType, + } } -// NetworkFunctionSKUDetails - The network function sku details. -type NetworkFunctionSKUDetails struct { - // The network function sku type. - SKUType *SKUType - - // The network function sku role details. - Value []*NetworkFunctionSKURoleDetails +// AzureArcKubernetesArtifactProfile - Azure arc kubernetes artifact profile properties. +type AzureArcKubernetesArtifactProfile struct { + // The reference to artifact store. + ArtifactStore *ReferencedResource - // READ-ONLY; The URL to get the next set of results. - NextLink *string + // Helm artifact profile. + HelmArtifactProfile *HelmArtifactProfile } -// NetworkFunctionSKUListResult - A list of available network function skus. -type NetworkFunctionSKUListResult struct { - // The network function vendor sku overview properties. - Value []*SKUOverview +// AzureArcKubernetesDeployMappingRuleProfile - Azure arc kubernetes deploy mapping rule profile. +type AzureArcKubernetesDeployMappingRuleProfile struct { + // The application enablement. + ApplicationEnablement *ApplicationEnablement - // READ-ONLY; The URL to get the next set of results. - NextLink *string + // The helm mapping rule profile. + HelmMappingRuleProfile *HelmMappingRuleProfile } -// NetworkFunctionSKURoleDetails - The network function user configuration. -type NetworkFunctionSKURoleDetails struct { - // The network interface configuration. - NetworkInterfaces []*NetworkInterface +// AzureArcKubernetesHelmApplication - Azure arc kubernetes helm application configurations. +type AzureArcKubernetesHelmApplication struct { + // REQUIRED; The artifact type. + ArtifactType *AzureArcKubernetesArtifactType - // The name of the network function role. - RoleName *string + // Azure arc kubernetes artifact profile. + ArtifactProfile *AzureArcKubernetesArtifactProfile - // The user parameters for customers. - UserDataParameters any + // Depends on profile definition. + DependsOnProfile *DependsOnProfile - // The user data template for customers. - UserDataTemplate any + // Deploy mapping rule profile. + DeployParametersMappingRuleProfile *AzureArcKubernetesDeployMappingRuleProfile + + // The name of the network function application. + Name *string } -// NetworkFunctionTemplate - The network function template. -type NetworkFunctionTemplate struct { - // An array of network function role definitions. - NetworkFunctionRoleConfigurations []*NetworkFunctionRoleConfiguration +// GetAzureArcKubernetesNetworkFunctionApplication implements the AzureArcKubernetesNetworkFunctionApplicationClassification +// interface for type AzureArcKubernetesHelmApplication. +func (a *AzureArcKubernetesHelmApplication) GetAzureArcKubernetesNetworkFunctionApplication() *AzureArcKubernetesNetworkFunctionApplication { + return &AzureArcKubernetesNetworkFunctionApplication{ + ArtifactType: a.ArtifactType, + DependsOnProfile: a.DependsOnProfile, + Name: a.Name, + } } -// NetworkFunctionUserConfiguration - The network function user configuration. -type NetworkFunctionUserConfiguration struct { - // The network interface configuration. - NetworkInterfaces []*NetworkInterface +// AzureArcKubernetesNetworkFunctionApplication - Azure arc kubernetes network function application definition. +type AzureArcKubernetesNetworkFunctionApplication struct { + // REQUIRED; The artifact type. + ArtifactType *AzureArcKubernetesArtifactType - // Specifies the operating system settings for the role instance. - OSProfile *NetworkFunctionUserConfigurationOsProfile + // Depends on profile definition. + DependsOnProfile *DependsOnProfile - // The name of the network function role. - RoleName *string + // The name of the network function application. + Name *string +} - // The user data parameters from the customer. - UserDataParameters any +// GetAzureArcKubernetesNetworkFunctionApplication implements the AzureArcKubernetesNetworkFunctionApplicationClassification +// interface for type AzureArcKubernetesNetworkFunctionApplication. +func (a *AzureArcKubernetesNetworkFunctionApplication) GetAzureArcKubernetesNetworkFunctionApplication() *AzureArcKubernetesNetworkFunctionApplication { + return a } -// NetworkFunctionUserConfigurationOsProfile - Specifies the operating system settings for the role instance. -type NetworkFunctionUserConfigurationOsProfile struct { - // Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved - // as a file on the virtual machine. The maximum length of the binary array is - // 65535 bytes. - // Note: Do not pass any secrets or passwords in customData property - // This property cannot be updated after the VM is created. - // customData is passed to the VM to be saved as a file. For more information see Custom Data on Azure VMs [https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/] - // For using cloud-init for your Linux VM, see Using cloud-init to customize a Linux VM during creation - // [https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json] - CustomData *string +// AzureArcKubernetesNetworkFunctionTemplate - Azure Arc kubernetes network function template. +type AzureArcKubernetesNetworkFunctionTemplate struct { + // REQUIRED; The network function type. + NfviType *ContainerizedNetworkFunctionNFVIType + + // Network function applications. + NetworkFunctionApplications []AzureArcKubernetesNetworkFunctionApplicationClassification } -// NetworkFunctionVendor - The network function vendor. -type NetworkFunctionVendor struct { - // Vendors of Hybrid Network service provider. - Properties *VendorDetails +// GetContainerizedNetworkFunctionTemplate implements the ContainerizedNetworkFunctionTemplateClassification interface for +// type AzureArcKubernetesNetworkFunctionTemplate. +func (a *AzureArcKubernetesNetworkFunctionTemplate) GetContainerizedNetworkFunctionTemplate() *ContainerizedNetworkFunctionTemplate { + return &ContainerizedNetworkFunctionTemplate{ + NfviType: a.NfviType, + } } -// NetworkFunctionVendorConfiguration - Network function vendor configuration. -type NetworkFunctionVendorConfiguration struct { - // The network interface configurations. - NetworkInterfaces []*NetworkInterface +// AzureContainerRegistryScopedTokenCredential - The azure container registry scoped token credential definition. +type AzureContainerRegistryScopedTokenCredential struct { + // REQUIRED; The credential type. + CredentialType *CredentialType - // Specifies the operating system settings for the role instance. - OSProfile *OsProfile + // The Acr server url + AcrServerURL *string - // The name of the vendor network function role. - RoleName *string + // The credential value. + AcrToken *string - // READ-ONLY; The user parameters from the customer. - UserDataParameters any -} + // The UTC time when credential will expire. + Expiry *time.Time -// NetworkFunctionVendorListResult - The network function vendor list result. -type NetworkFunctionVendorListResult struct { - // A list of available network function vendors and skus. - Value []*NetworkFunctionVendor + // The repositories that could be accessed using the current credential. + Repositories []*string - // READ-ONLY; The URL to get the next set of results. - NextLink *string + // The username of the credential. + Username *string } -// NetworkFunctionVendorSKUsClientListBySKUOptions contains the optional parameters for the NetworkFunctionVendorSKUsClient.NewListBySKUPager -// method. -type NetworkFunctionVendorSKUsClientListBySKUOptions struct { - // placeholder for future optional parameters +// GetArtifactAccessCredential implements the ArtifactAccessCredentialClassification interface for type AzureContainerRegistryScopedTokenCredential. +func (a *AzureContainerRegistryScopedTokenCredential) GetArtifactAccessCredential() *ArtifactAccessCredential { + return &ArtifactAccessCredential{ + CredentialType: a.CredentialType, + } } -// NetworkFunctionVendorSKUsClientListByVendorOptions contains the optional parameters for the NetworkFunctionVendorSKUsClient.NewListByVendorPager -// method. -type NetworkFunctionVendorSKUsClientListByVendorOptions struct { - // placeholder for future optional parameters -} +// AzureCoreArmTemplateArtifactProfile - Azure template artifact profile properties. +type AzureCoreArmTemplateArtifactProfile struct { + // The reference to artifact store. + ArtifactStore *ReferencedResource -// NetworkFunctionVendorsClientListOptions contains the optional parameters for the NetworkFunctionVendorsClient.NewListPager -// method. -type NetworkFunctionVendorsClientListOptions struct { - // placeholder for future optional parameters + // Template artifact profile. + TemplateArtifactProfile *ArmTemplateArtifactProfile } -// NetworkFunctionsClientBeginCreateOrUpdateOptions contains the optional parameters for the NetworkFunctionsClient.BeginCreateOrUpdate -// method. -type NetworkFunctionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} +// AzureCoreArmTemplateDeployMappingRuleProfile - Azure template deploy mapping rule profile. +type AzureCoreArmTemplateDeployMappingRuleProfile struct { + // The application enablement. + ApplicationEnablement *ApplicationEnablement -// NetworkFunctionsClientBeginDeleteOptions contains the optional parameters for the NetworkFunctionsClient.BeginDelete method. -type NetworkFunctionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string + // The template mapping rule profile. + TemplateMappingRuleProfile *ArmTemplateMappingRuleProfile } -// NetworkFunctionsClientGetOptions contains the optional parameters for the NetworkFunctionsClient.Get method. -type NetworkFunctionsClientGetOptions struct { - // placeholder for future optional parameters -} +// AzureCoreNFVIDetails - The Azure Core NFVI detail. +type AzureCoreNFVIDetails struct { + // REQUIRED; The NFVI type. + NfviType *NFVIType -// NetworkFunctionsClientListByResourceGroupOptions contains the optional parameters for the NetworkFunctionsClient.NewListByResourceGroupPager -// method. -type NetworkFunctionsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} + // Location of the Azure core. + Location *string -// NetworkFunctionsClientListBySubscriptionOptions contains the optional parameters for the NetworkFunctionsClient.NewListBySubscriptionPager -// method. -type NetworkFunctionsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters + // Name of the nfvi. + Name *string } -// NetworkFunctionsClientUpdateTagsOptions contains the optional parameters for the NetworkFunctionsClient.UpdateTags method. -type NetworkFunctionsClientUpdateTagsOptions struct { - // placeholder for future optional parameters +// GetNFVIs implements the NFVIsClassification interface for type AzureCoreNFVIDetails. +func (a *AzureCoreNFVIDetails) GetNFVIs() *NFVIs { + return &NFVIs{ + Name: a.Name, + NfviType: a.NfviType, + } } -// NetworkInterface - Network interface properties. -type NetworkInterface struct { - // A list of IP configurations of the network interface. - IPConfigurations []*NetworkInterfaceIPConfiguration +// AzureCoreNetworkFunctionApplication - Azure virtual network function application definition. +type AzureCoreNetworkFunctionApplication struct { + // REQUIRED; The artifact type. + ArtifactType *AzureCoreArtifactType - // The MAC address of the network interface. - MacAddress *string + // Depends on profile definition. + DependsOnProfile *DependsOnProfile - // The name of the network interface. - NetworkInterfaceName *string - - // The type of the VM switch. - VMSwitchType *VMSwitchType + // The name of the network function application. + Name *string } -// NetworkInterfaceIPConfiguration - Network interface IP configuration properties. -type NetworkInterfaceIPConfiguration struct { - // The list of DNS servers IP addresses. - DNSServers []*string - - // The value of the gateway. - Gateway *string - - // The value of the IP address. - IPAddress *string +// GetAzureCoreNetworkFunctionApplication implements the AzureCoreNetworkFunctionApplicationClassification interface for type +// AzureCoreNetworkFunctionApplication. +func (a *AzureCoreNetworkFunctionApplication) GetAzureCoreNetworkFunctionApplication() *AzureCoreNetworkFunctionApplication { + return a +} - // IP address allocation method. - IPAllocationMethod *IPAllocationMethod +// AzureCoreNetworkFunctionArmTemplateApplication - Azure core network function Template application definition. +type AzureCoreNetworkFunctionArmTemplateApplication struct { + // REQUIRED; The artifact type. + ArtifactType *AzureCoreArtifactType - // IP address version. - IPVersion *IPVersion + // Azure template artifact profile. + ArtifactProfile *AzureCoreArmTemplateArtifactProfile - // The value of the subnet. - Subnet *string -} + // Depends on profile definition. + DependsOnProfile *DependsOnProfile -// Operation - Object that describes a single Microsoft.HybridNetwork operation. -type Operation struct { - // READ-ONLY; The object that represents the operation. - Display *OperationDisplay + // Deploy mapping rule profile. + DeployParametersMappingRuleProfile *AzureCoreArmTemplateDeployMappingRuleProfile - // READ-ONLY; Operation name: {provider}/{resource}/{operation}. + // The name of the network function application. Name *string } -// OperationDisplay - The object that represents the operation. -type OperationDisplay struct { - // Description of the operation. - Description *string - - // Operation type: Read, write, delete, etc. - Operation *string - - // Service provider: Microsoft.HybridNetwork. - Provider *string - - // Resource on which the operation is performed: Registration definition, registration assignment, etc. - Resource *string +// GetAzureCoreNetworkFunctionApplication implements the AzureCoreNetworkFunctionApplicationClassification interface for type +// AzureCoreNetworkFunctionArmTemplateApplication. +func (a *AzureCoreNetworkFunctionArmTemplateApplication) GetAzureCoreNetworkFunctionApplication() *AzureCoreNetworkFunctionApplication { + return &AzureCoreNetworkFunctionApplication{ + ArtifactType: a.ArtifactType, + DependsOnProfile: a.DependsOnProfile, + Name: a.Name, + } } -// OperationList - A list of the operations. -type OperationList struct { - // READ-ONLY; The URL to get the next set of results. - NextLink *string +// AzureCoreNetworkFunctionTemplate - Azure virtual network function template. +type AzureCoreNetworkFunctionTemplate struct { + // REQUIRED; The network function type. + NfviType *VirtualNetworkFunctionNFVIType - // READ-ONLY; A list of Microsoft.HybridNetwork operations. - Value []*Operation + // Network function applications. + NetworkFunctionApplications []AzureCoreNetworkFunctionApplicationClassification } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters +// GetVirtualNetworkFunctionTemplate implements the VirtualNetworkFunctionTemplateClassification interface for type AzureCoreNetworkFunctionTemplate. +func (a *AzureCoreNetworkFunctionTemplate) GetVirtualNetworkFunctionTemplate() *VirtualNetworkFunctionTemplate { + return &VirtualNetworkFunctionTemplate{ + NfviType: a.NfviType, + } } -// OsDisk - Specifies information about the operating system disk used by the virtual machine. -// For more information about disks, see About disks and VHDs for Azure virtual machines -// [https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json]. -type OsDisk struct { - // Specifies the size of os disk in gigabytes. This is the fully expanded disk size needed of the VHD image on the ASE. This - // disk size should be greater than the size of the VHD provided in vhdUri. - DiskSizeGB *int32 - - // The VHD name. - Name *string +// AzureCoreNetworkFunctionVhdApplication - Azure core network function vhd application definition. +type AzureCoreNetworkFunctionVhdApplication struct { + // REQUIRED; The artifact type. + ArtifactType *AzureCoreArtifactType - // The OS type. - OSType *OperatingSystemTypes - - // The virtual hard disk. - Vhd *VirtualHardDisk -} - -// OsProfile - Specifies the operating system settings for the role instance. -type OsProfile struct { - // Specifies the name of the administrator account. - // Windows-only restriction: Cannot end in "." - // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", - // "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", - // "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". - // Minimum-length (Linux): 1 character - // Max-length (Linux): 64 characters - // Max-length (Windows): 20 characters - // For root access to the Linux VM, see Using root privileges on Linux virtual machines in Azure - // [https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json] - // For a list of built-in system users on Linux that should not be used in this field, see Selecting User Names for Linux - // on Azure - // [https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json]. - AdminUsername *string - - // Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved - // as a file on the virtual machine. The maximum length of the binary array is - // 65535 bytes. - // Note: Do not pass any secrets or passwords in customData property - // This property cannot be updated after the VM is created. - // customData is passed to the VM to be saved as a file. For more information see Custom Data on Azure VMs [https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/] - // For using cloud-init for your Linux VM, see Using cloud-init to customize a Linux VM during creation - // [https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json] - CustomData *string - - // Indicates if custom data is required to deploy this role. - CustomDataRequired *bool - - // Specifies the Linux operating system settings on the virtual machine. - // For a list of supported Linux distributions, see Linux on Azure-Endorsed Distributions - // [https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json] - // For running non-endorsed distributions, see Information for Non-Endorsed Distributions - // [https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json]. - LinuxConfiguration *LinuxConfiguration -} - -// PreviewSubscription - Customer subscription which can use a sku. -type PreviewSubscription struct { - // The Preview Subscription properties. - Properties *PreviewSubscriptionProperties - - // READ-ONLY; The ARM ID of the resource. - ID *string + // Azure vhd image artifact profile. + ArtifactProfile *AzureCoreVhdImageArtifactProfile - // READ-ONLY; The preview subscription ID. - Name *string + // Depends on profile definition. + DependsOnProfile *DependsOnProfile - // READ-ONLY; The system meta data relating to this resource. - SystemData *SystemData + // Deploy mapping rule profile. + DeployParametersMappingRuleProfile *AzureCoreVhdImageDeployMappingRuleProfile - // READ-ONLY; The type of the resource. - Type *string + // The name of the network function application. + Name *string } -// PreviewSubscriptionProperties - PreviewSubscription properties -type PreviewSubscriptionProperties struct { - // READ-ONLY; The provisioning state of the PreviewSubscription resource. - ProvisioningState *ProvisioningState +// GetAzureCoreNetworkFunctionApplication implements the AzureCoreNetworkFunctionApplicationClassification interface for type +// AzureCoreNetworkFunctionVhdApplication. +func (a *AzureCoreNetworkFunctionVhdApplication) GetAzureCoreNetworkFunctionApplication() *AzureCoreNetworkFunctionApplication { + return &AzureCoreNetworkFunctionApplication{ + ArtifactType: a.ArtifactType, + DependsOnProfile: a.DependsOnProfile, + Name: a.Name, + } } -// PreviewSubscriptionsList - A list of customer subscriptions which can use a sku. -type PreviewSubscriptionsList struct { - // A list of preview subscriptions. - Value []*PreviewSubscription +// AzureCoreVhdImageArtifactProfile - Azure vhd artifact profile properties. +type AzureCoreVhdImageArtifactProfile struct { + // The reference to artifact store. + ArtifactStore *ReferencedResource - // READ-ONLY; The URL to get the next set of results. - NextLink *string + // Vhd artifact profile. + VhdArtifactProfile *VhdImageArtifactProfile } -// 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 +// AzureCoreVhdImageDeployMappingRuleProfile - Azure vhd deploy mapping rule profile. +type AzureCoreVhdImageDeployMappingRuleProfile struct { + // The application enablement. + ApplicationEnablement *ApplicationEnablement - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string + // The vhd mapping rule profile. + VhdImageMappingRuleProfile *VhdImageMappingRuleProfile } -// 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 +// AzureOperatorNexusArmTemplateArtifactProfile - Azure Operator Distributed Services vhd artifact profile properties. +type AzureOperatorNexusArmTemplateArtifactProfile struct { + // The reference to artifact store. + ArtifactStore *ReferencedResource - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string + // Template artifact profile. + TemplateArtifactProfile *ArmTemplateArtifactProfile } -// RoleInstance - The role instance sub resource. -type RoleInstance struct { - // The ARM ID of the resource. - ID *string +// AzureOperatorNexusArmTemplateDeployMappingRuleProfile - Azure Operator Distributed Services template deploy mapping rule +// profile. +type AzureOperatorNexusArmTemplateDeployMappingRuleProfile struct { + // The application enablement. + ApplicationEnablement *ApplicationEnablement - // The role instance name. - Name *string + // The template mapping rule profile. + TemplateMappingRuleProfile *ArmTemplateMappingRuleProfile +} - // The role instance properties. - Properties *RoleInstanceProperties +// AzureOperatorNexusClusterNFVIDetails - The AzureOperatorNexusCluster NFVI detail. +type AzureOperatorNexusClusterNFVIDetails struct { + // REQUIRED; The NFVI type. + NfviType *NFVIType - // The type of the resource. - Type *string + // The reference to the custom location. + CustomLocationReference *ReferencedResource - // READ-ONLY; The system meta data relating to this resource. - SystemData *SystemData + // Name of the nfvi. + Name *string } -// RoleInstanceProperties - The role instance properties of the network function. -type RoleInstanceProperties struct { - // The operational state of the role instance. - OperationalState *OperationalState - - // READ-ONLY; The provisioning state of the RoleInstance resource. - ProvisioningState *ProvisioningState +// GetNFVIs implements the NFVIsClassification interface for type AzureOperatorNexusClusterNFVIDetails. +func (a *AzureOperatorNexusClusterNFVIDetails) GetNFVIs() *NFVIs { + return &NFVIs{ + Name: a.Name, + NfviType: a.NfviType, + } } -// RoleInstancesClientBeginRestartOptions contains the optional parameters for the RoleInstancesClient.BeginRestart method. -type RoleInstancesClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} +// AzureOperatorNexusImageArtifactProfile - Azure Operator Distributed Services image artifact profile properties. +type AzureOperatorNexusImageArtifactProfile struct { + // The reference to artifact store. + ArtifactStore *ReferencedResource -// RoleInstancesClientBeginStartOptions contains the optional parameters for the RoleInstancesClient.BeginStart method. -type RoleInstancesClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string + // Image artifact profile. + ImageArtifactProfile *ImageArtifactProfile } -// RoleInstancesClientBeginStopOptions contains the optional parameters for the RoleInstancesClient.BeginStop method. -type RoleInstancesClientBeginStopOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} +// AzureOperatorNexusImageDeployMappingRuleProfile - Azure Operator Distributed Services image deploy mapping rule profile. +type AzureOperatorNexusImageDeployMappingRuleProfile struct { + // The application enablement. + ApplicationEnablement *ApplicationEnablement -// RoleInstancesClientGetOptions contains the optional parameters for the RoleInstancesClient.Get method. -type RoleInstancesClientGetOptions struct { - // placeholder for future optional parameters + // The vhd mapping rule profile. + ImageMappingRuleProfile *ImageMappingRuleProfile } -// RoleInstancesClientListOptions contains the optional parameters for the RoleInstancesClient.NewListPager method. -type RoleInstancesClientListOptions struct { - // placeholder for future optional parameters -} +// AzureOperatorNexusNetworkFunctionApplication - Azure Operator Distributed Services network function application definition. +type AzureOperatorNexusNetworkFunctionApplication struct { + // REQUIRED; The artifact type. + ArtifactType *AzureOperatorNexusArtifactType -// SKUOverview - The network function sku overview. -type SKUOverview struct { - // The vendor sku name. - SKUName *string + // Depends on profile definition. + DependsOnProfile *DependsOnProfile - // The vendor sku type. - SKUType *SKUType + // The name of the network function application. + Name *string } -// SSHConfiguration - SSH configuration for Linux based VMs running on Azure -type SSHConfiguration struct { - // The list of SSH public keys used to authenticate with linux based VMs. - PublicKeys []*SSHPublicKey +// GetAzureOperatorNexusNetworkFunctionApplication implements the AzureOperatorNexusNetworkFunctionApplicationClassification +// interface for type AzureOperatorNexusNetworkFunctionApplication. +func (a *AzureOperatorNexusNetworkFunctionApplication) GetAzureOperatorNexusNetworkFunctionApplication() *AzureOperatorNexusNetworkFunctionApplication { + return a } -// SSHPublicKey - Contains information about SSH certificate public key and the path on the Linux VM where the public key -// is placed. -type SSHPublicKey struct { - // SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa - // format. - // For creating ssh keys, see Create SSH keys on Linux and Mac for Linux VMs in Azure - // [https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json]. - KeyData *string +// AzureOperatorNexusNetworkFunctionArmTemplateApplication - Azure Operator Distributed Services network function Template +// application definition. +type AzureOperatorNexusNetworkFunctionArmTemplateApplication struct { + // REQUIRED; The artifact type. + ArtifactType *AzureOperatorNexusArtifactType - // Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key - // is appended to the file. Example: /home/user/.ssh/authorized_keys - Path *string -} + // Azure Operator Distributed Services Template artifact profile. + ArtifactProfile *AzureOperatorNexusArmTemplateArtifactProfile -// StorageProfile - Specifies the storage settings for the virtual machine disks. -type StorageProfile struct { - // Specifies the parameters that are used to add a data disk to a virtual machine. - DataDisks []*DataDisk + // Depends on profile definition. + DependsOnProfile *DependsOnProfile - // The image reference properties. - ImageReference *ImageReference + // Deploy mapping rule profile. + DeployParametersMappingRuleProfile *AzureOperatorNexusArmTemplateDeployMappingRuleProfile - // Specifies information about the operating system disk used by the virtual machine. - OSDisk *OsDisk + // The name of the network function application. + Name *string } -// SubResource - Reference to another sub resource. -type SubResource struct { - // Resource ID. - ID *string +// GetAzureOperatorNexusNetworkFunctionApplication implements the AzureOperatorNexusNetworkFunctionApplicationClassification +// interface for type AzureOperatorNexusNetworkFunctionArmTemplateApplication. +func (a *AzureOperatorNexusNetworkFunctionArmTemplateApplication) GetAzureOperatorNexusNetworkFunctionApplication() *AzureOperatorNexusNetworkFunctionApplication { + return &AzureOperatorNexusNetworkFunctionApplication{ + ArtifactType: a.ArtifactType, + DependsOnProfile: a.DependsOnProfile, + Name: a.Name, + } } -// SystemData - Metadata pertaining to creation and last modification of the resource. -type SystemData struct { - // The timestamp of resource creation (UTC). - CreatedAt *time.Time +// AzureOperatorNexusNetworkFunctionImageApplication - Azure Operator Distributed Services network function image application +// definition. +type AzureOperatorNexusNetworkFunctionImageApplication struct { + // REQUIRED; The artifact type. + ArtifactType *AzureOperatorNexusArtifactType - // The identity that created the resource. - CreatedBy *string + // Azure Operator Distributed Services image artifact profile. + ArtifactProfile *AzureOperatorNexusImageArtifactProfile - // The type of identity that created the resource. - CreatedByType *CreatedByType + // Depends on profile definition. + DependsOnProfile *DependsOnProfile - // The timestamp of resource last modification (UTC) - LastModifiedAt *time.Time + // Deploy mapping rule profile. + DeployParametersMappingRuleProfile *AzureOperatorNexusImageDeployMappingRuleProfile - // The identity that last modified the resource. - LastModifiedBy *string + // The name of the network function application. + Name *string +} - // The type of identity that last modified the resource. - LastModifiedByType *CreatedByType +// GetAzureOperatorNexusNetworkFunctionApplication implements the AzureOperatorNexusNetworkFunctionApplicationClassification +// interface for type AzureOperatorNexusNetworkFunctionImageApplication. +func (a *AzureOperatorNexusNetworkFunctionImageApplication) GetAzureOperatorNexusNetworkFunctionApplication() *AzureOperatorNexusNetworkFunctionApplication { + return &AzureOperatorNexusNetworkFunctionApplication{ + ArtifactType: a.ArtifactType, + DependsOnProfile: a.DependsOnProfile, + Name: a.Name, + } } -// TagsObject - Tags object for patch operations. -type TagsObject struct { - // Resource tags. - Tags map[string]*string +// AzureOperatorNexusNetworkFunctionTemplate - Azure Operator Distributed Services network function template. +type AzureOperatorNexusNetworkFunctionTemplate struct { + // REQUIRED; The network function type. + NfviType *VirtualNetworkFunctionNFVIType + + // Network function applications. + NetworkFunctionApplications []AzureOperatorNexusNetworkFunctionApplicationClassification } -// 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 +// GetVirtualNetworkFunctionTemplate implements the VirtualNetworkFunctionTemplateClassification interface for type AzureOperatorNexusNetworkFunctionTemplate. +func (a *AzureOperatorNexusNetworkFunctionTemplate) GetVirtualNetworkFunctionTemplate() *VirtualNetworkFunctionTemplate { + return &VirtualNetworkFunctionTemplate{ + NfviType: a.NfviType, + } +} - // Resource tags. - Tags map[string]*string +// AzureStorageAccountContainerCredential - The azure storage account container credential definition. +type AzureStorageAccountContainerCredential struct { + // The storage account container name + ContainerName *string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string + // The storage account container sas uri + ContainerSasURI *string +} - // READ-ONLY; The name of the resource - Name *string +// AzureStorageAccountCredential - The azure storage account credential definition. +type AzureStorageAccountCredential struct { + // REQUIRED; The credential type. + CredentialType *CredentialType - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string + // The containers that could be accessed using the current credential. + ContainerCredentials []*AzureStorageAccountContainerCredential + + // The UTC time when credential will expire. + Expiry *time.Time + + // The storage account Id + StorageAccountID *string +} + +// GetArtifactAccessCredential implements the ArtifactAccessCredentialClassification interface for type AzureStorageAccountCredential. +func (a *AzureStorageAccountCredential) GetArtifactAccessCredential() *ArtifactAccessCredential { + return &ArtifactAccessCredential{ + CredentialType: a.CredentialType, + } } -// Vendor resource. -type Vendor struct { - // Vendor properties. - Properties *VendorPropertiesFormat +// Component - The component sub resource. +type Component struct { + // The component properties. + Properties *ComponentProperties // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string @@ -838,35 +664,44 @@ type Vendor struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // 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 } -// VendorDetails - The network function vendor details. -type VendorDetails struct { - // The network function sku list. - SKUList []*SKUOverview +// ComponentListResult - Response for list component API service call. +type ComponentListResult struct { + // A list of component resources in a networkFunction. + Value []*Component - // The network function vendor name. - VendorName *string + // READ-ONLY; The URL to get the next set of results. + NextLink *string } -// VendorListResult - Response for vendors API service call. -type VendorListResult struct { - // A list of vendors. - Value []*Vendor +// ComponentProperties - The component properties of the network function. +type ComponentProperties struct { + // READ-ONLY; The JSON-serialized deployment profile of the component resource. + DeploymentProfile *string - // READ-ONLY; The URL to get the next set of results. - NextLink *string + // READ-ONLY; The deployment status of the component resource. + DeploymentStatus *DeploymentStatusProperties + + // READ-ONLY; The provisioning state of the component resource. + ProvisioningState *ProvisioningState } -// VendorNetworkFunction - Vendor network function sub resource. -type VendorNetworkFunction struct { - // Network function details. - Properties *VendorNetworkFunctionPropertiesFormat +// ConfigurationGroupSchema - Configuration group schema resource. +type ConfigurationGroupSchema struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // Configuration group schema properties. + Properties *ConfigurationGroupSchemaPropertiesFormat + + // 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 @@ -874,195 +709,1594 @@ type VendorNetworkFunction struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // 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 } -// VendorNetworkFunctionListResult - Response for vendors API service call. -type VendorNetworkFunctionListResult struct { - // A list of vendor network functions. - Value []*VendorNetworkFunction +// ConfigurationGroupSchemaListResult - A list of configuration group schema resources. +type ConfigurationGroupSchemaListResult struct { + // A list of configuration group schema. + Value []*ConfigurationGroupSchema // READ-ONLY; The URL to get the next set of results. NextLink *string } -// VendorNetworkFunctionPropertiesFormat - Vendor network function properties. -type VendorNetworkFunctionPropertiesFormat struct { - // An array of network function vendor configurations. - NetworkFunctionVendorConfigurations []*NetworkFunctionVendorConfiguration +// ConfigurationGroupSchemaPropertiesFormat - Configuration group schema properties. +type ConfigurationGroupSchemaPropertiesFormat struct { + // Description of what schema can contain. + Description *string - // The vendor controlled provisioning state of the vendor network function. - VendorProvisioningState *VendorProvisioningState + // Name and value pairs that define the configuration value. It can be a well formed escaped JSON string. + SchemaDefinition *string - // READ-ONLY; The provisioning state of the vendor network function sub resource. + // READ-ONLY; The provisioning state of the Configuration group schema resource. ProvisioningState *ProvisioningState - // READ-ONLY; The name of the sku. Once set, it cannot be updated. - SKUName *string - - // READ-ONLY; The sku type. - SKUType *SKUType -} - -// VendorNetworkFunctionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VendorNetworkFunctionsClient.BeginCreateOrUpdate -// method. -type VendorNetworkFunctionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string + // READ-ONLY; The configuration group schema version state. + VersionState *VersionState } -// VendorNetworkFunctionsClientGetOptions contains the optional parameters for the VendorNetworkFunctionsClient.Get method. -type VendorNetworkFunctionsClientGetOptions struct { - // placeholder for future optional parameters +// ConfigurationGroupSchemaVersionUpdateState - Publisher configuration group schema update request definition. +type ConfigurationGroupSchemaVersionUpdateState struct { + // The configuration group schema state. + VersionState *VersionState } -// VendorNetworkFunctionsClientListOptions contains the optional parameters for the VendorNetworkFunctionsClient.NewListPager -// method. -type VendorNetworkFunctionsClientListOptions struct { - // The filter to apply on the operation. The properties you can use for eq (equals) are: skuType, skuName and vendorProvisioningState. - Filter *string +// ConfigurationGroupValue - Hybrid configuration group value resource. +type ConfigurationGroupValue struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // Hybrid configuration group value properties. + Properties ConfigurationGroupValuePropertiesFormatClassification + + // 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 +} + +// ConfigurationGroupValueListResult - Response for hybrid configurationGroups API service call. +type ConfigurationGroupValueListResult struct { + // A list of hybrid configurationGroups. + Value []*ConfigurationGroupValue + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// ConfigurationGroupValuePropertiesFormat - Hybrid configuration group value properties. +type ConfigurationGroupValuePropertiesFormat struct { + // REQUIRED; The value which indicates if configuration values are secrets + ConfigurationType *ConfigurationGroupValueConfigurationType + + // The configuration group schema resource reference. + ConfigurationGroupSchemaResourceReference DeploymentResourceIDReferenceClassification + + // READ-ONLY; The configuration group schema name. + ConfigurationGroupSchemaName *string + + // READ-ONLY; The location of the configuration group schema offering. + ConfigurationGroupSchemaOfferingLocation *string + + // READ-ONLY; The provisioning state of the site resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The publisher name for the configuration group schema. + PublisherName *string + + // READ-ONLY; The scope of the publisher. + PublisherScope *PublisherScope +} + +// GetConfigurationGroupValuePropertiesFormat implements the ConfigurationGroupValuePropertiesFormatClassification interface +// for type ConfigurationGroupValuePropertiesFormat. +func (c *ConfigurationGroupValuePropertiesFormat) GetConfigurationGroupValuePropertiesFormat() *ConfigurationGroupValuePropertiesFormat { + return c +} + +// ConfigurationValueWithSecrets - The ConfigurationValue with secrets. +type ConfigurationValueWithSecrets struct { + // REQUIRED; The value which indicates if configuration values are secrets + ConfigurationType *ConfigurationGroupValueConfigurationType + + // The configuration group schema resource reference. + ConfigurationGroupSchemaResourceReference DeploymentResourceIDReferenceClassification + + // Name and value pairs that define the configuration value secrets. It can be a well formed escaped JSON string. + SecretConfigurationValue *string + + // READ-ONLY; The configuration group schema name. + ConfigurationGroupSchemaName *string + + // READ-ONLY; The location of the configuration group schema offering. + ConfigurationGroupSchemaOfferingLocation *string + + // READ-ONLY; The provisioning state of the site resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The publisher name for the configuration group schema. + PublisherName *string + + // READ-ONLY; The scope of the publisher. + PublisherScope *PublisherScope +} + +// GetConfigurationGroupValuePropertiesFormat implements the ConfigurationGroupValuePropertiesFormatClassification interface +// for type ConfigurationValueWithSecrets. +func (c *ConfigurationValueWithSecrets) GetConfigurationGroupValuePropertiesFormat() *ConfigurationGroupValuePropertiesFormat { + return &ConfigurationGroupValuePropertiesFormat{ + ConfigurationGroupSchemaName: c.ConfigurationGroupSchemaName, + ConfigurationGroupSchemaOfferingLocation: c.ConfigurationGroupSchemaOfferingLocation, + ConfigurationGroupSchemaResourceReference: c.ConfigurationGroupSchemaResourceReference, + ConfigurationType: c.ConfigurationType, + ProvisioningState: c.ProvisioningState, + PublisherName: c.PublisherName, + PublisherScope: c.PublisherScope, + } +} + +// ConfigurationValueWithoutSecrets - The ConfigurationValue with no secrets. +type ConfigurationValueWithoutSecrets struct { + // REQUIRED; The value which indicates if configuration values are secrets + ConfigurationType *ConfigurationGroupValueConfigurationType + + // The configuration group schema resource reference. + ConfigurationGroupSchemaResourceReference DeploymentResourceIDReferenceClassification + + // Name and value pairs that define the configuration value. It can be a well formed escaped JSON string. + ConfigurationValue *string + + // READ-ONLY; The configuration group schema name. + ConfigurationGroupSchemaName *string + + // READ-ONLY; The location of the configuration group schema offering. + ConfigurationGroupSchemaOfferingLocation *string + + // READ-ONLY; The provisioning state of the site resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The publisher name for the configuration group schema. + PublisherName *string + + // READ-ONLY; The scope of the publisher. + PublisherScope *PublisherScope +} + +// GetConfigurationGroupValuePropertiesFormat implements the ConfigurationGroupValuePropertiesFormatClassification interface +// for type ConfigurationValueWithoutSecrets. +func (c *ConfigurationValueWithoutSecrets) GetConfigurationGroupValuePropertiesFormat() *ConfigurationGroupValuePropertiesFormat { + return &ConfigurationGroupValuePropertiesFormat{ + ConfigurationGroupSchemaName: c.ConfigurationGroupSchemaName, + ConfigurationGroupSchemaOfferingLocation: c.ConfigurationGroupSchemaOfferingLocation, + ConfigurationGroupSchemaResourceReference: c.ConfigurationGroupSchemaResourceReference, + ConfigurationType: c.ConfigurationType, + ProvisioningState: c.ProvisioningState, + PublisherName: c.PublisherName, + PublisherScope: c.PublisherScope, + } +} + +// ContainerizedNetworkFunctionDefinitionVersion - Containerized network function network function definition version properties. +type ContainerizedNetworkFunctionDefinitionVersion struct { + // REQUIRED; The network function type. + NetworkFunctionType *NetworkFunctionType + + // The deployment parameters of the network function definition version. + DeployParameters *string + + // The network function definition version description. + Description *string + + // Containerized network function template. + NetworkFunctionTemplate ContainerizedNetworkFunctionTemplateClassification + + // READ-ONLY; The provisioning state of the network function definition version resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The network function definition version state. + VersionState *VersionState +} + +// GetNetworkFunctionDefinitionVersionPropertiesFormat implements the NetworkFunctionDefinitionVersionPropertiesFormatClassification +// interface for type ContainerizedNetworkFunctionDefinitionVersion. +func (c *ContainerizedNetworkFunctionDefinitionVersion) GetNetworkFunctionDefinitionVersionPropertiesFormat() *NetworkFunctionDefinitionVersionPropertiesFormat { + return &NetworkFunctionDefinitionVersionPropertiesFormat{ + DeployParameters: c.DeployParameters, + Description: c.Description, + NetworkFunctionType: c.NetworkFunctionType, + ProvisioningState: c.ProvisioningState, + VersionState: c.VersionState, + } +} + +// ContainerizedNetworkFunctionTemplate - Containerized network function template. +type ContainerizedNetworkFunctionTemplate struct { + // REQUIRED; The network function type. + NfviType *ContainerizedNetworkFunctionNFVIType +} + +// GetContainerizedNetworkFunctionTemplate implements the ContainerizedNetworkFunctionTemplateClassification interface for +// type ContainerizedNetworkFunctionTemplate. +func (c *ContainerizedNetworkFunctionTemplate) GetContainerizedNetworkFunctionTemplate() *ContainerizedNetworkFunctionTemplate { + return c +} + +// CustomLocationResourceID - Reference to an Azure ARC custom location resource. +type CustomLocationResourceID struct { + // Azure ARC custom location resource ID. + ID *string +} + +// DaemonSet - Helm DaemonSet status properties. +type DaemonSet struct { + // Number of available pods. + Available *int32 + + // Creation Time of daemonSet. + CreationTime *time.Time + + // Current number of pods + Current *int32 + + // Desired number of pods + Desired *int32 + + // The name of the daemonSet. + Name *string + + // The namespace of the daemonSet. + Namespace *string + + // Number of Ready pods + Ready *int32 + + // Number of upto date pods + UpToDate *int32 +} + +// DependsOnProfile - Depends on profile definition. +type DependsOnProfile struct { + // Application installation operation dependency. + InstallDependsOn []*string + + // Application deletion operation dependency. + UninstallDependsOn []*string + + // Application update operation dependency. + UpdateDependsOn []*string +} + +// Deployment - Helm Deployment status properties. +type Deployment struct { + // Number of available pods. + Available *int32 + + // Creation Time of deployment. + CreationTime *time.Time + + // Desired number of pods + Desired *int32 + + // The name of the deployment. + Name *string + + // The namespace of the deployment. + Namespace *string + + // Number of ready pods. + Ready *int32 + + // Number of upto date pods. + UpToDate *int32 +} + +// DeploymentResourceIDReference - The azure resource reference which is used for deployment. +type DeploymentResourceIDReference struct { + // REQUIRED; The resource reference arm id type. + IDType *IDType +} + +// GetDeploymentResourceIDReference implements the DeploymentResourceIDReferenceClassification interface for type DeploymentResourceIDReference. +func (d *DeploymentResourceIDReference) GetDeploymentResourceIDReference() *DeploymentResourceIDReference { + return d +} + +// DeploymentStatusProperties - The deployment status properties of the network function component. +type DeploymentStatusProperties struct { + // The next expected update of deployment status. + NextExpectedUpdateAt *time.Time + + // The resource related to the component resource. + Resources *Resources + + // The status of the component resource. + Status *Status +} + +// 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 +} + +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo + + // READ-ONLY; The error code. + Code *string + + // READ-ONLY; The error details. + Details []*ErrorDetail + + // READ-ONLY; The error message. + Message *string + + // 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 +} + +// ExecuteRequestParameters - Payload for execute request post call. +type ExecuteRequestParameters struct { + // REQUIRED; The request metadata. + RequestMetadata *RequestMetadata + + // REQUIRED; The endpoint of service to call. + ServiceEndpoint *string +} + +// HelmArtifactProfile - Helm artifact profile. +type HelmArtifactProfile struct { + // Helm package name. + HelmPackageName *string + + // Helm package version range. + HelmPackageVersionRange *string + + // The image pull secrets values path list. + ImagePullSecretsValuesPaths []*string + + // The registry values path list. + RegistryValuesPaths []*string +} + +// HelmInstallOptions - The helm deployment install options +type HelmInstallOptions struct { + // The helm deployment atomic options + Atomic *string + + // The helm deployment timeout options + Timeout *string + + // The helm deployment wait options + Wait *string +} + +// HelmMappingRuleProfile - Helm mapping rule profile +type HelmMappingRuleProfile struct { + // Helm package version. + HelmPackageVersion *string + + // The helm deployment options + Options *HelmMappingRuleProfileOptions + + // Helm release name. + ReleaseName *string + + // Helm release namespace. + ReleaseNamespace *string + + // Helm release values. + Values *string +} + +// HelmMappingRuleProfileOptions - The helm deployment options +type HelmMappingRuleProfileOptions struct { + // The helm deployment install options + InstallOptions *HelmInstallOptions + + // The helm deployment upgrade options + UpgradeOptions *HelmUpgradeOptions +} + +// HelmUpgradeOptions - The helm deployment install options +type HelmUpgradeOptions struct { + // The helm deployment atomic options + Atomic *string + + // The helm deployment timeout options + Timeout *string + + // The helm deployment wait options + Wait *string +} + +// ImageArtifactProfile - Image artifact profile. +type ImageArtifactProfile struct { + // Image name. + ImageName *string + + // Image version. + ImageVersion *string +} + +// ImageMappingRuleProfile - Image mapping rule profile +type ImageMappingRuleProfile struct { + // List of values. + UserConfiguration *string +} + +// ManagedResourceGroupConfiguration - Managed resource group configuration. +type ManagedResourceGroupConfiguration struct { + // Managed resource group location. + Location *string + + // Managed resource group name. + Name *string +} + +// ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) +type ManagedServiceIdentity struct { + // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + Type *ManagedServiceIdentityType + + // The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM + // resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + // The dictionary values can be empty objects ({}) in + // requests. + UserAssignedIdentities map[string]*UserAssignedIdentity + + // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned + // identity. + PrincipalID *string + + // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *string +} + +// ManifestArtifactFormat - Manifest artifact properties. +type ManifestArtifactFormat struct { + // The artifact name + ArtifactName *string + + // The artifact type. + ArtifactType *ArtifactType + + // The artifact version. + ArtifactVersion *string +} + +// MappingRuleProfile - Mapping rule profile properties. +type MappingRuleProfile struct { + // The application enablement. + ApplicationEnablement *ApplicationEnablement +} + +// NFVIs - The NFVI object. +type NFVIs struct { + // REQUIRED; The NFVI type. + NfviType *NFVIType + + // Name of the nfvi. + Name *string +} + +// GetNFVIs implements the NFVIsClassification interface for type NFVIs. +func (n *NFVIs) GetNFVIs() *NFVIs { return n } + +// NSDArtifactProfile - Artifact profile properties. +type NSDArtifactProfile struct { + // Artifact name. + ArtifactName *string + + // The artifact store resource id + ArtifactStoreReference *ReferencedResource + + // Artifact version. + ArtifactVersion *string +} + +// NetworkFunction - Network function resource response. +type NetworkFunction struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // A unique read-only string that changes whenever the resource is updated. + Etag *string + + // The managed identity of the network function. + Identity *ManagedServiceIdentity + + // Network function properties. + Properties NetworkFunctionPropertiesFormatClassification + + // 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 +} + +// NetworkFunctionApplication - Network function application definition. +type NetworkFunctionApplication struct { + // Depends on profile definition. + DependsOnProfile *DependsOnProfile + + // The name of the network function application. + Name *string +} + +// NetworkFunctionDefinitionGroup - Network function definition group resource. +type NetworkFunctionDefinitionGroup struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // Network function definition group properties. + Properties *NetworkFunctionDefinitionGroupPropertiesFormat + + // 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 +} + +// NetworkFunctionDefinitionGroupListResult - A list of network function definition group resources. +type NetworkFunctionDefinitionGroupListResult struct { + // A list of network function definition group. + Value []*NetworkFunctionDefinitionGroup + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// NetworkFunctionDefinitionGroupPropertiesFormat - Network function definition group properties. +type NetworkFunctionDefinitionGroupPropertiesFormat struct { + // The network function definition group description. + Description *string + + // READ-ONLY; The provisioning state of the network function definition groups resource. + ProvisioningState *ProvisioningState +} + +// NetworkFunctionDefinitionResourceElementTemplateDetails - The network function definition resource element template details. +type NetworkFunctionDefinitionResourceElementTemplateDetails struct { + // REQUIRED; The resource element template type. + ResourceElementType *Type + + // The resource element template type. + Configuration *ArmResourceDefinitionResourceElementTemplate + + // The depends on profile. + DependsOnProfile *DependsOnProfile + + // Name of the resource element template. + Name *string +} + +// GetResourceElementTemplate implements the ResourceElementTemplateClassification interface for type NetworkFunctionDefinitionResourceElementTemplateDetails. +func (n *NetworkFunctionDefinitionResourceElementTemplateDetails) GetResourceElementTemplate() *ResourceElementTemplate { + return &ResourceElementTemplate{ + DependsOnProfile: n.DependsOnProfile, + Name: n.Name, + ResourceElementType: n.ResourceElementType, + } +} + +// NetworkFunctionDefinitionVersion - Network function definition version. +type NetworkFunctionDefinitionVersion struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // Network function definition version properties. + Properties NetworkFunctionDefinitionVersionPropertiesFormatClassification + + // 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 +} + +// NetworkFunctionDefinitionVersionListResult - A list of network function definition versions. +type NetworkFunctionDefinitionVersionListResult struct { + // A list of network function definition versions. + Value []*NetworkFunctionDefinitionVersion + + // READ-ONLY; The URI to get the next set of results. + NextLink *string +} + +// NetworkFunctionDefinitionVersionPropertiesFormat - Network function definition version properties. +type NetworkFunctionDefinitionVersionPropertiesFormat struct { + // REQUIRED; The network function type. + NetworkFunctionType *NetworkFunctionType + + // The deployment parameters of the network function definition version. + DeployParameters *string + + // The network function definition version description. + Description *string + + // READ-ONLY; The provisioning state of the network function definition version resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The network function definition version state. + VersionState *VersionState +} + +// GetNetworkFunctionDefinitionVersionPropertiesFormat implements the NetworkFunctionDefinitionVersionPropertiesFormatClassification +// interface for type NetworkFunctionDefinitionVersionPropertiesFormat. +func (n *NetworkFunctionDefinitionVersionPropertiesFormat) GetNetworkFunctionDefinitionVersionPropertiesFormat() *NetworkFunctionDefinitionVersionPropertiesFormat { + return n +} + +// NetworkFunctionDefinitionVersionUpdateState - Publisher network function definition version update request definition. +type NetworkFunctionDefinitionVersionUpdateState struct { + // The network function definition version state. Only the 'Active' and 'Deprecated' states are allowed for updates. Other + // states are used for internal state transitioning. + VersionState *VersionState +} + +// NetworkFunctionListResult - Response for network function API service call. +type NetworkFunctionListResult struct { + // A list of network function resources in a subscription or resource group. + Value []*NetworkFunction + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// NetworkFunctionPropertiesFormat - Network function properties. +type NetworkFunctionPropertiesFormat struct { + // REQUIRED; The value which indicates if NF values are secrets + ConfigurationType *NetworkFunctionConfigurationType + + // Indicates if software updates are allowed during deployment. + AllowSoftwareUpdate *bool + + // The network function definition version resource reference. + NetworkFunctionDefinitionVersionResourceReference DeploymentResourceIDReferenceClassification + + // The nfviId for the network function. + NfviID *string + + // The nfvi type for the network function. + NfviType *NFVIType + + // The role configuration override values from the user. + RoleOverrideValues []*string + + // READ-ONLY; The network function definition group name for the network function. + NetworkFunctionDefinitionGroupName *string + + // READ-ONLY; The location of the network function definition offering. + NetworkFunctionDefinitionOfferingLocation *string + + // READ-ONLY; The network function definition version for the network function. + NetworkFunctionDefinitionVersion *string + + // READ-ONLY; The provisioning state of the network function resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The publisher name for the network function. + PublisherName *string + + // READ-ONLY; The scope of the publisher. + PublisherScope *PublisherScope +} + +// GetNetworkFunctionPropertiesFormat implements the NetworkFunctionPropertiesFormatClassification interface for type NetworkFunctionPropertiesFormat. +func (n *NetworkFunctionPropertiesFormat) GetNetworkFunctionPropertiesFormat() *NetworkFunctionPropertiesFormat { + return n +} + +// NetworkFunctionValueWithSecrets - NetworkFunction with secrets. +type NetworkFunctionValueWithSecrets struct { + // REQUIRED; The value which indicates if NF values are secrets + ConfigurationType *NetworkFunctionConfigurationType + + // Indicates if software updates are allowed during deployment. + AllowSoftwareUpdate *bool + + // The network function definition version resource reference. + NetworkFunctionDefinitionVersionResourceReference DeploymentResourceIDReferenceClassification + + // The nfviId for the network function. + NfviID *string + + // The nfvi type for the network function. + NfviType *NFVIType + + // The role configuration override values from the user. + RoleOverrideValues []*string + + // The JSON-serialized secret deployment values from the user. This contains secrets like passwords,keys etc + SecretDeploymentValues *string + + // READ-ONLY; The network function definition group name for the network function. + NetworkFunctionDefinitionGroupName *string + + // READ-ONLY; The location of the network function definition offering. + NetworkFunctionDefinitionOfferingLocation *string + + // READ-ONLY; The network function definition version for the network function. + NetworkFunctionDefinitionVersion *string + + // READ-ONLY; The provisioning state of the network function resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The publisher name for the network function. + PublisherName *string + + // READ-ONLY; The scope of the publisher. + PublisherScope *PublisherScope +} + +// GetNetworkFunctionPropertiesFormat implements the NetworkFunctionPropertiesFormatClassification interface for type NetworkFunctionValueWithSecrets. +func (n *NetworkFunctionValueWithSecrets) GetNetworkFunctionPropertiesFormat() *NetworkFunctionPropertiesFormat { + return &NetworkFunctionPropertiesFormat{ + AllowSoftwareUpdate: n.AllowSoftwareUpdate, + ConfigurationType: n.ConfigurationType, + NetworkFunctionDefinitionGroupName: n.NetworkFunctionDefinitionGroupName, + NetworkFunctionDefinitionOfferingLocation: n.NetworkFunctionDefinitionOfferingLocation, + NetworkFunctionDefinitionVersion: n.NetworkFunctionDefinitionVersion, + NetworkFunctionDefinitionVersionResourceReference: n.NetworkFunctionDefinitionVersionResourceReference, + NfviID: n.NfviID, + NfviType: n.NfviType, + ProvisioningState: n.ProvisioningState, + PublisherName: n.PublisherName, + PublisherScope: n.PublisherScope, + RoleOverrideValues: n.RoleOverrideValues, + } +} + +// NetworkFunctionValueWithoutSecrets - NetworkFunction with no secrets. +type NetworkFunctionValueWithoutSecrets struct { + // REQUIRED; The value which indicates if NF values are secrets + ConfigurationType *NetworkFunctionConfigurationType + + // Indicates if software updates are allowed during deployment. + AllowSoftwareUpdate *bool + + // The JSON-serialized deployment values from the user. + DeploymentValues *string + + // The network function definition version resource reference. + NetworkFunctionDefinitionVersionResourceReference DeploymentResourceIDReferenceClassification + + // The nfviId for the network function. + NfviID *string + + // The nfvi type for the network function. + NfviType *NFVIType + + // The role configuration override values from the user. + RoleOverrideValues []*string + + // READ-ONLY; The network function definition group name for the network function. + NetworkFunctionDefinitionGroupName *string + + // READ-ONLY; The location of the network function definition offering. + NetworkFunctionDefinitionOfferingLocation *string + + // READ-ONLY; The network function definition version for the network function. + NetworkFunctionDefinitionVersion *string + + // READ-ONLY; The provisioning state of the network function resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The publisher name for the network function. + PublisherName *string + + // READ-ONLY; The scope of the publisher. + PublisherScope *PublisherScope +} + +// GetNetworkFunctionPropertiesFormat implements the NetworkFunctionPropertiesFormatClassification interface for type NetworkFunctionValueWithoutSecrets. +func (n *NetworkFunctionValueWithoutSecrets) GetNetworkFunctionPropertiesFormat() *NetworkFunctionPropertiesFormat { + return &NetworkFunctionPropertiesFormat{ + AllowSoftwareUpdate: n.AllowSoftwareUpdate, + ConfigurationType: n.ConfigurationType, + NetworkFunctionDefinitionGroupName: n.NetworkFunctionDefinitionGroupName, + NetworkFunctionDefinitionOfferingLocation: n.NetworkFunctionDefinitionOfferingLocation, + NetworkFunctionDefinitionVersion: n.NetworkFunctionDefinitionVersion, + NetworkFunctionDefinitionVersionResourceReference: n.NetworkFunctionDefinitionVersionResourceReference, + NfviID: n.NfviID, + NfviType: n.NfviType, + ProvisioningState: n.ProvisioningState, + PublisherName: n.PublisherName, + PublisherScope: n.PublisherScope, + RoleOverrideValues: n.RoleOverrideValues, + } +} + +// NetworkServiceDesignGroup - network service design group resource. +type NetworkServiceDesignGroup struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // network service design group properties. + Properties *NetworkServiceDesignGroupPropertiesFormat + + // 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 +} + +// NetworkServiceDesignGroupListResult - A list of network service design group resources. +type NetworkServiceDesignGroupListResult struct { + // A list of network service design group. + Value []*NetworkServiceDesignGroup + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// NetworkServiceDesignGroupPropertiesFormat - network service design group properties. +type NetworkServiceDesignGroupPropertiesFormat struct { + // The network service design group description. + Description *string + + // READ-ONLY; The provisioning state of the network service design groups resource. + ProvisioningState *ProvisioningState +} + +// NetworkServiceDesignVersion - network service design version. +type NetworkServiceDesignVersion struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // network service design version properties. + Properties *NetworkServiceDesignVersionPropertiesFormat + + // 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 +} + +// NetworkServiceDesignVersionListResult - A list of network service design versions. +type NetworkServiceDesignVersionListResult struct { + // A list of network service design versions. + Value []*NetworkServiceDesignVersion + + // READ-ONLY; The URI to get the next set of results. + NextLink *string +} + +// NetworkServiceDesignVersionPropertiesFormat - network service design version properties. +type NetworkServiceDesignVersionPropertiesFormat struct { + // The configuration schemas to used to define the values. + ConfigurationGroupSchemaReferences map[string]*ReferencedResource + + // The network service design version description. + Description *string + + // The nfvis from the site. + NfvisFromSite map[string]*NfviDetails + + // List of resource element template + ResourceElementTemplates []ResourceElementTemplateClassification + + // READ-ONLY; The provisioning state of the network service design version resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The network service design version state. + VersionState *VersionState +} + +// NetworkServiceDesignVersionUpdateState - Publisher network service design version update request definition. +type NetworkServiceDesignVersionUpdateState struct { + // The network service design version state. + VersionState *VersionState +} + +// NfviDetails - The nfvi details. +type NfviDetails struct { + // The nfvi name. + Name *string + + // The nfvi type. + Type *string +} + +// OpenDeploymentResourceReference - Non secret deployment resource id reference. +type OpenDeploymentResourceReference struct { + // REQUIRED; The resource reference arm id type. + IDType *IDType + + // Resource ID. + ID *string +} + +// GetDeploymentResourceIDReference implements the DeploymentResourceIDReferenceClassification interface for type OpenDeploymentResourceReference. +func (o *OpenDeploymentResourceReference) GetDeploymentResourceIDReference() *DeploymentResourceIDReference { + return &DeploymentResourceIDReference{ + IDType: o.IDType, + } +} + +// Operation - Details of a REST API operation, returned from the Resource Provider Operations API +type Operation struct { + // Localized display information for this particular operation. + Display *OperationDisplay + + // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType + + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane + // operations. + IsDataAction *bool + + // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + // "Microsoft.Compute/virtualMachines/capture/action" + Name *string + + // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + // value is "user,system" + Origin *Origin +} + +// OperationDisplay - Localized display information for this particular operation. +type OperationDisplay struct { + // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. + Description *string + + // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + // Machine", "Restart Virtual Machine". + Operation *string + + // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + // Compute". + Provider *string + + // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + // Schedule Collections". + Resource *string +} + +// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to +// get the next set of results. +type OperationListResult struct { + // READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string + + // READ-ONLY; List of operations supported by the resource provider + Value []*Operation +} + +// Pod - Helm Pod status properties. +type Pod struct { + // Creation Time of Pod. + CreationTime *time.Time + + // Desired number of containers + Desired *int32 + + // Last 5 Pod events. + Events []*PodEvent + + // The name of the Pod. + Name *string + + // The namespace of the Pod. + Namespace *string + + // Number of ready containers. + Ready *int32 + + // The status of a pod. + Status *PodStatus } -// VendorPropertiesFormat - Vendor properties. -type VendorPropertiesFormat struct { - // READ-ONLY; The provisioning state of the vendor resource. - ProvisioningState *ProvisioningState +// PodEvent - Pod Event properties. +type PodEvent struct { + // Event Last seen. + LastSeenTime *time.Time + + // Event message. + Message *string + + // Event reason. + Reason *string - // READ-ONLY; A list of IDs of the vendor skus offered by the vendor. - SKUs []*SubResource + // The type of pod event. + Type *PodEventType } -// VendorSKU - Sku sub resource. -type VendorSKU struct { - // Vendor sku details. - Properties *VendorSKUPropertiesFormat +// ProxyArtifactListOverview - The proxy artifact overview. +type ProxyArtifactListOverview 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 +} +// ProxyArtifactOverview - The proxy artifact overview. +type ProxyArtifactOverview 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; The system meta data relating to this resource. + // READ-ONLY; Proxy Artifact properties overview. + Properties *ProxyArtifactOverviewPropertiesFormat + + // 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 } -// VendorSKUListResult - Response for list vendor sku API service call. -type VendorSKUListResult struct { - // A list of vendor skus offered by the vendor. - Value []*VendorSKU +// ProxyArtifactOverviewListResult - The proxy artifact list result. +type ProxyArtifactOverviewListResult struct { + // A list of available proxy artifacts. + Value []*ProxyArtifactListOverview - // READ-ONLY; The URI to get the next set of results. + // READ-ONLY; The URL to get the next set of results. NextLink *string } -// VendorSKUPreviewClientBeginCreateOrUpdateOptions contains the optional parameters for the VendorSKUPreviewClient.BeginCreateOrUpdate -// method. -type VendorSKUPreviewClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// ProxyArtifactOverviewPropertiesFormat - Proxy Artifact overview properties. +type ProxyArtifactOverviewPropertiesFormat struct { + // The proxy artifact overview properties. + ArtifactVersions []*ProxyArtifactOverviewPropertiesValue +} + +type ProxyArtifactOverviewPropertiesValue struct { + // The artifact state + ArtifactState *ArtifactState + + // The artifact type. + ArtifactType *ArtifactType + + // The artifact version. + ArtifactVersion *string } -// VendorSKUPreviewClientBeginDeleteOptions contains the optional parameters for the VendorSKUPreviewClient.BeginDelete method. -type VendorSKUPreviewClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// ProxyArtifactVersionsListOverview - The proxy artifact overview. +type ProxyArtifactVersionsListOverview 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; Proxy Artifact overview properties. + Properties *ProxyArtifactOverviewPropertiesValue + + // 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 } -// VendorSKUPreviewClientGetOptions contains the optional parameters for the VendorSKUPreviewClient.Get method. -type VendorSKUPreviewClientGetOptions struct { - // placeholder for future optional parameters +// ProxyArtifactVersionsOverviewListResult - The proxy artifact list result. +type ProxyArtifactVersionsOverviewListResult struct { + // A list of available proxy artifacts. + Value []*ProxyArtifactVersionsListOverview + + // READ-ONLY; The URL to get the next set of results. + NextLink *string } -// VendorSKUPreviewClientListOptions contains the optional parameters for the VendorSKUPreviewClient.NewListPager method. -type VendorSKUPreviewClientListOptions struct { - // placeholder for future optional parameters +// 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 } -// VendorSKUPropertiesFormat - Sku properties -type VendorSKUPropertiesFormat struct { - // The sku deployment mode. - DeploymentMode *SKUDeploymentMode +// Publisher - publisher resource. +type Publisher struct { + // REQUIRED; The geo-location where the resource lives + Location *string - // The parameters for the managed application to be supplied by the vendor. - ManagedApplicationParameters any + // The managed identity of the publisher, if configured. + Identity *ManagedServiceIdentity - // The template for the managed application deployment. - ManagedApplicationTemplate any + // Publisher properties. + Properties *PublisherPropertiesFormat - // The template definition of the network function. - NetworkFunctionTemplate *NetworkFunctionTemplate + // Resource tags. + Tags map[string]*string - // The network function type. - NetworkFunctionType *NetworkFunctionType + // 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 +} + +// PublisherListResult - A list of publishers. +type PublisherListResult struct { + // A list of publishers. + Value []*Publisher + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// PublisherPropertiesFormat - publisher properties. +type PublisherPropertiesFormat struct { + // The publisher scope. + Scope *PublisherScope + + // READ-ONLY; The provisioning state of the publisher resource. + ProvisioningState *ProvisioningState +} + +// ReferencedResource - Reference to another resource. +type ReferencedResource struct { + // Resource ID. + ID *string +} + +// ReplicaSet - Helm ReplicaSet status properties. +type ReplicaSet struct { + // Creation Time of replicaSet. + CreationTime *time.Time + + // Number of current pods. + Current *int32 + + // Desired number of pods + Desired *int32 + + // The name of the replicaSet. + Name *string + + // The namespace of the replicaSet. + Namespace *string + + // Number of ready pods. + Ready *int32 +} + +// RequestMetadata - Request metadata of execute request post call payload. +type RequestMetadata struct { + // REQUIRED; The http method of the request. + HTTPMethod *HTTPMethod + + // REQUIRED; The relative path of the request. + RelativePath *string + + // REQUIRED; The serialized body of the request. + SerializedBody *string + + // The api version of the request. + APIVersion *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 + + // 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 +} + +// ResourceElementTemplate - The resource element template object. +type ResourceElementTemplate struct { + // REQUIRED; The resource element template type. + ResourceElementType *Type + + // The depends on profile. + DependsOnProfile *DependsOnProfile + + // Name of the resource element template. + Name *string +} + +// GetResourceElementTemplate implements the ResourceElementTemplateClassification interface for type ResourceElementTemplate. +func (r *ResourceElementTemplate) GetResourceElementTemplate() *ResourceElementTemplate { return r } + +// Resources - The resources of the network function component. +type Resources struct { + // Daemonsets related to component resource. + DaemonSets []*DaemonSet + + // Deployments that are related to component resource. + Deployments []*Deployment + + // Pods related to component resource. + Pods []*Pod + + // Replica sets related to component resource. + ReplicaSets []*ReplicaSet + + // Stateful sets related to component resource. + StatefulSets []*StatefulSet +} + +// SKU - Sku, to be associated with a SiteNetworkService. +type SKU struct { + // REQUIRED; Name of this Sku + Name *SKUName + + // READ-ONLY; The SKU tier based on the SKU name. + Tier *SKUTier +} + +// SecretDeploymentResourceReference - Secret deployment resource id reference. +type SecretDeploymentResourceReference struct { + // REQUIRED; The resource reference arm id type. + IDType *IDType + + // Resource ID. + ID *string +} + +// GetDeploymentResourceIDReference implements the DeploymentResourceIDReferenceClassification interface for type SecretDeploymentResourceReference. +func (s *SecretDeploymentResourceReference) GetDeploymentResourceIDReference() *DeploymentResourceIDReference { + return &DeploymentResourceIDReference{ + IDType: s.IDType, + } +} + +// Site resource. +type Site struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // Site properties. + Properties *SitePropertiesFormat + + // 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 +} + +// SiteListResult - Response for sites API service call. +type SiteListResult struct { + // A list of sites in a resource group. + Value []*Site + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// SiteNetworkService - Site network service resource. +type SiteNetworkService struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // The managed identity of the Site network service, if configured. + Identity *ManagedServiceIdentity + + // Site network service properties. + Properties *SiteNetworkServicePropertiesFormat + + // Sku of the site network service. + SKU *SKU + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; 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 +} + +// SiteNetworkServiceListResult - Response for site network services API service call. +type SiteNetworkServiceListResult struct { + // A list of site network services in a resource group. + Value []*SiteNetworkService + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// SiteNetworkServicePropertiesFormat - Site network service properties. +type SiteNetworkServicePropertiesFormat struct { + // The goal state of the site network service resource. This has references to the configuration group value objects that + // describe the desired state of the site network service. + DesiredStateConfigurationGroupValueReferences map[string]*ReferencedResource + + // Managed resource group configuration. + ManagedResourceGroupConfiguration *ManagedResourceGroupConfiguration + + // The network service design version resource reference. + NetworkServiceDesignVersionResourceReference DeploymentResourceIDReferenceClassification + + // The site details + SiteReference *ReferencedResource + + // READ-ONLY; The last state of the site network service resource. + LastStateConfigurationGroupValueReferences map[string]*ReferencedResource + + // READ-ONLY; The network service design version for the site network service. + LastStateNetworkServiceDesignVersionName *string + + // READ-ONLY; The network service design group name for the site network service. + NetworkServiceDesignGroupName *string + + // READ-ONLY; The network service design version for the site network service. + NetworkServiceDesignVersionName *string + + // READ-ONLY; The location of the network service design offering. + NetworkServiceDesignVersionOfferingLocation *string + + // READ-ONLY; The provisioning state of the site network service resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The publisher name for the site network service. + PublisherName *string - // Indicates if the vendor sku is in preview mode. - Preview *bool + // READ-ONLY; The scope of the publisher. + PublisherScope *PublisherScope +} - // The sku type. - SKUType *SKUType +// SitePropertiesFormat - Site properties. +type SitePropertiesFormat struct { + // List of NFVIs + Nfvis []NFVIsClassification - // READ-ONLY; The provisioning state of the vendor sku sub resource. + // READ-ONLY; The provisioning state of the site resource. TODO: Confirm if this is needed. ProvisioningState *ProvisioningState + + // READ-ONLY; The list of site network services on the site. + SiteNetworkServiceReferences []*ReferencedResource +} + +// StatefulSet - Helm StatefulSet status properties. +type StatefulSet struct { + // Creation Time of statefulset. + CreationTime *time.Time + + // Desired number of pods + Desired *int32 + + // The name of the statefulset. + Name *string + + // The namespace of the statefulset. + Namespace *string + + // Number of ready pods. + Ready *int32 +} + +// 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 } -// VendorSKUsClientBeginCreateOrUpdateOptions contains the optional parameters for the VendorSKUsClient.BeginCreateOrUpdate -// method. -type VendorSKUsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// TagsObject - Tags object for patch operations. +type TagsObject struct { + // Resource tags. + Tags map[string]*string } -// VendorSKUsClientBeginDeleteOptions contains the optional parameters for the VendorSKUsClient.BeginDelete method. -type VendorSKUsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// 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 } -// VendorSKUsClientGetOptions contains the optional parameters for the VendorSKUsClient.Get method. -type VendorSKUsClientGetOptions struct { - // placeholder for future optional parameters +// UserAssignedIdentity - User assigned identity properties +type UserAssignedIdentity struct { + // READ-ONLY; The client ID of the assigned identity. + ClientID *string + + // READ-ONLY; The principal ID of the assigned identity. + PrincipalID *string } -// VendorSKUsClientListOptions contains the optional parameters for the VendorSKUsClient.NewListPager method. -type VendorSKUsClientListOptions struct { - // placeholder for future optional parameters +// VhdImageArtifactProfile - Vhd artifact profile. +type VhdImageArtifactProfile struct { + // Vhd name. + VhdName *string + + // Vhd version. + VhdVersion *string } -// VendorsClientBeginCreateOrUpdateOptions contains the optional parameters for the VendorsClient.BeginCreateOrUpdate method. -type VendorsClientBeginCreateOrUpdateOptions struct { - // Parameters supplied to the create vendor operation. - Parameters *Vendor - // Resumes the LRO from the provided token. - ResumeToken string +// VhdImageMappingRuleProfile - Vhd mapping rule profile +type VhdImageMappingRuleProfile struct { + // List of values. + UserConfiguration *string } -// VendorsClientBeginDeleteOptions contains the optional parameters for the VendorsClient.BeginDelete method. -type VendorsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// VirtualNetworkFunctionDefinitionVersion - Virtual network function network function definition version properties. +type VirtualNetworkFunctionDefinitionVersion struct { + // REQUIRED; The network function type. + NetworkFunctionType *NetworkFunctionType + + // The deployment parameters of the network function definition version. + DeployParameters *string + + // The network function definition version description. + Description *string + + // Virtual network function template. + NetworkFunctionTemplate VirtualNetworkFunctionTemplateClassification + + // READ-ONLY; The provisioning state of the network function definition version resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The network function definition version state. + VersionState *VersionState } -// VendorsClientGetOptions contains the optional parameters for the VendorsClient.Get method. -type VendorsClientGetOptions struct { - // placeholder for future optional parameters +// GetNetworkFunctionDefinitionVersionPropertiesFormat implements the NetworkFunctionDefinitionVersionPropertiesFormatClassification +// interface for type VirtualNetworkFunctionDefinitionVersion. +func (v *VirtualNetworkFunctionDefinitionVersion) GetNetworkFunctionDefinitionVersionPropertiesFormat() *NetworkFunctionDefinitionVersionPropertiesFormat { + return &NetworkFunctionDefinitionVersionPropertiesFormat{ + DeployParameters: v.DeployParameters, + Description: v.Description, + NetworkFunctionType: v.NetworkFunctionType, + ProvisioningState: v.ProvisioningState, + VersionState: v.VersionState, + } } -// VendorsClientListBySubscriptionOptions contains the optional parameters for the VendorsClient.NewListBySubscriptionPager -// method. -type VendorsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters +// VirtualNetworkFunctionTemplate - Virtual network function template. +type VirtualNetworkFunctionTemplate struct { + // REQUIRED; The network function type. + NfviType *VirtualNetworkFunctionNFVIType } -// VirtualHardDisk - Describes the uri of a disk. -type VirtualHardDisk struct { - // Specifies the virtual hard disk's uri. - URI *string +// GetVirtualNetworkFunctionTemplate implements the VirtualNetworkFunctionTemplateClassification interface for type VirtualNetworkFunctionTemplate. +func (v *VirtualNetworkFunctionTemplate) GetVirtualNetworkFunctionTemplate() *VirtualNetworkFunctionTemplate { + return v } diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/models_serde.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/models_serde.go index 06b76ce82b62..b57e8d45842d 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/models_serde.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/models_serde.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armhybridnetwork @@ -16,19 +15,17 @@ import ( "reflect" ) -// MarshalJSON implements the json.Marshaller interface for type AzureStackEdgeFormat. -func (a AzureStackEdgeFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArmResourceDefinitionResourceElementTemplate. +func (a ArmResourceDefinitionResourceElementTemplate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "azureStackEdge", a.AzureStackEdge) - objectMap["deviceType"] = DeviceTypeAzureStackEdge - populate(objectMap, "networkFunctions", a.NetworkFunctions) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "status", a.Status) + populate(objectMap, "artifactProfile", a.ArtifactProfile) + populate(objectMap, "parameterValues", a.ParameterValues) + populate(objectMap, "templateType", a.TemplateType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureStackEdgeFormat. -func (a *AzureStackEdgeFormat) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmResourceDefinitionResourceElementTemplate. +func (a *ArmResourceDefinitionResourceElementTemplate) UnmarshalJSON(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) @@ -36,20 +33,14 @@ func (a *AzureStackEdgeFormat) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "azureStackEdge": - err = unpopulate(val, "AzureStackEdge", &a.AzureStackEdge) - delete(rawMsg, key) - case "deviceType": - err = unpopulate(val, "DeviceType", &a.DeviceType) + case "artifactProfile": + err = unpopulate(val, "ArtifactProfile", &a.ArtifactProfile) delete(rawMsg, key) - case "networkFunctions": - err = unpopulate(val, "NetworkFunctions", &a.NetworkFunctions) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + case "parameterValues": + err = unpopulate(val, "ParameterValues", &a.ParameterValues) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &a.Status) + case "templateType": + err = unpopulate(val, "TemplateType", &a.TemplateType) delete(rawMsg, key) } if err != nil { @@ -59,1352 +50,4520 @@ func (a *AzureStackEdgeFormat) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomProfile. -func (c CustomProfile) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArmResourceDefinitionResourceElementTemplateDetails. +func (a ArmResourceDefinitionResourceElementTemplateDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "metadataConfigurationPath", c.MetadataConfigurationPath) + populate(objectMap, "configuration", a.Configuration) + populate(objectMap, "dependsOnProfile", a.DependsOnProfile) + populate(objectMap, "name", a.Name) + objectMap["type"] = TypeArmResourceDefinition return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomProfile. -func (c *CustomProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmResourceDefinitionResourceElementTemplateDetails. +func (a *ArmResourceDefinitionResourceElementTemplateDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "metadataConfigurationPath": - err = unpopulate(val, "MetadataConfigurationPath", &c.MetadataConfigurationPath) + case "configuration": + err = unpopulate(val, "Configuration", &a.Configuration) + delete(rawMsg, key) + case "dependsOnProfile": + err = unpopulate(val, "DependsOnProfile", &a.DependsOnProfile) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "ResourceElementType", &a.ResourceElementType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataDisk. -func (d DataDisk) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArmTemplateArtifactProfile. +func (a ArmTemplateArtifactProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "createOption", d.CreateOption) - populate(objectMap, "diskSizeGB", d.DiskSizeGB) - populate(objectMap, "name", d.Name) + populate(objectMap, "templateName", a.TemplateName) + populate(objectMap, "templateVersion", a.TemplateVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataDisk. -func (d *DataDisk) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmTemplateArtifactProfile. +func (a *ArmTemplateArtifactProfile) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "createOption": - err = unpopulate(val, "CreateOption", &d.CreateOption) + case "templateName": + err = unpopulate(val, "TemplateName", &a.TemplateName) delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &d.DiskSizeGB) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) + case "templateVersion": + err = unpopulate(val, "TemplateVersion", &a.TemplateVersion) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Device. -func (d Device) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArmTemplateMappingRuleProfile. +func (a ArmTemplateMappingRuleProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) + populate(objectMap, "templateParameters", a.TemplateParameters) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Device. -func (d *Device) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmTemplateMappingRuleProfile. +func (a *ArmTemplateMappingRuleProfile) UnmarshalJSON(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) + 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", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - d.Properties, err = unmarshalDevicePropertiesFormatClassification(val) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "templateParameters": + err = unpopulate(val, "TemplateParameters", &a.TemplateParameters) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeviceListResult. -func (d DeviceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArtifactAccessCredential. +func (a ArtifactAccessCredential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + objectMap["credentialType"] = a.CredentialType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceListResult. -func (d *DeviceListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactAccessCredential. +func (a *ArtifactAccessCredential) UnmarshalJSON(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) + 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", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "credentialType": + err = unpopulate(val, "CredentialType", &a.CredentialType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DevicePropertiesFormat. -func (d DevicePropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArtifactChangeState. +func (a ArtifactChangeState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["deviceType"] = d.DeviceType - populate(objectMap, "networkFunctions", d.NetworkFunctions) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "status", d.Status) + populate(objectMap, "properties", a.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DevicePropertiesFormat. -func (d *DevicePropertiesFormat) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactChangeState. +func (a *ArtifactChangeState) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "deviceType": - err = unpopulate(val, "DeviceType", &d.DeviceType) - delete(rawMsg, key) - case "networkFunctions": - err = unpopulate(val, "NetworkFunctions", &d.NetworkFunctions) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeviceRegistrationKey. -func (d DeviceRegistrationKey) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArtifactChangeStateProperties. +func (a ArtifactChangeStateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "registrationKey", d.RegistrationKey) + populate(objectMap, "artifactState", a.ArtifactState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceRegistrationKey. -func (d *DeviceRegistrationKey) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactChangeStateProperties. +func (a *ArtifactChangeStateProperties) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "registrationKey": - err = unpopulate(val, "RegistrationKey", &d.RegistrationKey) + case "artifactState": + err = unpopulate(val, "ArtifactState", &a.ArtifactState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. -func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArtifactManifest. +func (a ArtifactManifest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateAny(objectMap, "info", e.Info) - populate(objectMap, "type", e.Type) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. -func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactManifest. +func (a *ArtifactManifest) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "info": - err = unpopulate(val, "Info", &e.Info) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + 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 "tags": + err = unpopulate(val, "Tags", &a.Tags) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &e.Type) + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. -func (e ErrorDetail) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArtifactManifestListResult. +func (a ArtifactManifestListResult) 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) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. -func (e *ErrorDetail) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactManifestListResult. +func (a *ArtifactManifestListResult) UnmarshalJSON(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", a, 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) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 ArtifactManifestPropertiesFormat. +func (a ArtifactManifestPropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "error", e.Error) + populate(objectMap, "artifactManifestState", a.ArtifactManifestState) + populate(objectMap, "artifacts", a.Artifacts) + populate(objectMap, "provisioningState", a.ProvisioningState) 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 ArtifactManifestPropertiesFormat. +func (a *ArtifactManifestPropertiesFormat) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "error": - err = unpopulate(val, "Error", &e.Error) + case "artifactManifestState": + err = unpopulate(val, "ArtifactManifestState", &a.ArtifactManifestState) + delete(rawMsg, key) + case "artifacts": + err = unpopulate(val, "Artifacts", &a.Artifacts) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageReference. -func (i ImageReference) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArtifactManifestUpdateState. +func (a ArtifactManifestUpdateState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "exactVersion", i.ExactVersion) - populate(objectMap, "offer", i.Offer) - populate(objectMap, "publisher", i.Publisher) - populate(objectMap, "sku", i.SKU) - populate(objectMap, "version", i.Version) + populate(objectMap, "artifactManifestState", a.ArtifactManifestState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageReference. -func (i *ImageReference) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactManifestUpdateState. +func (a *ArtifactManifestUpdateState) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "exactVersion": - err = unpopulate(val, "ExactVersion", &i.ExactVersion) - delete(rawMsg, key) - case "offer": - err = unpopulate(val, "Offer", &i.Offer) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &i.Publisher) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &i.SKU) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &i.Version) + case "artifactManifestState": + err = unpopulate(val, "ArtifactManifestState", &a.ArtifactManifestState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LinuxConfiguration. -func (l LinuxConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArtifactProfile. +func (a ArtifactProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "ssh", l.SSH) + populate(objectMap, "artifactStore", a.ArtifactStore) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxConfiguration. -func (l *LinuxConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactProfile. +func (a *ArtifactProfile) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "ssh": - err = unpopulate(val, "SSH", &l.SSH) + case "artifactStore": + err = unpopulate(val, "ArtifactStore", &a.ArtifactStore) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFunction. -func (n NetworkFunction) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArtifactStore. +func (a ArtifactStore) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "etag", n.Etag) - populate(objectMap, "id", n.ID) - populate(objectMap, "location", n.Location) - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "systemData", n.SystemData) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "type", n.Type) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunction. -func (n *NetworkFunction) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactStore. +func (a *ArtifactStore) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "etag": - err = unpopulate(val, "Etag", &n.Etag) - delete(rawMsg, key) case "id": - err = unpopulate(val, "ID", &n.ID) + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) case "location": - err = unpopulate(val, "Location", &n.Location) + err = unpopulate(val, "Location", &a.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &n.Name) + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &n.Properties) + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &n.SystemData) + err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) case "tags": - err = unpopulate(val, "Tags", &n.Tags) + err = unpopulate(val, "Tags", &a.Tags) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &n.Type) + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionListResult. -func (n NetworkFunctionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArtifactStoreListResult. +func (a ArtifactStoreListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", n.NextLink) - populate(objectMap, "value", n.Value) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionListResult. -func (n *NetworkFunctionListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactStoreListResult. +func (a *ArtifactStoreListResult) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &n.NextLink) + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &n.Value) + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionPropertiesFormat. -func (n NetworkFunctionPropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArtifactStorePropertiesFormat. +func (a ArtifactStorePropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "device", n.Device) - populate(objectMap, "managedApplication", n.ManagedApplication) - populateAny(objectMap, "managedApplicationParameters", n.ManagedApplicationParameters) - populateAny(objectMap, "networkFunctionContainerConfigurations", n.NetworkFunctionContainerConfigurations) - populate(objectMap, "networkFunctionUserConfigurations", n.NetworkFunctionUserConfigurations) - populate(objectMap, "provisioningState", n.ProvisioningState) - populate(objectMap, "skuName", n.SKUName) - populate(objectMap, "skuType", n.SKUType) - populate(objectMap, "serviceKey", n.ServiceKey) - populate(objectMap, "vendorName", n.VendorName) - populate(objectMap, "vendorProvisioningState", n.VendorProvisioningState) + populate(objectMap, "managedResourceGroupConfiguration", a.ManagedResourceGroupConfiguration) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "replicationStrategy", a.ReplicationStrategy) + populate(objectMap, "storageResourceId", a.StorageResourceID) + populate(objectMap, "storeType", a.StoreType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionPropertiesFormat. -func (n *NetworkFunctionPropertiesFormat) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactStorePropertiesFormat. +func (a *ArtifactStorePropertiesFormat) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "device": - err = unpopulate(val, "Device", &n.Device) - delete(rawMsg, key) - case "managedApplication": - err = unpopulate(val, "ManagedApplication", &n.ManagedApplication) - delete(rawMsg, key) - case "managedApplicationParameters": - err = unpopulate(val, "ManagedApplicationParameters", &n.ManagedApplicationParameters) - delete(rawMsg, key) - case "networkFunctionContainerConfigurations": - err = unpopulate(val, "NetworkFunctionContainerConfigurations", &n.NetworkFunctionContainerConfigurations) - delete(rawMsg, key) - case "networkFunctionUserConfigurations": - err = unpopulate(val, "NetworkFunctionUserConfigurations", &n.NetworkFunctionUserConfigurations) + case "managedResourceGroupConfiguration": + err = unpopulate(val, "ManagedResourceGroupConfiguration", &a.ManagedResourceGroupConfiguration) delete(rawMsg, key) case "provisioningState": - err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) - delete(rawMsg, key) - case "skuName": - err = unpopulate(val, "SKUName", &n.SKUName) - delete(rawMsg, key) - case "skuType": - err = unpopulate(val, "SKUType", &n.SKUType) + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) delete(rawMsg, key) - case "serviceKey": - err = unpopulate(val, "ServiceKey", &n.ServiceKey) + case "replicationStrategy": + err = unpopulate(val, "ReplicationStrategy", &a.ReplicationStrategy) delete(rawMsg, key) - case "vendorName": - err = unpopulate(val, "VendorName", &n.VendorName) + case "storageResourceId": + err = unpopulate(val, "StorageResourceID", &a.StorageResourceID) delete(rawMsg, key) - case "vendorProvisioningState": - err = unpopulate(val, "VendorProvisioningState", &n.VendorProvisioningState) + case "storeType": + err = unpopulate(val, "StoreType", &a.StoreType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionRoleConfiguration. -func (n NetworkFunctionRoleConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArtifactStorePropertiesFormatManagedResourceGroupConfiguration. +func (a ArtifactStorePropertiesFormatManagedResourceGroupConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "customProfile", n.CustomProfile) - populate(objectMap, "networkInterfaces", n.NetworkInterfaces) - populate(objectMap, "osProfile", n.OSProfile) - populate(objectMap, "roleName", n.RoleName) - populate(objectMap, "roleType", n.RoleType) - populate(objectMap, "storageProfile", n.StorageProfile) - populateAny(objectMap, "userDataParameters", n.UserDataParameters) - populateAny(objectMap, "userDataTemplate", n.UserDataTemplate) - populate(objectMap, "virtualMachineSize", n.VirtualMachineSize) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionRoleConfiguration. -func (n *NetworkFunctionRoleConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactStorePropertiesFormatManagedResourceGroupConfiguration. +func (a *ArtifactStorePropertiesFormatManagedResourceGroupConfiguration) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "customProfile": - err = unpopulate(val, "CustomProfile", &n.CustomProfile) - delete(rawMsg, key) - case "networkInterfaces": - err = unpopulate(val, "NetworkInterfaces", &n.NetworkInterfaces) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &n.OSProfile) - delete(rawMsg, key) - case "roleName": - err = unpopulate(val, "RoleName", &n.RoleName) - delete(rawMsg, key) - case "roleType": - err = unpopulate(val, "RoleType", &n.RoleType) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &n.StorageProfile) - delete(rawMsg, key) - case "userDataParameters": - err = unpopulate(val, "UserDataParameters", &n.UserDataParameters) - delete(rawMsg, key) - case "userDataTemplate": - err = unpopulate(val, "UserDataTemplate", &n.UserDataTemplate) + case "location": + err = unpopulate(val, "Location", &a.Location) delete(rawMsg, key) - case "virtualMachineSize": - err = unpopulate(val, "VirtualMachineSize", &n.VirtualMachineSize) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionRoleInstanceListResult. -func (n NetworkFunctionRoleInstanceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureArcK8SClusterNFVIDetails. +func (a AzureArcK8SClusterNFVIDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", n.NextLink) - populate(objectMap, "value", n.Value) + populate(objectMap, "customLocationReference", a.CustomLocationReference) + populate(objectMap, "name", a.Name) + objectMap["nfviType"] = NFVITypeAzureArcKubernetes return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionRoleInstanceListResult. -func (n *NetworkFunctionRoleInstanceListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureArcK8SClusterNFVIDetails. +func (a *AzureArcK8SClusterNFVIDetails) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &n.NextLink) + case "customLocationReference": + err = unpopulate(val, "CustomLocationReference", &a.CustomLocationReference) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "nfviType": + err = unpopulate(val, "NfviType", &a.NfviType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionSKUDetails. -func (n NetworkFunctionSKUDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureArcKubernetesArtifactProfile. +func (a AzureArcKubernetesArtifactProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", n.NextLink) - populate(objectMap, "skuType", n.SKUType) - populate(objectMap, "value", n.Value) + populate(objectMap, "artifactStore", a.ArtifactStore) + populate(objectMap, "helmArtifactProfile", a.HelmArtifactProfile) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionSKUDetails. -func (n *NetworkFunctionSKUDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureArcKubernetesArtifactProfile. +func (a *AzureArcKubernetesArtifactProfile) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &n.NextLink) - delete(rawMsg, key) - case "skuType": - err = unpopulate(val, "SKUType", &n.SKUType) + case "artifactStore": + err = unpopulate(val, "ArtifactStore", &a.ArtifactStore) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "helmArtifactProfile": + err = unpopulate(val, "HelmArtifactProfile", &a.HelmArtifactProfile) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionSKUListResult. -func (n NetworkFunctionSKUListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureArcKubernetesDeployMappingRuleProfile. +func (a AzureArcKubernetesDeployMappingRuleProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", n.NextLink) - populate(objectMap, "value", n.Value) + populate(objectMap, "applicationEnablement", a.ApplicationEnablement) + populate(objectMap, "helmMappingRuleProfile", a.HelmMappingRuleProfile) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionSKUListResult. -func (n *NetworkFunctionSKUListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureArcKubernetesDeployMappingRuleProfile. +func (a *AzureArcKubernetesDeployMappingRuleProfile) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &n.NextLink) + case "applicationEnablement": + err = unpopulate(val, "ApplicationEnablement", &a.ApplicationEnablement) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "helmMappingRuleProfile": + err = unpopulate(val, "HelmMappingRuleProfile", &a.HelmMappingRuleProfile) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionSKURoleDetails. -func (n NetworkFunctionSKURoleDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureArcKubernetesHelmApplication. +func (a AzureArcKubernetesHelmApplication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "networkInterfaces", n.NetworkInterfaces) - populate(objectMap, "roleName", n.RoleName) - populateAny(objectMap, "userDataParameters", n.UserDataParameters) - populateAny(objectMap, "userDataTemplate", n.UserDataTemplate) + populate(objectMap, "artifactProfile", a.ArtifactProfile) + objectMap["artifactType"] = AzureArcKubernetesArtifactTypeHelmPackage + populate(objectMap, "dependsOnProfile", a.DependsOnProfile) + populate(objectMap, "deployParametersMappingRuleProfile", a.DeployParametersMappingRuleProfile) + populate(objectMap, "name", a.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionSKURoleDetails. -func (n *NetworkFunctionSKURoleDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureArcKubernetesHelmApplication. +func (a *AzureArcKubernetesHelmApplication) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "networkInterfaces": - err = unpopulate(val, "NetworkInterfaces", &n.NetworkInterfaces) + case "artifactProfile": + err = unpopulate(val, "ArtifactProfile", &a.ArtifactProfile) delete(rawMsg, key) - case "roleName": - err = unpopulate(val, "RoleName", &n.RoleName) + case "artifactType": + err = unpopulate(val, "ArtifactType", &a.ArtifactType) delete(rawMsg, key) - case "userDataParameters": - err = unpopulate(val, "UserDataParameters", &n.UserDataParameters) + case "dependsOnProfile": + err = unpopulate(val, "DependsOnProfile", &a.DependsOnProfile) delete(rawMsg, key) - case "userDataTemplate": - err = unpopulate(val, "UserDataTemplate", &n.UserDataTemplate) + case "deployParametersMappingRuleProfile": + err = unpopulate(val, "DeployParametersMappingRuleProfile", &a.DeployParametersMappingRuleProfile) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionTemplate. -func (n NetworkFunctionTemplate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureArcKubernetesNetworkFunctionApplication. +func (a AzureArcKubernetesNetworkFunctionApplication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "networkFunctionRoleConfigurations", n.NetworkFunctionRoleConfigurations) + objectMap["artifactType"] = a.ArtifactType + populate(objectMap, "dependsOnProfile", a.DependsOnProfile) + populate(objectMap, "name", a.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionTemplate. -func (n *NetworkFunctionTemplate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureArcKubernetesNetworkFunctionApplication. +func (a *AzureArcKubernetesNetworkFunctionApplication) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "networkFunctionRoleConfigurations": - err = unpopulate(val, "NetworkFunctionRoleConfigurations", &n.NetworkFunctionRoleConfigurations) + case "artifactType": + err = unpopulate(val, "ArtifactType", &a.ArtifactType) + delete(rawMsg, key) + case "dependsOnProfile": + err = unpopulate(val, "DependsOnProfile", &a.DependsOnProfile) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionUserConfiguration. -func (n NetworkFunctionUserConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureArcKubernetesNetworkFunctionTemplate. +func (a AzureArcKubernetesNetworkFunctionTemplate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "networkInterfaces", n.NetworkInterfaces) - populate(objectMap, "osProfile", n.OSProfile) - populate(objectMap, "roleName", n.RoleName) - populateAny(objectMap, "userDataParameters", n.UserDataParameters) + populate(objectMap, "networkFunctionApplications", a.NetworkFunctionApplications) + objectMap["nfviType"] = ContainerizedNetworkFunctionNFVITypeAzureArcKubernetes return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionUserConfiguration. -func (n *NetworkFunctionUserConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureArcKubernetesNetworkFunctionTemplate. +func (a *AzureArcKubernetesNetworkFunctionTemplate) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "networkInterfaces": - err = unpopulate(val, "NetworkInterfaces", &n.NetworkInterfaces) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &n.OSProfile) + case "networkFunctionApplications": + a.NetworkFunctionApplications, err = unmarshalAzureArcKubernetesNetworkFunctionApplicationClassificationArray(val) delete(rawMsg, key) - case "roleName": - err = unpopulate(val, "RoleName", &n.RoleName) - delete(rawMsg, key) - case "userDataParameters": - err = unpopulate(val, "UserDataParameters", &n.UserDataParameters) + case "nfviType": + err = unpopulate(val, "NfviType", &a.NfviType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionUserConfigurationOsProfile. -func (n NetworkFunctionUserConfigurationOsProfile) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureContainerRegistryScopedTokenCredential. +func (a AzureContainerRegistryScopedTokenCredential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "customData", n.CustomData) + populate(objectMap, "acrServerUrl", a.AcrServerURL) + populate(objectMap, "acrToken", a.AcrToken) + objectMap["credentialType"] = CredentialTypeAzureContainerRegistryScopedToken + populateTimeRFC3339(objectMap, "expiry", a.Expiry) + populate(objectMap, "repositories", a.Repositories) + populate(objectMap, "username", a.Username) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionUserConfigurationOsProfile. -func (n *NetworkFunctionUserConfigurationOsProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureContainerRegistryScopedTokenCredential. +func (a *AzureContainerRegistryScopedTokenCredential) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "customData": - err = unpopulate(val, "CustomData", &n.CustomData) + case "acrServerUrl": + err = unpopulate(val, "AcrServerURL", &a.AcrServerURL) + delete(rawMsg, key) + case "acrToken": + err = unpopulate(val, "AcrToken", &a.AcrToken) + delete(rawMsg, key) + case "credentialType": + err = unpopulate(val, "CredentialType", &a.CredentialType) + delete(rawMsg, key) + case "expiry": + err = unpopulateTimeRFC3339(val, "Expiry", &a.Expiry) + delete(rawMsg, key) + case "repositories": + err = unpopulate(val, "Repositories", &a.Repositories) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &a.Username) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionVendor. -func (n NetworkFunctionVendor) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureCoreArmTemplateArtifactProfile. +func (a AzureCoreArmTemplateArtifactProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", n.Properties) + populate(objectMap, "artifactStore", a.ArtifactStore) + populate(objectMap, "templateArtifactProfile", a.TemplateArtifactProfile) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionVendor. -func (n *NetworkFunctionVendor) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureCoreArmTemplateArtifactProfile. +func (a *AzureCoreArmTemplateArtifactProfile) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &n.Properties) + case "artifactStore": + err = unpopulate(val, "ArtifactStore", &a.ArtifactStore) + delete(rawMsg, key) + case "templateArtifactProfile": + err = unpopulate(val, "TemplateArtifactProfile", &a.TemplateArtifactProfile) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionVendorConfiguration. -func (n NetworkFunctionVendorConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureCoreArmTemplateDeployMappingRuleProfile. +func (a AzureCoreArmTemplateDeployMappingRuleProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "networkInterfaces", n.NetworkInterfaces) - populate(objectMap, "osProfile", n.OSProfile) - populate(objectMap, "roleName", n.RoleName) - populateAny(objectMap, "userDataParameters", n.UserDataParameters) + populate(objectMap, "applicationEnablement", a.ApplicationEnablement) + populate(objectMap, "templateMappingRuleProfile", a.TemplateMappingRuleProfile) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionVendorConfiguration. -func (n *NetworkFunctionVendorConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureCoreArmTemplateDeployMappingRuleProfile. +func (a *AzureCoreArmTemplateDeployMappingRuleProfile) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "networkInterfaces": - err = unpopulate(val, "NetworkInterfaces", &n.NetworkInterfaces) + case "applicationEnablement": + err = unpopulate(val, "ApplicationEnablement", &a.ApplicationEnablement) delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &n.OSProfile) - delete(rawMsg, key) - case "roleName": - err = unpopulate(val, "RoleName", &n.RoleName) - delete(rawMsg, key) - case "userDataParameters": - err = unpopulate(val, "UserDataParameters", &n.UserDataParameters) + case "templateMappingRuleProfile": + err = unpopulate(val, "TemplateMappingRuleProfile", &a.TemplateMappingRuleProfile) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionVendorListResult. -func (n NetworkFunctionVendorListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureCoreNFVIDetails. +func (a AzureCoreNFVIDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", n.NextLink) - populate(objectMap, "value", n.Value) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + objectMap["nfviType"] = NFVITypeAzureCore return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionVendorListResult. -func (n *NetworkFunctionVendorListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureCoreNFVIDetails. +func (a *AzureCoreNFVIDetails) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &n.NextLink) + case "location": + err = unpopulate(val, "Location", &a.Location) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "nfviType": + err = unpopulate(val, "NfviType", &a.NfviType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkInterface. -func (n NetworkInterface) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureCoreNetworkFunctionApplication. +func (a AzureCoreNetworkFunctionApplication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "ipConfigurations", n.IPConfigurations) - populate(objectMap, "macAddress", n.MacAddress) - populate(objectMap, "networkInterfaceName", n.NetworkInterfaceName) - populate(objectMap, "vmSwitchType", n.VMSwitchType) + objectMap["artifactType"] = a.ArtifactType + populate(objectMap, "dependsOnProfile", a.DependsOnProfile) + populate(objectMap, "name", a.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterface. -func (n *NetworkInterface) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureCoreNetworkFunctionApplication. +func (a *AzureCoreNetworkFunctionApplication) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &n.IPConfigurations) - delete(rawMsg, key) - case "macAddress": - err = unpopulate(val, "MacAddress", &n.MacAddress) + case "artifactType": + err = unpopulate(val, "ArtifactType", &a.ArtifactType) delete(rawMsg, key) - case "networkInterfaceName": - err = unpopulate(val, "NetworkInterfaceName", &n.NetworkInterfaceName) + case "dependsOnProfile": + err = unpopulate(val, "DependsOnProfile", &a.DependsOnProfile) delete(rawMsg, key) - case "vmSwitchType": - err = unpopulate(val, "VMSwitchType", &n.VMSwitchType) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkInterfaceIPConfiguration. -func (n NetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureCoreNetworkFunctionArmTemplateApplication. +func (a AzureCoreNetworkFunctionArmTemplateApplication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dnsServers", n.DNSServers) - populate(objectMap, "gateway", n.Gateway) - populate(objectMap, "ipAddress", n.IPAddress) - populate(objectMap, "ipAllocationMethod", n.IPAllocationMethod) - populate(objectMap, "ipVersion", n.IPVersion) - populate(objectMap, "subnet", n.Subnet) + populate(objectMap, "artifactProfile", a.ArtifactProfile) + objectMap["artifactType"] = AzureCoreArtifactTypeArmTemplate + populate(objectMap, "dependsOnProfile", a.DependsOnProfile) + populate(objectMap, "deployParametersMappingRuleProfile", a.DeployParametersMappingRuleProfile) + populate(objectMap, "name", a.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceIPConfiguration. -func (n *NetworkInterfaceIPConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureCoreNetworkFunctionArmTemplateApplication. +func (a *AzureCoreNetworkFunctionArmTemplateApplication) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "dnsServers": - err = unpopulate(val, "DNSServers", &n.DNSServers) - delete(rawMsg, key) - case "gateway": - err = unpopulate(val, "Gateway", &n.Gateway) + case "artifactProfile": + err = unpopulate(val, "ArtifactProfile", &a.ArtifactProfile) delete(rawMsg, key) - case "ipAddress": - err = unpopulate(val, "IPAddress", &n.IPAddress) + case "artifactType": + err = unpopulate(val, "ArtifactType", &a.ArtifactType) delete(rawMsg, key) - case "ipAllocationMethod": - err = unpopulate(val, "IPAllocationMethod", &n.IPAllocationMethod) + case "dependsOnProfile": + err = unpopulate(val, "DependsOnProfile", &a.DependsOnProfile) delete(rawMsg, key) - case "ipVersion": - err = unpopulate(val, "IPVersion", &n.IPVersion) + case "deployParametersMappingRuleProfile": + err = unpopulate(val, "DeployParametersMappingRuleProfile", &a.DeployParametersMappingRuleProfile) delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &n.Subnet) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Operation. -func (o Operation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureCoreNetworkFunctionTemplate. +func (a AzureCoreNetworkFunctionTemplate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "display", o.Display) - populate(objectMap, "name", o.Name) + populate(objectMap, "networkFunctionApplications", a.NetworkFunctionApplications) + objectMap["nfviType"] = VirtualNetworkFunctionNFVITypeAzureCore return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. -func (o *Operation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureCoreNetworkFunctionTemplate. +func (a *AzureCoreNetworkFunctionTemplate) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) + case "networkFunctionApplications": + a.NetworkFunctionApplications, err = unmarshalAzureCoreNetworkFunctionApplicationClassificationArray(val) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "nfviType": + err = unpopulate(val, "NfviType", &a.NfviType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. -func (o OperationDisplay) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureCoreNetworkFunctionVhdApplication. +func (a AzureCoreNetworkFunctionVhdApplication) 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, "artifactProfile", a.ArtifactProfile) + objectMap["artifactType"] = AzureCoreArtifactTypeVhdImageFile + populate(objectMap, "dependsOnProfile", a.DependsOnProfile) + populate(objectMap, "deployParametersMappingRuleProfile", a.DeployParametersMappingRuleProfile) + populate(objectMap, "name", a.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. -func (o *OperationDisplay) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureCoreNetworkFunctionVhdApplication. +func (a *AzureCoreNetworkFunctionVhdApplication) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) + case "artifactProfile": + err = unpopulate(val, "ArtifactProfile", &a.ArtifactProfile) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) + case "artifactType": + err = unpopulate(val, "ArtifactType", &a.ArtifactType) delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) + case "dependsOnProfile": + err = unpopulate(val, "DependsOnProfile", &a.DependsOnProfile) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) + case "deployParametersMappingRuleProfile": + err = unpopulate(val, "DeployParametersMappingRuleProfile", &a.DeployParametersMappingRuleProfile) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationList. -func (o OperationList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureCoreVhdImageArtifactProfile. +func (a AzureCoreVhdImageArtifactProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + populate(objectMap, "artifactStore", a.ArtifactStore) + populate(objectMap, "vhdArtifactProfile", a.VhdArtifactProfile) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationList. -func (o *OperationList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureCoreVhdImageArtifactProfile. +func (a *AzureCoreVhdImageArtifactProfile) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) + case "artifactStore": + err = unpopulate(val, "ArtifactStore", &a.ArtifactStore) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) + case "vhdArtifactProfile": + err = unpopulate(val, "VhdArtifactProfile", &a.VhdArtifactProfile) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OsDisk. -func (o OsDisk) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureCoreVhdImageDeployMappingRuleProfile. +func (a AzureCoreVhdImageDeployMappingRuleProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "diskSizeGB", o.DiskSizeGB) - populate(objectMap, "name", o.Name) - populate(objectMap, "osType", o.OSType) - populate(objectMap, "vhd", o.Vhd) + populate(objectMap, "applicationEnablement", a.ApplicationEnablement) + populate(objectMap, "vhdImageMappingRuleProfile", a.VhdImageMappingRuleProfile) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OsDisk. -func (o *OsDisk) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureCoreVhdImageDeployMappingRuleProfile. +func (a *AzureCoreVhdImageDeployMappingRuleProfile) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &o.DiskSizeGB) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &o.OSType) + case "applicationEnablement": + err = unpopulate(val, "ApplicationEnablement", &a.ApplicationEnablement) delete(rawMsg, key) - case "vhd": - err = unpopulate(val, "Vhd", &o.Vhd) + case "vhdImageMappingRuleProfile": + err = unpopulate(val, "VhdImageMappingRuleProfile", &a.VhdImageMappingRuleProfile) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OsProfile. -func (o OsProfile) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureOperatorNexusArmTemplateArtifactProfile. +func (a AzureOperatorNexusArmTemplateArtifactProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "adminUsername", o.AdminUsername) - populate(objectMap, "customData", o.CustomData) - populate(objectMap, "customDataRequired", o.CustomDataRequired) - populate(objectMap, "linuxConfiguration", o.LinuxConfiguration) + populate(objectMap, "artifactStore", a.ArtifactStore) + populate(objectMap, "templateArtifactProfile", a.TemplateArtifactProfile) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OsProfile. -func (o *OsProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureOperatorNexusArmTemplateArtifactProfile. +func (a *AzureOperatorNexusArmTemplateArtifactProfile) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "adminUsername": - err = unpopulate(val, "AdminUsername", &o.AdminUsername) + case "artifactStore": + err = unpopulate(val, "ArtifactStore", &a.ArtifactStore) delete(rawMsg, key) - case "customData": - err = unpopulate(val, "CustomData", &o.CustomData) + case "templateArtifactProfile": + err = unpopulate(val, "TemplateArtifactProfile", &a.TemplateArtifactProfile) delete(rawMsg, key) - case "customDataRequired": - err = unpopulate(val, "CustomDataRequired", &o.CustomDataRequired) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureOperatorNexusArmTemplateDeployMappingRuleProfile. +func (a AzureOperatorNexusArmTemplateDeployMappingRuleProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationEnablement", a.ApplicationEnablement) + populate(objectMap, "templateMappingRuleProfile", a.TemplateMappingRuleProfile) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureOperatorNexusArmTemplateDeployMappingRuleProfile. +func (a *AzureOperatorNexusArmTemplateDeployMappingRuleProfile) UnmarshalJSON(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 "applicationEnablement": + err = unpopulate(val, "ApplicationEnablement", &a.ApplicationEnablement) delete(rawMsg, key) - case "linuxConfiguration": - err = unpopulate(val, "LinuxConfiguration", &o.LinuxConfiguration) + case "templateMappingRuleProfile": + err = unpopulate(val, "TemplateMappingRuleProfile", &a.TemplateMappingRuleProfile) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PreviewSubscription. -func (p PreviewSubscription) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureOperatorNexusClusterNFVIDetails. +func (a AzureOperatorNexusClusterNFVIDetails) 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, "systemData", p.SystemData) - populate(objectMap, "type", p.Type) + populate(objectMap, "customLocationReference", a.CustomLocationReference) + populate(objectMap, "name", a.Name) + objectMap["nfviType"] = NFVITypeAzureOperatorNexus return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PreviewSubscription. -func (p *PreviewSubscription) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureOperatorNexusClusterNFVIDetails. +func (a *AzureOperatorNexusClusterNFVIDetails) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "customLocationReference": + err = unpopulate(val, "CustomLocationReference", &a.CustomLocationReference) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "nfviType": + err = unpopulate(val, "NfviType", &a.NfviType) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureOperatorNexusImageArtifactProfile. +func (a AzureOperatorNexusImageArtifactProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "artifactStore", a.ArtifactStore) + populate(objectMap, "imageArtifactProfile", a.ImageArtifactProfile) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureOperatorNexusImageArtifactProfile. +func (a *AzureOperatorNexusImageArtifactProfile) UnmarshalJSON(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 "artifactStore": + err = unpopulate(val, "ArtifactStore", &a.ArtifactStore) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "imageArtifactProfile": + err = unpopulate(val, "ImageArtifactProfile", &a.ImageArtifactProfile) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PreviewSubscriptionProperties. -func (p PreviewSubscriptionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureOperatorNexusImageDeployMappingRuleProfile. +func (a AzureOperatorNexusImageDeployMappingRuleProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "applicationEnablement", a.ApplicationEnablement) + populate(objectMap, "imageMappingRuleProfile", a.ImageMappingRuleProfile) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PreviewSubscriptionProperties. -func (p *PreviewSubscriptionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureOperatorNexusImageDeployMappingRuleProfile. +func (a *AzureOperatorNexusImageDeployMappingRuleProfile) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "applicationEnablement": + err = unpopulate(val, "ApplicationEnablement", &a.ApplicationEnablement) + delete(rawMsg, key) + case "imageMappingRuleProfile": + err = unpopulate(val, "ImageMappingRuleProfile", &a.ImageMappingRuleProfile) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PreviewSubscriptionsList. -func (p PreviewSubscriptionsList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureOperatorNexusNetworkFunctionApplication. +func (a AzureOperatorNexusNetworkFunctionApplication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + objectMap["artifactType"] = a.ArtifactType + populate(objectMap, "dependsOnProfile", a.DependsOnProfile) + populate(objectMap, "name", a.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PreviewSubscriptionsList. -func (p *PreviewSubscriptionsList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureOperatorNexusNetworkFunctionApplication. +func (a *AzureOperatorNexusNetworkFunctionApplication) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + case "artifactType": + err = unpopulate(val, "ArtifactType", &a.ArtifactType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "dependsOnProfile": + err = unpopulate(val, "DependsOnProfile", &a.DependsOnProfile) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 AzureOperatorNexusNetworkFunctionArmTemplateApplication. +func (a AzureOperatorNexusNetworkFunctionArmTemplateApplication) 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, "artifactProfile", a.ArtifactProfile) + objectMap["artifactType"] = AzureOperatorNexusArtifactTypeArmTemplate + populate(objectMap, "dependsOnProfile", a.DependsOnProfile) + populate(objectMap, "deployParametersMappingRuleProfile", a.DeployParametersMappingRuleProfile) + populate(objectMap, "name", a.Name) 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 AzureOperatorNexusNetworkFunctionArmTemplateApplication. +func (a *AzureOperatorNexusNetworkFunctionArmTemplateApplication) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "artifactProfile": + err = unpopulate(val, "ArtifactProfile", &a.ArtifactProfile) + delete(rawMsg, key) + case "artifactType": + err = unpopulate(val, "ArtifactType", &a.ArtifactType) + delete(rawMsg, key) + case "dependsOnProfile": + err = unpopulate(val, "DependsOnProfile", &a.DependsOnProfile) + delete(rawMsg, key) + case "deployParametersMappingRuleProfile": + err = unpopulate(val, "DeployParametersMappingRuleProfile", &a.DeployParametersMappingRuleProfile) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureOperatorNexusNetworkFunctionImageApplication. +func (a AzureOperatorNexusNetworkFunctionImageApplication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "artifactProfile", a.ArtifactProfile) + objectMap["artifactType"] = AzureOperatorNexusArtifactTypeImageFile + populate(objectMap, "dependsOnProfile", a.DependsOnProfile) + populate(objectMap, "deployParametersMappingRuleProfile", a.DeployParametersMappingRuleProfile) + populate(objectMap, "name", a.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureOperatorNexusNetworkFunctionImageApplication. +func (a *AzureOperatorNexusNetworkFunctionImageApplication) UnmarshalJSON(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 "artifactProfile": + err = unpopulate(val, "ArtifactProfile", &a.ArtifactProfile) + delete(rawMsg, key) + case "artifactType": + err = unpopulate(val, "ArtifactType", &a.ArtifactType) + delete(rawMsg, key) + case "dependsOnProfile": + err = unpopulate(val, "DependsOnProfile", &a.DependsOnProfile) + delete(rawMsg, key) + case "deployParametersMappingRuleProfile": + err = unpopulate(val, "DeployParametersMappingRuleProfile", &a.DeployParametersMappingRuleProfile) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 AzureOperatorNexusNetworkFunctionTemplate. +func (a AzureOperatorNexusNetworkFunctionTemplate) 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, "networkFunctionApplications", a.NetworkFunctionApplications) + objectMap["nfviType"] = VirtualNetworkFunctionNFVITypeAzureOperatorNexus 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 AzureOperatorNexusNetworkFunctionTemplate. +func (a *AzureOperatorNexusNetworkFunctionTemplate) UnmarshalJSON(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", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) + case "networkFunctionApplications": + a.NetworkFunctionApplications, err = unmarshalAzureOperatorNexusNetworkFunctionApplicationClassificationArray(val) + delete(rawMsg, key) + case "nfviType": + err = unpopulate(val, "NfviType", &a.NfviType) + 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 AzureStorageAccountContainerCredential. +func (a AzureStorageAccountContainerCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "containerName", a.ContainerName) + populate(objectMap, "containerSasUri", a.ContainerSasURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureStorageAccountContainerCredential. +func (a *AzureStorageAccountContainerCredential) UnmarshalJSON(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 "containerName": + err = unpopulate(val, "ContainerName", &a.ContainerName) + delete(rawMsg, key) + case "containerSasUri": + err = unpopulate(val, "ContainerSasURI", &a.ContainerSasURI) + 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 AzureStorageAccountCredential. +func (a AzureStorageAccountCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "containerCredentials", a.ContainerCredentials) + objectMap["credentialType"] = CredentialTypeAzureStorageAccountToken + populateTimeRFC3339(objectMap, "expiry", a.Expiry) + populate(objectMap, "storageAccountId", a.StorageAccountID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureStorageAccountCredential. +func (a *AzureStorageAccountCredential) UnmarshalJSON(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 "containerCredentials": + err = unpopulate(val, "ContainerCredentials", &a.ContainerCredentials) + delete(rawMsg, key) + case "credentialType": + err = unpopulate(val, "CredentialType", &a.CredentialType) + delete(rawMsg, key) + case "expiry": + err = unpopulateTimeRFC3339(val, "Expiry", &a.Expiry) + delete(rawMsg, key) + case "storageAccountId": + err = unpopulate(val, "StorageAccountID", &a.StorageAccountID) + 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 Component. +func (c Component) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Component. +func (c *Component) UnmarshalJSON(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 "id": + err = unpopulate(val, "ID", &c.ID) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentListResult. +func (c ComponentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentListResult. +func (c *ComponentListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + 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 ComponentProperties. +func (c ComponentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deploymentProfile", c.DeploymentProfile) + populate(objectMap, "deploymentStatus", c.DeploymentStatus) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentProperties. +func (c *ComponentProperties) UnmarshalJSON(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 "deploymentProfile": + err = unpopulate(val, "DeploymentProfile", &c.DeploymentProfile) + delete(rawMsg, key) + case "deploymentStatus": + err = unpopulate(val, "DeploymentStatus", &c.DeploymentStatus) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + 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 ConfigurationGroupSchema. +func (c ConfigurationGroupSchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationGroupSchema. +func (c *ConfigurationGroupSchema) UnmarshalJSON(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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + 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 "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConfigurationGroupSchemaListResult. +func (c ConfigurationGroupSchemaListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationGroupSchemaListResult. +func (c *ConfigurationGroupSchemaListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + 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 ConfigurationGroupSchemaPropertiesFormat. +func (c ConfigurationGroupSchemaPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", c.Description) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "schemaDefinition", c.SchemaDefinition) + populate(objectMap, "versionState", c.VersionState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationGroupSchemaPropertiesFormat. +func (c *ConfigurationGroupSchemaPropertiesFormat) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "schemaDefinition": + err = unpopulate(val, "SchemaDefinition", &c.SchemaDefinition) + delete(rawMsg, key) + case "versionState": + err = unpopulate(val, "VersionState", &c.VersionState) + 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 ConfigurationGroupSchemaVersionUpdateState. +func (c ConfigurationGroupSchemaVersionUpdateState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "versionState", c.VersionState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationGroupSchemaVersionUpdateState. +func (c *ConfigurationGroupSchemaVersionUpdateState) UnmarshalJSON(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 "versionState": + err = unpopulate(val, "VersionState", &c.VersionState) + 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 ConfigurationGroupValue. +func (c ConfigurationGroupValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationGroupValue. +func (c *ConfigurationGroupValue) UnmarshalJSON(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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + c.Properties, err = unmarshalConfigurationGroupValuePropertiesFormatClassification(val) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConfigurationGroupValueListResult. +func (c ConfigurationGroupValueListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationGroupValueListResult. +func (c *ConfigurationGroupValueListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + 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 ConfigurationGroupValuePropertiesFormat. +func (c ConfigurationGroupValuePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configurationGroupSchemaName", c.ConfigurationGroupSchemaName) + populate(objectMap, "configurationGroupSchemaOfferingLocation", c.ConfigurationGroupSchemaOfferingLocation) + populate(objectMap, "configurationGroupSchemaResourceReference", c.ConfigurationGroupSchemaResourceReference) + objectMap["configurationType"] = c.ConfigurationType + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "publisherName", c.PublisherName) + populate(objectMap, "publisherScope", c.PublisherScope) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationGroupValuePropertiesFormat. +func (c *ConfigurationGroupValuePropertiesFormat) UnmarshalJSON(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 "configurationGroupSchemaName": + err = unpopulate(val, "ConfigurationGroupSchemaName", &c.ConfigurationGroupSchemaName) + delete(rawMsg, key) + case "configurationGroupSchemaOfferingLocation": + err = unpopulate(val, "ConfigurationGroupSchemaOfferingLocation", &c.ConfigurationGroupSchemaOfferingLocation) + delete(rawMsg, key) + case "configurationGroupSchemaResourceReference": + c.ConfigurationGroupSchemaResourceReference, err = unmarshalDeploymentResourceIDReferenceClassification(val) + delete(rawMsg, key) + case "configurationType": + err = unpopulate(val, "ConfigurationType", &c.ConfigurationType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "publisherName": + err = unpopulate(val, "PublisherName", &c.PublisherName) + delete(rawMsg, key) + case "publisherScope": + err = unpopulate(val, "PublisherScope", &c.PublisherScope) + 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 ConfigurationValueWithSecrets. +func (c ConfigurationValueWithSecrets) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configurationGroupSchemaName", c.ConfigurationGroupSchemaName) + populate(objectMap, "configurationGroupSchemaOfferingLocation", c.ConfigurationGroupSchemaOfferingLocation) + populate(objectMap, "configurationGroupSchemaResourceReference", c.ConfigurationGroupSchemaResourceReference) + objectMap["configurationType"] = ConfigurationGroupValueConfigurationTypeSecret + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "publisherName", c.PublisherName) + populate(objectMap, "publisherScope", c.PublisherScope) + populate(objectMap, "secretConfigurationValue", c.SecretConfigurationValue) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationValueWithSecrets. +func (c *ConfigurationValueWithSecrets) UnmarshalJSON(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 "configurationGroupSchemaName": + err = unpopulate(val, "ConfigurationGroupSchemaName", &c.ConfigurationGroupSchemaName) + delete(rawMsg, key) + case "configurationGroupSchemaOfferingLocation": + err = unpopulate(val, "ConfigurationGroupSchemaOfferingLocation", &c.ConfigurationGroupSchemaOfferingLocation) + delete(rawMsg, key) + case "configurationGroupSchemaResourceReference": + c.ConfigurationGroupSchemaResourceReference, err = unmarshalDeploymentResourceIDReferenceClassification(val) + delete(rawMsg, key) + case "configurationType": + err = unpopulate(val, "ConfigurationType", &c.ConfigurationType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "publisherName": + err = unpopulate(val, "PublisherName", &c.PublisherName) + delete(rawMsg, key) + case "publisherScope": + err = unpopulate(val, "PublisherScope", &c.PublisherScope) + delete(rawMsg, key) + case "secretConfigurationValue": + err = unpopulate(val, "SecretConfigurationValue", &c.SecretConfigurationValue) + 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 ConfigurationValueWithoutSecrets. +func (c ConfigurationValueWithoutSecrets) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configurationGroupSchemaName", c.ConfigurationGroupSchemaName) + populate(objectMap, "configurationGroupSchemaOfferingLocation", c.ConfigurationGroupSchemaOfferingLocation) + populate(objectMap, "configurationGroupSchemaResourceReference", c.ConfigurationGroupSchemaResourceReference) + objectMap["configurationType"] = ConfigurationGroupValueConfigurationTypeOpen + populate(objectMap, "configurationValue", c.ConfigurationValue) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "publisherName", c.PublisherName) + populate(objectMap, "publisherScope", c.PublisherScope) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationValueWithoutSecrets. +func (c *ConfigurationValueWithoutSecrets) UnmarshalJSON(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 "configurationGroupSchemaName": + err = unpopulate(val, "ConfigurationGroupSchemaName", &c.ConfigurationGroupSchemaName) + delete(rawMsg, key) + case "configurationGroupSchemaOfferingLocation": + err = unpopulate(val, "ConfigurationGroupSchemaOfferingLocation", &c.ConfigurationGroupSchemaOfferingLocation) + delete(rawMsg, key) + case "configurationGroupSchemaResourceReference": + c.ConfigurationGroupSchemaResourceReference, err = unmarshalDeploymentResourceIDReferenceClassification(val) + delete(rawMsg, key) + case "configurationType": + err = unpopulate(val, "ConfigurationType", &c.ConfigurationType) + delete(rawMsg, key) + case "configurationValue": + err = unpopulate(val, "ConfigurationValue", &c.ConfigurationValue) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "publisherName": + err = unpopulate(val, "PublisherName", &c.PublisherName) + delete(rawMsg, key) + case "publisherScope": + err = unpopulate(val, "PublisherScope", &c.PublisherScope) + 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 ContainerizedNetworkFunctionDefinitionVersion. +func (c ContainerizedNetworkFunctionDefinitionVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deployParameters", c.DeployParameters) + populate(objectMap, "description", c.Description) + populate(objectMap, "networkFunctionTemplate", c.NetworkFunctionTemplate) + objectMap["networkFunctionType"] = NetworkFunctionTypeContainerizedNetworkFunction + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "versionState", c.VersionState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerizedNetworkFunctionDefinitionVersion. +func (c *ContainerizedNetworkFunctionDefinitionVersion) UnmarshalJSON(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 "deployParameters": + err = unpopulate(val, "DeployParameters", &c.DeployParameters) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "networkFunctionTemplate": + c.NetworkFunctionTemplate, err = unmarshalContainerizedNetworkFunctionTemplateClassification(val) + delete(rawMsg, key) + case "networkFunctionType": + err = unpopulate(val, "NetworkFunctionType", &c.NetworkFunctionType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "versionState": + err = unpopulate(val, "VersionState", &c.VersionState) + 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 ContainerizedNetworkFunctionTemplate. +func (c ContainerizedNetworkFunctionTemplate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["nfviType"] = c.NfviType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerizedNetworkFunctionTemplate. +func (c *ContainerizedNetworkFunctionTemplate) UnmarshalJSON(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 "nfviType": + err = unpopulate(val, "NfviType", &c.NfviType) + 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 CustomLocationResourceID. +func (c CustomLocationResourceID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomLocationResourceID. +func (c *CustomLocationResourceID) UnmarshalJSON(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 "id": + err = unpopulate(val, "ID", &c.ID) + 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 DaemonSet. +func (d DaemonSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "available", d.Available) + populateTimeRFC3339(objectMap, "creationTime", d.CreationTime) + populate(objectMap, "current", d.Current) + populate(objectMap, "desired", d.Desired) + populate(objectMap, "name", d.Name) + populate(objectMap, "namespace", d.Namespace) + populate(objectMap, "ready", d.Ready) + populate(objectMap, "upToDate", d.UpToDate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DaemonSet. +func (d *DaemonSet) UnmarshalJSON(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 "available": + err = unpopulate(val, "Available", &d.Available) + delete(rawMsg, key) + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &d.CreationTime) + delete(rawMsg, key) + case "current": + err = unpopulate(val, "Current", &d.Current) + delete(rawMsg, key) + case "desired": + err = unpopulate(val, "Desired", &d.Desired) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &d.Namespace) + delete(rawMsg, key) + case "ready": + err = unpopulate(val, "Ready", &d.Ready) + delete(rawMsg, key) + case "upToDate": + err = unpopulate(val, "UpToDate", &d.UpToDate) + 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 DependsOnProfile. +func (d DependsOnProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "installDependsOn", d.InstallDependsOn) + populate(objectMap, "uninstallDependsOn", d.UninstallDependsOn) + populate(objectMap, "updateDependsOn", d.UpdateDependsOn) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DependsOnProfile. +func (d *DependsOnProfile) UnmarshalJSON(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 "installDependsOn": + err = unpopulate(val, "InstallDependsOn", &d.InstallDependsOn) + delete(rawMsg, key) + case "uninstallDependsOn": + err = unpopulate(val, "UninstallDependsOn", &d.UninstallDependsOn) + delete(rawMsg, key) + case "updateDependsOn": + err = unpopulate(val, "UpdateDependsOn", &d.UpdateDependsOn) + 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 Deployment. +func (d Deployment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "available", d.Available) + populateTimeRFC3339(objectMap, "creationTime", d.CreationTime) + populate(objectMap, "desired", d.Desired) + populate(objectMap, "name", d.Name) + populate(objectMap, "namespace", d.Namespace) + populate(objectMap, "ready", d.Ready) + populate(objectMap, "upToDate", d.UpToDate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Deployment. +func (d *Deployment) UnmarshalJSON(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 "available": + err = unpopulate(val, "Available", &d.Available) + delete(rawMsg, key) + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &d.CreationTime) + delete(rawMsg, key) + case "desired": + err = unpopulate(val, "Desired", &d.Desired) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &d.Namespace) + delete(rawMsg, key) + case "ready": + err = unpopulate(val, "Ready", &d.Ready) + delete(rawMsg, key) + case "upToDate": + err = unpopulate(val, "UpToDate", &d.UpToDate) + 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 DeploymentResourceIDReference. +func (d DeploymentResourceIDReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["idType"] = d.IDType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentResourceIDReference. +func (d *DeploymentResourceIDReference) UnmarshalJSON(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 "idType": + err = unpopulate(val, "IDType", &d.IDType) + 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 DeploymentStatusProperties. +func (d DeploymentStatusProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "nextExpectedUpdateAt", d.NextExpectedUpdateAt) + populate(objectMap, "resources", d.Resources) + populate(objectMap, "status", d.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentStatusProperties. +func (d *DeploymentStatusProperties) UnmarshalJSON(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 "nextExpectedUpdateAt": + err = unpopulateTimeRFC3339(val, "NextExpectedUpdateAt", &d.NextExpectedUpdateAt) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &d.Resources) + 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 ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + 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) + 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", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + 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 ExecuteRequestParameters. +func (e ExecuteRequestParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "requestMetadata", e.RequestMetadata) + populate(objectMap, "serviceEndpoint", e.ServiceEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExecuteRequestParameters. +func (e *ExecuteRequestParameters) UnmarshalJSON(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 "requestMetadata": + err = unpopulate(val, "RequestMetadata", &e.RequestMetadata) + delete(rawMsg, key) + case "serviceEndpoint": + err = unpopulate(val, "ServiceEndpoint", &e.ServiceEndpoint) + 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 HelmArtifactProfile. +func (h HelmArtifactProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "helmPackageName", h.HelmPackageName) + populate(objectMap, "helmPackageVersionRange", h.HelmPackageVersionRange) + populate(objectMap, "imagePullSecretsValuesPaths", h.ImagePullSecretsValuesPaths) + populate(objectMap, "registryValuesPaths", h.RegistryValuesPaths) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HelmArtifactProfile. +func (h *HelmArtifactProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "helmPackageName": + err = unpopulate(val, "HelmPackageName", &h.HelmPackageName) + delete(rawMsg, key) + case "helmPackageVersionRange": + err = unpopulate(val, "HelmPackageVersionRange", &h.HelmPackageVersionRange) + delete(rawMsg, key) + case "imagePullSecretsValuesPaths": + err = unpopulate(val, "ImagePullSecretsValuesPaths", &h.ImagePullSecretsValuesPaths) + delete(rawMsg, key) + case "registryValuesPaths": + err = unpopulate(val, "RegistryValuesPaths", &h.RegistryValuesPaths) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HelmInstallOptions. +func (h HelmInstallOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "atomic", h.Atomic) + populate(objectMap, "timeout", h.Timeout) + populate(objectMap, "wait", h.Wait) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HelmInstallOptions. +func (h *HelmInstallOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "atomic": + err = unpopulate(val, "Atomic", &h.Atomic) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &h.Timeout) + delete(rawMsg, key) + case "wait": + err = unpopulate(val, "Wait", &h.Wait) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HelmMappingRuleProfile. +func (h HelmMappingRuleProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "helmPackageVersion", h.HelmPackageVersion) + populate(objectMap, "options", h.Options) + populate(objectMap, "releaseName", h.ReleaseName) + populate(objectMap, "releaseNamespace", h.ReleaseNamespace) + populate(objectMap, "values", h.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HelmMappingRuleProfile. +func (h *HelmMappingRuleProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "helmPackageVersion": + err = unpopulate(val, "HelmPackageVersion", &h.HelmPackageVersion) + delete(rawMsg, key) + case "options": + err = unpopulate(val, "Options", &h.Options) + delete(rawMsg, key) + case "releaseName": + err = unpopulate(val, "ReleaseName", &h.ReleaseName) + delete(rawMsg, key) + case "releaseNamespace": + err = unpopulate(val, "ReleaseNamespace", &h.ReleaseNamespace) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &h.Values) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HelmMappingRuleProfileOptions. +func (h HelmMappingRuleProfileOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "installOptions", h.InstallOptions) + populate(objectMap, "upgradeOptions", h.UpgradeOptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HelmMappingRuleProfileOptions. +func (h *HelmMappingRuleProfileOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "installOptions": + err = unpopulate(val, "InstallOptions", &h.InstallOptions) + delete(rawMsg, key) + case "upgradeOptions": + err = unpopulate(val, "UpgradeOptions", &h.UpgradeOptions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HelmUpgradeOptions. +func (h HelmUpgradeOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "atomic", h.Atomic) + populate(objectMap, "timeout", h.Timeout) + populate(objectMap, "wait", h.Wait) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HelmUpgradeOptions. +func (h *HelmUpgradeOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "atomic": + err = unpopulate(val, "Atomic", &h.Atomic) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &h.Timeout) + delete(rawMsg, key) + case "wait": + err = unpopulate(val, "Wait", &h.Wait) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageArtifactProfile. +func (i ImageArtifactProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "imageName", i.ImageName) + populate(objectMap, "imageVersion", i.ImageVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageArtifactProfile. +func (i *ImageArtifactProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "imageName": + err = unpopulate(val, "ImageName", &i.ImageName) + delete(rawMsg, key) + case "imageVersion": + err = unpopulate(val, "ImageVersion", &i.ImageVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageMappingRuleProfile. +func (i ImageMappingRuleProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "userConfiguration", i.UserConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageMappingRuleProfile. +func (i *ImageMappingRuleProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "userConfiguration": + err = unpopulate(val, "UserConfiguration", &i.UserConfiguration) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedResourceGroupConfiguration. +func (m ManagedResourceGroupConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedResourceGroupConfiguration. +func (m *ManagedResourceGroupConfiguration) UnmarshalJSON(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 "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. +func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManifestArtifactFormat. +func (m ManifestArtifactFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "artifactName", m.ArtifactName) + populate(objectMap, "artifactType", m.ArtifactType) + populate(objectMap, "artifactVersion", m.ArtifactVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManifestArtifactFormat. +func (m *ManifestArtifactFormat) UnmarshalJSON(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 "artifactName": + err = unpopulate(val, "ArtifactName", &m.ArtifactName) + delete(rawMsg, key) + case "artifactType": + err = unpopulate(val, "ArtifactType", &m.ArtifactType) + delete(rawMsg, key) + case "artifactVersion": + err = unpopulate(val, "ArtifactVersion", &m.ArtifactVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MappingRuleProfile. +func (m MappingRuleProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationEnablement", m.ApplicationEnablement) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MappingRuleProfile. +func (m *MappingRuleProfile) UnmarshalJSON(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 "applicationEnablement": + err = unpopulate(val, "ApplicationEnablement", &m.ApplicationEnablement) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NFVIs. +func (n NFVIs) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", n.Name) + objectMap["nfviType"] = n.NfviType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NFVIs. +func (n *NFVIs) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "nfviType": + err = unpopulate(val, "NfviType", &n.NfviType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NSDArtifactProfile. +func (n NSDArtifactProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "artifactName", n.ArtifactName) + populate(objectMap, "artifactStoreReference", n.ArtifactStoreReference) + populate(objectMap, "artifactVersion", n.ArtifactVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NSDArtifactProfile. +func (n *NSDArtifactProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "artifactName": + err = unpopulate(val, "ArtifactName", &n.ArtifactName) + delete(rawMsg, key) + case "artifactStoreReference": + err = unpopulate(val, "ArtifactStoreReference", &n.ArtifactStoreReference) + delete(rawMsg, key) + case "artifactVersion": + err = unpopulate(val, "ArtifactVersion", &n.ArtifactVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunction. +func (n NetworkFunction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", n.Etag) + populate(objectMap, "id", n.ID) + populate(objectMap, "identity", n.Identity) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunction. +func (n *NetworkFunction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &n.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &n.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + n.Properties, err = unmarshalNetworkFunctionPropertiesFormatClassification(val) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionApplication. +func (n NetworkFunctionApplication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dependsOnProfile", n.DependsOnProfile) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionApplication. +func (n *NetworkFunctionApplication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dependsOnProfile": + err = unpopulate(val, "DependsOnProfile", &n.DependsOnProfile) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionDefinitionGroup. +func (n NetworkFunctionDefinitionGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionDefinitionGroup. +func (n *NetworkFunctionDefinitionGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + 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 "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionDefinitionGroupListResult. +func (n NetworkFunctionDefinitionGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionDefinitionGroupListResult. +func (n *NetworkFunctionDefinitionGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "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", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionDefinitionGroupPropertiesFormat. +func (n NetworkFunctionDefinitionGroupPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", n.Description) + populate(objectMap, "provisioningState", n.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionDefinitionGroupPropertiesFormat. +func (n *NetworkFunctionDefinitionGroupPropertiesFormat) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &n.Description) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionDefinitionResourceElementTemplateDetails. +func (n NetworkFunctionDefinitionResourceElementTemplateDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configuration", n.Configuration) + populate(objectMap, "dependsOnProfile", n.DependsOnProfile) + populate(objectMap, "name", n.Name) + objectMap["type"] = TypeNetworkFunctionDefinition + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionDefinitionResourceElementTemplateDetails. +func (n *NetworkFunctionDefinitionResourceElementTemplateDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configuration": + err = unpopulate(val, "Configuration", &n.Configuration) + delete(rawMsg, key) + case "dependsOnProfile": + err = unpopulate(val, "DependsOnProfile", &n.DependsOnProfile) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "ResourceElementType", &n.ResourceElementType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionDefinitionVersion. +func (n NetworkFunctionDefinitionVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionDefinitionVersion. +func (n *NetworkFunctionDefinitionVersion) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + n.Properties, err = unmarshalNetworkFunctionDefinitionVersionPropertiesFormatClassification(val) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionDefinitionVersionListResult. +func (n NetworkFunctionDefinitionVersionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionDefinitionVersionListResult. +func (n *NetworkFunctionDefinitionVersionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "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", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionDefinitionVersionPropertiesFormat. +func (n NetworkFunctionDefinitionVersionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deployParameters", n.DeployParameters) + populate(objectMap, "description", n.Description) + objectMap["networkFunctionType"] = n.NetworkFunctionType + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "versionState", n.VersionState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionDefinitionVersionPropertiesFormat. +func (n *NetworkFunctionDefinitionVersionPropertiesFormat) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deployParameters": + err = unpopulate(val, "DeployParameters", &n.DeployParameters) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &n.Description) + delete(rawMsg, key) + case "networkFunctionType": + err = unpopulate(val, "NetworkFunctionType", &n.NetworkFunctionType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "versionState": + err = unpopulate(val, "VersionState", &n.VersionState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionDefinitionVersionUpdateState. +func (n NetworkFunctionDefinitionVersionUpdateState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "versionState", n.VersionState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionDefinitionVersionUpdateState. +func (n *NetworkFunctionDefinitionVersionUpdateState) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "versionState": + err = unpopulate(val, "VersionState", &n.VersionState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionListResult. +func (n NetworkFunctionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionListResult. +func (n *NetworkFunctionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "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", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionPropertiesFormat. +func (n NetworkFunctionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowSoftwareUpdate", n.AllowSoftwareUpdate) + objectMap["configurationType"] = n.ConfigurationType + populate(objectMap, "networkFunctionDefinitionGroupName", n.NetworkFunctionDefinitionGroupName) + populate(objectMap, "networkFunctionDefinitionOfferingLocation", n.NetworkFunctionDefinitionOfferingLocation) + populate(objectMap, "networkFunctionDefinitionVersion", n.NetworkFunctionDefinitionVersion) + populate(objectMap, "networkFunctionDefinitionVersionResourceReference", n.NetworkFunctionDefinitionVersionResourceReference) + populate(objectMap, "nfviId", n.NfviID) + populate(objectMap, "nfviType", n.NfviType) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "publisherName", n.PublisherName) + populate(objectMap, "publisherScope", n.PublisherScope) + populate(objectMap, "roleOverrideValues", n.RoleOverrideValues) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionPropertiesFormat. +func (n *NetworkFunctionPropertiesFormat) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowSoftwareUpdate": + err = unpopulate(val, "AllowSoftwareUpdate", &n.AllowSoftwareUpdate) + delete(rawMsg, key) + case "configurationType": + err = unpopulate(val, "ConfigurationType", &n.ConfigurationType) + delete(rawMsg, key) + case "networkFunctionDefinitionGroupName": + err = unpopulate(val, "NetworkFunctionDefinitionGroupName", &n.NetworkFunctionDefinitionGroupName) + delete(rawMsg, key) + case "networkFunctionDefinitionOfferingLocation": + err = unpopulate(val, "NetworkFunctionDefinitionOfferingLocation", &n.NetworkFunctionDefinitionOfferingLocation) + delete(rawMsg, key) + case "networkFunctionDefinitionVersion": + err = unpopulate(val, "NetworkFunctionDefinitionVersion", &n.NetworkFunctionDefinitionVersion) + delete(rawMsg, key) + case "networkFunctionDefinitionVersionResourceReference": + n.NetworkFunctionDefinitionVersionResourceReference, err = unmarshalDeploymentResourceIDReferenceClassification(val) + delete(rawMsg, key) + case "nfviId": + err = unpopulate(val, "NfviID", &n.NfviID) + delete(rawMsg, key) + case "nfviType": + err = unpopulate(val, "NfviType", &n.NfviType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "publisherName": + err = unpopulate(val, "PublisherName", &n.PublisherName) + delete(rawMsg, key) + case "publisherScope": + err = unpopulate(val, "PublisherScope", &n.PublisherScope) + delete(rawMsg, key) + case "roleOverrideValues": + err = unpopulate(val, "RoleOverrideValues", &n.RoleOverrideValues) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionValueWithSecrets. +func (n NetworkFunctionValueWithSecrets) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowSoftwareUpdate", n.AllowSoftwareUpdate) + objectMap["configurationType"] = NetworkFunctionConfigurationTypeSecret + populate(objectMap, "networkFunctionDefinitionGroupName", n.NetworkFunctionDefinitionGroupName) + populate(objectMap, "networkFunctionDefinitionOfferingLocation", n.NetworkFunctionDefinitionOfferingLocation) + populate(objectMap, "networkFunctionDefinitionVersion", n.NetworkFunctionDefinitionVersion) + populate(objectMap, "networkFunctionDefinitionVersionResourceReference", n.NetworkFunctionDefinitionVersionResourceReference) + populate(objectMap, "nfviId", n.NfviID) + populate(objectMap, "nfviType", n.NfviType) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "publisherName", n.PublisherName) + populate(objectMap, "publisherScope", n.PublisherScope) + populate(objectMap, "roleOverrideValues", n.RoleOverrideValues) + populate(objectMap, "secretDeploymentValues", n.SecretDeploymentValues) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionValueWithSecrets. +func (n *NetworkFunctionValueWithSecrets) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowSoftwareUpdate": + err = unpopulate(val, "AllowSoftwareUpdate", &n.AllowSoftwareUpdate) + delete(rawMsg, key) + case "configurationType": + err = unpopulate(val, "ConfigurationType", &n.ConfigurationType) + delete(rawMsg, key) + case "networkFunctionDefinitionGroupName": + err = unpopulate(val, "NetworkFunctionDefinitionGroupName", &n.NetworkFunctionDefinitionGroupName) + delete(rawMsg, key) + case "networkFunctionDefinitionOfferingLocation": + err = unpopulate(val, "NetworkFunctionDefinitionOfferingLocation", &n.NetworkFunctionDefinitionOfferingLocation) + delete(rawMsg, key) + case "networkFunctionDefinitionVersion": + err = unpopulate(val, "NetworkFunctionDefinitionVersion", &n.NetworkFunctionDefinitionVersion) + delete(rawMsg, key) + case "networkFunctionDefinitionVersionResourceReference": + n.NetworkFunctionDefinitionVersionResourceReference, err = unmarshalDeploymentResourceIDReferenceClassification(val) + delete(rawMsg, key) + case "nfviId": + err = unpopulate(val, "NfviID", &n.NfviID) + delete(rawMsg, key) + case "nfviType": + err = unpopulate(val, "NfviType", &n.NfviType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "publisherName": + err = unpopulate(val, "PublisherName", &n.PublisherName) + delete(rawMsg, key) + case "publisherScope": + err = unpopulate(val, "PublisherScope", &n.PublisherScope) + delete(rawMsg, key) + case "roleOverrideValues": + err = unpopulate(val, "RoleOverrideValues", &n.RoleOverrideValues) + delete(rawMsg, key) + case "secretDeploymentValues": + err = unpopulate(val, "SecretDeploymentValues", &n.SecretDeploymentValues) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionValueWithoutSecrets. +func (n NetworkFunctionValueWithoutSecrets) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowSoftwareUpdate", n.AllowSoftwareUpdate) + objectMap["configurationType"] = NetworkFunctionConfigurationTypeOpen + populate(objectMap, "deploymentValues", n.DeploymentValues) + populate(objectMap, "networkFunctionDefinitionGroupName", n.NetworkFunctionDefinitionGroupName) + populate(objectMap, "networkFunctionDefinitionOfferingLocation", n.NetworkFunctionDefinitionOfferingLocation) + populate(objectMap, "networkFunctionDefinitionVersion", n.NetworkFunctionDefinitionVersion) + populate(objectMap, "networkFunctionDefinitionVersionResourceReference", n.NetworkFunctionDefinitionVersionResourceReference) + populate(objectMap, "nfviId", n.NfviID) + populate(objectMap, "nfviType", n.NfviType) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "publisherName", n.PublisherName) + populate(objectMap, "publisherScope", n.PublisherScope) + populate(objectMap, "roleOverrideValues", n.RoleOverrideValues) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionValueWithoutSecrets. +func (n *NetworkFunctionValueWithoutSecrets) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowSoftwareUpdate": + err = unpopulate(val, "AllowSoftwareUpdate", &n.AllowSoftwareUpdate) + delete(rawMsg, key) + case "configurationType": + err = unpopulate(val, "ConfigurationType", &n.ConfigurationType) + delete(rawMsg, key) + case "deploymentValues": + err = unpopulate(val, "DeploymentValues", &n.DeploymentValues) + delete(rawMsg, key) + case "networkFunctionDefinitionGroupName": + err = unpopulate(val, "NetworkFunctionDefinitionGroupName", &n.NetworkFunctionDefinitionGroupName) + delete(rawMsg, key) + case "networkFunctionDefinitionOfferingLocation": + err = unpopulate(val, "NetworkFunctionDefinitionOfferingLocation", &n.NetworkFunctionDefinitionOfferingLocation) + delete(rawMsg, key) + case "networkFunctionDefinitionVersion": + err = unpopulate(val, "NetworkFunctionDefinitionVersion", &n.NetworkFunctionDefinitionVersion) + delete(rawMsg, key) + case "networkFunctionDefinitionVersionResourceReference": + n.NetworkFunctionDefinitionVersionResourceReference, err = unmarshalDeploymentResourceIDReferenceClassification(val) + delete(rawMsg, key) + case "nfviId": + err = unpopulate(val, "NfviID", &n.NfviID) + delete(rawMsg, key) + case "nfviType": + err = unpopulate(val, "NfviType", &n.NfviType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "publisherName": + err = unpopulate(val, "PublisherName", &n.PublisherName) + delete(rawMsg, key) + case "publisherScope": + err = unpopulate(val, "PublisherScope", &n.PublisherScope) + delete(rawMsg, key) + case "roleOverrideValues": + err = unpopulate(val, "RoleOverrideValues", &n.RoleOverrideValues) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkServiceDesignGroup. +func (n NetworkServiceDesignGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkServiceDesignGroup. +func (n *NetworkServiceDesignGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + 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 "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkServiceDesignGroupListResult. +func (n NetworkServiceDesignGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkServiceDesignGroupListResult. +func (n *NetworkServiceDesignGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "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", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkServiceDesignGroupPropertiesFormat. +func (n NetworkServiceDesignGroupPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", n.Description) + populate(objectMap, "provisioningState", n.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkServiceDesignGroupPropertiesFormat. +func (n *NetworkServiceDesignGroupPropertiesFormat) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &n.Description) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkServiceDesignVersion. +func (n NetworkServiceDesignVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkServiceDesignVersion. +func (n *NetworkServiceDesignVersion) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + 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 "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkServiceDesignVersionListResult. +func (n NetworkServiceDesignVersionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkServiceDesignVersionListResult. +func (n *NetworkServiceDesignVersionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "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", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkServiceDesignVersionPropertiesFormat. +func (n NetworkServiceDesignVersionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configurationGroupSchemaReferences", n.ConfigurationGroupSchemaReferences) + populate(objectMap, "description", n.Description) + populate(objectMap, "nfvisFromSite", n.NfvisFromSite) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "resourceElementTemplates", n.ResourceElementTemplates) + populate(objectMap, "versionState", n.VersionState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkServiceDesignVersionPropertiesFormat. +func (n *NetworkServiceDesignVersionPropertiesFormat) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configurationGroupSchemaReferences": + err = unpopulate(val, "ConfigurationGroupSchemaReferences", &n.ConfigurationGroupSchemaReferences) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &n.Description) + delete(rawMsg, key) + case "nfvisFromSite": + err = unpopulate(val, "NfvisFromSite", &n.NfvisFromSite) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "resourceElementTemplates": + n.ResourceElementTemplates, err = unmarshalResourceElementTemplateClassificationArray(val) + delete(rawMsg, key) + case "versionState": + err = unpopulate(val, "VersionState", &n.VersionState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkServiceDesignVersionUpdateState. +func (n NetworkServiceDesignVersionUpdateState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "versionState", n.VersionState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkServiceDesignVersionUpdateState. +func (n *NetworkServiceDesignVersionUpdateState) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "versionState": + err = unpopulate(val, "VersionState", &n.VersionState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NfviDetails. +func (n NfviDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", n.Name) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NfviDetails. +func (n *NfviDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OpenDeploymentResourceReference. +func (o OpenDeploymentResourceReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", o.ID) + objectMap["idType"] = IDTypeOpen + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenDeploymentResourceReference. +func (o *OpenDeploymentResourceReference) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "idType": + err = unpopulate(val, "IDType", &o.IDType) + 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 Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionType", o.ActionType) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) + delete(rawMsg, key) + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Pod. +func (p Pod) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "creationTime", p.CreationTime) + populate(objectMap, "desired", p.Desired) + populate(objectMap, "events", p.Events) + populate(objectMap, "name", p.Name) + populate(objectMap, "namespace", p.Namespace) + populate(objectMap, "ready", p.Ready) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Pod. +func (p *Pod) UnmarshalJSON(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 "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &p.CreationTime) + delete(rawMsg, key) + case "desired": + err = unpopulate(val, "Desired", &p.Desired) + delete(rawMsg, key) + case "events": + err = unpopulate(val, "Events", &p.Events) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &p.Namespace) + delete(rawMsg, key) + case "ready": + err = unpopulate(val, "Ready", &p.Ready) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + 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 PodEvent. +func (p PodEvent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "lastSeenTime", p.LastSeenTime) + populate(objectMap, "message", p.Message) + populate(objectMap, "reason", p.Reason) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PodEvent. +func (p *PodEvent) UnmarshalJSON(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 "lastSeenTime": + err = unpopulateTimeRFC3339(val, "LastSeenTime", &p.LastSeenTime) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &p.Message) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &p.Reason) + 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 ProxyArtifactListOverview. +func (p ProxyArtifactListOverview) 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 ProxyArtifactListOverview. +func (p *ProxyArtifactListOverview) UnmarshalJSON(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 ProxyArtifactOverview. +func (p ProxyArtifactOverview) 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, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyArtifactOverview. +func (p *ProxyArtifactOverview) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &p.Properties) + 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 ProxyArtifactOverviewListResult. +func (p ProxyArtifactOverviewListResult) 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 ProxyArtifactOverviewListResult. +func (p *ProxyArtifactOverviewListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyArtifactOverviewPropertiesFormat. +func (p ProxyArtifactOverviewPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "artifactVersions", p.ArtifactVersions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyArtifactOverviewPropertiesFormat. +func (p *ProxyArtifactOverviewPropertiesFormat) UnmarshalJSON(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 "artifactVersions": + err = unpopulate(val, "ArtifactVersions", &p.ArtifactVersions) + 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 ProxyArtifactOverviewPropertiesValue. +func (p ProxyArtifactOverviewPropertiesValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "artifactState", p.ArtifactState) + populate(objectMap, "artifactType", p.ArtifactType) + populate(objectMap, "artifactVersion", p.ArtifactVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyArtifactOverviewPropertiesValue. +func (p *ProxyArtifactOverviewPropertiesValue) UnmarshalJSON(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 "artifactState": + err = unpopulate(val, "ArtifactState", &p.ArtifactState) + delete(rawMsg, key) + case "artifactType": + err = unpopulate(val, "ArtifactType", &p.ArtifactType) + delete(rawMsg, key) + case "artifactVersion": + err = unpopulate(val, "ArtifactVersion", &p.ArtifactVersion) + 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 ProxyArtifactVersionsListOverview. +func (p ProxyArtifactVersionsListOverview) 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, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyArtifactVersionsListOverview. +func (p *ProxyArtifactVersionsListOverview) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &p.Properties) + 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 ProxyArtifactVersionsOverviewListResult. +func (p ProxyArtifactVersionsOverviewListResult) 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 ProxyArtifactVersionsOverviewListResult. +func (p *ProxyArtifactVersionsOverviewListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type 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 Publisher. +func (p Publisher) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "identity", p.Identity) + 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 Publisher. +func (p *Publisher) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PublisherListResult. +func (p PublisherListResult) 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 PublisherListResult. +func (p *PublisherListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PublisherPropertiesFormat. +func (p PublisherPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "scope", p.Scope) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublisherPropertiesFormat. +func (p *PublisherPropertiesFormat) UnmarshalJSON(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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &p.Scope) + 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 ReferencedResource. +func (r ReferencedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReferencedResource. +func (r *ReferencedResource) UnmarshalJSON(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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReplicaSet. +func (r ReplicaSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "creationTime", r.CreationTime) + populate(objectMap, "current", r.Current) + populate(objectMap, "desired", r.Desired) + populate(objectMap, "name", r.Name) + populate(objectMap, "namespace", r.Namespace) + populate(objectMap, "ready", r.Ready) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicaSet. +func (r *ReplicaSet) UnmarshalJSON(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 "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &r.CreationTime) + delete(rawMsg, key) + case "current": + err = unpopulate(val, "Current", &r.Current) + delete(rawMsg, key) + case "desired": + err = unpopulate(val, "Desired", &r.Desired) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &r.Namespace) + delete(rawMsg, key) + case "ready": + err = unpopulate(val, "Ready", &r.Ready) + 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 RequestMetadata. +func (r RequestMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiVersion", r.APIVersion) + populate(objectMap, "httpMethod", r.HTTPMethod) + populate(objectMap, "relativePath", r.RelativePath) + populate(objectMap, "serializedBody", r.SerializedBody) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestMetadata. +func (r *RequestMetadata) UnmarshalJSON(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 "name": - err = unpopulate(val, "Name", &r.Name) + case "httpMethod": + err = unpopulate(val, "HTTPMethod", &r.HTTPMethod) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "relativePath": + err = unpopulate(val, "RelativePath", &r.RelativePath) + delete(rawMsg, key) + case "serializedBody": + err = unpopulate(val, "SerializedBody", &r.SerializedBody) delete(rawMsg, key) } if err != nil { @@ -1414,19 +4573,18 @@ func (r *Resource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RoleInstance. -func (r RoleInstance) MarshalJSON() ([]byte, error) { +// 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, "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 RoleInstance. -func (r *RoleInstance) UnmarshalJSON(data []byte) error { +// 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) @@ -1440,9 +4598,6 @@ func (r *RoleInstance) UnmarshalJSON(data []byte) error { 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) @@ -1457,16 +4612,17 @@ func (r *RoleInstance) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RoleInstanceProperties. -func (r RoleInstanceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceElementTemplate. +func (r ResourceElementTemplate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "operationalState", r.OperationalState) - populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "dependsOnProfile", r.DependsOnProfile) + populate(objectMap, "name", r.Name) + objectMap["type"] = r.ResourceElementType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceProperties. -func (r *RoleInstanceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceElementTemplate. +func (r *ResourceElementTemplate) UnmarshalJSON(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) @@ -1474,11 +4630,14 @@ func (r *RoleInstanceProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "operationalState": - err = unpopulate(val, "OperationalState", &r.OperationalState) + case "dependsOnProfile": + err = unpopulate(val, "DependsOnProfile", &r.DependsOnProfile) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "ResourceElementType", &r.ResourceElementType) delete(rawMsg, key) } if err != nil { @@ -1488,46 +4647,59 @@ func (r *RoleInstanceProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SKUOverview. -func (s SKUOverview) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Resources. +func (r Resources) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "skuName", s.SKUName) - populate(objectMap, "skuType", s.SKUType) + populate(objectMap, "daemonSets", r.DaemonSets) + populate(objectMap, "deployments", r.Deployments) + populate(objectMap, "pods", r.Pods) + populate(objectMap, "replicaSets", r.ReplicaSets) + populate(objectMap, "statefulSets", r.StatefulSets) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SKUOverview. -func (s *SKUOverview) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Resources. +func (r *Resources) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "skuName": - err = unpopulate(val, "SKUName", &s.SKUName) + case "daemonSets": + err = unpopulate(val, "DaemonSets", &r.DaemonSets) + delete(rawMsg, key) + case "deployments": + err = unpopulate(val, "Deployments", &r.Deployments) delete(rawMsg, key) - case "skuType": - err = unpopulate(val, "SKUType", &s.SKUType) + case "pods": + err = unpopulate(val, "Pods", &r.Pods) + delete(rawMsg, key) + case "replicaSets": + err = unpopulate(val, "ReplicaSets", &r.ReplicaSets) + delete(rawMsg, key) + case "statefulSets": + err = unpopulate(val, "StatefulSets", &r.StatefulSets) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SSHConfiguration. -func (s SSHConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "publicKeys", s.PublicKeys) + populate(objectMap, "name", s.Name) + populate(objectMap, "tier", s.Tier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHConfiguration. -func (s *SSHConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1535,8 +4707,11 @@ func (s *SSHConfiguration) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "publicKeys": - err = unpopulate(val, "PublicKeys", &s.PublicKeys) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) delete(rawMsg, key) } if err != nil { @@ -1546,16 +4721,16 @@ func (s *SSHConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKey. -func (s SSHPublicKey) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SecretDeploymentResourceReference. +func (s SecretDeploymentResourceReference) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "keyData", s.KeyData) - populate(objectMap, "path", s.Path) + populate(objectMap, "id", s.ID) + objectMap["idType"] = IDTypeSecret return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKey. -func (s *SSHPublicKey) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretDeploymentResourceReference. +func (s *SecretDeploymentResourceReference) UnmarshalJSON(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) @@ -1563,11 +4738,11 @@ func (s *SSHPublicKey) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "keyData": - err = unpopulate(val, "KeyData", &s.KeyData) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &s.Path) + case "idType": + err = unpopulate(val, "IDType", &s.IDType) delete(rawMsg, key) } if err != nil { @@ -1577,17 +4752,21 @@ func (s *SSHPublicKey) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type StorageProfile. -func (s StorageProfile) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Site. +func (s Site) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataDisks", s.DataDisks) - populate(objectMap, "imageReference", s.ImageReference) - populate(objectMap, "osDisk", s.OSDisk) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StorageProfile. -func (s *StorageProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Site. +func (s *Site) UnmarshalJSON(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) @@ -1595,14 +4774,26 @@ func (s *StorageProfile) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "dataDisks": - err = unpopulate(val, "DataDisks", &s.DataDisks) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "imageReference": - err = unpopulate(val, "ImageReference", &s.ImageReference) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) delete(rawMsg, key) - case "osDisk": - err = unpopulate(val, "OSDisk", &s.OSDisk) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -1612,15 +4803,16 @@ func (s *StorageProfile) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SubResource. -func (s SubResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SiteListResult. +func (s SiteListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SubResource. -func (s *SubResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SiteListResult. +func (s *SiteListResult) UnmarshalJSON(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) @@ -1628,8 +4820,11 @@ func (s *SubResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -1639,20 +4834,23 @@ func (s *SubResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SiteNetworkService. +func (s SiteNetworkService) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SiteNetworkService. +func (s *SiteNetworkService) UnmarshalJSON(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) @@ -1660,23 +4858,32 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) + case "identity": + err = unpopulate(val, "Identity", &s.Identity) delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) + case "location": + err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -1686,342 +4893,348 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TagsObject. -func (t TagsObject) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SiteNetworkServiceListResult. +func (s SiteNetworkServiceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "tags", t.Tags) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TagsObject. -func (t *TagsObject) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SiteNetworkServiceListResult. +func (s *SiteNetworkServiceListResult) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "tags": - err = unpopulate(val, "Tags", &t.Tags) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SiteNetworkServicePropertiesFormat. +func (s SiteNetworkServicePropertiesFormat) 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, "tags", t.Tags) - populate(objectMap, "type", t.Type) + populate(objectMap, "desiredStateConfigurationGroupValueReferences", s.DesiredStateConfigurationGroupValueReferences) + populate(objectMap, "lastStateConfigurationGroupValueReferences", s.LastStateConfigurationGroupValueReferences) + populate(objectMap, "lastStateNetworkServiceDesignVersionName", s.LastStateNetworkServiceDesignVersionName) + populate(objectMap, "managedResourceGroupConfiguration", s.ManagedResourceGroupConfiguration) + populate(objectMap, "networkServiceDesignGroupName", s.NetworkServiceDesignGroupName) + populate(objectMap, "networkServiceDesignVersionName", s.NetworkServiceDesignVersionName) + populate(objectMap, "networkServiceDesignVersionOfferingLocation", s.NetworkServiceDesignVersionOfferingLocation) + populate(objectMap, "networkServiceDesignVersionResourceReference", s.NetworkServiceDesignVersionResourceReference) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "publisherName", s.PublisherName) + populate(objectMap, "publisherScope", s.PublisherScope) + populate(objectMap, "siteReference", s.SiteReference) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. -func (t *TrackedResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SiteNetworkServicePropertiesFormat. +func (s *SiteNetworkServicePropertiesFormat) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &t.ID) + case "desiredStateConfigurationGroupValueReferences": + err = unpopulate(val, "DesiredStateConfigurationGroupValueReferences", &s.DesiredStateConfigurationGroupValueReferences) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &t.Location) + case "lastStateConfigurationGroupValueReferences": + err = unpopulate(val, "LastStateConfigurationGroupValueReferences", &s.LastStateConfigurationGroupValueReferences) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) + case "lastStateNetworkServiceDesignVersionName": + err = unpopulate(val, "LastStateNetworkServiceDesignVersionName", &s.LastStateNetworkServiceDesignVersionName) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &t.Tags) + case "managedResourceGroupConfiguration": + err = unpopulate(val, "ManagedResourceGroupConfiguration", &s.ManagedResourceGroupConfiguration) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) + case "networkServiceDesignGroupName": + err = unpopulate(val, "NetworkServiceDesignGroupName", &s.NetworkServiceDesignGroupName) 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 Vendor. -func (v Vendor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "systemData", v.SystemData) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Vendor. -func (v *Vendor) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) + case "networkServiceDesignVersionName": + err = unpopulate(val, "NetworkServiceDesignVersionName", &s.NetworkServiceDesignVersionName) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) + case "networkServiceDesignVersionOfferingLocation": + err = unpopulate(val, "NetworkServiceDesignVersionOfferingLocation", &s.NetworkServiceDesignVersionOfferingLocation) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) + case "networkServiceDesignVersionResourceReference": + s.NetworkServiceDesignVersionResourceReference, err = unmarshalDeploymentResourceIDReferenceClassification(val) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &v.SystemData) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) + case "publisherName": + err = unpopulate(val, "PublisherName", &s.PublisherName) + delete(rawMsg, key) + case "publisherScope": + err = unpopulate(val, "PublisherScope", &s.PublisherScope) + delete(rawMsg, key) + case "siteReference": + err = unpopulate(val, "SiteReference", &s.SiteReference) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type VendorDetails. -func (v VendorDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SitePropertiesFormat. +func (s SitePropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "skuList", v.SKUList) - populate(objectMap, "vendorName", v.VendorName) + populate(objectMap, "nfvis", s.Nfvis) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "siteNetworkServiceReferences", s.SiteNetworkServiceReferences) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VendorDetails. -func (v *VendorDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SitePropertiesFormat. +func (s *SitePropertiesFormat) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "skuList": - err = unpopulate(val, "SKUList", &v.SKUList) + case "nfvis": + s.Nfvis, err = unmarshalNFVIsClassificationArray(val) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) - case "vendorName": - err = unpopulate(val, "VendorName", &v.VendorName) + case "siteNetworkServiceReferences": + err = unpopulate(val, "SiteNetworkServiceReferences", &s.SiteNetworkServiceReferences) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type VendorListResult. -func (v VendorListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StatefulSet. +func (s StatefulSet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) + populateTimeRFC3339(objectMap, "creationTime", s.CreationTime) + populate(objectMap, "desired", s.Desired) + populate(objectMap, "name", s.Name) + populate(objectMap, "namespace", s.Namespace) + populate(objectMap, "ready", s.Ready) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VendorListResult. -func (v *VendorListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StatefulSet. +func (s *StatefulSet) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &s.CreationTime) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) + case "desired": + err = unpopulate(val, "Desired", &s.Desired) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &s.Namespace) + delete(rawMsg, key) + case "ready": + err = unpopulate(val, "Ready", &s.Ready) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type VendorNetworkFunction. -func (v VendorNetworkFunction) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "systemData", v.SystemData) - populate(objectMap, "type", v.Type) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(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 VendorNetworkFunction. -func (v *VendorNetworkFunction) UnmarshalJSON(data []byte) error { +// 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", v, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &v.SystemData) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) + 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", v, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type VendorNetworkFunctionListResult. -func (v VendorNetworkFunctionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TagsObject. +func (t TagsObject) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) + populate(objectMap, "tags", t.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VendorNetworkFunctionListResult. -func (v *VendorNetworkFunctionListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TagsObject. +func (t *TagsObject) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type VendorNetworkFunctionPropertiesFormat. -func (v VendorNetworkFunctionPropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "networkFunctionVendorConfigurations", v.NetworkFunctionVendorConfigurations) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "skuName", v.SKUName) - populate(objectMap, "skuType", v.SKUType) - populate(objectMap, "vendorProvisioningState", v.VendorProvisioningState) + 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 VendorNetworkFunctionPropertiesFormat. -func (v *VendorNetworkFunctionPropertiesFormat) UnmarshalJSON(data []byte) error { +// 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", v, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "networkFunctionVendorConfigurations": - err = unpopulate(val, "NetworkFunctionVendorConfigurations", &v.NetworkFunctionVendorConfigurations) + case "id": + err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) - case "skuName": - err = unpopulate(val, "SKUName", &v.SKUName) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) delete(rawMsg, key) - case "skuType": - err = unpopulate(val, "SKUType", &v.SKUType) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) delete(rawMsg, key) - case "vendorProvisioningState": - err = unpopulate(val, "VendorProvisioningState", &v.VendorProvisioningState) + case "type": + err = unpopulate(val, "Type", &t.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type VendorPropertiesFormat. -func (v VendorPropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. +func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "skus", v.SKUs) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VendorPropertiesFormat. -func (v *VendorPropertiesFormat) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity. +func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) delete(rawMsg, key) - case "skus": - err = unpopulate(val, "SKUs", &v.SKUs) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type VendorSKU. -func (v VendorSKU) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VhdImageArtifactProfile. +func (v VhdImageArtifactProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "systemData", v.SystemData) - populate(objectMap, "type", v.Type) + populate(objectMap, "vhdName", v.VhdName) + populate(objectMap, "vhdVersion", v.VhdVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VendorSKU. -func (v *VendorSKU) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VhdImageArtifactProfile. +func (v *VhdImageArtifactProfile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -2029,20 +5242,11 @@ func (v *VendorSKU) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &v.SystemData) + case "vhdName": + err = unpopulate(val, "VhdName", &v.VhdName) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) + case "vhdVersion": + err = unpopulate(val, "VhdVersion", &v.VhdVersion) delete(rawMsg, key) } if err != nil { @@ -2052,16 +5256,15 @@ func (v *VendorSKU) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VendorSKUListResult. -func (v VendorSKUListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VhdImageMappingRuleProfile. +func (v VhdImageMappingRuleProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) + populate(objectMap, "userConfiguration", v.UserConfiguration) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VendorSKUListResult. -func (v *VendorSKUListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VhdImageMappingRuleProfile. +func (v *VhdImageMappingRuleProfile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -2069,11 +5272,8 @@ func (v *VendorSKUListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) + case "userConfiguration": + err = unpopulate(val, "UserConfiguration", &v.UserConfiguration) delete(rawMsg, key) } if err != nil { @@ -2083,22 +5283,20 @@ func (v *VendorSKUListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VendorSKUPropertiesFormat. -func (v VendorSKUPropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkFunctionDefinitionVersion. +func (v VirtualNetworkFunctionDefinitionVersion) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "deploymentMode", v.DeploymentMode) - populateAny(objectMap, "managedApplicationParameters", v.ManagedApplicationParameters) - populateAny(objectMap, "managedApplicationTemplate", v.ManagedApplicationTemplate) + populate(objectMap, "deployParameters", v.DeployParameters) + populate(objectMap, "description", v.Description) populate(objectMap, "networkFunctionTemplate", v.NetworkFunctionTemplate) - populate(objectMap, "networkFunctionType", v.NetworkFunctionType) - populate(objectMap, "preview", v.Preview) + objectMap["networkFunctionType"] = NetworkFunctionTypeVirtualNetworkFunction populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "skuType", v.SKUType) + populate(objectMap, "versionState", v.VersionState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VendorSKUPropertiesFormat. -func (v *VendorSKUPropertiesFormat) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkFunctionDefinitionVersion. +func (v *VirtualNetworkFunctionDefinitionVersion) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -2106,29 +5304,23 @@ func (v *VendorSKUPropertiesFormat) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "deploymentMode": - err = unpopulate(val, "DeploymentMode", &v.DeploymentMode) - delete(rawMsg, key) - case "managedApplicationParameters": - err = unpopulate(val, "ManagedApplicationParameters", &v.ManagedApplicationParameters) + case "deployParameters": + err = unpopulate(val, "DeployParameters", &v.DeployParameters) delete(rawMsg, key) - case "managedApplicationTemplate": - err = unpopulate(val, "ManagedApplicationTemplate", &v.ManagedApplicationTemplate) + case "description": + err = unpopulate(val, "Description", &v.Description) delete(rawMsg, key) case "networkFunctionTemplate": - err = unpopulate(val, "NetworkFunctionTemplate", &v.NetworkFunctionTemplate) + v.NetworkFunctionTemplate, err = unmarshalVirtualNetworkFunctionTemplateClassification(val) delete(rawMsg, key) case "networkFunctionType": err = unpopulate(val, "NetworkFunctionType", &v.NetworkFunctionType) delete(rawMsg, key) - case "preview": - err = unpopulate(val, "Preview", &v.Preview) - delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) delete(rawMsg, key) - case "skuType": - err = unpopulate(val, "SKUType", &v.SKUType) + case "versionState": + err = unpopulate(val, "VersionState", &v.VersionState) delete(rawMsg, key) } if err != nil { @@ -2138,15 +5330,15 @@ func (v *VendorSKUPropertiesFormat) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualHardDisk. -func (v VirtualHardDisk) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkFunctionTemplate. +func (v VirtualNetworkFunctionTemplate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "uri", v.URI) + objectMap["nfviType"] = v.NfviType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHardDisk. -func (v *VirtualHardDisk) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkFunctionTemplate. +func (v *VirtualNetworkFunctionTemplate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -2154,8 +5346,8 @@ func (v *VirtualHardDisk) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "uri": - err = unpopulate(val, "URI", &v.URI) + case "nfviType": + err = unpopulate(val, "NfviType", &v.NfviType) delete(rawMsg, key) } if err != nil { diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctiondefinitiongroups_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctiondefinitiongroups_client.go new file mode 100644 index 000000000000..d1e7e7fd5c9d --- /dev/null +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctiondefinitiongroups_client.go @@ -0,0 +1,404 @@ +//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 armhybridnetwork + +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" +) + +// NetworkFunctionDefinitionGroupsClient contains the methods for the NetworkFunctionDefinitionGroups group. +// Don't use this type directly, use NewNetworkFunctionDefinitionGroupsClient() instead. +type NetworkFunctionDefinitionGroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNetworkFunctionDefinitionGroupsClient creates a new instance of NetworkFunctionDefinitionGroupsClient 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 NewNetworkFunctionDefinitionGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkFunctionDefinitionGroupsClient, error) { + cl, err := arm.NewClient(moduleName+".NetworkFunctionDefinitionGroupsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkFunctionDefinitionGroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a network function definition group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkFunctionDefinitionGroupName - The name of the network function definition group. +// - parameters - Parameters supplied to the create or update publisher network function definition group operation. +// - options - NetworkFunctionDefinitionGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the NetworkFunctionDefinitionGroupsClient.BeginCreateOrUpdate +// method. +func (client *NetworkFunctionDefinitionGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, parameters NetworkFunctionDefinitionGroup, options *NetworkFunctionDefinitionGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[NetworkFunctionDefinitionGroupsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFunctionDefinitionGroupsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[NetworkFunctionDefinitionGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a network function definition group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *NetworkFunctionDefinitionGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, parameters NetworkFunctionDefinitionGroup, options *NetworkFunctionDefinitionGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, parameters, 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 *NetworkFunctionDefinitionGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, parameters NetworkFunctionDefinitionGroup, options *NetworkFunctionDefinitionGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkFunctionDefinitionGroupName == "" { + return nil, errors.New("parameter networkFunctionDefinitionGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionDefinitionGroupName}", url.PathEscape(networkFunctionDefinitionGroupName)) + 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes a specified network function definition group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkFunctionDefinitionGroupName - The name of the network function definition group. +// - options - NetworkFunctionDefinitionGroupsClientBeginDeleteOptions contains the optional parameters for the NetworkFunctionDefinitionGroupsClient.BeginDelete +// method. +func (client *NetworkFunctionDefinitionGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, options *NetworkFunctionDefinitionGroupsClientBeginDeleteOptions) (*runtime.Poller[NetworkFunctionDefinitionGroupsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFunctionDefinitionGroupsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[NetworkFunctionDefinitionGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a specified network function definition group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *NetworkFunctionDefinitionGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, options *NetworkFunctionDefinitionGroupsClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *NetworkFunctionDefinitionGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, options *NetworkFunctionDefinitionGroupsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkFunctionDefinitionGroupName == "" { + return nil, errors.New("parameter networkFunctionDefinitionGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionDefinitionGroupName}", url.PathEscape(networkFunctionDefinitionGroupName)) + 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about the specified networkFunctionDefinition group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkFunctionDefinitionGroupName - The name of the network function definition group. +// - options - NetworkFunctionDefinitionGroupsClientGetOptions contains the optional parameters for the NetworkFunctionDefinitionGroupsClient.Get +// method. +func (client *NetworkFunctionDefinitionGroupsClient) Get(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, options *NetworkFunctionDefinitionGroupsClientGetOptions) (NetworkFunctionDefinitionGroupsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, options) + if err != nil { + return NetworkFunctionDefinitionGroupsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkFunctionDefinitionGroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkFunctionDefinitionGroupsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *NetworkFunctionDefinitionGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, options *NetworkFunctionDefinitionGroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkFunctionDefinitionGroupName == "" { + return nil, errors.New("parameter networkFunctionDefinitionGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionDefinitionGroupName}", url.PathEscape(networkFunctionDefinitionGroupName)) + 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", "2023-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 *NetworkFunctionDefinitionGroupsClient) getHandleResponse(resp *http.Response) (NetworkFunctionDefinitionGroupsClientGetResponse, error) { + result := NetworkFunctionDefinitionGroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFunctionDefinitionGroup); err != nil { + return NetworkFunctionDefinitionGroupsClientGetResponse{}, err + } + return result, nil +} + +// NewListByPublisherPager - Gets information of the network function definition groups under a publisher. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - options - NetworkFunctionDefinitionGroupsClientListByPublisherOptions contains the optional parameters for the NetworkFunctionDefinitionGroupsClient.NewListByPublisherPager +// method. +func (client *NetworkFunctionDefinitionGroupsClient) NewListByPublisherPager(resourceGroupName string, publisherName string, options *NetworkFunctionDefinitionGroupsClientListByPublisherOptions) *runtime.Pager[NetworkFunctionDefinitionGroupsClientListByPublisherResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkFunctionDefinitionGroupsClientListByPublisherResponse]{ + More: func(page NetworkFunctionDefinitionGroupsClientListByPublisherResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkFunctionDefinitionGroupsClientListByPublisherResponse) (NetworkFunctionDefinitionGroupsClientListByPublisherResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByPublisherCreateRequest(ctx, resourceGroupName, publisherName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NetworkFunctionDefinitionGroupsClientListByPublisherResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkFunctionDefinitionGroupsClientListByPublisherResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkFunctionDefinitionGroupsClientListByPublisherResponse{}, runtime.NewResponseError(resp) + } + return client.listByPublisherHandleResponse(resp) + }, + }) +} + +// listByPublisherCreateRequest creates the ListByPublisher request. +func (client *NetworkFunctionDefinitionGroupsClient) listByPublisherCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, options *NetworkFunctionDefinitionGroupsClientListByPublisherOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByPublisherHandleResponse handles the ListByPublisher response. +func (client *NetworkFunctionDefinitionGroupsClient) listByPublisherHandleResponse(resp *http.Response) (NetworkFunctionDefinitionGroupsClientListByPublisherResponse, error) { + result := NetworkFunctionDefinitionGroupsClientListByPublisherResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFunctionDefinitionGroupListResult); err != nil { + return NetworkFunctionDefinitionGroupsClientListByPublisherResponse{}, err + } + return result, nil +} + +// Update - Updates a network function definition group resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkFunctionDefinitionGroupName - The name of the network function definition group. +// - parameters - Parameters supplied to the create or update publisher network function definition group operation. +// - options - NetworkFunctionDefinitionGroupsClientUpdateOptions contains the optional parameters for the NetworkFunctionDefinitionGroupsClient.Update +// method. +func (client *NetworkFunctionDefinitionGroupsClient) Update(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, parameters TagsObject, options *NetworkFunctionDefinitionGroupsClientUpdateOptions) (NetworkFunctionDefinitionGroupsClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, parameters, options) + if err != nil { + return NetworkFunctionDefinitionGroupsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkFunctionDefinitionGroupsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkFunctionDefinitionGroupsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *NetworkFunctionDefinitionGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, parameters TagsObject, options *NetworkFunctionDefinitionGroupsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkFunctionDefinitionGroupName == "" { + return nil, errors.New("parameter networkFunctionDefinitionGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionDefinitionGroupName}", url.PathEscape(networkFunctionDefinitionGroupName)) + 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.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *NetworkFunctionDefinitionGroupsClient) updateHandleResponse(resp *http.Response) (NetworkFunctionDefinitionGroupsClientUpdateResponse, error) { + result := NetworkFunctionDefinitionGroupsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFunctionDefinitionGroup); err != nil { + return NetworkFunctionDefinitionGroupsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctiondefinitionversions_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctiondefinitionversions_client.go new file mode 100644 index 000000000000..27edac38503c --- /dev/null +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctiondefinitionversions_client.go @@ -0,0 +1,519 @@ +//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 armhybridnetwork + +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" +) + +// NetworkFunctionDefinitionVersionsClient contains the methods for the NetworkFunctionDefinitionVersions group. +// Don't use this type directly, use NewNetworkFunctionDefinitionVersionsClient() instead. +type NetworkFunctionDefinitionVersionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNetworkFunctionDefinitionVersionsClient creates a new instance of NetworkFunctionDefinitionVersionsClient 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 NewNetworkFunctionDefinitionVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkFunctionDefinitionVersionsClient, error) { + cl, err := arm.NewClient(moduleName+".NetworkFunctionDefinitionVersionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkFunctionDefinitionVersionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a network function definition version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkFunctionDefinitionGroupName - The name of the network function definition group. +// - networkFunctionDefinitionVersionName - The name of the network function definition version. The name should conform to +// the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. +// - parameters - Parameters supplied to the create or update network function definition version operation. +// - options - NetworkFunctionDefinitionVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the NetworkFunctionDefinitionVersionsClient.BeginCreateOrUpdate +// method. +func (client *NetworkFunctionDefinitionVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, networkFunctionDefinitionVersionName string, parameters NetworkFunctionDefinitionVersion, options *NetworkFunctionDefinitionVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[NetworkFunctionDefinitionVersionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, networkFunctionDefinitionVersionName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFunctionDefinitionVersionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[NetworkFunctionDefinitionVersionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a network function definition version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *NetworkFunctionDefinitionVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, networkFunctionDefinitionVersionName string, parameters NetworkFunctionDefinitionVersion, options *NetworkFunctionDefinitionVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, networkFunctionDefinitionVersionName, parameters, 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 *NetworkFunctionDefinitionVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, networkFunctionDefinitionVersionName string, parameters NetworkFunctionDefinitionVersion, options *NetworkFunctionDefinitionVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkFunctionDefinitionGroupName == "" { + return nil, errors.New("parameter networkFunctionDefinitionGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionDefinitionGroupName}", url.PathEscape(networkFunctionDefinitionGroupName)) + if networkFunctionDefinitionVersionName == "" { + return nil, errors.New("parameter networkFunctionDefinitionVersionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionDefinitionVersionName}", url.PathEscape(networkFunctionDefinitionVersionName)) + 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes the specified network function definition version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkFunctionDefinitionGroupName - The name of the network function definition group. +// - networkFunctionDefinitionVersionName - The name of the network function definition version. The name should conform to +// the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. +// - options - NetworkFunctionDefinitionVersionsClientBeginDeleteOptions contains the optional parameters for the NetworkFunctionDefinitionVersionsClient.BeginDelete +// method. +func (client *NetworkFunctionDefinitionVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, networkFunctionDefinitionVersionName string, options *NetworkFunctionDefinitionVersionsClientBeginDeleteOptions) (*runtime.Poller[NetworkFunctionDefinitionVersionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, networkFunctionDefinitionVersionName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFunctionDefinitionVersionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[NetworkFunctionDefinitionVersionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified network function definition version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *NetworkFunctionDefinitionVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, networkFunctionDefinitionVersionName string, options *NetworkFunctionDefinitionVersionsClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, networkFunctionDefinitionVersionName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *NetworkFunctionDefinitionVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, networkFunctionDefinitionVersionName string, options *NetworkFunctionDefinitionVersionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkFunctionDefinitionGroupName == "" { + return nil, errors.New("parameter networkFunctionDefinitionGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionDefinitionGroupName}", url.PathEscape(networkFunctionDefinitionGroupName)) + if networkFunctionDefinitionVersionName == "" { + return nil, errors.New("parameter networkFunctionDefinitionVersionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionDefinitionVersionName}", url.PathEscape(networkFunctionDefinitionVersionName)) + 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about a network function definition version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkFunctionDefinitionGroupName - The name of the network function definition group. +// - networkFunctionDefinitionVersionName - The name of the network function definition version. The name should conform to +// the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. +// - options - NetworkFunctionDefinitionVersionsClientGetOptions contains the optional parameters for the NetworkFunctionDefinitionVersionsClient.Get +// method. +func (client *NetworkFunctionDefinitionVersionsClient) Get(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, networkFunctionDefinitionVersionName string, options *NetworkFunctionDefinitionVersionsClientGetOptions) (NetworkFunctionDefinitionVersionsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, networkFunctionDefinitionVersionName, options) + if err != nil { + return NetworkFunctionDefinitionVersionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkFunctionDefinitionVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkFunctionDefinitionVersionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *NetworkFunctionDefinitionVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, networkFunctionDefinitionVersionName string, options *NetworkFunctionDefinitionVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkFunctionDefinitionGroupName == "" { + return nil, errors.New("parameter networkFunctionDefinitionGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionDefinitionGroupName}", url.PathEscape(networkFunctionDefinitionGroupName)) + if networkFunctionDefinitionVersionName == "" { + return nil, errors.New("parameter networkFunctionDefinitionVersionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionDefinitionVersionName}", url.PathEscape(networkFunctionDefinitionVersionName)) + 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", "2023-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 *NetworkFunctionDefinitionVersionsClient) getHandleResponse(resp *http.Response) (NetworkFunctionDefinitionVersionsClientGetResponse, error) { + result := NetworkFunctionDefinitionVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFunctionDefinitionVersion); err != nil { + return NetworkFunctionDefinitionVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListByNetworkFunctionDefinitionGroupPager - Gets information about a list of network function definition versions under +// a network function definition group. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkFunctionDefinitionGroupName - The name of the network function definition group. +// - options - NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupOptions contains the optional parameters +// for the NetworkFunctionDefinitionVersionsClient.NewListByNetworkFunctionDefinitionGroupPager method. +func (client *NetworkFunctionDefinitionVersionsClient) NewListByNetworkFunctionDefinitionGroupPager(resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, options *NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupOptions) *runtime.Pager[NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupResponse]{ + More: func(page NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupResponse) (NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByNetworkFunctionDefinitionGroupCreateRequest(ctx, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByNetworkFunctionDefinitionGroupHandleResponse(resp) + }, + }) +} + +// listByNetworkFunctionDefinitionGroupCreateRequest creates the ListByNetworkFunctionDefinitionGroup request. +func (client *NetworkFunctionDefinitionVersionsClient) listByNetworkFunctionDefinitionGroupCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, options *NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkFunctionDefinitionGroupName == "" { + return nil, errors.New("parameter networkFunctionDefinitionGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionDefinitionGroupName}", url.PathEscape(networkFunctionDefinitionGroupName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByNetworkFunctionDefinitionGroupHandleResponse handles the ListByNetworkFunctionDefinitionGroup response. +func (client *NetworkFunctionDefinitionVersionsClient) listByNetworkFunctionDefinitionGroupHandleResponse(resp *http.Response) (NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupResponse, error) { + result := NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFunctionDefinitionVersionListResult); err != nil { + return NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupResponse{}, err + } + return result, nil +} + +// Update - Updates a network function definition version resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkFunctionDefinitionGroupName - The name of the network function definition group. +// - networkFunctionDefinitionVersionName - The name of the network function definition version. The name should conform to +// the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. +// - parameters - Parameters supplied to the create or update network function definition version operation. +// - options - NetworkFunctionDefinitionVersionsClientUpdateOptions contains the optional parameters for the NetworkFunctionDefinitionVersionsClient.Update +// method. +func (client *NetworkFunctionDefinitionVersionsClient) Update(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, networkFunctionDefinitionVersionName string, parameters TagsObject, options *NetworkFunctionDefinitionVersionsClientUpdateOptions) (NetworkFunctionDefinitionVersionsClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, networkFunctionDefinitionVersionName, parameters, options) + if err != nil { + return NetworkFunctionDefinitionVersionsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkFunctionDefinitionVersionsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkFunctionDefinitionVersionsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *NetworkFunctionDefinitionVersionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, networkFunctionDefinitionVersionName string, parameters TagsObject, options *NetworkFunctionDefinitionVersionsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkFunctionDefinitionGroupName == "" { + return nil, errors.New("parameter networkFunctionDefinitionGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionDefinitionGroupName}", url.PathEscape(networkFunctionDefinitionGroupName)) + if networkFunctionDefinitionVersionName == "" { + return nil, errors.New("parameter networkFunctionDefinitionVersionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionDefinitionVersionName}", url.PathEscape(networkFunctionDefinitionVersionName)) + 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.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *NetworkFunctionDefinitionVersionsClient) updateHandleResponse(resp *http.Response) (NetworkFunctionDefinitionVersionsClientUpdateResponse, error) { + result := NetworkFunctionDefinitionVersionsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFunctionDefinitionVersion); err != nil { + return NetworkFunctionDefinitionVersionsClientUpdateResponse{}, err + } + return result, nil +} + +// BeginUpdateState - Update network function definition version state. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkFunctionDefinitionGroupName - The name of the network function definition group. +// - networkFunctionDefinitionVersionName - The name of the network function definition version. The name should conform to +// the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. +// - parameters - Parameters supplied to update the state of network function definition version. +// - options - NetworkFunctionDefinitionVersionsClientBeginUpdateStateOptions contains the optional parameters for the NetworkFunctionDefinitionVersionsClient.BeginUpdateState +// method. +func (client *NetworkFunctionDefinitionVersionsClient) BeginUpdateState(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, networkFunctionDefinitionVersionName string, parameters NetworkFunctionDefinitionVersionUpdateState, options *NetworkFunctionDefinitionVersionsClientBeginUpdateStateOptions) (*runtime.Poller[NetworkFunctionDefinitionVersionsClientUpdateStateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateState(ctx, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, networkFunctionDefinitionVersionName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFunctionDefinitionVersionsClientUpdateStateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[NetworkFunctionDefinitionVersionsClientUpdateStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateState - Update network function definition version state. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *NetworkFunctionDefinitionVersionsClient) updateState(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, networkFunctionDefinitionVersionName string, parameters NetworkFunctionDefinitionVersionUpdateState, options *NetworkFunctionDefinitionVersionsClientBeginUpdateStateOptions) (*http.Response, error) { + var err error + req, err := client.updateStateCreateRequest(ctx, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, networkFunctionDefinitionVersionName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateStateCreateRequest creates the UpdateState request. +func (client *NetworkFunctionDefinitionVersionsClient) updateStateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkFunctionDefinitionGroupName string, networkFunctionDefinitionVersionName string, parameters NetworkFunctionDefinitionVersionUpdateState, options *NetworkFunctionDefinitionVersionsClientBeginUpdateStateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}/updateState" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkFunctionDefinitionGroupName == "" { + return nil, errors.New("parameter networkFunctionDefinitionGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionDefinitionGroupName}", url.PathEscape(networkFunctionDefinitionGroupName)) + if networkFunctionDefinitionVersionName == "" { + return nil, errors.New("parameter networkFunctionDefinitionVersionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionDefinitionVersionName}", url.PathEscape(networkFunctionDefinitionVersionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctions_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctions_client.go index 1d107f24d454..5c8c97c8043e 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctions_client.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctions_client.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armhybridnetwork @@ -44,11 +43,10 @@ func NewNetworkFunctionsClient(subscriptionID string, credential azcore.TokenCre return client, nil } -// BeginCreateOrUpdate - Creates or updates a network function resource. This operation can take up to 6 hours to complete. -// This is expected service behavior. +// BeginCreateOrUpdate - Creates or updates a network function resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkFunctionName - Resource name for the network function resource. // - parameters - Parameters supplied in the body to the create or update network function operation. @@ -60,32 +58,34 @@ func (client *NetworkFunctionsClient) BeginCreateOrUpdate(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFunctionsClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFunctionsClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFunctionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } -// CreateOrUpdate - Creates or updates a network function resource. This operation can take up to 6 hours to complete. This -// is expected service behavior. +// CreateOrUpdate - Creates or updates a network function resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01 +// Generated from API version 2023-09-01 func (client *NetworkFunctionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkFunctionName string, parameters NetworkFunction, options *NetworkFunctionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkFunctionName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -108,17 +108,19 @@ func (client *NetworkFunctionsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } -// BeginDelete - Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is -// expected service behavior. +// BeginDelete - Deletes the specified network function resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkFunctionName - The name of the network function. // - options - NetworkFunctionsClientBeginDeleteOptions contains the optional parameters for the NetworkFunctionsClient.BeginDelete @@ -129,32 +131,34 @@ func (client *NetworkFunctionsClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFunctionsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFunctionsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFunctionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } -// Delete - Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is expected -// service behavior. +// Delete - Deletes the specified network function resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01 +// Generated from API version 2023-09-01 func (client *NetworkFunctionsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkFunctionName string, options *NetworkFunctionsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkFunctionName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -177,32 +181,109 @@ func (client *NetworkFunctionsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginExecuteRequest - Execute a request to services on a containerized network function. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFunctionName - The name of the network function. +// - parameters - Payload for execute request post call. +// - options - NetworkFunctionsClientBeginExecuteRequestOptions contains the optional parameters for the NetworkFunctionsClient.BeginExecuteRequest +// method. +func (client *NetworkFunctionsClient) BeginExecuteRequest(ctx context.Context, resourceGroupName string, networkFunctionName string, parameters ExecuteRequestParameters, options *NetworkFunctionsClientBeginExecuteRequestOptions) (*runtime.Poller[NetworkFunctionsClientExecuteRequestResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.executeRequest(ctx, resourceGroupName, networkFunctionName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFunctionsClientExecuteRequestResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[NetworkFunctionsClientExecuteRequestResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ExecuteRequest - Execute a request to services on a containerized network function. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *NetworkFunctionsClient) executeRequest(ctx context.Context, resourceGroupName string, networkFunctionName string, parameters ExecuteRequestParameters, options *NetworkFunctionsClientBeginExecuteRequestOptions) (*http.Response, error) { + var err error + req, err := client.executeRequestCreateRequest(ctx, resourceGroupName, networkFunctionName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// executeRequestCreateRequest creates the ExecuteRequest request. +func (client *NetworkFunctionsClient) executeRequestCreateRequest(ctx context.Context, resourceGroupName string, networkFunctionName string, parameters ExecuteRequestParameters, options *NetworkFunctionsClientBeginExecuteRequestOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFunctionName == "" { + return nil, errors.New("parameter networkFunctionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionName}", url.PathEscape(networkFunctionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } return req, nil } // Get - Gets information about the specified network function resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkFunctionName - The name of the network function resource. // - options - NetworkFunctionsClientGetOptions contains the optional parameters for the NetworkFunctionsClient.Get method. func (client *NetworkFunctionsClient) Get(ctx context.Context, resourceGroupName string, networkFunctionName string, options *NetworkFunctionsClientGetOptions) (NetworkFunctionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, networkFunctionName, options) if err != nil { return NetworkFunctionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NetworkFunctionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkFunctionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkFunctionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -225,7 +306,7 @@ func (client *NetworkFunctionsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +323,7 @@ func (client *NetworkFunctionsClient) getHandleResponse(resp *http.Response) (Ne // NewListByResourceGroupPager - Lists all the network function resources in a resource group. // -// Generated from API version 2021-05-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - NetworkFunctionsClientListByResourceGroupOptions contains the optional parameters for the NetworkFunctionsClient.NewListByResourceGroupPager // method. @@ -290,7 +371,7 @@ func (client *NetworkFunctionsClient) listByResourceGroupCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,7 +388,7 @@ func (client *NetworkFunctionsClient) listByResourceGroupHandleResponse(resp *ht // NewListBySubscriptionPager - Lists all the network functions in a subscription. // -// Generated from API version 2021-05-01 +// Generated from API version 2023-09-01 // - options - NetworkFunctionsClientListBySubscriptionOptions contains the optional parameters for the NetworkFunctionsClient.NewListBySubscriptionPager // method. func (client *NetworkFunctionsClient) NewListBySubscriptionPager(options *NetworkFunctionsClientListBySubscriptionOptions) *runtime.Pager[NetworkFunctionsClientListBySubscriptionResponse] { @@ -350,7 +431,7 @@ func (client *NetworkFunctionsClient) listBySubscriptionCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -368,25 +449,28 @@ func (client *NetworkFunctionsClient) listBySubscriptionHandleResponse(resp *htt // UpdateTags - Updates the tags for the network function resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkFunctionName - Resource name for the network function resource. // - parameters - Parameters supplied to the update network function tags operation. // - options - NetworkFunctionsClientUpdateTagsOptions contains the optional parameters for the NetworkFunctionsClient.UpdateTags // method. func (client *NetworkFunctionsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkFunctionName string, parameters TagsObject, options *NetworkFunctionsClientUpdateTagsOptions) (NetworkFunctionsClientUpdateTagsResponse, error) { + var err error req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkFunctionName, parameters, options) if err != nil { return NetworkFunctionsClientUpdateTagsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NetworkFunctionsClientUpdateTagsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkFunctionsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkFunctionsClientUpdateTagsResponse{}, err } - return client.updateTagsHandleResponse(resp) + resp, err := client.updateTagsHandleResponse(httpResp) + return resp, err } // updateTagsCreateRequest creates the UpdateTags request. @@ -409,10 +493,13 @@ func (client *NetworkFunctionsClient) updateTagsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateTagsHandleResponse handles the UpdateTags response. diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctions_client_example_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctions_client_example_test.go deleted file mode 100644 index be851e0c6a74..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctions_client_example_test.go +++ /dev/null @@ -1,487 +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 armhybridnetwork_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/hybridnetwork/armhybridnetwork" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionDelete.json -func ExampleNetworkFunctionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFunctionsClient().BeginDelete(ctx, "rg", "testNf", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionGet.json -func ExampleNetworkFunctionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkFunctionsClient().Get(ctx, "rg", "testNf", 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.NetworkFunction = armhybridnetwork.NetworkFunction{ - // Name: to.Ptr("testNf"), - // Type: to.Ptr("Microsoft.HybridNetwork/networkFunctions"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf"), - // Location: to.Ptr("eastus"), - // Properties: &armhybridnetwork.NetworkFunctionPropertiesFormat{ - // Device: &armhybridnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/devices/testDevice"), - // }, - // ManagedApplication: &armhybridnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/testServiceKey"), - // }, - // ManagedApplicationParameters: map[string]any{ - // }, - // NetworkFunctionUserConfigurations: []*armhybridnetwork.NetworkFunctionUserConfiguration{ - // { - // NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic1"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeManagement), - // }, - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr("DC-97-F8-79-16-7D"), - // NetworkInterfaceName: to.Ptr("nic2"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeWan), - // }}, - // RoleName: to.Ptr("testRole"), - // UserDataParameters: map[string]any{ - // }, - // }}, - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("testServiceKey"), - // SKUName: to.Ptr("testSku"), - // SKUType: to.Ptr(armhybridnetwork.SKUTypeSDWAN), - // VendorName: to.Ptr("testVendor"), - // VendorProvisioningState: to.Ptr(armhybridnetwork.VendorProvisioningStateNotProvisioned), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionCreate.json -func ExampleNetworkFunctionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFunctionsClient().BeginCreateOrUpdate(ctx, "rg", "testNf", armhybridnetwork.NetworkFunction{ - Location: to.Ptr("eastus"), - Properties: &armhybridnetwork.NetworkFunctionPropertiesFormat{ - Device: &armhybridnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/devices/testDevice"), - }, - ManagedApplicationParameters: map[string]any{}, - NetworkFunctionUserConfigurations: []*armhybridnetwork.NetworkFunctionUserConfiguration{ - { - NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - { - IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - { - Gateway: to.Ptr(""), - IPAddress: to.Ptr(""), - IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - Subnet: to.Ptr(""), - }}, - MacAddress: to.Ptr(""), - NetworkInterfaceName: to.Ptr("nic1"), - VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeManagement), - }, - { - IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - { - Gateway: to.Ptr(""), - IPAddress: to.Ptr(""), - IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - Subnet: to.Ptr(""), - }}, - MacAddress: to.Ptr("DC-97-F8-79-16-7D"), - NetworkInterfaceName: to.Ptr("nic2"), - VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeWan), - }}, - RoleName: to.Ptr("testRole"), - UserDataParameters: map[string]any{}, - }}, - SKUName: to.Ptr("testSku"), - SKUType: to.Ptr(armhybridnetwork.SKUTypeSDWAN), - VendorName: to.Ptr("testVendor"), - }, - }, 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.NetworkFunction = armhybridnetwork.NetworkFunction{ - // Name: to.Ptr("testNf"), - // Type: to.Ptr("Microsoft.HybridNetwork/networkFunctions"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf"), - // Location: to.Ptr("eastus"), - // Properties: &armhybridnetwork.NetworkFunctionPropertiesFormat{ - // Device: &armhybridnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/devices/testDevice"), - // }, - // ManagedApplication: &armhybridnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/testServiceKey"), - // }, - // ManagedApplicationParameters: map[string]any{ - // }, - // NetworkFunctionUserConfigurations: []*armhybridnetwork.NetworkFunctionUserConfiguration{ - // { - // NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic1"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeManagement), - // }, - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr("DC-97-F8-79-16-7D"), - // NetworkInterfaceName: to.Ptr("nic2"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeWan), - // }}, - // RoleName: to.Ptr("testRole"), - // UserDataParameters: map[string]any{ - // }, - // }}, - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("testServiceKey"), - // SKUName: to.Ptr("testSku"), - // SKUType: to.Ptr(armhybridnetwork.SKUTypeSDWAN), - // VendorName: to.Ptr("testVendor"), - // VendorProvisioningState: to.Ptr(armhybridnetwork.VendorProvisioningStateNotProvisioned), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionUpdateTags.json -func ExampleNetworkFunctionsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkFunctionsClient().UpdateTags(ctx, "rg", "testNf", armhybridnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.NetworkFunction = armhybridnetwork.NetworkFunction{ - // Name: to.Ptr("testNf"), - // Type: to.Ptr("Microsoft.HybridNetwork/networkFunctions"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armhybridnetwork.NetworkFunctionPropertiesFormat{ - // Device: &armhybridnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/devices/testDevice"), - // }, - // ManagedApplication: &armhybridnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/testServiceKey"), - // }, - // ManagedApplicationParameters: map[string]any{ - // }, - // NetworkFunctionUserConfigurations: []*armhybridnetwork.NetworkFunctionUserConfiguration{ - // { - // NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic1"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeManagement), - // }, - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr("DC-97-F8-79-16-7D"), - // NetworkInterfaceName: to.Ptr("nic2"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeWan), - // }}, - // RoleName: to.Ptr("testRole"), - // UserDataParameters: map[string]any{ - // }, - // }}, - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("testServiceKey"), - // SKUName: to.Ptr("testSku"), - // SKUType: to.Ptr(armhybridnetwork.SKUTypeSDWAN), - // VendorName: to.Ptr("testVendor"), - // VendorProvisioningState: to.Ptr(armhybridnetwork.VendorProvisioningStateNotProvisioned), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionListBySubscription.json -func ExampleNetworkFunctionsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkFunctionsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkFunctionListResult = armhybridnetwork.NetworkFunctionListResult{ - // Value: []*armhybridnetwork.NetworkFunction{ - // { - // Name: to.Ptr("testNf"), - // Type: to.Ptr("Microsoft.HybridNetwork/networkFunctions"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf"), - // Location: to.Ptr("eastus"), - // Properties: &armhybridnetwork.NetworkFunctionPropertiesFormat{ - // Device: &armhybridnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/devices/testDevice"), - // }, - // ManagedApplication: &armhybridnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/testServiceKey"), - // }, - // ManagedApplicationParameters: map[string]any{ - // }, - // NetworkFunctionUserConfigurations: []*armhybridnetwork.NetworkFunctionUserConfiguration{ - // { - // NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic1"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeManagement), - // }, - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr("DC-97-F8-79-16-7D"), - // NetworkInterfaceName: to.Ptr("nic2"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeWan), - // }}, - // RoleName: to.Ptr("testRole"), - // UserDataParameters: map[string]any{ - // }, - // }}, - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("testServiceKey"), - // SKUName: to.Ptr("testSku"), - // SKUType: to.Ptr(armhybridnetwork.SKUTypeSDWAN), - // VendorName: to.Ptr("testVendor"), - // VendorProvisioningState: to.Ptr(armhybridnetwork.VendorProvisioningStateNotProvisioned), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionListByResourceGroup.json -func ExampleNetworkFunctionsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkFunctionsClient().NewListByResourceGroupPager("rg", 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.NetworkFunctionListResult = armhybridnetwork.NetworkFunctionListResult{ - // Value: []*armhybridnetwork.NetworkFunction{ - // { - // Name: to.Ptr("testNf"), - // Type: to.Ptr("Microsoft.HybridNetwork/networkFunctions"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf"), - // Location: to.Ptr("eastus"), - // Properties: &armhybridnetwork.NetworkFunctionPropertiesFormat{ - // Device: &armhybridnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/devices/testDevice"), - // }, - // ManagedApplication: &armhybridnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/testServiceKey"), - // }, - // ManagedApplicationParameters: map[string]any{ - // }, - // NetworkFunctionUserConfigurations: []*armhybridnetwork.NetworkFunctionUserConfiguration{ - // { - // NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic1"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeManagement), - // }, - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr("DC-97-F8-79-16-7D"), - // NetworkInterfaceName: to.Ptr("nic2"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeWan), - // }}, - // RoleName: to.Ptr("testRole"), - // UserDataParameters: map[string]any{ - // }, - // }}, - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("testServiceKey"), - // SKUName: to.Ptr("testSku"), - // SKUType: to.Ptr(armhybridnetwork.SKUTypeSDWAN), - // VendorName: to.Ptr("testVendor"), - // VendorProvisioningState: to.Ptr(armhybridnetwork.VendorProvisioningStateNotProvisioned), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctionvendors_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctionvendors_client.go deleted file mode 100644 index 795a318f23eb..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctionvendors_client.go +++ /dev/null @@ -1,105 +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 armhybridnetwork - -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" -) - -// NetworkFunctionVendorsClient contains the methods for the NetworkFunctionVendors group. -// Don't use this type directly, use NewNetworkFunctionVendorsClient() instead. -type NetworkFunctionVendorsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewNetworkFunctionVendorsClient creates a new instance of NetworkFunctionVendorsClient 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 NewNetworkFunctionVendorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkFunctionVendorsClient, error) { - cl, err := arm.NewClient(moduleName+".NetworkFunctionVendorsClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &NetworkFunctionVendorsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - Lists all the available vendor and sku information. -// -// Generated from API version 2021-05-01 -// - options - NetworkFunctionVendorsClientListOptions contains the optional parameters for the NetworkFunctionVendorsClient.NewListPager -// method. -func (client *NetworkFunctionVendorsClient) NewListPager(options *NetworkFunctionVendorsClientListOptions) *runtime.Pager[NetworkFunctionVendorsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[NetworkFunctionVendorsClientListResponse]{ - More: func(page NetworkFunctionVendorsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *NetworkFunctionVendorsClientListResponse) (NetworkFunctionVendorsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return NetworkFunctionVendorsClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return NetworkFunctionVendorsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkFunctionVendorsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *NetworkFunctionVendorsClient) listCreateRequest(ctx context.Context, options *NetworkFunctionVendorsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctionVendors" - 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", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *NetworkFunctionVendorsClient) listHandleResponse(resp *http.Response) (NetworkFunctionVendorsClientListResponse, error) { - result := NetworkFunctionVendorsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFunctionVendorListResult); err != nil { - return NetworkFunctionVendorsClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctionvendors_client_example_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctionvendors_client_example_test.go deleted file mode 100644 index 43c3c1c7c0ba..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctionvendors_client_example_test.go +++ /dev/null @@ -1,56 +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 armhybridnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionVendorAndSkuListBySubscription.json -func ExampleNetworkFunctionVendorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkFunctionVendorsClient().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.NetworkFunctionVendorListResult = armhybridnetwork.NetworkFunctionVendorListResult{ - // Value: []*armhybridnetwork.NetworkFunctionVendor{ - // { - // Properties: &armhybridnetwork.VendorDetails{ - // SKUList: []*armhybridnetwork.SKUOverview{ - // { - // SKUName: to.Ptr("testSku"), - // SKUType: to.Ptr(armhybridnetwork.SKUTypeSDWAN), - // }}, - // VendorName: to.Ptr("testVendor"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctionvendorskus_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctionvendorskus_client.go deleted file mode 100644 index e974e1f8b4f3..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctionvendorskus_client.go +++ /dev/null @@ -1,180 +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 armhybridnetwork - -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" -) - -// NetworkFunctionVendorSKUsClient contains the methods for the NetworkFunctionVendorSKUs group. -// Don't use this type directly, use NewNetworkFunctionVendorSKUsClient() instead. -type NetworkFunctionVendorSKUsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewNetworkFunctionVendorSKUsClient creates a new instance of NetworkFunctionVendorSKUsClient 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 NewNetworkFunctionVendorSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkFunctionVendorSKUsClient, error) { - cl, err := arm.NewClient(moduleName+".NetworkFunctionVendorSKUsClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &NetworkFunctionVendorSKUsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListBySKUPager - Lists information about network function vendor sku details. -// -// Generated from API version 2021-05-01 -// - vendorName - The name of the network function vendor. -// - vendorSKUName - The name of the network function sku. -// - options - NetworkFunctionVendorSKUsClientListBySKUOptions contains the optional parameters for the NetworkFunctionVendorSKUsClient.NewListBySKUPager -// method. -func (client *NetworkFunctionVendorSKUsClient) NewListBySKUPager(vendorName string, vendorSKUName string, options *NetworkFunctionVendorSKUsClientListBySKUOptions) *runtime.Pager[NetworkFunctionVendorSKUsClientListBySKUResponse] { - return runtime.NewPager(runtime.PagingHandler[NetworkFunctionVendorSKUsClientListBySKUResponse]{ - More: func(page NetworkFunctionVendorSKUsClientListBySKUResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *NetworkFunctionVendorSKUsClientListBySKUResponse) (NetworkFunctionVendorSKUsClientListBySKUResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySKUCreateRequest(ctx, vendorName, vendorSKUName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return NetworkFunctionVendorSKUsClientListBySKUResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return NetworkFunctionVendorSKUsClientListBySKUResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkFunctionVendorSKUsClientListBySKUResponse{}, runtime.NewResponseError(resp) - } - return client.listBySKUHandleResponse(resp) - }, - }) -} - -// listBySKUCreateRequest creates the ListBySKU request. -func (client *NetworkFunctionVendorSKUsClient) listBySKUCreateRequest(ctx context.Context, vendorName string, vendorSKUName string, options *NetworkFunctionVendorSKUsClientListBySKUOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctionVendors/{vendorName}/vendorSkus/{vendorSkuName}" - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - if vendorSKUName == "" { - return nil, errors.New("parameter vendorSKUName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorSkuName}", url.PathEscape(vendorSKUName)) - 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", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySKUHandleResponse handles the ListBySKU response. -func (client *NetworkFunctionVendorSKUsClient) listBySKUHandleResponse(resp *http.Response) (NetworkFunctionVendorSKUsClientListBySKUResponse, error) { - result := NetworkFunctionVendorSKUsClientListBySKUResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFunctionSKUDetails); err != nil { - return NetworkFunctionVendorSKUsClientListBySKUResponse{}, err - } - return result, nil -} - -// NewListByVendorPager - Lists all network function vendor sku details in a vendor. -// -// Generated from API version 2021-05-01 -// - vendorName - The name of the network function vendor. -// - options - NetworkFunctionVendorSKUsClientListByVendorOptions contains the optional parameters for the NetworkFunctionVendorSKUsClient.NewListByVendorPager -// method. -func (client *NetworkFunctionVendorSKUsClient) NewListByVendorPager(vendorName string, options *NetworkFunctionVendorSKUsClientListByVendorOptions) *runtime.Pager[NetworkFunctionVendorSKUsClientListByVendorResponse] { - return runtime.NewPager(runtime.PagingHandler[NetworkFunctionVendorSKUsClientListByVendorResponse]{ - More: func(page NetworkFunctionVendorSKUsClientListByVendorResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *NetworkFunctionVendorSKUsClientListByVendorResponse) (NetworkFunctionVendorSKUsClientListByVendorResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByVendorCreateRequest(ctx, vendorName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return NetworkFunctionVendorSKUsClientListByVendorResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return NetworkFunctionVendorSKUsClientListByVendorResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkFunctionVendorSKUsClientListByVendorResponse{}, runtime.NewResponseError(resp) - } - return client.listByVendorHandleResponse(resp) - }, - }) -} - -// listByVendorCreateRequest creates the ListByVendor request. -func (client *NetworkFunctionVendorSKUsClient) listByVendorCreateRequest(ctx context.Context, vendorName string, options *NetworkFunctionVendorSKUsClientListByVendorOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctionVendors/{vendorName}/vendorSkus" - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - 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", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByVendorHandleResponse handles the ListByVendor response. -func (client *NetworkFunctionVendorSKUsClient) listByVendorHandleResponse(resp *http.Response) (NetworkFunctionVendorSKUsClientListByVendorResponse, error) { - result := NetworkFunctionVendorSKUsClientListByVendorResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFunctionSKUListResult); err != nil { - return NetworkFunctionVendorSKUsClientListByVendorResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctionvendorskus_client_example_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctionvendorskus_client_example_test.go deleted file mode 100644 index 5062ff3cd4d6..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkfunctionvendorskus_client_example_test.go +++ /dev/null @@ -1,113 +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 armhybridnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionSkuListByVendor.json -func ExampleNetworkFunctionVendorSKUsClient_NewListByVendorPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkFunctionVendorSKUsClient().NewListByVendorPager("testVendor", 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.NetworkFunctionSKUListResult = armhybridnetwork.NetworkFunctionSKUListResult{ - // Value: []*armhybridnetwork.SKUOverview{ - // { - // SKUName: to.Ptr("testSku"), - // SKUType: to.Ptr(armhybridnetwork.SKUTypeSDWAN), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionSkuDetailsGet.json -func ExampleNetworkFunctionVendorSKUsClient_NewListBySKUPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkFunctionVendorSKUsClient().NewListBySKUPager("testVendor", "testSku", 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.NetworkFunctionSKUDetails = armhybridnetwork.NetworkFunctionSKUDetails{ - // SKUType: to.Ptr(armhybridnetwork.SKUTypeSDWAN), - // Value: []*armhybridnetwork.NetworkFunctionSKURoleDetails{ - // { - // NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic1"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeManagement), - // }, - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic2"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeWan), - // }}, - // RoleName: to.Ptr("testRole"), - // UserDataParameters: map[string]any{ - // }, - // UserDataTemplate: map[string]any{ - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkservicedesigngroups_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkservicedesigngroups_client.go new file mode 100644 index 000000000000..b9a0f0fe579f --- /dev/null +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkservicedesigngroups_client.go @@ -0,0 +1,404 @@ +//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 armhybridnetwork + +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" +) + +// NetworkServiceDesignGroupsClient contains the methods for the NetworkServiceDesignGroups group. +// Don't use this type directly, use NewNetworkServiceDesignGroupsClient() instead. +type NetworkServiceDesignGroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNetworkServiceDesignGroupsClient creates a new instance of NetworkServiceDesignGroupsClient 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 NewNetworkServiceDesignGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkServiceDesignGroupsClient, error) { + cl, err := arm.NewClient(moduleName+".NetworkServiceDesignGroupsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkServiceDesignGroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a network service design group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkServiceDesignGroupName - The name of the network service design group. +// - parameters - Parameters supplied to the create or update publisher network service design group operation. +// - options - NetworkServiceDesignGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the NetworkServiceDesignGroupsClient.BeginCreateOrUpdate +// method. +func (client *NetworkServiceDesignGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, parameters NetworkServiceDesignGroup, options *NetworkServiceDesignGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[NetworkServiceDesignGroupsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, publisherName, networkServiceDesignGroupName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkServiceDesignGroupsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[NetworkServiceDesignGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a network service design group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *NetworkServiceDesignGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, parameters NetworkServiceDesignGroup, options *NetworkServiceDesignGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, publisherName, networkServiceDesignGroupName, parameters, 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 *NetworkServiceDesignGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, parameters NetworkServiceDesignGroup, options *NetworkServiceDesignGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}" + 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 publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkServiceDesignGroupName == "" { + return nil, errors.New("parameter networkServiceDesignGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkServiceDesignGroupName}", url.PathEscape(networkServiceDesignGroupName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes a specified network service design group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkServiceDesignGroupName - The name of the network service design group. +// - options - NetworkServiceDesignGroupsClientBeginDeleteOptions contains the optional parameters for the NetworkServiceDesignGroupsClient.BeginDelete +// method. +func (client *NetworkServiceDesignGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, options *NetworkServiceDesignGroupsClientBeginDeleteOptions) (*runtime.Poller[NetworkServiceDesignGroupsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, publisherName, networkServiceDesignGroupName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkServiceDesignGroupsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[NetworkServiceDesignGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a specified network service design group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *NetworkServiceDesignGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, options *NetworkServiceDesignGroupsClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, publisherName, networkServiceDesignGroupName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *NetworkServiceDesignGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, options *NetworkServiceDesignGroupsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}" + 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 publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkServiceDesignGroupName == "" { + return nil, errors.New("parameter networkServiceDesignGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkServiceDesignGroupName}", url.PathEscape(networkServiceDesignGroupName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about the specified networkServiceDesign group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkServiceDesignGroupName - The name of the network service design group. +// - options - NetworkServiceDesignGroupsClientGetOptions contains the optional parameters for the NetworkServiceDesignGroupsClient.Get +// method. +func (client *NetworkServiceDesignGroupsClient) Get(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, options *NetworkServiceDesignGroupsClientGetOptions) (NetworkServiceDesignGroupsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, publisherName, networkServiceDesignGroupName, options) + if err != nil { + return NetworkServiceDesignGroupsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkServiceDesignGroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkServiceDesignGroupsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *NetworkServiceDesignGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, options *NetworkServiceDesignGroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}" + 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 publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkServiceDesignGroupName == "" { + return nil, errors.New("parameter networkServiceDesignGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkServiceDesignGroupName}", url.PathEscape(networkServiceDesignGroupName)) + 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", "2023-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 *NetworkServiceDesignGroupsClient) getHandleResponse(resp *http.Response) (NetworkServiceDesignGroupsClientGetResponse, error) { + result := NetworkServiceDesignGroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkServiceDesignGroup); err != nil { + return NetworkServiceDesignGroupsClientGetResponse{}, err + } + return result, nil +} + +// NewListByPublisherPager - Gets information of the network service design groups under a publisher. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - options - NetworkServiceDesignGroupsClientListByPublisherOptions contains the optional parameters for the NetworkServiceDesignGroupsClient.NewListByPublisherPager +// method. +func (client *NetworkServiceDesignGroupsClient) NewListByPublisherPager(resourceGroupName string, publisherName string, options *NetworkServiceDesignGroupsClientListByPublisherOptions) *runtime.Pager[NetworkServiceDesignGroupsClientListByPublisherResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkServiceDesignGroupsClientListByPublisherResponse]{ + More: func(page NetworkServiceDesignGroupsClientListByPublisherResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkServiceDesignGroupsClientListByPublisherResponse) (NetworkServiceDesignGroupsClientListByPublisherResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByPublisherCreateRequest(ctx, resourceGroupName, publisherName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NetworkServiceDesignGroupsClientListByPublisherResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkServiceDesignGroupsClientListByPublisherResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkServiceDesignGroupsClientListByPublisherResponse{}, runtime.NewResponseError(resp) + } + return client.listByPublisherHandleResponse(resp) + }, + }) +} + +// listByPublisherCreateRequest creates the ListByPublisher request. +func (client *NetworkServiceDesignGroupsClient) listByPublisherCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, options *NetworkServiceDesignGroupsClientListByPublisherOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups" + 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 publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByPublisherHandleResponse handles the ListByPublisher response. +func (client *NetworkServiceDesignGroupsClient) listByPublisherHandleResponse(resp *http.Response) (NetworkServiceDesignGroupsClientListByPublisherResponse, error) { + result := NetworkServiceDesignGroupsClientListByPublisherResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkServiceDesignGroupListResult); err != nil { + return NetworkServiceDesignGroupsClientListByPublisherResponse{}, err + } + return result, nil +} + +// Update - Updates a network service design groups resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkServiceDesignGroupName - The name of the network service design group. +// - parameters - Parameters supplied to the create or update publisher network service design group operation. +// - options - NetworkServiceDesignGroupsClientUpdateOptions contains the optional parameters for the NetworkServiceDesignGroupsClient.Update +// method. +func (client *NetworkServiceDesignGroupsClient) Update(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, parameters TagsObject, options *NetworkServiceDesignGroupsClientUpdateOptions) (NetworkServiceDesignGroupsClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, publisherName, networkServiceDesignGroupName, parameters, options) + if err != nil { + return NetworkServiceDesignGroupsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkServiceDesignGroupsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkServiceDesignGroupsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *NetworkServiceDesignGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, parameters TagsObject, options *NetworkServiceDesignGroupsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}" + 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 publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkServiceDesignGroupName == "" { + return nil, errors.New("parameter networkServiceDesignGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkServiceDesignGroupName}", url.PathEscape(networkServiceDesignGroupName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *NetworkServiceDesignGroupsClient) updateHandleResponse(resp *http.Response) (NetworkServiceDesignGroupsClientUpdateResponse, error) { + result := NetworkServiceDesignGroupsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkServiceDesignGroup); err != nil { + return NetworkServiceDesignGroupsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkservicedesignversions_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkservicedesignversions_client.go new file mode 100644 index 000000000000..fce0bb4c8866 --- /dev/null +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/networkservicedesignversions_client.go @@ -0,0 +1,519 @@ +//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 armhybridnetwork + +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" +) + +// NetworkServiceDesignVersionsClient contains the methods for the NetworkServiceDesignVersions group. +// Don't use this type directly, use NewNetworkServiceDesignVersionsClient() instead. +type NetworkServiceDesignVersionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNetworkServiceDesignVersionsClient creates a new instance of NetworkServiceDesignVersionsClient 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 NewNetworkServiceDesignVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkServiceDesignVersionsClient, error) { + cl, err := arm.NewClient(moduleName+".NetworkServiceDesignVersionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkServiceDesignVersionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a network service design version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkServiceDesignGroupName - The name of the network service design group. +// - networkServiceDesignVersionName - The name of the network service design version. The name should conform to the SemVer +// 2.0.0 specification: https://semver.org/spec/v2.0.0.html. +// - parameters - Parameters supplied to the create or update network service design version operation. +// - options - NetworkServiceDesignVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the NetworkServiceDesignVersionsClient.BeginCreateOrUpdate +// method. +func (client *NetworkServiceDesignVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, networkServiceDesignVersionName string, parameters NetworkServiceDesignVersion, options *NetworkServiceDesignVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[NetworkServiceDesignVersionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, publisherName, networkServiceDesignGroupName, networkServiceDesignVersionName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkServiceDesignVersionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[NetworkServiceDesignVersionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a network service design version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *NetworkServiceDesignVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, networkServiceDesignVersionName string, parameters NetworkServiceDesignVersion, options *NetworkServiceDesignVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, publisherName, networkServiceDesignGroupName, networkServiceDesignVersionName, parameters, 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 *NetworkServiceDesignVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, networkServiceDesignVersionName string, parameters NetworkServiceDesignVersion, options *NetworkServiceDesignVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}" + 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 publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkServiceDesignGroupName == "" { + return nil, errors.New("parameter networkServiceDesignGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkServiceDesignGroupName}", url.PathEscape(networkServiceDesignGroupName)) + if networkServiceDesignVersionName == "" { + return nil, errors.New("parameter networkServiceDesignVersionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkServiceDesignVersionName}", url.PathEscape(networkServiceDesignVersionName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes the specified network service design version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkServiceDesignGroupName - The name of the network service design group. +// - networkServiceDesignVersionName - The name of the network service design version. The name should conform to the SemVer +// 2.0.0 specification: https://semver.org/spec/v2.0.0.html. +// - options - NetworkServiceDesignVersionsClientBeginDeleteOptions contains the optional parameters for the NetworkServiceDesignVersionsClient.BeginDelete +// method. +func (client *NetworkServiceDesignVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, networkServiceDesignVersionName string, options *NetworkServiceDesignVersionsClientBeginDeleteOptions) (*runtime.Poller[NetworkServiceDesignVersionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, publisherName, networkServiceDesignGroupName, networkServiceDesignVersionName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkServiceDesignVersionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[NetworkServiceDesignVersionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified network service design version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *NetworkServiceDesignVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, networkServiceDesignVersionName string, options *NetworkServiceDesignVersionsClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, publisherName, networkServiceDesignGroupName, networkServiceDesignVersionName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *NetworkServiceDesignVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, networkServiceDesignVersionName string, options *NetworkServiceDesignVersionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}" + 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 publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkServiceDesignGroupName == "" { + return nil, errors.New("parameter networkServiceDesignGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkServiceDesignGroupName}", url.PathEscape(networkServiceDesignGroupName)) + if networkServiceDesignVersionName == "" { + return nil, errors.New("parameter networkServiceDesignVersionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkServiceDesignVersionName}", url.PathEscape(networkServiceDesignVersionName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about a network service design version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkServiceDesignGroupName - The name of the network service design group. +// - networkServiceDesignVersionName - The name of the network service design version. The name should conform to the SemVer +// 2.0.0 specification: https://semver.org/spec/v2.0.0.html. +// - options - NetworkServiceDesignVersionsClientGetOptions contains the optional parameters for the NetworkServiceDesignVersionsClient.Get +// method. +func (client *NetworkServiceDesignVersionsClient) Get(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, networkServiceDesignVersionName string, options *NetworkServiceDesignVersionsClientGetOptions) (NetworkServiceDesignVersionsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, publisherName, networkServiceDesignGroupName, networkServiceDesignVersionName, options) + if err != nil { + return NetworkServiceDesignVersionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkServiceDesignVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkServiceDesignVersionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *NetworkServiceDesignVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, networkServiceDesignVersionName string, options *NetworkServiceDesignVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}" + 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 publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkServiceDesignGroupName == "" { + return nil, errors.New("parameter networkServiceDesignGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkServiceDesignGroupName}", url.PathEscape(networkServiceDesignGroupName)) + if networkServiceDesignVersionName == "" { + return nil, errors.New("parameter networkServiceDesignVersionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkServiceDesignVersionName}", url.PathEscape(networkServiceDesignVersionName)) + 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", "2023-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 *NetworkServiceDesignVersionsClient) getHandleResponse(resp *http.Response) (NetworkServiceDesignVersionsClientGetResponse, error) { + result := NetworkServiceDesignVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkServiceDesignVersion); err != nil { + return NetworkServiceDesignVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListByNetworkServiceDesignGroupPager - Gets information about a list of network service design versions under a network +// service design group. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkServiceDesignGroupName - The name of the network service design group. +// - options - NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupOptions contains the optional parameters for +// the NetworkServiceDesignVersionsClient.NewListByNetworkServiceDesignGroupPager method. +func (client *NetworkServiceDesignVersionsClient) NewListByNetworkServiceDesignGroupPager(resourceGroupName string, publisherName string, networkServiceDesignGroupName string, options *NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupOptions) *runtime.Pager[NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupResponse]{ + More: func(page NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupResponse) (NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByNetworkServiceDesignGroupCreateRequest(ctx, resourceGroupName, publisherName, networkServiceDesignGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByNetworkServiceDesignGroupHandleResponse(resp) + }, + }) +} + +// listByNetworkServiceDesignGroupCreateRequest creates the ListByNetworkServiceDesignGroup request. +func (client *NetworkServiceDesignVersionsClient) listByNetworkServiceDesignGroupCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, options *NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions" + 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 publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkServiceDesignGroupName == "" { + return nil, errors.New("parameter networkServiceDesignGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkServiceDesignGroupName}", url.PathEscape(networkServiceDesignGroupName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByNetworkServiceDesignGroupHandleResponse handles the ListByNetworkServiceDesignGroup response. +func (client *NetworkServiceDesignVersionsClient) listByNetworkServiceDesignGroupHandleResponse(resp *http.Response) (NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupResponse, error) { + result := NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkServiceDesignVersionListResult); err != nil { + return NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupResponse{}, err + } + return result, nil +} + +// Update - Updates a network service design version resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkServiceDesignGroupName - The name of the network service design group. +// - networkServiceDesignVersionName - The name of the network service design version. The name should conform to the SemVer +// 2.0.0 specification: https://semver.org/spec/v2.0.0.html. +// - parameters - Parameters supplied to the create or update network service design version operation. +// - options - NetworkServiceDesignVersionsClientUpdateOptions contains the optional parameters for the NetworkServiceDesignVersionsClient.Update +// method. +func (client *NetworkServiceDesignVersionsClient) Update(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, networkServiceDesignVersionName string, parameters TagsObject, options *NetworkServiceDesignVersionsClientUpdateOptions) (NetworkServiceDesignVersionsClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, publisherName, networkServiceDesignGroupName, networkServiceDesignVersionName, parameters, options) + if err != nil { + return NetworkServiceDesignVersionsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkServiceDesignVersionsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkServiceDesignVersionsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *NetworkServiceDesignVersionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, networkServiceDesignVersionName string, parameters TagsObject, options *NetworkServiceDesignVersionsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}" + 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 publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkServiceDesignGroupName == "" { + return nil, errors.New("parameter networkServiceDesignGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkServiceDesignGroupName}", url.PathEscape(networkServiceDesignGroupName)) + if networkServiceDesignVersionName == "" { + return nil, errors.New("parameter networkServiceDesignVersionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkServiceDesignVersionName}", url.PathEscape(networkServiceDesignVersionName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *NetworkServiceDesignVersionsClient) updateHandleResponse(resp *http.Response) (NetworkServiceDesignVersionsClientUpdateResponse, error) { + result := NetworkServiceDesignVersionsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkServiceDesignVersion); err != nil { + return NetworkServiceDesignVersionsClientUpdateResponse{}, err + } + return result, nil +} + +// BeginUpdateState - Update network service design version state. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - networkServiceDesignGroupName - The name of the network service design group. +// - networkServiceDesignVersionName - The name of the network service design version. The name should conform to the SemVer +// 2.0.0 specification: https://semver.org/spec/v2.0.0.html. +// - parameters - Parameters supplied to update the state of network service design version. +// - options - NetworkServiceDesignVersionsClientBeginUpdateStateOptions contains the optional parameters for the NetworkServiceDesignVersionsClient.BeginUpdateState +// method. +func (client *NetworkServiceDesignVersionsClient) BeginUpdateState(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, networkServiceDesignVersionName string, parameters NetworkServiceDesignVersionUpdateState, options *NetworkServiceDesignVersionsClientBeginUpdateStateOptions) (*runtime.Poller[NetworkServiceDesignVersionsClientUpdateStateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateState(ctx, resourceGroupName, publisherName, networkServiceDesignGroupName, networkServiceDesignVersionName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkServiceDesignVersionsClientUpdateStateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[NetworkServiceDesignVersionsClientUpdateStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateState - Update network service design version state. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *NetworkServiceDesignVersionsClient) updateState(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, networkServiceDesignVersionName string, parameters NetworkServiceDesignVersionUpdateState, options *NetworkServiceDesignVersionsClientBeginUpdateStateOptions) (*http.Response, error) { + var err error + req, err := client.updateStateCreateRequest(ctx, resourceGroupName, publisherName, networkServiceDesignGroupName, networkServiceDesignVersionName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateStateCreateRequest creates the UpdateState request. +func (client *NetworkServiceDesignVersionsClient) updateStateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, networkServiceDesignGroupName string, networkServiceDesignVersionName string, parameters NetworkServiceDesignVersionUpdateState, options *NetworkServiceDesignVersionsClientBeginUpdateStateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}/updateState" + 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 publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if networkServiceDesignGroupName == "" { + return nil, errors.New("parameter networkServiceDesignGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkServiceDesignGroupName}", url.PathEscape(networkServiceDesignGroupName)) + if networkServiceDesignVersionName == "" { + return nil, errors.New("parameter networkServiceDesignVersionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkServiceDesignVersionName}", url.PathEscape(networkServiceDesignVersionName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/operations_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/operations_client.go index e353fb0053cf..501b5124853e 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/operations_client.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/operations_client.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armhybridnetwork @@ -40,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Gets a list of the operations. // -// Generated from API version 2021-05-01 +// Generated from API version 2023-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]{ @@ -78,7 +77,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -87,7 +86,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { result := OperationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OperationList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { return OperationsClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/operations_client_example_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/operations_client_example_test.go deleted file mode 100644 index 07eb3dd0088b..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/operations_client_example_test.go +++ /dev/null @@ -1,55 +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 armhybridnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/GetOperations.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 := armhybridnetwork.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.OperationList = armhybridnetwork.OperationList{ - // Value: []*armhybridnetwork.Operation{ - // { - // Name: to.Ptr("Microsoft.HybridNetwork/nfs/read"), - // Display: &armhybridnetwork.OperationDisplay{ - // Description: to.Ptr("Gets Nf"), - // Operation: to.Ptr("Get Nf"), - // Provider: to.Ptr("Microsoft Hybrid Network"), - // Resource: to.Ptr("Nf"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/options.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/options.go new file mode 100644 index 000000000000..a30b95ddbea7 --- /dev/null +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/options.go @@ -0,0 +1,483 @@ +//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 armhybridnetwork + +// ArtifactManifestsClientBeginCreateOrUpdateOptions contains the optional parameters for the ArtifactManifestsClient.BeginCreateOrUpdate +// method. +type ArtifactManifestsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ArtifactManifestsClientBeginDeleteOptions contains the optional parameters for the ArtifactManifestsClient.BeginDelete +// method. +type ArtifactManifestsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ArtifactManifestsClientBeginUpdateStateOptions contains the optional parameters for the ArtifactManifestsClient.BeginUpdateState +// method. +type ArtifactManifestsClientBeginUpdateStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ArtifactManifestsClientGetOptions contains the optional parameters for the ArtifactManifestsClient.Get method. +type ArtifactManifestsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ArtifactManifestsClientListByArtifactStoreOptions contains the optional parameters for the ArtifactManifestsClient.NewListByArtifactStorePager +// method. +type ArtifactManifestsClientListByArtifactStoreOptions struct { + // placeholder for future optional parameters +} + +// ArtifactManifestsClientListCredentialOptions contains the optional parameters for the ArtifactManifestsClient.ListCredential +// method. +type ArtifactManifestsClientListCredentialOptions struct { + // placeholder for future optional parameters +} + +// ArtifactManifestsClientUpdateOptions contains the optional parameters for the ArtifactManifestsClient.Update method. +type ArtifactManifestsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ArtifactStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the ArtifactStoresClient.BeginCreateOrUpdate +// method. +type ArtifactStoresClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ArtifactStoresClientBeginDeleteOptions contains the optional parameters for the ArtifactStoresClient.BeginDelete method. +type ArtifactStoresClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ArtifactStoresClientGetOptions contains the optional parameters for the ArtifactStoresClient.Get method. +type ArtifactStoresClientGetOptions struct { + // placeholder for future optional parameters +} + +// ArtifactStoresClientListByPublisherOptions contains the optional parameters for the ArtifactStoresClient.NewListByPublisherPager +// method. +type ArtifactStoresClientListByPublisherOptions struct { + // placeholder for future optional parameters +} + +// ArtifactStoresClientUpdateOptions contains the optional parameters for the ArtifactStoresClient.Update method. +type ArtifactStoresClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ComponentsClientGetOptions contains the optional parameters for the ComponentsClient.Get method. +type ComponentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ComponentsClientListByNetworkFunctionOptions contains the optional parameters for the ComponentsClient.NewListByNetworkFunctionPager +// method. +type ComponentsClientListByNetworkFunctionOptions struct { + // placeholder for future optional parameters +} + +// ConfigurationGroupSchemasClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationGroupSchemasClient.BeginCreateOrUpdate +// method. +type ConfigurationGroupSchemasClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConfigurationGroupSchemasClientBeginDeleteOptions contains the optional parameters for the ConfigurationGroupSchemasClient.BeginDelete +// method. +type ConfigurationGroupSchemasClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConfigurationGroupSchemasClientBeginUpdateStateOptions contains the optional parameters for the ConfigurationGroupSchemasClient.BeginUpdateState +// method. +type ConfigurationGroupSchemasClientBeginUpdateStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConfigurationGroupSchemasClientGetOptions contains the optional parameters for the ConfigurationGroupSchemasClient.Get +// method. +type ConfigurationGroupSchemasClientGetOptions struct { + // placeholder for future optional parameters +} + +// ConfigurationGroupSchemasClientListByPublisherOptions contains the optional parameters for the ConfigurationGroupSchemasClient.NewListByPublisherPager +// method. +type ConfigurationGroupSchemasClientListByPublisherOptions struct { + // placeholder for future optional parameters +} + +// ConfigurationGroupSchemasClientUpdateOptions contains the optional parameters for the ConfigurationGroupSchemasClient.Update +// method. +type ConfigurationGroupSchemasClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ConfigurationGroupValuesClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationGroupValuesClient.BeginCreateOrUpdate +// method. +type ConfigurationGroupValuesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConfigurationGroupValuesClientBeginDeleteOptions contains the optional parameters for the ConfigurationGroupValuesClient.BeginDelete +// method. +type ConfigurationGroupValuesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConfigurationGroupValuesClientGetOptions contains the optional parameters for the ConfigurationGroupValuesClient.Get method. +type ConfigurationGroupValuesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ConfigurationGroupValuesClientListByResourceGroupOptions contains the optional parameters for the ConfigurationGroupValuesClient.NewListByResourceGroupPager +// method. +type ConfigurationGroupValuesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ConfigurationGroupValuesClientListBySubscriptionOptions contains the optional parameters for the ConfigurationGroupValuesClient.NewListBySubscriptionPager +// method. +type ConfigurationGroupValuesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// ConfigurationGroupValuesClientUpdateTagsOptions contains the optional parameters for the ConfigurationGroupValuesClient.UpdateTags +// method. +type ConfigurationGroupValuesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// NetworkFunctionDefinitionGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the NetworkFunctionDefinitionGroupsClient.BeginCreateOrUpdate +// method. +type NetworkFunctionDefinitionGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFunctionDefinitionGroupsClientBeginDeleteOptions contains the optional parameters for the NetworkFunctionDefinitionGroupsClient.BeginDelete +// method. +type NetworkFunctionDefinitionGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFunctionDefinitionGroupsClientGetOptions contains the optional parameters for the NetworkFunctionDefinitionGroupsClient.Get +// method. +type NetworkFunctionDefinitionGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkFunctionDefinitionGroupsClientListByPublisherOptions contains the optional parameters for the NetworkFunctionDefinitionGroupsClient.NewListByPublisherPager +// method. +type NetworkFunctionDefinitionGroupsClientListByPublisherOptions struct { + // placeholder for future optional parameters +} + +// NetworkFunctionDefinitionGroupsClientUpdateOptions contains the optional parameters for the NetworkFunctionDefinitionGroupsClient.Update +// method. +type NetworkFunctionDefinitionGroupsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// NetworkFunctionDefinitionVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the NetworkFunctionDefinitionVersionsClient.BeginCreateOrUpdate +// method. +type NetworkFunctionDefinitionVersionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFunctionDefinitionVersionsClientBeginDeleteOptions contains the optional parameters for the NetworkFunctionDefinitionVersionsClient.BeginDelete +// method. +type NetworkFunctionDefinitionVersionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFunctionDefinitionVersionsClientBeginUpdateStateOptions contains the optional parameters for the NetworkFunctionDefinitionVersionsClient.BeginUpdateState +// method. +type NetworkFunctionDefinitionVersionsClientBeginUpdateStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFunctionDefinitionVersionsClientGetOptions contains the optional parameters for the NetworkFunctionDefinitionVersionsClient.Get +// method. +type NetworkFunctionDefinitionVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupOptions contains the optional parameters for +// the NetworkFunctionDefinitionVersionsClient.NewListByNetworkFunctionDefinitionGroupPager method. +type NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupOptions struct { + // placeholder for future optional parameters +} + +// NetworkFunctionDefinitionVersionsClientUpdateOptions contains the optional parameters for the NetworkFunctionDefinitionVersionsClient.Update +// method. +type NetworkFunctionDefinitionVersionsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// NetworkFunctionsClientBeginCreateOrUpdateOptions contains the optional parameters for the NetworkFunctionsClient.BeginCreateOrUpdate +// method. +type NetworkFunctionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFunctionsClientBeginDeleteOptions contains the optional parameters for the NetworkFunctionsClient.BeginDelete method. +type NetworkFunctionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFunctionsClientBeginExecuteRequestOptions contains the optional parameters for the NetworkFunctionsClient.BeginExecuteRequest +// method. +type NetworkFunctionsClientBeginExecuteRequestOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFunctionsClientGetOptions contains the optional parameters for the NetworkFunctionsClient.Get method. +type NetworkFunctionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkFunctionsClientListByResourceGroupOptions contains the optional parameters for the NetworkFunctionsClient.NewListByResourceGroupPager +// method. +type NetworkFunctionsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// NetworkFunctionsClientListBySubscriptionOptions contains the optional parameters for the NetworkFunctionsClient.NewListBySubscriptionPager +// method. +type NetworkFunctionsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// NetworkFunctionsClientUpdateTagsOptions contains the optional parameters for the NetworkFunctionsClient.UpdateTags method. +type NetworkFunctionsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// NetworkServiceDesignGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the NetworkServiceDesignGroupsClient.BeginCreateOrUpdate +// method. +type NetworkServiceDesignGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkServiceDesignGroupsClientBeginDeleteOptions contains the optional parameters for the NetworkServiceDesignGroupsClient.BeginDelete +// method. +type NetworkServiceDesignGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkServiceDesignGroupsClientGetOptions contains the optional parameters for the NetworkServiceDesignGroupsClient.Get +// method. +type NetworkServiceDesignGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkServiceDesignGroupsClientListByPublisherOptions contains the optional parameters for the NetworkServiceDesignGroupsClient.NewListByPublisherPager +// method. +type NetworkServiceDesignGroupsClientListByPublisherOptions struct { + // placeholder for future optional parameters +} + +// NetworkServiceDesignGroupsClientUpdateOptions contains the optional parameters for the NetworkServiceDesignGroupsClient.Update +// method. +type NetworkServiceDesignGroupsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// NetworkServiceDesignVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the NetworkServiceDesignVersionsClient.BeginCreateOrUpdate +// method. +type NetworkServiceDesignVersionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkServiceDesignVersionsClientBeginDeleteOptions contains the optional parameters for the NetworkServiceDesignVersionsClient.BeginDelete +// method. +type NetworkServiceDesignVersionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkServiceDesignVersionsClientBeginUpdateStateOptions contains the optional parameters for the NetworkServiceDesignVersionsClient.BeginUpdateState +// method. +type NetworkServiceDesignVersionsClientBeginUpdateStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkServiceDesignVersionsClientGetOptions contains the optional parameters for the NetworkServiceDesignVersionsClient.Get +// method. +type NetworkServiceDesignVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupOptions contains the optional parameters for the NetworkServiceDesignVersionsClient.NewListByNetworkServiceDesignGroupPager +// method. +type NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupOptions struct { + // placeholder for future optional parameters +} + +// NetworkServiceDesignVersionsClientUpdateOptions contains the optional parameters for the NetworkServiceDesignVersionsClient.Update +// method. +type NetworkServiceDesignVersionsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// ProxyArtifactClientBeginUpdateStateOptions contains the optional parameters for the ProxyArtifactClient.BeginUpdateState +// method. +type ProxyArtifactClientBeginUpdateStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ProxyArtifactClientGetOptions contains the optional parameters for the ProxyArtifactClient.NewGetPager method. +type ProxyArtifactClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProxyArtifactClientListOptions contains the optional parameters for the ProxyArtifactClient.NewListPager method. +type ProxyArtifactClientListOptions struct { + // placeholder for future optional parameters +} + +// PublishersClientBeginCreateOrUpdateOptions contains the optional parameters for the PublishersClient.BeginCreateOrUpdate +// method. +type PublishersClientBeginCreateOrUpdateOptions struct { + // Parameters supplied to the create publisher operation. + Parameters *Publisher + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PublishersClientBeginDeleteOptions contains the optional parameters for the PublishersClient.BeginDelete method. +type PublishersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PublishersClientGetOptions contains the optional parameters for the PublishersClient.Get method. +type PublishersClientGetOptions struct { + // placeholder for future optional parameters +} + +// PublishersClientListByResourceGroupOptions contains the optional parameters for the PublishersClient.NewListByResourceGroupPager +// method. +type PublishersClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// PublishersClientListBySubscriptionOptions contains the optional parameters for the PublishersClient.NewListBySubscriptionPager +// method. +type PublishersClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// PublishersClientUpdateOptions contains the optional parameters for the PublishersClient.Update method. +type PublishersClientUpdateOptions struct { + // Parameters supplied to the create publisher operation. + Parameters *TagsObject +} + +// SiteNetworkServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the SiteNetworkServicesClient.BeginCreateOrUpdate +// method. +type SiteNetworkServicesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SiteNetworkServicesClientBeginDeleteOptions contains the optional parameters for the SiteNetworkServicesClient.BeginDelete +// method. +type SiteNetworkServicesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SiteNetworkServicesClientGetOptions contains the optional parameters for the SiteNetworkServicesClient.Get method. +type SiteNetworkServicesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SiteNetworkServicesClientListByResourceGroupOptions contains the optional parameters for the SiteNetworkServicesClient.NewListByResourceGroupPager +// method. +type SiteNetworkServicesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// SiteNetworkServicesClientListBySubscriptionOptions contains the optional parameters for the SiteNetworkServicesClient.NewListBySubscriptionPager +// method. +type SiteNetworkServicesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// SiteNetworkServicesClientUpdateTagsOptions contains the optional parameters for the SiteNetworkServicesClient.UpdateTags +// method. +type SiteNetworkServicesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// SitesClientBeginCreateOrUpdateOptions contains the optional parameters for the SitesClient.BeginCreateOrUpdate method. +type SitesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SitesClientBeginDeleteOptions contains the optional parameters for the SitesClient.BeginDelete method. +type SitesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SitesClientGetOptions contains the optional parameters for the SitesClient.Get method. +type SitesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SitesClientListByResourceGroupOptions contains the optional parameters for the SitesClient.NewListByResourceGroupPager +// method. +type SitesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// SitesClientListBySubscriptionOptions contains the optional parameters for the SitesClient.NewListBySubscriptionPager method. +type SitesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// SitesClientUpdateTagsOptions contains the optional parameters for the SitesClient.UpdateTags method. +type SitesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/polymorphic_helpers.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/polymorphic_helpers.go index d7476af9a609..1be390b0af88 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/polymorphic_helpers.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/polymorphic_helpers.go @@ -3,15 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armhybridnetwork import "encoding/json" -func unmarshalDevicePropertiesFormatClassification(rawMsg json.RawMessage) (DevicePropertiesFormatClassification, error) { +func unmarshalArtifactAccessCredentialClassification(rawMsg json.RawMessage) (ArtifactAccessCredentialClassification, error) { if rawMsg == nil { return nil, nil } @@ -19,12 +18,363 @@ func unmarshalDevicePropertiesFormatClassification(rawMsg json.RawMessage) (Devi if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } - var b DevicePropertiesFormatClassification - switch m["deviceType"] { - case string(DeviceTypeAzureStackEdge): - b = &AzureStackEdgeFormat{} + var b ArtifactAccessCredentialClassification + switch m["credentialType"] { + case string(CredentialTypeAzureContainerRegistryScopedToken): + b = &AzureContainerRegistryScopedTokenCredential{} + case string(CredentialTypeAzureStorageAccountToken): + b = &AzureStorageAccountCredential{} default: - b = &DevicePropertiesFormat{} + b = &ArtifactAccessCredential{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalAzureArcKubernetesNetworkFunctionApplicationClassification(rawMsg json.RawMessage) (AzureArcKubernetesNetworkFunctionApplicationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b AzureArcKubernetesNetworkFunctionApplicationClassification + switch m["artifactType"] { + case string(AzureArcKubernetesArtifactTypeHelmPackage): + b = &AzureArcKubernetesHelmApplication{} + default: + b = &AzureArcKubernetesNetworkFunctionApplication{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalAzureArcKubernetesNetworkFunctionApplicationClassificationArray(rawMsg json.RawMessage) ([]AzureArcKubernetesNetworkFunctionApplicationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]AzureArcKubernetesNetworkFunctionApplicationClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalAzureArcKubernetesNetworkFunctionApplicationClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalAzureCoreNetworkFunctionApplicationClassification(rawMsg json.RawMessage) (AzureCoreNetworkFunctionApplicationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b AzureCoreNetworkFunctionApplicationClassification + switch m["artifactType"] { + case string(AzureCoreArtifactTypeArmTemplate): + b = &AzureCoreNetworkFunctionArmTemplateApplication{} + case string(AzureCoreArtifactTypeVhdImageFile): + b = &AzureCoreNetworkFunctionVhdApplication{} + default: + b = &AzureCoreNetworkFunctionApplication{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalAzureCoreNetworkFunctionApplicationClassificationArray(rawMsg json.RawMessage) ([]AzureCoreNetworkFunctionApplicationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]AzureCoreNetworkFunctionApplicationClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalAzureCoreNetworkFunctionApplicationClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalAzureOperatorNexusNetworkFunctionApplicationClassification(rawMsg json.RawMessage) (AzureOperatorNexusNetworkFunctionApplicationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b AzureOperatorNexusNetworkFunctionApplicationClassification + switch m["artifactType"] { + case string(AzureOperatorNexusArtifactTypeArmTemplate): + b = &AzureOperatorNexusNetworkFunctionArmTemplateApplication{} + case string(AzureOperatorNexusArtifactTypeImageFile): + b = &AzureOperatorNexusNetworkFunctionImageApplication{} + default: + b = &AzureOperatorNexusNetworkFunctionApplication{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalAzureOperatorNexusNetworkFunctionApplicationClassificationArray(rawMsg json.RawMessage) ([]AzureOperatorNexusNetworkFunctionApplicationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]AzureOperatorNexusNetworkFunctionApplicationClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalAzureOperatorNexusNetworkFunctionApplicationClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalConfigurationGroupValuePropertiesFormatClassification(rawMsg json.RawMessage) (ConfigurationGroupValuePropertiesFormatClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ConfigurationGroupValuePropertiesFormatClassification + switch m["configurationType"] { + case string(ConfigurationGroupValueConfigurationTypeOpen): + b = &ConfigurationValueWithoutSecrets{} + case string(ConfigurationGroupValueConfigurationTypeSecret): + b = &ConfigurationValueWithSecrets{} + default: + b = &ConfigurationGroupValuePropertiesFormat{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalContainerizedNetworkFunctionTemplateClassification(rawMsg json.RawMessage) (ContainerizedNetworkFunctionTemplateClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ContainerizedNetworkFunctionTemplateClassification + switch m["nfviType"] { + case string(ContainerizedNetworkFunctionNFVITypeAzureArcKubernetes): + b = &AzureArcKubernetesNetworkFunctionTemplate{} + default: + b = &ContainerizedNetworkFunctionTemplate{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalDeploymentResourceIDReferenceClassification(rawMsg json.RawMessage) (DeploymentResourceIDReferenceClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b DeploymentResourceIDReferenceClassification + switch m["idType"] { + case string(IDTypeOpen): + b = &OpenDeploymentResourceReference{} + case string(IDTypeSecret): + b = &SecretDeploymentResourceReference{} + default: + b = &DeploymentResourceIDReference{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalNFVIsClassification(rawMsg json.RawMessage) (NFVIsClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b NFVIsClassification + switch m["nfviType"] { + case string(NFVITypeAzureArcKubernetes): + b = &AzureArcK8SClusterNFVIDetails{} + case string(NFVITypeAzureCore): + b = &AzureCoreNFVIDetails{} + case string(NFVITypeAzureOperatorNexus): + b = &AzureOperatorNexusClusterNFVIDetails{} + default: + b = &NFVIs{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalNFVIsClassificationArray(rawMsg json.RawMessage) ([]NFVIsClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]NFVIsClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalNFVIsClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalNetworkFunctionDefinitionVersionPropertiesFormatClassification(rawMsg json.RawMessage) (NetworkFunctionDefinitionVersionPropertiesFormatClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b NetworkFunctionDefinitionVersionPropertiesFormatClassification + switch m["networkFunctionType"] { + case string(NetworkFunctionTypeContainerizedNetworkFunction): + b = &ContainerizedNetworkFunctionDefinitionVersion{} + case string(NetworkFunctionTypeVirtualNetworkFunction): + b = &VirtualNetworkFunctionDefinitionVersion{} + default: + b = &NetworkFunctionDefinitionVersionPropertiesFormat{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalNetworkFunctionPropertiesFormatClassification(rawMsg json.RawMessage) (NetworkFunctionPropertiesFormatClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b NetworkFunctionPropertiesFormatClassification + switch m["configurationType"] { + case string(NetworkFunctionConfigurationTypeOpen): + b = &NetworkFunctionValueWithoutSecrets{} + case string(NetworkFunctionConfigurationTypeSecret): + b = &NetworkFunctionValueWithSecrets{} + default: + b = &NetworkFunctionPropertiesFormat{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalResourceElementTemplateClassification(rawMsg json.RawMessage) (ResourceElementTemplateClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ResourceElementTemplateClassification + switch m["type"] { + case string(TypeArmResourceDefinition): + b = &ArmResourceDefinitionResourceElementTemplateDetails{} + case string(TypeNetworkFunctionDefinition): + b = &NetworkFunctionDefinitionResourceElementTemplateDetails{} + default: + b = &ResourceElementTemplate{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalResourceElementTemplateClassificationArray(rawMsg json.RawMessage) ([]ResourceElementTemplateClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]ResourceElementTemplateClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalResourceElementTemplateClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalVirtualNetworkFunctionTemplateClassification(rawMsg json.RawMessage) (VirtualNetworkFunctionTemplateClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b VirtualNetworkFunctionTemplateClassification + switch m["nfviType"] { + case string(VirtualNetworkFunctionNFVITypeAzureCore): + b = &AzureCoreNetworkFunctionTemplate{} + case string(VirtualNetworkFunctionNFVITypeAzureOperatorNexus): + b = &AzureOperatorNexusNetworkFunctionTemplate{} + default: + b = &VirtualNetworkFunctionTemplate{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/proxyartifact_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/proxyartifact_client.go new file mode 100644 index 000000000000..0dc2945cc29a --- /dev/null +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/proxyartifact_client.go @@ -0,0 +1,280 @@ +//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 armhybridnetwork + +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" +) + +// ProxyArtifactClient contains the methods for the ProxyArtifact group. +// Don't use this type directly, use NewProxyArtifactClient() instead. +type ProxyArtifactClient struct { + internal *arm.Client + subscriptionID string +} + +// NewProxyArtifactClient creates a new instance of ProxyArtifactClient 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 NewProxyArtifactClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProxyArtifactClient, error) { + cl, err := arm.NewClient(moduleName+".ProxyArtifactClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ProxyArtifactClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewGetPager - Get a Artifact overview information. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - artifactStoreName - The name of the artifact store. +// - artifactName - The name of the artifact. +// - options - ProxyArtifactClientGetOptions contains the optional parameters for the ProxyArtifactClient.NewGetPager method. +func (client *ProxyArtifactClient) NewGetPager(resourceGroupName string, publisherName string, artifactStoreName string, artifactName string, options *ProxyArtifactClientGetOptions) *runtime.Pager[ProxyArtifactClientGetResponse] { + return runtime.NewPager(runtime.PagingHandler[ProxyArtifactClientGetResponse]{ + More: func(page ProxyArtifactClientGetResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ProxyArtifactClientGetResponse) (ProxyArtifactClientGetResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.getCreateRequest(ctx, resourceGroupName, publisherName, artifactStoreName, artifactName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ProxyArtifactClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProxyArtifactClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProxyArtifactClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) + }, + }) +} + +// getCreateRequest creates the Get request. +func (client *ProxyArtifactClient) getCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactName string, options *ProxyArtifactClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if artifactStoreName == "" { + return nil, errors.New("parameter artifactStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactStoreName}", url.PathEscape(artifactStoreName)) + 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("artifactName", artifactName) + reqQP.Set("api-version", "2023-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 *ProxyArtifactClient) getHandleResponse(resp *http.Response) (ProxyArtifactClientGetResponse, error) { + result := ProxyArtifactClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ProxyArtifactVersionsOverviewListResult); err != nil { + return ProxyArtifactClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all the available artifacts in the parent Artifact Store. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - artifactStoreName - The name of the artifact store. +// - options - ProxyArtifactClientListOptions contains the optional parameters for the ProxyArtifactClient.NewListPager method. +func (client *ProxyArtifactClient) NewListPager(resourceGroupName string, publisherName string, artifactStoreName string, options *ProxyArtifactClientListOptions) *runtime.Pager[ProxyArtifactClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ProxyArtifactClientListResponse]{ + More: func(page ProxyArtifactClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ProxyArtifactClientListResponse) (ProxyArtifactClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, publisherName, artifactStoreName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ProxyArtifactClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProxyArtifactClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProxyArtifactClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ProxyArtifactClient) listCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, options *ProxyArtifactClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifacts" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if artifactStoreName == "" { + return nil, errors.New("parameter artifactStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactStoreName}", url.PathEscape(artifactStoreName)) + 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", "2023-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 *ProxyArtifactClient) listHandleResponse(resp *http.Response) (ProxyArtifactClientListResponse, error) { + result := ProxyArtifactClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ProxyArtifactOverviewListResult); err != nil { + return ProxyArtifactClientListResponse{}, err + } + return result, nil +} + +// BeginUpdateState - Change artifact state defined in artifact store. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - artifactStoreName - The name of the artifact store. +// - artifactName - The name of the artifact. +// - artifactVersionName - The name of the artifact version. +// - parameters - Parameters supplied to update the state of artifact manifest. +// - options - ProxyArtifactClientBeginUpdateStateOptions contains the optional parameters for the ProxyArtifactClient.BeginUpdateState +// method. +func (client *ProxyArtifactClient) BeginUpdateState(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactName string, artifactVersionName string, parameters ArtifactChangeState, options *ProxyArtifactClientBeginUpdateStateOptions) (*runtime.Poller[ProxyArtifactClientUpdateStateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateState(ctx, resourceGroupName, publisherName, artifactStoreName, artifactName, artifactVersionName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ProxyArtifactClientUpdateStateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ProxyArtifactClientUpdateStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateState - Change artifact state defined in artifact store. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *ProxyArtifactClient) updateState(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactName string, artifactVersionName string, parameters ArtifactChangeState, options *ProxyArtifactClientBeginUpdateStateOptions) (*http.Response, error) { + var err error + req, err := client.updateStateCreateRequest(ctx, resourceGroupName, publisherName, artifactStoreName, artifactName, artifactVersionName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateStateCreateRequest creates the UpdateState request. +func (client *ProxyArtifactClient) updateStateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, artifactStoreName string, artifactName string, artifactVersionName string, parameters ArtifactChangeState, options *ProxyArtifactClientBeginUpdateStateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions/{artifactVersionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if artifactStoreName == "" { + return nil, errors.New("parameter artifactStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactStoreName}", url.PathEscape(artifactStoreName)) + if artifactVersionName == "" { + return nil, errors.New("parameter artifactVersionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{artifactVersionName}", url.PathEscape(artifactVersionName)) + 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.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("artifactName", artifactName) + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/publishers_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/publishers_client.go new file mode 100644 index 000000000000..e55efe3c254d --- /dev/null +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/publishers_client.go @@ -0,0 +1,440 @@ +//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 armhybridnetwork + +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" +) + +// PublishersClient contains the methods for the Publishers group. +// Don't use this type directly, use NewPublishersClient() instead. +type PublishersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPublishersClient creates a new instance of PublishersClient 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 NewPublishersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PublishersClient, error) { + cl, err := arm.NewClient(moduleName+".PublishersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PublishersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a publisher. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - options - PublishersClientBeginCreateOrUpdateOptions contains the optional parameters for the PublishersClient.BeginCreateOrUpdate +// method. +func (client *PublishersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, options *PublishersClientBeginCreateOrUpdateOptions) (*runtime.Poller[PublishersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, publisherName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PublishersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[PublishersClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a publisher. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *PublishersClient) createOrUpdate(ctx context.Context, resourceGroupName string, publisherName string, options *PublishersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, publisherName, 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 *PublishersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, options *PublishersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Parameters != nil { + if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} + +// BeginDelete - Deletes the specified publisher. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - options - PublishersClientBeginDeleteOptions contains the optional parameters for the PublishersClient.BeginDelete method. +func (client *PublishersClient) BeginDelete(ctx context.Context, resourceGroupName string, publisherName string, options *PublishersClientBeginDeleteOptions) (*runtime.Poller[PublishersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, publisherName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PublishersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[PublishersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified publisher. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *PublishersClient) deleteOperation(ctx context.Context, resourceGroupName string, publisherName string, options *PublishersClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, publisherName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PublishersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, options *PublishersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about the specified publisher. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - options - PublishersClientGetOptions contains the optional parameters for the PublishersClient.Get method. +func (client *PublishersClient) Get(ctx context.Context, resourceGroupName string, publisherName string, options *PublishersClientGetOptions) (PublishersClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, publisherName, options) + if err != nil { + return PublishersClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublishersClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PublishersClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *PublishersClient) getCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, options *PublishersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + 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", "2023-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 *PublishersClient) getHandleResponse(resp *http.Response) (PublishersClientGetResponse, error) { + result := PublishersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Publisher); err != nil { + return PublishersClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all the publishers in a resource group. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - PublishersClientListByResourceGroupOptions contains the optional parameters for the PublishersClient.NewListByResourceGroupPager +// method. +func (client *PublishersClient) NewListByResourceGroupPager(resourceGroupName string, options *PublishersClientListByResourceGroupOptions) *runtime.Pager[PublishersClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[PublishersClientListByResourceGroupResponse]{ + More: func(page PublishersClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PublishersClientListByResourceGroupResponse) (PublishersClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PublishersClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublishersClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublishersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *PublishersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *PublishersClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + 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", "2023-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 *PublishersClient) listByResourceGroupHandleResponse(resp *http.Response) (PublishersClientListByResourceGroupResponse, error) { + result := PublishersClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublisherListResult); err != nil { + return PublishersClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Lists all the publishers in a subscription. +// +// Generated from API version 2023-09-01 +// - options - PublishersClientListBySubscriptionOptions contains the optional parameters for the PublishersClient.NewListBySubscriptionPager +// method. +func (client *PublishersClient) NewListBySubscriptionPager(options *PublishersClientListBySubscriptionOptions) *runtime.Pager[PublishersClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[PublishersClientListBySubscriptionResponse]{ + More: func(page PublishersClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PublishersClientListBySubscriptionResponse) (PublishersClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PublishersClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublishersClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublishersClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *PublishersClient) listBySubscriptionCreateRequest(ctx context.Context, options *PublishersClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/publishers" + 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", "2023-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 *PublishersClient) listBySubscriptionHandleResponse(resp *http.Response) (PublishersClientListBySubscriptionResponse, error) { + result := PublishersClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublisherListResult); err != nil { + return PublishersClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// Update - Update a publisher resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publisherName - The name of the publisher. +// - options - PublishersClientUpdateOptions contains the optional parameters for the PublishersClient.Update method. +func (client *PublishersClient) Update(ctx context.Context, resourceGroupName string, publisherName string, options *PublishersClientUpdateOptions) (PublishersClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, publisherName, options) + if err != nil { + return PublishersClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublishersClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PublishersClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *PublishersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, publisherName string, options *PublishersClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + 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.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Parameters != nil { + if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *PublishersClient) updateHandleResponse(resp *http.Response) (PublishersClientUpdateResponse, error) { + result := PublishersClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Publisher); err != nil { + return PublishersClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/response_types.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/response_types.go index 00b7e503ee5c..a973b54c1d6c 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/response_types.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/response_types.go @@ -3,64 +3,241 @@ // 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. +// 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. -// DO NOT EDIT. package armhybridnetwork -// DevicesClientCreateOrUpdateResponse contains the response from method DevicesClient.BeginCreateOrUpdate. -type DevicesClientCreateOrUpdateResponse struct { - Device +// ArtifactManifestsClientCreateOrUpdateResponse contains the response from method ArtifactManifestsClient.BeginCreateOrUpdate. +type ArtifactManifestsClientCreateOrUpdateResponse struct { + // Artifact manifest properties. + ArtifactManifest } -// DevicesClientDeleteResponse contains the response from method DevicesClient.BeginDelete. -type DevicesClientDeleteResponse struct { +// ArtifactManifestsClientDeleteResponse contains the response from method ArtifactManifestsClient.BeginDelete. +type ArtifactManifestsClientDeleteResponse struct { // placeholder for future response values } -// DevicesClientGetResponse contains the response from method DevicesClient.Get. -type DevicesClientGetResponse struct { - Device +// ArtifactManifestsClientGetResponse contains the response from method ArtifactManifestsClient.Get. +type ArtifactManifestsClientGetResponse struct { + // Artifact manifest properties. + ArtifactManifest } -// DevicesClientListByResourceGroupResponse contains the response from method DevicesClient.NewListByResourceGroupPager. -type DevicesClientListByResourceGroupResponse struct { - DeviceListResult +// ArtifactManifestsClientListByArtifactStoreResponse contains the response from method ArtifactManifestsClient.NewListByArtifactStorePager. +type ArtifactManifestsClientListByArtifactStoreResponse struct { + // A list of artifact manifests. + ArtifactManifestListResult } -// DevicesClientListBySubscriptionResponse contains the response from method DevicesClient.NewListBySubscriptionPager. -type DevicesClientListBySubscriptionResponse struct { - DeviceListResult +// ArtifactManifestsClientListCredentialResponse contains the response from method ArtifactManifestsClient.ListCredential. +type ArtifactManifestsClientListCredentialResponse struct { + // The artifact manifest credential definition. + ArtifactAccessCredentialClassification } -// DevicesClientListRegistrationKeyResponse contains the response from method DevicesClient.ListRegistrationKey. -type DevicesClientListRegistrationKeyResponse struct { - DeviceRegistrationKey +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactManifestsClientListCredentialResponse. +func (a *ArtifactManifestsClientListCredentialResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalArtifactAccessCredentialClassification(data) + if err != nil { + return err + } + a.ArtifactAccessCredentialClassification = res + return nil } -// DevicesClientUpdateTagsResponse contains the response from method DevicesClient.UpdateTags. -type DevicesClientUpdateTagsResponse struct { - Device +// ArtifactManifestsClientUpdateResponse contains the response from method ArtifactManifestsClient.Update. +type ArtifactManifestsClientUpdateResponse struct { + // Artifact manifest properties. + ArtifactManifest } -// NetworkFunctionVendorSKUsClientListBySKUResponse contains the response from method NetworkFunctionVendorSKUsClient.NewListBySKUPager. -type NetworkFunctionVendorSKUsClientListBySKUResponse struct { - NetworkFunctionSKUDetails +// ArtifactManifestsClientUpdateStateResponse contains the response from method ArtifactManifestsClient.BeginUpdateState. +type ArtifactManifestsClientUpdateStateResponse struct { + // The artifact manifest updating request payload. Only the 'Uploaded' state is allowed for updates. Other states are used + // for internal state transitioning. + ArtifactManifestUpdateState } -// NetworkFunctionVendorSKUsClientListByVendorResponse contains the response from method NetworkFunctionVendorSKUsClient.NewListByVendorPager. -type NetworkFunctionVendorSKUsClientListByVendorResponse struct { - NetworkFunctionSKUListResult +// ArtifactStoresClientCreateOrUpdateResponse contains the response from method ArtifactStoresClient.BeginCreateOrUpdate. +type ArtifactStoresClientCreateOrUpdateResponse struct { + // Artifact store properties. + ArtifactStore } -// NetworkFunctionVendorsClientListResponse contains the response from method NetworkFunctionVendorsClient.NewListPager. -type NetworkFunctionVendorsClientListResponse struct { - NetworkFunctionVendorListResult +// ArtifactStoresClientDeleteResponse contains the response from method ArtifactStoresClient.BeginDelete. +type ArtifactStoresClientDeleteResponse struct { + // placeholder for future response values +} + +// ArtifactStoresClientGetResponse contains the response from method ArtifactStoresClient.Get. +type ArtifactStoresClientGetResponse struct { + // Artifact store properties. + ArtifactStore +} + +// ArtifactStoresClientListByPublisherResponse contains the response from method ArtifactStoresClient.NewListByPublisherPager. +type ArtifactStoresClientListByPublisherResponse struct { + // A list of artifact stores. + ArtifactStoreListResult +} + +// ArtifactStoresClientUpdateResponse contains the response from method ArtifactStoresClient.Update. +type ArtifactStoresClientUpdateResponse struct { + // Artifact store properties. + ArtifactStore +} + +// ComponentsClientGetResponse contains the response from method ComponentsClient.Get. +type ComponentsClientGetResponse struct { + // The component sub resource. + Component +} + +// ComponentsClientListByNetworkFunctionResponse contains the response from method ComponentsClient.NewListByNetworkFunctionPager. +type ComponentsClientListByNetworkFunctionResponse struct { + // Response for list component API service call. + ComponentListResult +} + +// ConfigurationGroupSchemasClientCreateOrUpdateResponse contains the response from method ConfigurationGroupSchemasClient.BeginCreateOrUpdate. +type ConfigurationGroupSchemasClientCreateOrUpdateResponse struct { + // Configuration group schema resource. + ConfigurationGroupSchema +} + +// ConfigurationGroupSchemasClientDeleteResponse contains the response from method ConfigurationGroupSchemasClient.BeginDelete. +type ConfigurationGroupSchemasClientDeleteResponse struct { + // placeholder for future response values +} + +// ConfigurationGroupSchemasClientGetResponse contains the response from method ConfigurationGroupSchemasClient.Get. +type ConfigurationGroupSchemasClientGetResponse struct { + // Configuration group schema resource. + ConfigurationGroupSchema +} + +// ConfigurationGroupSchemasClientListByPublisherResponse contains the response from method ConfigurationGroupSchemasClient.NewListByPublisherPager. +type ConfigurationGroupSchemasClientListByPublisherResponse struct { + // A list of configuration group schema resources. + ConfigurationGroupSchemaListResult +} + +// ConfigurationGroupSchemasClientUpdateResponse contains the response from method ConfigurationGroupSchemasClient.Update. +type ConfigurationGroupSchemasClientUpdateResponse struct { + // Configuration group schema resource. + ConfigurationGroupSchema +} + +// ConfigurationGroupSchemasClientUpdateStateResponse contains the response from method ConfigurationGroupSchemasClient.BeginUpdateState. +type ConfigurationGroupSchemasClientUpdateStateResponse struct { + // Publisher configuration group schema update request definition. + ConfigurationGroupSchemaVersionUpdateState +} + +// ConfigurationGroupValuesClientCreateOrUpdateResponse contains the response from method ConfigurationGroupValuesClient.BeginCreateOrUpdate. +type ConfigurationGroupValuesClientCreateOrUpdateResponse struct { + // Hybrid configuration group value resource. + ConfigurationGroupValue +} + +// ConfigurationGroupValuesClientDeleteResponse contains the response from method ConfigurationGroupValuesClient.BeginDelete. +type ConfigurationGroupValuesClientDeleteResponse struct { + // placeholder for future response values +} + +// ConfigurationGroupValuesClientGetResponse contains the response from method ConfigurationGroupValuesClient.Get. +type ConfigurationGroupValuesClientGetResponse struct { + // Hybrid configuration group value resource. + ConfigurationGroupValue +} + +// ConfigurationGroupValuesClientListByResourceGroupResponse contains the response from method ConfigurationGroupValuesClient.NewListByResourceGroupPager. +type ConfigurationGroupValuesClientListByResourceGroupResponse struct { + // Response for hybrid configurationGroups API service call. + ConfigurationGroupValueListResult +} + +// ConfigurationGroupValuesClientListBySubscriptionResponse contains the response from method ConfigurationGroupValuesClient.NewListBySubscriptionPager. +type ConfigurationGroupValuesClientListBySubscriptionResponse struct { + // Response for hybrid configurationGroups API service call. + ConfigurationGroupValueListResult +} + +// ConfigurationGroupValuesClientUpdateTagsResponse contains the response from method ConfigurationGroupValuesClient.UpdateTags. +type ConfigurationGroupValuesClientUpdateTagsResponse struct { + // Hybrid configuration group value resource. + ConfigurationGroupValue +} + +// NetworkFunctionDefinitionGroupsClientCreateOrUpdateResponse contains the response from method NetworkFunctionDefinitionGroupsClient.BeginCreateOrUpdate. +type NetworkFunctionDefinitionGroupsClientCreateOrUpdateResponse struct { + // Network function definition group resource. + NetworkFunctionDefinitionGroup +} + +// NetworkFunctionDefinitionGroupsClientDeleteResponse contains the response from method NetworkFunctionDefinitionGroupsClient.BeginDelete. +type NetworkFunctionDefinitionGroupsClientDeleteResponse struct { + // placeholder for future response values +} + +// NetworkFunctionDefinitionGroupsClientGetResponse contains the response from method NetworkFunctionDefinitionGroupsClient.Get. +type NetworkFunctionDefinitionGroupsClientGetResponse struct { + // Network function definition group resource. + NetworkFunctionDefinitionGroup +} + +// NetworkFunctionDefinitionGroupsClientListByPublisherResponse contains the response from method NetworkFunctionDefinitionGroupsClient.NewListByPublisherPager. +type NetworkFunctionDefinitionGroupsClientListByPublisherResponse struct { + // A list of network function definition group resources. + NetworkFunctionDefinitionGroupListResult +} + +// NetworkFunctionDefinitionGroupsClientUpdateResponse contains the response from method NetworkFunctionDefinitionGroupsClient.Update. +type NetworkFunctionDefinitionGroupsClientUpdateResponse struct { + // Network function definition group resource. + NetworkFunctionDefinitionGroup +} + +// NetworkFunctionDefinitionVersionsClientCreateOrUpdateResponse contains the response from method NetworkFunctionDefinitionVersionsClient.BeginCreateOrUpdate. +type NetworkFunctionDefinitionVersionsClientCreateOrUpdateResponse struct { + // Network function definition version. + NetworkFunctionDefinitionVersion +} + +// NetworkFunctionDefinitionVersionsClientDeleteResponse contains the response from method NetworkFunctionDefinitionVersionsClient.BeginDelete. +type NetworkFunctionDefinitionVersionsClientDeleteResponse struct { + // placeholder for future response values +} + +// NetworkFunctionDefinitionVersionsClientGetResponse contains the response from method NetworkFunctionDefinitionVersionsClient.Get. +type NetworkFunctionDefinitionVersionsClientGetResponse struct { + // Network function definition version. + NetworkFunctionDefinitionVersion +} + +// NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupResponse contains the response from method NetworkFunctionDefinitionVersionsClient.NewListByNetworkFunctionDefinitionGroupPager. +type NetworkFunctionDefinitionVersionsClientListByNetworkFunctionDefinitionGroupResponse struct { + // A list of network function definition versions. + NetworkFunctionDefinitionVersionListResult +} + +// NetworkFunctionDefinitionVersionsClientUpdateResponse contains the response from method NetworkFunctionDefinitionVersionsClient.Update. +type NetworkFunctionDefinitionVersionsClientUpdateResponse struct { + // Network function definition version. + NetworkFunctionDefinitionVersion +} + +// NetworkFunctionDefinitionVersionsClientUpdateStateResponse contains the response from method NetworkFunctionDefinitionVersionsClient.BeginUpdateState. +type NetworkFunctionDefinitionVersionsClientUpdateStateResponse struct { + // Publisher network function definition version update request definition. + NetworkFunctionDefinitionVersionUpdateState } // NetworkFunctionsClientCreateOrUpdateResponse contains the response from method NetworkFunctionsClient.BeginCreateOrUpdate. type NetworkFunctionsClientCreateOrUpdateResponse struct { + // Network function resource response. NetworkFunction } @@ -69,127 +246,224 @@ type NetworkFunctionsClientDeleteResponse struct { // placeholder for future response values } +// NetworkFunctionsClientExecuteRequestResponse contains the response from method NetworkFunctionsClient.BeginExecuteRequest. +type NetworkFunctionsClientExecuteRequestResponse struct { + // placeholder for future response values +} + // NetworkFunctionsClientGetResponse contains the response from method NetworkFunctionsClient.Get. type NetworkFunctionsClientGetResponse struct { + // Network function resource response. NetworkFunction } // NetworkFunctionsClientListByResourceGroupResponse contains the response from method NetworkFunctionsClient.NewListByResourceGroupPager. type NetworkFunctionsClientListByResourceGroupResponse struct { + // Response for network function API service call. NetworkFunctionListResult } // NetworkFunctionsClientListBySubscriptionResponse contains the response from method NetworkFunctionsClient.NewListBySubscriptionPager. type NetworkFunctionsClientListBySubscriptionResponse struct { + // Response for network function API service call. NetworkFunctionListResult } // NetworkFunctionsClientUpdateTagsResponse contains the response from method NetworkFunctionsClient.UpdateTags. type NetworkFunctionsClientUpdateTagsResponse struct { + // Network function resource response. NetworkFunction } -// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. -type OperationsClientListResponse struct { - OperationList +// NetworkServiceDesignGroupsClientCreateOrUpdateResponse contains the response from method NetworkServiceDesignGroupsClient.BeginCreateOrUpdate. +type NetworkServiceDesignGroupsClientCreateOrUpdateResponse struct { + // network service design group resource. + NetworkServiceDesignGroup } -// RoleInstancesClientGetResponse contains the response from method RoleInstancesClient.Get. -type RoleInstancesClientGetResponse struct { - RoleInstance +// NetworkServiceDesignGroupsClientDeleteResponse contains the response from method NetworkServiceDesignGroupsClient.BeginDelete. +type NetworkServiceDesignGroupsClientDeleteResponse struct { + // placeholder for future response values } -// RoleInstancesClientListResponse contains the response from method RoleInstancesClient.NewListPager. -type RoleInstancesClientListResponse struct { - NetworkFunctionRoleInstanceListResult +// NetworkServiceDesignGroupsClientGetResponse contains the response from method NetworkServiceDesignGroupsClient.Get. +type NetworkServiceDesignGroupsClientGetResponse struct { + // network service design group resource. + NetworkServiceDesignGroup } -// RoleInstancesClientRestartResponse contains the response from method RoleInstancesClient.BeginRestart. -type RoleInstancesClientRestartResponse struct { - // placeholder for future response values +// NetworkServiceDesignGroupsClientListByPublisherResponse contains the response from method NetworkServiceDesignGroupsClient.NewListByPublisherPager. +type NetworkServiceDesignGroupsClientListByPublisherResponse struct { + // A list of network service design group resources. + NetworkServiceDesignGroupListResult } -// RoleInstancesClientStartResponse contains the response from method RoleInstancesClient.BeginStart. -type RoleInstancesClientStartResponse struct { - // placeholder for future response values +// NetworkServiceDesignGroupsClientUpdateResponse contains the response from method NetworkServiceDesignGroupsClient.Update. +type NetworkServiceDesignGroupsClientUpdateResponse struct { + // network service design group resource. + NetworkServiceDesignGroup } -// RoleInstancesClientStopResponse contains the response from method RoleInstancesClient.BeginStop. -type RoleInstancesClientStopResponse struct { +// NetworkServiceDesignVersionsClientCreateOrUpdateResponse contains the response from method NetworkServiceDesignVersionsClient.BeginCreateOrUpdate. +type NetworkServiceDesignVersionsClientCreateOrUpdateResponse struct { + // network service design version. + NetworkServiceDesignVersion +} + +// NetworkServiceDesignVersionsClientDeleteResponse contains the response from method NetworkServiceDesignVersionsClient.BeginDelete. +type NetworkServiceDesignVersionsClientDeleteResponse struct { // placeholder for future response values } -// VendorNetworkFunctionsClientCreateOrUpdateResponse contains the response from method VendorNetworkFunctionsClient.BeginCreateOrUpdate. -type VendorNetworkFunctionsClientCreateOrUpdateResponse struct { - VendorNetworkFunction +// NetworkServiceDesignVersionsClientGetResponse contains the response from method NetworkServiceDesignVersionsClient.Get. +type NetworkServiceDesignVersionsClientGetResponse struct { + // network service design version. + NetworkServiceDesignVersion } -// VendorNetworkFunctionsClientGetResponse contains the response from method VendorNetworkFunctionsClient.Get. -type VendorNetworkFunctionsClientGetResponse struct { - VendorNetworkFunction +// NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupResponse contains the response from method NetworkServiceDesignVersionsClient.NewListByNetworkServiceDesignGroupPager. +type NetworkServiceDesignVersionsClientListByNetworkServiceDesignGroupResponse struct { + // A list of network service design versions. + NetworkServiceDesignVersionListResult } -// VendorNetworkFunctionsClientListResponse contains the response from method VendorNetworkFunctionsClient.NewListPager. -type VendorNetworkFunctionsClientListResponse struct { - VendorNetworkFunctionListResult +// NetworkServiceDesignVersionsClientUpdateResponse contains the response from method NetworkServiceDesignVersionsClient.Update. +type NetworkServiceDesignVersionsClientUpdateResponse struct { + // network service design version. + NetworkServiceDesignVersion } -// VendorSKUPreviewClientCreateOrUpdateResponse contains the response from method VendorSKUPreviewClient.BeginCreateOrUpdate. -type VendorSKUPreviewClientCreateOrUpdateResponse struct { - PreviewSubscription +// NetworkServiceDesignVersionsClientUpdateStateResponse contains the response from method NetworkServiceDesignVersionsClient.BeginUpdateState. +type NetworkServiceDesignVersionsClientUpdateStateResponse struct { + // Publisher network service design version update request definition. + NetworkServiceDesignVersionUpdateState } -// VendorSKUPreviewClientDeleteResponse contains the response from method VendorSKUPreviewClient.BeginDelete. -type VendorSKUPreviewClientDeleteResponse struct { +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. +type OperationsClientListResponse struct { + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + OperationListResult +} + +// ProxyArtifactClientGetResponse contains the response from method ProxyArtifactClient.NewGetPager. +type ProxyArtifactClientGetResponse struct { + // The proxy artifact list result. + ProxyArtifactVersionsOverviewListResult +} + +// ProxyArtifactClientListResponse contains the response from method ProxyArtifactClient.NewListPager. +type ProxyArtifactClientListResponse struct { + // The proxy artifact list result. + ProxyArtifactOverviewListResult +} + +// ProxyArtifactClientUpdateStateResponse contains the response from method ProxyArtifactClient.BeginUpdateState. +type ProxyArtifactClientUpdateStateResponse struct { + // The proxy artifact overview. + ProxyArtifactVersionsListOverview +} + +// PublishersClientCreateOrUpdateResponse contains the response from method PublishersClient.BeginCreateOrUpdate. +type PublishersClientCreateOrUpdateResponse struct { + // publisher resource. + Publisher +} + +// PublishersClientDeleteResponse contains the response from method PublishersClient.BeginDelete. +type PublishersClientDeleteResponse struct { // placeholder for future response values } -// VendorSKUPreviewClientGetResponse contains the response from method VendorSKUPreviewClient.Get. -type VendorSKUPreviewClientGetResponse struct { - PreviewSubscription +// PublishersClientGetResponse contains the response from method PublishersClient.Get. +type PublishersClientGetResponse struct { + // publisher resource. + Publisher } -// VendorSKUPreviewClientListResponse contains the response from method VendorSKUPreviewClient.NewListPager. -type VendorSKUPreviewClientListResponse struct { - PreviewSubscriptionsList +// PublishersClientListByResourceGroupResponse contains the response from method PublishersClient.NewListByResourceGroupPager. +type PublishersClientListByResourceGroupResponse struct { + // A list of publishers. + PublisherListResult } -// VendorSKUsClientCreateOrUpdateResponse contains the response from method VendorSKUsClient.BeginCreateOrUpdate. -type VendorSKUsClientCreateOrUpdateResponse struct { - VendorSKU +// PublishersClientListBySubscriptionResponse contains the response from method PublishersClient.NewListBySubscriptionPager. +type PublishersClientListBySubscriptionResponse struct { + // A list of publishers. + PublisherListResult } -// VendorSKUsClientDeleteResponse contains the response from method VendorSKUsClient.BeginDelete. -type VendorSKUsClientDeleteResponse struct { +// PublishersClientUpdateResponse contains the response from method PublishersClient.Update. +type PublishersClientUpdateResponse struct { + // publisher resource. + Publisher +} + +// SiteNetworkServicesClientCreateOrUpdateResponse contains the response from method SiteNetworkServicesClient.BeginCreateOrUpdate. +type SiteNetworkServicesClientCreateOrUpdateResponse struct { + // Site network service resource. + SiteNetworkService +} + +// SiteNetworkServicesClientDeleteResponse contains the response from method SiteNetworkServicesClient.BeginDelete. +type SiteNetworkServicesClientDeleteResponse struct { // placeholder for future response values } -// VendorSKUsClientGetResponse contains the response from method VendorSKUsClient.Get. -type VendorSKUsClientGetResponse struct { - VendorSKU +// SiteNetworkServicesClientGetResponse contains the response from method SiteNetworkServicesClient.Get. +type SiteNetworkServicesClientGetResponse struct { + // Site network service resource. + SiteNetworkService } -// VendorSKUsClientListResponse contains the response from method VendorSKUsClient.NewListPager. -type VendorSKUsClientListResponse struct { - VendorSKUListResult +// SiteNetworkServicesClientListByResourceGroupResponse contains the response from method SiteNetworkServicesClient.NewListByResourceGroupPager. +type SiteNetworkServicesClientListByResourceGroupResponse struct { + // Response for site network services API service call. + SiteNetworkServiceListResult } -// VendorsClientCreateOrUpdateResponse contains the response from method VendorsClient.BeginCreateOrUpdate. -type VendorsClientCreateOrUpdateResponse struct { - Vendor +// SiteNetworkServicesClientListBySubscriptionResponse contains the response from method SiteNetworkServicesClient.NewListBySubscriptionPager. +type SiteNetworkServicesClientListBySubscriptionResponse struct { + // Response for site network services API service call. + SiteNetworkServiceListResult } -// VendorsClientDeleteResponse contains the response from method VendorsClient.BeginDelete. -type VendorsClientDeleteResponse struct { +// SiteNetworkServicesClientUpdateTagsResponse contains the response from method SiteNetworkServicesClient.UpdateTags. +type SiteNetworkServicesClientUpdateTagsResponse struct { + // Site network service resource. + SiteNetworkService +} + +// SitesClientCreateOrUpdateResponse contains the response from method SitesClient.BeginCreateOrUpdate. +type SitesClientCreateOrUpdateResponse struct { + // Site resource. + Site +} + +// SitesClientDeleteResponse contains the response from method SitesClient.BeginDelete. +type SitesClientDeleteResponse struct { // placeholder for future response values } -// VendorsClientGetResponse contains the response from method VendorsClient.Get. -type VendorsClientGetResponse struct { - Vendor +// SitesClientGetResponse contains the response from method SitesClient.Get. +type SitesClientGetResponse struct { + // Site resource. + Site +} + +// SitesClientListByResourceGroupResponse contains the response from method SitesClient.NewListByResourceGroupPager. +type SitesClientListByResourceGroupResponse struct { + // Response for sites API service call. + SiteListResult +} + +// SitesClientListBySubscriptionResponse contains the response from method SitesClient.NewListBySubscriptionPager. +type SitesClientListBySubscriptionResponse struct { + // Response for sites API service call. + SiteListResult } -// VendorsClientListBySubscriptionResponse contains the response from method VendorsClient.NewListBySubscriptionPager. -type VendorsClientListBySubscriptionResponse struct { - VendorListResult +// SitesClientUpdateTagsResponse contains the response from method SitesClient.UpdateTags. +type SitesClientUpdateTagsResponse struct { + // Site resource. + Site } diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/roleinstances_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/roleinstances_client.go deleted file mode 100644 index 70bc2fd168a5..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/roleinstances_client.go +++ /dev/null @@ -1,416 +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 armhybridnetwork - -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" -) - -// RoleInstancesClient contains the methods for the RoleInstances group. -// Don't use this type directly, use NewRoleInstancesClient() instead. -type RoleInstancesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewRoleInstancesClient creates a new instance of RoleInstancesClient 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 NewRoleInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RoleInstancesClient, error) { - cl, err := arm.NewClient(moduleName+".RoleInstancesClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &RoleInstancesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Gets the information of role instance of vendor network function. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - locationName - The Azure region where the network function resource was created by customer. -// - vendorName - The name of the vendor. -// - serviceKey - The GUID for the vendor network function. -// - roleInstanceName - The name of the role instance of the vendor network function. -// - options - RoleInstancesClientGetOptions contains the optional parameters for the RoleInstancesClient.Get method. -func (client *RoleInstancesClient) Get(ctx context.Context, locationName string, vendorName string, serviceKey string, roleInstanceName string, options *RoleInstancesClientGetOptions) (RoleInstancesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, locationName, vendorName, serviceKey, roleInstanceName, options) - if err != nil { - return RoleInstancesClientGetResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RoleInstancesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoleInstancesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *RoleInstancesClient) getCreateRequest(ctx context.Context, locationName string, vendorName string, serviceKey string, roleInstanceName string, options *RoleInstancesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors/{vendorName}/networkFunctions/{serviceKey}/roleInstances/{roleInstanceName}" - if locationName == "" { - return nil, errors.New("parameter locationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - if serviceKey == "" { - return nil, errors.New("parameter serviceKey cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceKey}", url.PathEscape(serviceKey)) - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - 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", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RoleInstancesClient) getHandleResponse(resp *http.Response) (RoleInstancesClientGetResponse, error) { - result := RoleInstancesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RoleInstance); err != nil { - return RoleInstancesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists the information of role instances of vendor network function. -// -// Generated from API version 2021-05-01 -// - locationName - The Azure region where the network function resource was created by customer. -// - vendorName - The name of the vendor. -// - serviceKey - The GUID for the vendor network function. -// - options - RoleInstancesClientListOptions contains the optional parameters for the RoleInstancesClient.NewListPager method. -func (client *RoleInstancesClient) NewListPager(locationName string, vendorName string, serviceKey string, options *RoleInstancesClientListOptions) *runtime.Pager[RoleInstancesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[RoleInstancesClientListResponse]{ - More: func(page RoleInstancesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RoleInstancesClientListResponse) (RoleInstancesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, locationName, vendorName, serviceKey, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return RoleInstancesClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RoleInstancesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoleInstancesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *RoleInstancesClient) listCreateRequest(ctx context.Context, locationName string, vendorName string, serviceKey string, options *RoleInstancesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors/{vendorName}/networkFunctions/{serviceKey}/roleInstances" - if locationName == "" { - return nil, errors.New("parameter locationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - if serviceKey == "" { - return nil, errors.New("parameter serviceKey cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceKey}", url.PathEscape(serviceKey)) - 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", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *RoleInstancesClient) listHandleResponse(resp *http.Response) (RoleInstancesClientListResponse, error) { - result := RoleInstancesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFunctionRoleInstanceListResult); err != nil { - return RoleInstancesClientListResponse{}, err - } - return result, nil -} - -// BeginRestart - Restarts a role instance of a vendor network function. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - locationName - The Azure region where the network function resource was created by customer. -// - vendorName - The name of the vendor. -// - serviceKey - The GUID for the vendor network function. -// - roleInstanceName - The name of the role instance of the vendor network function. -// - options - RoleInstancesClientBeginRestartOptions contains the optional parameters for the RoleInstancesClient.BeginRestart -// method. -func (client *RoleInstancesClient) BeginRestart(ctx context.Context, locationName string, vendorName string, serviceKey string, roleInstanceName string, options *RoleInstancesClientBeginRestartOptions) (*runtime.Poller[RoleInstancesClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, locationName, vendorName, serviceKey, roleInstanceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoleInstancesClientRestartResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[RoleInstancesClientRestartResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Restart - Restarts a role instance of a vendor network function. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -func (client *RoleInstancesClient) restart(ctx context.Context, locationName string, vendorName string, serviceKey string, roleInstanceName string, options *RoleInstancesClientBeginRestartOptions) (*http.Response, error) { - req, err := client.restartCreateRequest(ctx, locationName, vendorName, serviceKey, roleInstanceName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *RoleInstancesClient) restartCreateRequest(ctx context.Context, locationName string, vendorName string, serviceKey string, roleInstanceName string, options *RoleInstancesClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors/{vendorName}/networkFunctions/{serviceKey}/roleInstances/{roleInstanceName}/restart" - if locationName == "" { - return nil, errors.New("parameter locationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - if serviceKey == "" { - return nil, errors.New("parameter serviceKey cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceKey}", url.PathEscape(serviceKey)) - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStart - Starts a role instance of a vendor network function. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - locationName - The Azure region where the network function resource was created by customer. -// - vendorName - The name of the vendor. -// - serviceKey - The GUID for the vendor network function. -// - roleInstanceName - The name of the role instance of the vendor network function. -// - options - RoleInstancesClientBeginStartOptions contains the optional parameters for the RoleInstancesClient.BeginStart -// method. -func (client *RoleInstancesClient) BeginStart(ctx context.Context, locationName string, vendorName string, serviceKey string, roleInstanceName string, options *RoleInstancesClientBeginStartOptions) (*runtime.Poller[RoleInstancesClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, locationName, vendorName, serviceKey, roleInstanceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoleInstancesClientStartResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[RoleInstancesClientStartResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Start - Starts a role instance of a vendor network function. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -func (client *RoleInstancesClient) start(ctx context.Context, locationName string, vendorName string, serviceKey string, roleInstanceName string, options *RoleInstancesClientBeginStartOptions) (*http.Response, error) { - req, err := client.startCreateRequest(ctx, locationName, vendorName, serviceKey, roleInstanceName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// startCreateRequest creates the Start request. -func (client *RoleInstancesClient) startCreateRequest(ctx context.Context, locationName string, vendorName string, serviceKey string, roleInstanceName string, options *RoleInstancesClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors/{vendorName}/networkFunctions/{serviceKey}/roleInstances/{roleInstanceName}/start" - if locationName == "" { - return nil, errors.New("parameter locationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - if serviceKey == "" { - return nil, errors.New("parameter serviceKey cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceKey}", url.PathEscape(serviceKey)) - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStop - Powers off (stop) a role instance of a vendor network function. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - locationName - The Azure region where the network function resource was created by customer. -// - vendorName - The name of the vendor. -// - serviceKey - The GUID for the vendor network function. -// - roleInstanceName - The name of the role instance of the vendor network function. -// - options - RoleInstancesClientBeginStopOptions contains the optional parameters for the RoleInstancesClient.BeginStop method. -func (client *RoleInstancesClient) BeginStop(ctx context.Context, locationName string, vendorName string, serviceKey string, roleInstanceName string, options *RoleInstancesClientBeginStopOptions) (*runtime.Poller[RoleInstancesClientStopResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.stop(ctx, locationName, vendorName, serviceKey, roleInstanceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoleInstancesClientStopResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[RoleInstancesClientStopResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Stop - Powers off (stop) a role instance of a vendor network function. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -func (client *RoleInstancesClient) stop(ctx context.Context, locationName string, vendorName string, serviceKey string, roleInstanceName string, options *RoleInstancesClientBeginStopOptions) (*http.Response, error) { - req, err := client.stopCreateRequest(ctx, locationName, vendorName, serviceKey, roleInstanceName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// stopCreateRequest creates the Stop request. -func (client *RoleInstancesClient) stopCreateRequest(ctx context.Context, locationName string, vendorName string, serviceKey string, roleInstanceName string, options *RoleInstancesClientBeginStopOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors/{vendorName}/networkFunctions/{serviceKey}/roleInstances/{roleInstanceName}/stop" - if locationName == "" { - return nil, errors.New("parameter locationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - if serviceKey == "" { - return nil, errors.New("parameter serviceKey cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceKey}", url.PathEscape(serviceKey)) - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/roleinstances_client_example_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/roleinstances_client_example_test.go deleted file mode 100644 index 6a04bcdee96a..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/roleinstances_client_example_test.go +++ /dev/null @@ -1,153 +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 armhybridnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceStart.json -func ExampleRoleInstancesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoleInstancesClient().BeginStart(ctx, "eastus", "testVendor", "testServiceKey", "mrm", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceStop.json -func ExampleRoleInstancesClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoleInstancesClient().BeginStop(ctx, "eastus", "testVendor", "testServiceKey", "mrm", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceRestart.json -func ExampleRoleInstancesClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoleInstancesClient().BeginRestart(ctx, "eastus", "testVendor", "testServiceKey", "mrm", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceGet.json -func ExampleRoleInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoleInstancesClient().Get(ctx, "eastus", "testVendor", "testServiceKey", "mrm", 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.RoleInstance = armhybridnetwork.RoleInstance{ - // Name: to.Ptr("mrm"), - // Type: to.Ptr("Microsoft.HybridNetwork/locations/vendors/networkFunctions/roleInstances"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/locations/eastus/vendors/testVendor/networkFunctions/testServiceKey/roleInstances/mrm"), - // Properties: &armhybridnetwork.RoleInstanceProperties{ - // OperationalState: to.Ptr(armhybridnetwork.OperationalStateRunning), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceListByVendorNetworkFunction.json -func ExampleRoleInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRoleInstancesClient().NewListPager("eastus", "testVendor", "testServiceKey", 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.NetworkFunctionRoleInstanceListResult = armhybridnetwork.NetworkFunctionRoleInstanceListResult{ - // Value: []*armhybridnetwork.RoleInstance{ - // { - // Name: to.Ptr("mrm"), - // Type: to.Ptr("Microsoft.HybridNetwork/locations/vendors/networkFunctions/roleInstances"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/locations/eastus/vendors/testVendor/networkFunctions/testServiceKey/roleInstances/mrm"), - // Properties: &armhybridnetwork.RoleInstanceProperties{ - // OperationalState: to.Ptr(armhybridnetwork.OperationalStateRunning), - // }, - // }, - // { - // Name: to.Ptr("msm"), - // Type: to.Ptr("Microsoft.HybridNetwork/locations/vendors/networkFunctions/roleInstances"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/locations/eastus/vendors/testVendor/networkFunctions/testServiceKey/roleInstances/msm"), - // Properties: &armhybridnetwork.RoleInstanceProperties{ - // OperationalState: to.Ptr(armhybridnetwork.OperationalStateStopped), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/sitenetworkservices_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/sitenetworkservices_client.go new file mode 100644 index 000000000000..c77e388f782b --- /dev/null +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/sitenetworkservices_client.go @@ -0,0 +1,438 @@ +//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 armhybridnetwork + +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" +) + +// SiteNetworkServicesClient contains the methods for the SiteNetworkServices group. +// Don't use this type directly, use NewSiteNetworkServicesClient() instead. +type SiteNetworkServicesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSiteNetworkServicesClient creates a new instance of SiteNetworkServicesClient 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 NewSiteNetworkServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SiteNetworkServicesClient, error) { + cl, err := arm.NewClient(moduleName+".SiteNetworkServicesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SiteNetworkServicesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a network site. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - siteNetworkServiceName - The name of the site network service. +// - parameters - Parameters supplied to the create or update site network service operation. +// - options - SiteNetworkServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the SiteNetworkServicesClient.BeginCreateOrUpdate +// method. +func (client *SiteNetworkServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, siteNetworkServiceName string, parameters SiteNetworkService, options *SiteNetworkServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SiteNetworkServicesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, siteNetworkServiceName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SiteNetworkServicesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[SiteNetworkServicesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a network site. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *SiteNetworkServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, siteNetworkServiceName string, parameters SiteNetworkService, options *SiteNetworkServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, siteNetworkServiceName, parameters, 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 *SiteNetworkServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, siteNetworkServiceName string, parameters SiteNetworkService, options *SiteNetworkServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}" + 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 siteNetworkServiceName == "" { + return nil, errors.New("parameter siteNetworkServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteNetworkServiceName}", url.PathEscape(siteNetworkServiceName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes the specified site network service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - siteNetworkServiceName - The name of the site network service. +// - options - SiteNetworkServicesClientBeginDeleteOptions contains the optional parameters for the SiteNetworkServicesClient.BeginDelete +// method. +func (client *SiteNetworkServicesClient) BeginDelete(ctx context.Context, resourceGroupName string, siteNetworkServiceName string, options *SiteNetworkServicesClientBeginDeleteOptions) (*runtime.Poller[SiteNetworkServicesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, siteNetworkServiceName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SiteNetworkServicesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[SiteNetworkServicesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified site network service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *SiteNetworkServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, siteNetworkServiceName string, options *SiteNetworkServicesClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, siteNetworkServiceName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SiteNetworkServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, siteNetworkServiceName string, options *SiteNetworkServicesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}" + 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 siteNetworkServiceName == "" { + return nil, errors.New("parameter siteNetworkServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteNetworkServiceName}", url.PathEscape(siteNetworkServiceName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about the specified site network service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - siteNetworkServiceName - The name of the site network service. +// - options - SiteNetworkServicesClientGetOptions contains the optional parameters for the SiteNetworkServicesClient.Get method. +func (client *SiteNetworkServicesClient) Get(ctx context.Context, resourceGroupName string, siteNetworkServiceName string, options *SiteNetworkServicesClientGetOptions) (SiteNetworkServicesClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, siteNetworkServiceName, options) + if err != nil { + return SiteNetworkServicesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SiteNetworkServicesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SiteNetworkServicesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SiteNetworkServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, siteNetworkServiceName string, options *SiteNetworkServicesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}" + 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 siteNetworkServiceName == "" { + return nil, errors.New("parameter siteNetworkServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteNetworkServiceName}", url.PathEscape(siteNetworkServiceName)) + 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", "2023-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 *SiteNetworkServicesClient) getHandleResponse(resp *http.Response) (SiteNetworkServicesClientGetResponse, error) { + result := SiteNetworkServicesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteNetworkService); err != nil { + return SiteNetworkServicesClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all site network services. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - SiteNetworkServicesClientListByResourceGroupOptions contains the optional parameters for the SiteNetworkServicesClient.NewListByResourceGroupPager +// method. +func (client *SiteNetworkServicesClient) NewListByResourceGroupPager(resourceGroupName string, options *SiteNetworkServicesClientListByResourceGroupOptions) *runtime.Pager[SiteNetworkServicesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[SiteNetworkServicesClientListByResourceGroupResponse]{ + More: func(page SiteNetworkServicesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SiteNetworkServicesClientListByResourceGroupResponse) (SiteNetworkServicesClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SiteNetworkServicesClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SiteNetworkServicesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SiteNetworkServicesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *SiteNetworkServicesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SiteNetworkServicesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices" + 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", "2023-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 *SiteNetworkServicesClient) listByResourceGroupHandleResponse(resp *http.Response) (SiteNetworkServicesClientListByResourceGroupResponse, error) { + result := SiteNetworkServicesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteNetworkServiceListResult); err != nil { + return SiteNetworkServicesClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Lists all sites in the network service in a subscription. +// +// Generated from API version 2023-09-01 +// - options - SiteNetworkServicesClientListBySubscriptionOptions contains the optional parameters for the SiteNetworkServicesClient.NewListBySubscriptionPager +// method. +func (client *SiteNetworkServicesClient) NewListBySubscriptionPager(options *SiteNetworkServicesClientListBySubscriptionOptions) *runtime.Pager[SiteNetworkServicesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[SiteNetworkServicesClientListBySubscriptionResponse]{ + More: func(page SiteNetworkServicesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SiteNetworkServicesClientListBySubscriptionResponse) (SiteNetworkServicesClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SiteNetworkServicesClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SiteNetworkServicesClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SiteNetworkServicesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *SiteNetworkServicesClient) listBySubscriptionCreateRequest(ctx context.Context, options *SiteNetworkServicesClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/siteNetworkServices" + 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", "2023-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 *SiteNetworkServicesClient) listBySubscriptionHandleResponse(resp *http.Response) (SiteNetworkServicesClientListBySubscriptionResponse, error) { + result := SiteNetworkServicesClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteNetworkServiceListResult); err != nil { + return SiteNetworkServicesClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates a site update tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - siteNetworkServiceName - The name of the site network service. +// - parameters - Parameters supplied to update network site tags. +// - options - SiteNetworkServicesClientUpdateTagsOptions contains the optional parameters for the SiteNetworkServicesClient.UpdateTags +// method. +func (client *SiteNetworkServicesClient) UpdateTags(ctx context.Context, resourceGroupName string, siteNetworkServiceName string, parameters TagsObject, options *SiteNetworkServicesClientUpdateTagsOptions) (SiteNetworkServicesClientUpdateTagsResponse, error) { + var err error + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, siteNetworkServiceName, parameters, options) + if err != nil { + return SiteNetworkServicesClientUpdateTagsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SiteNetworkServicesClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SiteNetworkServicesClientUpdateTagsResponse{}, err + } + resp, err := client.updateTagsHandleResponse(httpResp) + return resp, err +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *SiteNetworkServicesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, siteNetworkServiceName string, parameters TagsObject, options *SiteNetworkServicesClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}" + 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 siteNetworkServiceName == "" { + return nil, errors.New("parameter siteNetworkServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteNetworkServiceName}", url.PathEscape(siteNetworkServiceName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *SiteNetworkServicesClient) updateTagsHandleResponse(resp *http.Response) (SiteNetworkServicesClientUpdateTagsResponse, error) { + result := SiteNetworkServicesClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteNetworkService); err != nil { + return SiteNetworkServicesClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/sites_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/sites_client.go new file mode 100644 index 000000000000..21fd779b6e83 --- /dev/null +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/sites_client.go @@ -0,0 +1,436 @@ +//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 armhybridnetwork + +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" +) + +// SitesClient contains the methods for the Sites group. +// Don't use this type directly, use NewSitesClient() instead. +type SitesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSitesClient creates a new instance of SitesClient 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 NewSitesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SitesClient, error) { + cl, err := arm.NewClient(moduleName+".SitesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SitesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a network site. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - siteName - The name of the network service site. +// - parameters - Parameters supplied to the create or update network site operation. +// - options - SitesClientBeginCreateOrUpdateOptions contains the optional parameters for the SitesClient.BeginCreateOrUpdate +// method. +func (client *SitesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, siteName string, parameters Site, options *SitesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SitesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, siteName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SitesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[SitesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a network site. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *SitesClient) createOrUpdate(ctx context.Context, resourceGroupName string, siteName string, parameters Site, options *SitesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, siteName, parameters, 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 *SitesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, siteName string, parameters Site, options *SitesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}" + 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 siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes the specified network site. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - siteName - The name of the network service site. +// - options - SitesClientBeginDeleteOptions contains the optional parameters for the SitesClient.BeginDelete method. +func (client *SitesClient) BeginDelete(ctx context.Context, resourceGroupName string, siteName string, options *SitesClientBeginDeleteOptions) (*runtime.Poller[SitesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, siteName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SitesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[SitesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified network site. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *SitesClient) deleteOperation(ctx context.Context, resourceGroupName string, siteName string, options *SitesClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, siteName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SitesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, siteName string, options *SitesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}" + 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 siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about the specified network site. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - siteName - The name of the network service site. +// - options - SitesClientGetOptions contains the optional parameters for the SitesClient.Get method. +func (client *SitesClient) Get(ctx context.Context, resourceGroupName string, siteName string, options *SitesClientGetOptions) (SitesClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, siteName, options) + if err != nil { + return SitesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SitesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SitesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SitesClient) getCreateRequest(ctx context.Context, resourceGroupName string, siteName string, options *SitesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}" + 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 siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + 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", "2023-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 *SitesClient) getHandleResponse(resp *http.Response) (SitesClientGetResponse, error) { + result := SitesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Site); err != nil { + return SitesClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all sites in the network service. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - SitesClientListByResourceGroupOptions contains the optional parameters for the SitesClient.NewListByResourceGroupPager +// method. +func (client *SitesClient) NewListByResourceGroupPager(resourceGroupName string, options *SitesClientListByResourceGroupOptions) *runtime.Pager[SitesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[SitesClientListByResourceGroupResponse]{ + More: func(page SitesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SitesClientListByResourceGroupResponse) (SitesClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SitesClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SitesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SitesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *SitesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SitesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites" + 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", "2023-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 *SitesClient) listByResourceGroupHandleResponse(resp *http.Response) (SitesClientListByResourceGroupResponse, error) { + result := SitesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteListResult); err != nil { + return SitesClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Lists all sites in the network service in a subscription. +// +// Generated from API version 2023-09-01 +// - options - SitesClientListBySubscriptionOptions contains the optional parameters for the SitesClient.NewListBySubscriptionPager +// method. +func (client *SitesClient) NewListBySubscriptionPager(options *SitesClientListBySubscriptionOptions) *runtime.Pager[SitesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[SitesClientListBySubscriptionResponse]{ + More: func(page SitesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SitesClientListBySubscriptionResponse) (SitesClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SitesClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SitesClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SitesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *SitesClient) listBySubscriptionCreateRequest(ctx context.Context, options *SitesClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/sites" + 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", "2023-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 *SitesClient) listBySubscriptionHandleResponse(resp *http.Response) (SitesClientListBySubscriptionResponse, error) { + result := SitesClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteListResult); err != nil { + return SitesClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates a site update tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - siteName - The name of the network service site. +// - parameters - Parameters supplied to update network site tags. +// - options - SitesClientUpdateTagsOptions contains the optional parameters for the SitesClient.UpdateTags method. +func (client *SitesClient) UpdateTags(ctx context.Context, resourceGroupName string, siteName string, parameters TagsObject, options *SitesClientUpdateTagsOptions) (SitesClientUpdateTagsResponse, error) { + var err error + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, siteName, parameters, options) + if err != nil { + return SitesClientUpdateTagsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SitesClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SitesClientUpdateTagsResponse{}, err + } + resp, err := client.updateTagsHandleResponse(httpResp) + return resp, err +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *SitesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, siteName string, parameters TagsObject, options *SitesClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}" + 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 siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + 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", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *SitesClient) updateTagsHandleResponse(resp *http.Response) (SitesClientUpdateTagsResponse, error) { + result := SitesClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Site); err != nil { + return SitesClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/time_rfc3339.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/time_rfc3339.go index 46af8222dce3..0e00816256bd 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/time_rfc3339.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/time_rfc3339.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armhybridnetwork diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendornetworkfunctions_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendornetworkfunctions_client.go deleted file mode 100644 index 91248161d3bf..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendornetworkfunctions_client.go +++ /dev/null @@ -1,256 +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 armhybridnetwork - -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" -) - -// VendorNetworkFunctionsClient contains the methods for the VendorNetworkFunctions group. -// Don't use this type directly, use NewVendorNetworkFunctionsClient() instead. -type VendorNetworkFunctionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVendorNetworkFunctionsClient creates a new instance of VendorNetworkFunctionsClient 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 NewVendorNetworkFunctionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VendorNetworkFunctionsClient, error) { - cl, err := arm.NewClient(moduleName+".VendorNetworkFunctionsClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VendorNetworkFunctionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a vendor network function. This operation can take up to 6 hours to complete. -// This is expected service behavior. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - locationName - The Azure region where the network function resource was created by the customer. -// - vendorName - The name of the vendor. -// - serviceKey - The GUID for the vendor network function. -// - parameters - Parameters supplied to the create or update vendor network function operation. -// - options - VendorNetworkFunctionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VendorNetworkFunctionsClient.BeginCreateOrUpdate -// method. -func (client *VendorNetworkFunctionsClient) BeginCreateOrUpdate(ctx context.Context, locationName string, vendorName string, serviceKey string, parameters VendorNetworkFunction, options *VendorNetworkFunctionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VendorNetworkFunctionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, locationName, vendorName, serviceKey, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VendorNetworkFunctionsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VendorNetworkFunctionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// CreateOrUpdate - Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This -// is expected service behavior. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -func (client *VendorNetworkFunctionsClient) createOrUpdate(ctx context.Context, locationName string, vendorName string, serviceKey string, parameters VendorNetworkFunction, options *VendorNetworkFunctionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, locationName, vendorName, serviceKey, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VendorNetworkFunctionsClient) createOrUpdateCreateRequest(ctx context.Context, locationName string, vendorName string, serviceKey string, parameters VendorNetworkFunction, options *VendorNetworkFunctionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors/{vendorName}/networkFunctions/{serviceKey}" - if locationName == "" { - return nil, errors.New("parameter locationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - if serviceKey == "" { - return nil, errors.New("parameter serviceKey cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceKey}", url.PathEscape(serviceKey)) - 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// Get - Gets information about the specified vendor network function. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - locationName - The Azure region where the network function resource was created by the customer. -// - vendorName - The name of the vendor. -// - serviceKey - The GUID for the vendor network function. -// - options - VendorNetworkFunctionsClientGetOptions contains the optional parameters for the VendorNetworkFunctionsClient.Get -// method. -func (client *VendorNetworkFunctionsClient) Get(ctx context.Context, locationName string, vendorName string, serviceKey string, options *VendorNetworkFunctionsClientGetOptions) (VendorNetworkFunctionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, locationName, vendorName, serviceKey, options) - if err != nil { - return VendorNetworkFunctionsClientGetResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VendorNetworkFunctionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VendorNetworkFunctionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VendorNetworkFunctionsClient) getCreateRequest(ctx context.Context, locationName string, vendorName string, serviceKey string, options *VendorNetworkFunctionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors/{vendorName}/networkFunctions/{serviceKey}" - if locationName == "" { - return nil, errors.New("parameter locationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - if serviceKey == "" { - return nil, errors.New("parameter serviceKey cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceKey}", url.PathEscape(serviceKey)) - 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", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VendorNetworkFunctionsClient) getHandleResponse(resp *http.Response) (VendorNetworkFunctionsClientGetResponse, error) { - result := VendorNetworkFunctionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VendorNetworkFunction); err != nil { - return VendorNetworkFunctionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, vendorProvisioningState. -// -// Generated from API version 2021-05-01 -// - locationName - The Azure region where the network function resource was created by the customer. -// - vendorName - The name of the vendor. -// - options - VendorNetworkFunctionsClientListOptions contains the optional parameters for the VendorNetworkFunctionsClient.NewListPager -// method. -func (client *VendorNetworkFunctionsClient) NewListPager(locationName string, vendorName string, options *VendorNetworkFunctionsClientListOptions) *runtime.Pager[VendorNetworkFunctionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VendorNetworkFunctionsClientListResponse]{ - More: func(page VendorNetworkFunctionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VendorNetworkFunctionsClientListResponse) (VendorNetworkFunctionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, locationName, vendorName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VendorNetworkFunctionsClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VendorNetworkFunctionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VendorNetworkFunctionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VendorNetworkFunctionsClient) listCreateRequest(ctx context.Context, locationName string, vendorName string, options *VendorNetworkFunctionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors/{vendorName}/networkFunctions" - if locationName == "" { - return nil, errors.New("parameter locationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - 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() - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - reqQP.Set("api-version", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VendorNetworkFunctionsClient) listHandleResponse(resp *http.Response) (VendorNetworkFunctionsClientListResponse, error) { - result := VendorNetworkFunctionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VendorNetworkFunctionListResult); err != nil { - return VendorNetworkFunctionsClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendornetworkfunctions_client_example_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendornetworkfunctions_client_example_test.go deleted file mode 100644 index 2548c9bd64c8..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendornetworkfunctions_client_example_test.go +++ /dev/null @@ -1,312 +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 armhybridnetwork_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/hybridnetwork/armhybridnetwork" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorNfGet.json -func ExampleVendorNetworkFunctionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVendorNetworkFunctionsClient().Get(ctx, "eastus", "testVendor", "testServiceKey", 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.VendorNetworkFunction = armhybridnetwork.VendorNetworkFunction{ - // Name: to.Ptr("testServiceKey"), - // Type: to.Ptr("Microsoft.HybridNetwork/locations/vendors/networkFunctions"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/locations/eastus/vendors/testVendor/networkFunctions/testServiceKey"), - // Properties: &armhybridnetwork.VendorNetworkFunctionPropertiesFormat{ - // NetworkFunctionVendorConfigurations: []*armhybridnetwork.NetworkFunctionVendorConfiguration{ - // { - // NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic1"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeManagement), - // }, - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr("DC-97-F8-79-16-7D"), - // NetworkInterfaceName: to.Ptr("nic2"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeWan), - // }}, - // OSProfile: &armhybridnetwork.OsProfile{ - // AdminUsername: to.Ptr("dummyuser"), - // CustomData: to.Ptr("base-64 encoded string of custom data"), - // LinuxConfiguration: &armhybridnetwork.LinuxConfiguration{ - // SSH: &armhybridnetwork.SSHConfiguration{ - // PublicKeys: []*armhybridnetwork.SSHPublicKey{ - // { - // Path: to.Ptr("home/user/.ssh/authorized_keys"), - // KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAwrr66r8n6B8Y0zMF3dOpXEapIQD9DiYQ6D6/zwor9o39jSkHNiMMER/GETBbzP83LOcekm02aRjo55ArO7gPPVvCXbrirJu9pkm4AC4BBre5xSLS= user@constoso-DSH"), - // }}, - // }, - // }, - // }, - // RoleName: to.Ptr("testRole"), - // UserDataParameters: map[string]any{ - // }, - // }}, - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // SKUName: to.Ptr("testSku"), - // SKUType: to.Ptr(armhybridnetwork.SKUTypeSDWAN), - // VendorProvisioningState: to.Ptr(armhybridnetwork.VendorProvisioningStateProvisioning), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorNfCreate.json -func ExampleVendorNetworkFunctionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVendorNetworkFunctionsClient().BeginCreateOrUpdate(ctx, "eastus", "testVendor", "testServiceKey", armhybridnetwork.VendorNetworkFunction{ - Properties: &armhybridnetwork.VendorNetworkFunctionPropertiesFormat{ - NetworkFunctionVendorConfigurations: []*armhybridnetwork.NetworkFunctionVendorConfiguration{ - { - NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - { - IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - { - Gateway: to.Ptr(""), - IPAddress: to.Ptr(""), - IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - Subnet: to.Ptr(""), - }}, - MacAddress: to.Ptr(""), - NetworkInterfaceName: to.Ptr("nic1"), - VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeManagement), - }, - { - IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - { - Gateway: to.Ptr(""), - IPAddress: to.Ptr(""), - IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - Subnet: to.Ptr(""), - }}, - MacAddress: to.Ptr("DC-97-F8-79-16-7D"), - NetworkInterfaceName: to.Ptr("nic2"), - VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeWan), - }}, - OSProfile: &armhybridnetwork.OsProfile{ - AdminUsername: to.Ptr("dummyuser"), - CustomData: to.Ptr("base-64 encoded string of custom data"), - LinuxConfiguration: &armhybridnetwork.LinuxConfiguration{ - SSH: &armhybridnetwork.SSHConfiguration{ - PublicKeys: []*armhybridnetwork.SSHPublicKey{ - { - Path: to.Ptr("home/user/.ssh/authorized_keys"), - KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAwrr66r8n6B8Y0zMF3dOpXEapIQD9DiYQ6D6/zwor9o39jSkHNiMMER/GETBbzP83LOcekm02aRjo55ArO7gPPVvCXbrirJu9pkm4AC4BBre5xSLS= user@constoso-DSH"), - }}, - }, - }, - }, - RoleName: to.Ptr("testRole"), - UserDataParameters: map[string]any{}, - }}, - SKUType: to.Ptr(armhybridnetwork.SKUTypeSDWAN), - VendorProvisioningState: to.Ptr(armhybridnetwork.VendorProvisioningStateProvisioning), - }, - }, 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.VendorNetworkFunction = armhybridnetwork.VendorNetworkFunction{ - // Name: to.Ptr("testServiceKey"), - // Type: to.Ptr("Microsoft.HybridNetwork/locations/vendors/networkFunctions"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/locations/eastus/vendors/testVendor/networkFunctions/testServiceKey"), - // Properties: &armhybridnetwork.VendorNetworkFunctionPropertiesFormat{ - // NetworkFunctionVendorConfigurations: []*armhybridnetwork.NetworkFunctionVendorConfiguration{ - // { - // NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic1"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeManagement), - // }, - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr("DC-97-F8-79-16-7D"), - // NetworkInterfaceName: to.Ptr("nic2"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeWan), - // }}, - // OSProfile: &armhybridnetwork.OsProfile{ - // AdminUsername: to.Ptr("dummyuser"), - // CustomData: to.Ptr("base-64 encoded string of custom data"), - // LinuxConfiguration: &armhybridnetwork.LinuxConfiguration{ - // SSH: &armhybridnetwork.SSHConfiguration{ - // PublicKeys: []*armhybridnetwork.SSHPublicKey{ - // { - // Path: to.Ptr("home/user/.ssh/authorized_keys"), - // KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAwrr66r8n6B8Y0zMF3dOpXEapIQD9DiYQ6D6/zwor9o39jSkHNiMMER/GETBbzP83LOcekm02aRjo55ArO7gPPVvCXbrirJu9pkm4AC4BBre5xSLS= user@constoso-DSH"), - // }}, - // }, - // }, - // }, - // RoleName: to.Ptr("testRole"), - // UserDataParameters: map[string]any{ - // }, - // }}, - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // SKUName: to.Ptr("testSku"), - // SKUType: to.Ptr(armhybridnetwork.SKUTypeSDWAN), - // VendorProvisioningState: to.Ptr(armhybridnetwork.VendorProvisioningStateProvisioning), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorNfListByVendor.json -func ExampleVendorNetworkFunctionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVendorNetworkFunctionsClient().NewListPager("eastus", "testVendor", &armhybridnetwork.VendorNetworkFunctionsClientListOptions{Filter: 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.VendorNetworkFunctionListResult = armhybridnetwork.VendorNetworkFunctionListResult{ - // Value: []*armhybridnetwork.VendorNetworkFunction{ - // { - // Name: to.Ptr("TestServiceKey"), - // Type: to.Ptr("Microsoft.HybridNetwork/locations/vendors/networkFunctions"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/locations/eastus/vendors/testVendor/networkFunctions/testServiceKey"), - // Properties: &armhybridnetwork.VendorNetworkFunctionPropertiesFormat{ - // NetworkFunctionVendorConfigurations: []*armhybridnetwork.NetworkFunctionVendorConfiguration{ - // { - // NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic1"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeManagement), - // }, - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr("DC-97-F8-79-16-7D"), - // NetworkInterfaceName: to.Ptr("nic2"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeWan), - // }}, - // OSProfile: &armhybridnetwork.OsProfile{ - // AdminUsername: to.Ptr("dummyuser"), - // CustomData: to.Ptr("base-64 encoded string of custom data"), - // LinuxConfiguration: &armhybridnetwork.LinuxConfiguration{ - // SSH: &armhybridnetwork.SSHConfiguration{ - // PublicKeys: []*armhybridnetwork.SSHPublicKey{ - // { - // Path: to.Ptr("home/user/.ssh/authorized_keys"), - // KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAwrr66r8n6B8Y0zMF3dOpXEapIQD9DiYQ6D6/zwor9o39jSkHNiMMER/GETBbzP83LOcekm02aRjo55ArO7gPPVvCXbrirJu9pkm4AC4BBre5xSLS= user@constoso-DSH"), - // }}, - // }, - // }, - // }, - // RoleName: to.Ptr("testRole"), - // UserDataParameters: map[string]any{ - // }, - // }}, - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // SKUName: to.Ptr("testSku"), - // SKUType: to.Ptr(armhybridnetwork.SKUTypeSDWAN), - // VendorProvisioningState: to.Ptr(armhybridnetwork.VendorProvisioningStateProvisioning), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendors_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendors_client.go deleted file mode 100644 index 9addcd47d700..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendors_client.go +++ /dev/null @@ -1,283 +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 armhybridnetwork - -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" -) - -// VendorsClient contains the methods for the Vendors group. -// Don't use this type directly, use NewVendorsClient() instead. -type VendorsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVendorsClient creates a new instance of VendorsClient 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 NewVendorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VendorsClient, error) { - cl, err := arm.NewClient(moduleName+".VendorsClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VendorsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a vendor. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - vendorName - The name of the vendor. -// - options - VendorsClientBeginCreateOrUpdateOptions contains the optional parameters for the VendorsClient.BeginCreateOrUpdate -// method. -func (client *VendorsClient) BeginCreateOrUpdate(ctx context.Context, vendorName string, options *VendorsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VendorsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, vendorName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VendorsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VendorsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// CreateOrUpdate - Creates or updates a vendor. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -func (client *VendorsClient) createOrUpdate(ctx context.Context, vendorName string, options *VendorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, vendorName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VendorsClient) createOrUpdateCreateRequest(ctx context.Context, vendorName string, options *VendorsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}" - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} - -// BeginDelete - Deletes the specified vendor. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - vendorName - The name of the vendor. -// - options - VendorsClientBeginDeleteOptions contains the optional parameters for the VendorsClient.BeginDelete method. -func (client *VendorsClient) BeginDelete(ctx context.Context, vendorName string, options *VendorsClientBeginDeleteOptions) (*runtime.Poller[VendorsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, vendorName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VendorsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VendorsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Delete - Deletes the specified vendor. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -func (client *VendorsClient) deleteOperation(ctx context.Context, vendorName string, options *VendorsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, vendorName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VendorsClient) deleteCreateRequest(ctx context.Context, vendorName string, options *VendorsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}" - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about the specified vendor. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - vendorName - The name of the vendor. -// - options - VendorsClientGetOptions contains the optional parameters for the VendorsClient.Get method. -func (client *VendorsClient) Get(ctx context.Context, vendorName string, options *VendorsClientGetOptions) (VendorsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, vendorName, options) - if err != nil { - return VendorsClientGetResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VendorsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VendorsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VendorsClient) getCreateRequest(ctx context.Context, vendorName string, options *VendorsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}" - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - 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", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VendorsClient) getHandleResponse(resp *http.Response) (VendorsClientGetResponse, error) { - result := VendorsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Vendor); err != nil { - return VendorsClientGetResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all the vendors in a subscription. -// -// Generated from API version 2021-05-01 -// - options - VendorsClientListBySubscriptionOptions contains the optional parameters for the VendorsClient.NewListBySubscriptionPager -// method. -func (client *VendorsClient) NewListBySubscriptionPager(options *VendorsClientListBySubscriptionOptions) *runtime.Pager[VendorsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[VendorsClientListBySubscriptionResponse]{ - More: func(page VendorsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VendorsClientListBySubscriptionResponse) (VendorsClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VendorsClientListBySubscriptionResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VendorsClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VendorsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *VendorsClient) listBySubscriptionCreateRequest(ctx context.Context, options *VendorsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors" - 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", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *VendorsClient) listBySubscriptionHandleResponse(resp *http.Response) (VendorsClientListBySubscriptionResponse, error) { - result := VendorsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VendorListResult); err != nil { - return VendorsClientListBySubscriptionResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendors_client_example_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendors_client_example_test.go deleted file mode 100644 index b248e2958658..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendors_client_example_test.go +++ /dev/null @@ -1,155 +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 armhybridnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorDelete.json -func ExampleVendorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVendorsClient().BeginDelete(ctx, "TestVendor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorGet.json -func ExampleVendorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVendorsClient().Get(ctx, "TestVendor", 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.Vendor = armhybridnetwork.Vendor{ - // Name: to.Ptr("TestVendor"), - // Type: to.Ptr("Microsoft.HybridNetwork/vendors"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/vendors/TestVendor"), - // Properties: &armhybridnetwork.VendorPropertiesFormat{ - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // SKUs: []*armhybridnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/vendors/TestVendor/skus/TestVendorSku"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorCreate.json -func ExampleVendorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVendorsClient().BeginCreateOrUpdate(ctx, "TestVendor", &armhybridnetwork.VendorsClientBeginCreateOrUpdateOptions{Parameters: &armhybridnetwork.Vendor{}}) - 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.Vendor = armhybridnetwork.Vendor{ - // Name: to.Ptr("TestVendor"), - // Type: to.Ptr("Microsoft.HybridNetwork/vendors"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/vendors/TestVendor"), - // Properties: &armhybridnetwork.VendorPropertiesFormat{ - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorListBySubscription.json -func ExampleVendorsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVendorsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VendorListResult = armhybridnetwork.VendorListResult{ - // Value: []*armhybridnetwork.Vendor{ - // { - // Name: to.Ptr("TestVendor"), - // Type: to.Ptr("Microsoft.HybridNetwork/vendors"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/vendors/TestVendor"), - // Properties: &armhybridnetwork.VendorPropertiesFormat{ - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // SKUs: []*armhybridnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/vendors/TestVendor/vendorskus/TestVendorSku1"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("TestVendor2"), - // Type: to.Ptr("Microsoft.HybridNetwork/vendors"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/vendors/TestVendor2"), - // Properties: &armhybridnetwork.VendorPropertiesFormat{ - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // SKUs: []*armhybridnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/vendors/TestVendor/vendorskus/TestVendorSku2"), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendorskupreview_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendorskupreview_client.go deleted file mode 100644 index 8f8c5ede0333..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendorskupreview_client.go +++ /dev/null @@ -1,322 +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 armhybridnetwork - -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" -) - -// VendorSKUPreviewClient contains the methods for the VendorSKUPreview group. -// Don't use this type directly, use NewVendorSKUPreviewClient() instead. -type VendorSKUPreviewClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVendorSKUPreviewClient creates a new instance of VendorSKUPreviewClient 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 NewVendorSKUPreviewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VendorSKUPreviewClient, error) { - cl, err := arm.NewClient(moduleName+".VendorSKUPreviewClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VendorSKUPreviewClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates preview information of a vendor sku. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - vendorName - The name of the vendor. -// - skuName - The name of the vendor sku. -// - previewSubscription - Preview subscription ID. -// - parameters - Parameters supplied to the create or update vendor preview subscription operation. -// - options - VendorSKUPreviewClientBeginCreateOrUpdateOptions contains the optional parameters for the VendorSKUPreviewClient.BeginCreateOrUpdate -// method. -func (client *VendorSKUPreviewClient) BeginCreateOrUpdate(ctx context.Context, vendorName string, skuName string, previewSubscription string, parameters PreviewSubscription, options *VendorSKUPreviewClientBeginCreateOrUpdateOptions) (*runtime.Poller[VendorSKUPreviewClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, vendorName, skuName, previewSubscription, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VendorSKUPreviewClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VendorSKUPreviewClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// CreateOrUpdate - Creates or updates preview information of a vendor sku. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -func (client *VendorSKUPreviewClient) createOrUpdate(ctx context.Context, vendorName string, skuName string, previewSubscription string, parameters PreviewSubscription, options *VendorSKUPreviewClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, vendorName, skuName, previewSubscription, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VendorSKUPreviewClient) createOrUpdateCreateRequest(ctx context.Context, vendorName string, skuName string, previewSubscription string, parameters PreviewSubscription, options *VendorSKUPreviewClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus/{skuName}/previewSubscriptions/{previewSubscription}" - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - if skuName == "" { - return nil, errors.New("parameter skuName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skuName}", url.PathEscape(skuName)) - if previewSubscription == "" { - return nil, errors.New("parameter previewSubscription cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{previewSubscription}", url.PathEscape(previewSubscription)) - 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the preview information of a vendor sku. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - vendorName - The name of the vendor. -// - skuName - The name of the vendor sku. -// - previewSubscription - Preview subscription ID. -// - options - VendorSKUPreviewClientBeginDeleteOptions contains the optional parameters for the VendorSKUPreviewClient.BeginDelete -// method. -func (client *VendorSKUPreviewClient) BeginDelete(ctx context.Context, vendorName string, skuName string, previewSubscription string, options *VendorSKUPreviewClientBeginDeleteOptions) (*runtime.Poller[VendorSKUPreviewClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, vendorName, skuName, previewSubscription, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VendorSKUPreviewClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VendorSKUPreviewClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Delete - Deletes the preview information of a vendor sku. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -func (client *VendorSKUPreviewClient) deleteOperation(ctx context.Context, vendorName string, skuName string, previewSubscription string, options *VendorSKUPreviewClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, vendorName, skuName, previewSubscription, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VendorSKUPreviewClient) deleteCreateRequest(ctx context.Context, vendorName string, skuName string, previewSubscription string, options *VendorSKUPreviewClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus/{skuName}/previewSubscriptions/{previewSubscription}" - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - if skuName == "" { - return nil, errors.New("parameter skuName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skuName}", url.PathEscape(skuName)) - if previewSubscription == "" { - return nil, errors.New("parameter previewSubscription cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{previewSubscription}", url.PathEscape(previewSubscription)) - 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the preview information of a vendor sku. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - vendorName - The name of the vendor. -// - skuName - The name of the vendor sku. -// - previewSubscription - Preview subscription ID. -// - options - VendorSKUPreviewClientGetOptions contains the optional parameters for the VendorSKUPreviewClient.Get method. -func (client *VendorSKUPreviewClient) Get(ctx context.Context, vendorName string, skuName string, previewSubscription string, options *VendorSKUPreviewClientGetOptions) (VendorSKUPreviewClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, vendorName, skuName, previewSubscription, options) - if err != nil { - return VendorSKUPreviewClientGetResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VendorSKUPreviewClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VendorSKUPreviewClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VendorSKUPreviewClient) getCreateRequest(ctx context.Context, vendorName string, skuName string, previewSubscription string, options *VendorSKUPreviewClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus/{skuName}/previewSubscriptions/{previewSubscription}" - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - if skuName == "" { - return nil, errors.New("parameter skuName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skuName}", url.PathEscape(skuName)) - if previewSubscription == "" { - return nil, errors.New("parameter previewSubscription cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{previewSubscription}", url.PathEscape(previewSubscription)) - 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", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VendorSKUPreviewClient) getHandleResponse(resp *http.Response) (VendorSKUPreviewClientGetResponse, error) { - result := VendorSKUPreviewClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PreviewSubscription); err != nil { - return VendorSKUPreviewClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the preview information of a vendor sku. -// -// Generated from API version 2021-05-01 -// - vendorName - The name of the vendor. -// - skuName - The name of the sku. -// - options - VendorSKUPreviewClientListOptions contains the optional parameters for the VendorSKUPreviewClient.NewListPager -// method. -func (client *VendorSKUPreviewClient) NewListPager(vendorName string, skuName string, options *VendorSKUPreviewClientListOptions) *runtime.Pager[VendorSKUPreviewClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VendorSKUPreviewClientListResponse]{ - More: func(page VendorSKUPreviewClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VendorSKUPreviewClientListResponse) (VendorSKUPreviewClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, vendorName, skuName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VendorSKUPreviewClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VendorSKUPreviewClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VendorSKUPreviewClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VendorSKUPreviewClient) listCreateRequest(ctx context.Context, vendorName string, skuName string, options *VendorSKUPreviewClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus/{skuName}/previewSubscriptions" - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - if skuName == "" { - return nil, errors.New("parameter skuName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skuName}", url.PathEscape(skuName)) - 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", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VendorSKUPreviewClient) listHandleResponse(resp *http.Response) (VendorSKUPreviewClientListResponse, error) { - result := VendorSKUPreviewClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PreviewSubscriptionsList); err != nil { - return VendorSKUPreviewClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendorskupreview_client_example_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendorskupreview_client_example_test.go deleted file mode 100644 index 1803e698da89..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendorskupreview_client_example_test.go +++ /dev/null @@ -1,131 +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 armhybridnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewListBySku.json -func ExampleVendorSKUPreviewClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVendorSKUPreviewClient().NewListPager("TestVendor", "TestSku", 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.PreviewSubscriptionsList = armhybridnetwork.PreviewSubscriptionsList{ - // Value: []*armhybridnetwork.PreviewSubscription{ - // { - // Name: to.Ptr("previewSub1"), - // Type: to.Ptr("Microsoft.HybridNetwork/vendors/vendorskus/previewsubscriptions"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/vendors/TestVendor/vendorskus/TestSku/previewsubscriptions/previewSub1"), - // }, - // { - // Name: to.Ptr("previewSub2"), - // Type: to.Ptr("Microsoft.HybridNetwork/vendors/vendorskus/previewsubscriptions"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/vendors/TestVendor/vendorskus/TestSku/previewsubscriptions/previewSub2"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewCreate.json -func ExampleVendorSKUPreviewClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVendorSKUPreviewClient().BeginCreateOrUpdate(ctx, "TestVendor", "TestSku", "previewSub", armhybridnetwork.PreviewSubscription{}, 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.PreviewSubscription = armhybridnetwork.PreviewSubscription{ - // Name: to.Ptr("previewSub"), - // Type: to.Ptr("Microsoft.HybridNetwork/vendors/vendorskus/previewsubscriptions"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/vendors/TestVendor/vendorskus/TestSku/previewsubscriptions/previewSub"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewGet.json -func ExampleVendorSKUPreviewClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVendorSKUPreviewClient().Get(ctx, "TestVendor", "TestSku", "previewSub", 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.PreviewSubscription = armhybridnetwork.PreviewSubscription{ - // Name: to.Ptr("previewSub"), - // Type: to.Ptr("Microsoft.HybridNetwork/vendors/vendorskus/previewsubscriptions"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/vendors/TestVendor/vendorskus/TestSku/previewsubscriptions/previewSub"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewDelete.json -func ExampleVendorSKUPreviewClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVendorSKUPreviewClient().BeginDelete(ctx, "TestVendor", "TestSku", "previewSub", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendorskus_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendorskus_client.go deleted file mode 100644 index 0fa2f2b3912e..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendorskus_client.go +++ /dev/null @@ -1,302 +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 armhybridnetwork - -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" -) - -// VendorSKUsClient contains the methods for the VendorSKUs group. -// Don't use this type directly, use NewVendorSKUsClient() instead. -type VendorSKUsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVendorSKUsClient creates a new instance of VendorSKUsClient 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 NewVendorSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VendorSKUsClient, error) { - cl, err := arm.NewClient(moduleName+".VendorSKUsClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VendorSKUsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service -// behavior. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - vendorName - The name of the vendor. -// - skuName - The name of the sku. -// - parameters - Parameters supplied to the create or update sku operation. -// - options - VendorSKUsClientBeginCreateOrUpdateOptions contains the optional parameters for the VendorSKUsClient.BeginCreateOrUpdate -// method. -func (client *VendorSKUsClient) BeginCreateOrUpdate(ctx context.Context, vendorName string, skuName string, parameters VendorSKU, options *VendorSKUsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VendorSKUsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, vendorName, skuName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VendorSKUsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VendorSKUsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// CreateOrUpdate - Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service -// behavior. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -func (client *VendorSKUsClient) createOrUpdate(ctx context.Context, vendorName string, skuName string, parameters VendorSKU, options *VendorSKUsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, vendorName, skuName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VendorSKUsClient) createOrUpdateCreateRequest(ctx context.Context, vendorName string, skuName string, parameters VendorSKU, options *VendorSKUsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus/{skuName}" - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - if skuName == "" { - return nil, errors.New("parameter skuName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skuName}", url.PathEscape(skuName)) - 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - vendorName - The name of the vendor. -// - skuName - The name of the sku. -// - options - VendorSKUsClientBeginDeleteOptions contains the optional parameters for the VendorSKUsClient.BeginDelete method. -func (client *VendorSKUsClient) BeginDelete(ctx context.Context, vendorName string, skuName string, options *VendorSKUsClientBeginDeleteOptions) (*runtime.Poller[VendorSKUsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, vendorName, skuName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VendorSKUsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VendorSKUsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Delete - Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -func (client *VendorSKUsClient) deleteOperation(ctx context.Context, vendorName string, skuName string, options *VendorSKUsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, vendorName, skuName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VendorSKUsClient) deleteCreateRequest(ctx context.Context, vendorName string, skuName string, options *VendorSKUsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus/{skuName}" - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - if skuName == "" { - return nil, errors.New("parameter skuName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skuName}", url.PathEscape(skuName)) - 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about the specified sku. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-05-01 -// - vendorName - The name of the vendor. -// - skuName - The name of the sku. -// - options - VendorSKUsClientGetOptions contains the optional parameters for the VendorSKUsClient.Get method. -func (client *VendorSKUsClient) Get(ctx context.Context, vendorName string, skuName string, options *VendorSKUsClientGetOptions) (VendorSKUsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, vendorName, skuName, options) - if err != nil { - return VendorSKUsClientGetResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VendorSKUsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VendorSKUsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VendorSKUsClient) getCreateRequest(ctx context.Context, vendorName string, skuName string, options *VendorSKUsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus/{skuName}" - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - if skuName == "" { - return nil, errors.New("parameter skuName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skuName}", url.PathEscape(skuName)) - 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", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VendorSKUsClient) getHandleResponse(resp *http.Response) (VendorSKUsClientGetResponse, error) { - result := VendorSKUsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VendorSKU); err != nil { - return VendorSKUsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the skus of a vendor. -// -// Generated from API version 2021-05-01 -// - vendorName - The name of the vendor. -// - options - VendorSKUsClientListOptions contains the optional parameters for the VendorSKUsClient.NewListPager method. -func (client *VendorSKUsClient) NewListPager(vendorName string, options *VendorSKUsClientListOptions) *runtime.Pager[VendorSKUsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VendorSKUsClientListResponse]{ - More: func(page VendorSKUsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VendorSKUsClientListResponse) (VendorSKUsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, vendorName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VendorSKUsClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VendorSKUsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VendorSKUsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VendorSKUsClient) listCreateRequest(ctx context.Context, vendorName string, options *VendorSKUsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus" - if vendorName == "" { - return nil, errors.New("parameter vendorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) - 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", "2021-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VendorSKUsClient) listHandleResponse(resp *http.Response) (VendorSKUsClientListResponse, error) { - result := VendorSKUsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VendorSKUListResult); err != nil { - return VendorSKUsClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendorskus_client_example_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendorskus_client_example_test.go deleted file mode 100644 index df5ec4998895..000000000000 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/vendorskus_client_example_test.go +++ /dev/null @@ -1,527 +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 armhybridnetwork_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/hybridnetwork/armhybridnetwork" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuDelete.json -func ExampleVendorSKUsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVendorSKUsClient().BeginDelete(ctx, "TestVendor", "TestSku", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuGet.json -func ExampleVendorSKUsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVendorSKUsClient().Get(ctx, "TestVendor", "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.VendorSKU = armhybridnetwork.VendorSKU{ - // Name: to.Ptr("TestSku"), - // Type: to.Ptr("Microsoft.HybridNetwork/vendors/vendorskus"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/vendors/TestVendor/vendorskus/TestSku"), - // Properties: &armhybridnetwork.VendorSKUPropertiesFormat{ - // DeploymentMode: to.Ptr(armhybridnetwork.SKUDeploymentModePrivateEdgeZone), - // ManagedApplicationTemplate: map[string]any{ - // }, - // NetworkFunctionTemplate: &armhybridnetwork.NetworkFunctionTemplate{ - // NetworkFunctionRoleConfigurations: []*armhybridnetwork.NetworkFunctionRoleConfiguration{ - // { - // CustomProfile: &armhybridnetwork.CustomProfile{ - // MetadataConfigurationPath: to.Ptr("/var/logs/network.cfg"), - // }, - // NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic1"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchType("")), - // }, - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic2"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchType("")), - // }}, - // OSProfile: &armhybridnetwork.OsProfile{ - // AdminUsername: to.Ptr("dummyuser"), - // CustomData: to.Ptr("base-64 encoded string of custom data"), - // LinuxConfiguration: &armhybridnetwork.LinuxConfiguration{ - // SSH: &armhybridnetwork.SSHConfiguration{ - // PublicKeys: []*armhybridnetwork.SSHPublicKey{ - // { - // Path: to.Ptr("home/user/.ssh/authorized_keys"), - // KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAwrr66r8n6B8Y0zMF3dOpXEapIQD9DiYQ6D6/zwor9o39jSkHNiMMER/GETBbzP83LOcekm02aRjo55ArO7gPPVvCXbrirJu9pkm4AC4BBre5xSLS= user@constoso-DSH"), - // }}, - // }, - // }, - // }, - // RoleName: to.Ptr("test"), - // RoleType: to.Ptr(armhybridnetwork.NetworkFunctionRoleConfigurationTypeVirtualMachine), - // StorageProfile: &armhybridnetwork.StorageProfile{ - // DataDisks: []*armhybridnetwork.DataDisk{ - // { - // Name: to.Ptr("DataDisk1"), - // CreateOption: to.Ptr(armhybridnetwork.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](10), - // }}, - // ImageReference: &armhybridnetwork.ImageReference{ - // Offer: to.Ptr("UbuntuServer"), - // Publisher: to.Ptr("Canonical"), - // SKU: to.Ptr("18.04-LTS"), - // Version: to.Ptr("18.04.201804262"), - // }, - // OSDisk: &armhybridnetwork.OsDisk{ - // Name: to.Ptr("vhdName"), - // DiskSizeGB: to.Ptr[int32](30), - // OSType: to.Ptr(armhybridnetwork.OperatingSystemTypesLinux), - // Vhd: &armhybridnetwork.VirtualHardDisk{ - // }, - // }, - // }, - // VirtualMachineSize: to.Ptr(armhybridnetwork.VirtualMachineSizeTypesStandardD3V2), - // }}, - // }, - // Preview: to.Ptr(true), - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuCreate.json -func ExampleVendorSKUsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVendorSKUsClient().BeginCreateOrUpdate(ctx, "TestVendor", "TestSku", armhybridnetwork.VendorSKU{ - Properties: &armhybridnetwork.VendorSKUPropertiesFormat{ - DeploymentMode: to.Ptr(armhybridnetwork.SKUDeploymentModePrivateEdgeZone), - ManagedApplicationTemplate: map[string]any{}, - NetworkFunctionTemplate: &armhybridnetwork.NetworkFunctionTemplate{ - NetworkFunctionRoleConfigurations: []*armhybridnetwork.NetworkFunctionRoleConfiguration{ - { - CustomProfile: &armhybridnetwork.CustomProfile{ - MetadataConfigurationPath: to.Ptr("/var/logs/network.cfg"), - }, - NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - { - IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - { - Gateway: to.Ptr(""), - IPAddress: to.Ptr(""), - IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - Subnet: to.Ptr(""), - }}, - MacAddress: to.Ptr(""), - NetworkInterfaceName: to.Ptr("nic1"), - VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeWan), - }, - { - IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - { - Gateway: to.Ptr(""), - IPAddress: to.Ptr(""), - IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - Subnet: to.Ptr(""), - }}, - MacAddress: to.Ptr(""), - NetworkInterfaceName: to.Ptr("nic2"), - VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeManagement), - }}, - OSProfile: &armhybridnetwork.OsProfile{ - AdminUsername: to.Ptr("dummyuser"), - CustomData: to.Ptr("base-64 encoded string of custom data"), - LinuxConfiguration: &armhybridnetwork.LinuxConfiguration{ - SSH: &armhybridnetwork.SSHConfiguration{ - PublicKeys: []*armhybridnetwork.SSHPublicKey{ - { - Path: to.Ptr("home/user/.ssh/authorized_keys"), - KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAwrr66r8n6B8Y0zMF3dOpXEapIQD9DiYQ6D6/zwor9o39jSkHNiMMER/GETBbzP83LOcekm02aRjo55ArO7gPPVvCXbrirJu9pkm4AC4BBre5xSLS= user@constoso-DSH"), - }}, - }, - }, - }, - RoleName: to.Ptr("test"), - RoleType: to.Ptr(armhybridnetwork.NetworkFunctionRoleConfigurationTypeVirtualMachine), - StorageProfile: &armhybridnetwork.StorageProfile{ - DataDisks: []*armhybridnetwork.DataDisk{ - { - Name: to.Ptr("DataDisk1"), - CreateOption: to.Ptr(armhybridnetwork.DiskCreateOptionTypesEmpty), - DiskSizeGB: to.Ptr[int32](10), - }}, - ImageReference: &armhybridnetwork.ImageReference{ - Offer: to.Ptr("UbuntuServer"), - Publisher: to.Ptr("Canonical"), - SKU: to.Ptr("18.04-LTS"), - Version: to.Ptr("18.04.201804262"), - }, - OSDisk: &armhybridnetwork.OsDisk{ - Name: to.Ptr("vhdName"), - DiskSizeGB: to.Ptr[int32](30), - OSType: to.Ptr(armhybridnetwork.OperatingSystemTypesLinux), - Vhd: &armhybridnetwork.VirtualHardDisk{ - URI: to.Ptr("https://contoso.net/link/vnd.vhd?sp=rl&st=2020-10-08T20:38:19Z&se=2020-12-09T19:38:00Z&sv=2019-12-12&sr=b&sig=7BM2f4yOw%3D"), - }, - }, - }, - VirtualMachineSize: to.Ptr(armhybridnetwork.VirtualMachineSizeTypesStandardD3V2), - }}, - }, - Preview: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VendorSKU = armhybridnetwork.VendorSKU{ - // Name: to.Ptr("TestSku"), - // Type: to.Ptr("Microsoft.HybridNetwork/vendors/vendorskus"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/vendors/TestVendor/vendorskus/TestSku"), - // Properties: &armhybridnetwork.VendorSKUPropertiesFormat{ - // DeploymentMode: to.Ptr(armhybridnetwork.SKUDeploymentModePrivateEdgeZone), - // ManagedApplicationTemplate: map[string]any{ - // }, - // NetworkFunctionTemplate: &armhybridnetwork.NetworkFunctionTemplate{ - // NetworkFunctionRoleConfigurations: []*armhybridnetwork.NetworkFunctionRoleConfiguration{ - // { - // CustomProfile: &armhybridnetwork.CustomProfile{ - // MetadataConfigurationPath: to.Ptr("/var/logs/network.cfg"), - // }, - // NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic1"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeWan), - // }, - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic2"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchTypeManagement), - // }}, - // OSProfile: &armhybridnetwork.OsProfile{ - // AdminUsername: to.Ptr("dummyuser"), - // CustomData: to.Ptr("base-64 encoded string of custom data"), - // LinuxConfiguration: &armhybridnetwork.LinuxConfiguration{ - // SSH: &armhybridnetwork.SSHConfiguration{ - // PublicKeys: []*armhybridnetwork.SSHPublicKey{ - // { - // Path: to.Ptr("home/user/.ssh/authorized_keys"), - // KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAwrr66r8n6B8Y0zMF3dOpXEapIQD9DiYQ6D6/zwor9o39jSkHNiMMER/GETBbzP83LOcekm02aRjo55ArO7gPPVvCXbrirJu9pkm4AC4BBre5xSLS= user@constoso-DSH"), - // }}, - // }, - // }, - // }, - // RoleName: to.Ptr("test"), - // RoleType: to.Ptr(armhybridnetwork.NetworkFunctionRoleConfigurationTypeVirtualMachine), - // StorageProfile: &armhybridnetwork.StorageProfile{ - // DataDisks: []*armhybridnetwork.DataDisk{ - // { - // Name: to.Ptr("DataDisk1"), - // CreateOption: to.Ptr(armhybridnetwork.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](10), - // }}, - // ImageReference: &armhybridnetwork.ImageReference{ - // Offer: to.Ptr("UbuntuServer"), - // Publisher: to.Ptr("Canonical"), - // SKU: to.Ptr("18.04-LTS"), - // Version: to.Ptr("18.04.201804262"), - // }, - // OSDisk: &armhybridnetwork.OsDisk{ - // Name: to.Ptr("vhdName"), - // DiskSizeGB: to.Ptr[int32](30), - // OSType: to.Ptr(armhybridnetwork.OperatingSystemTypesLinux), - // Vhd: &armhybridnetwork.VirtualHardDisk{ - // }, - // }, - // }, - // VirtualMachineSize: to.Ptr(armhybridnetwork.VirtualMachineSizeTypesStandardD3V2), - // }}, - // }, - // Preview: to.Ptr(true), - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuListByVendor.json -func ExampleVendorSKUsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVendorSKUsClient().NewListPager("TestVendor", 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.VendorSKUListResult = armhybridnetwork.VendorSKUListResult{ - // Value: []*armhybridnetwork.VendorSKU{ - // { - // Name: to.Ptr("TestSku1"), - // Type: to.Ptr("Microsoft.HybridNetwork/vendors/vendorskus"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/vendors/TestVendor/vendorskus/TestSku1"), - // Properties: &armhybridnetwork.VendorSKUPropertiesFormat{ - // DeploymentMode: to.Ptr(armhybridnetwork.SKUDeploymentModePrivateEdgeZone), - // ManagedApplicationTemplate: map[string]any{ - // }, - // NetworkFunctionTemplate: &armhybridnetwork.NetworkFunctionTemplate{ - // NetworkFunctionRoleConfigurations: []*armhybridnetwork.NetworkFunctionRoleConfiguration{ - // { - // CustomProfile: &armhybridnetwork.CustomProfile{ - // MetadataConfigurationPath: to.Ptr("/var/logs/network.cfg"), - // }, - // NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic1"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchType("")), - // }, - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic2"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchType("")), - // }}, - // OSProfile: &armhybridnetwork.OsProfile{ - // AdminUsername: to.Ptr("dummyuser"), - // CustomData: to.Ptr("base-64 encoded string of custom data"), - // LinuxConfiguration: &armhybridnetwork.LinuxConfiguration{ - // SSH: &armhybridnetwork.SSHConfiguration{ - // PublicKeys: []*armhybridnetwork.SSHPublicKey{ - // { - // Path: to.Ptr("home/user/.ssh/authorized_keys"), - // KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAwrr66r8n6B8Y0zMF3dOpXEapIQD9DiYQ6D6/zwor9o39jSkHNiMMER/GETBbzP83LOcekm02aRjo55ArO7gPPVvCXbrirJu9pkm4AC4BBre5xSLS= user@constoso-DSH"), - // }}, - // }, - // }, - // }, - // RoleName: to.Ptr("test"), - // RoleType: to.Ptr(armhybridnetwork.NetworkFunctionRoleConfigurationTypeVirtualMachine), - // StorageProfile: &armhybridnetwork.StorageProfile{ - // DataDisks: []*armhybridnetwork.DataDisk{ - // { - // Name: to.Ptr("DataDisk1"), - // CreateOption: to.Ptr(armhybridnetwork.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](10), - // }}, - // ImageReference: &armhybridnetwork.ImageReference{ - // Offer: to.Ptr("UbuntuServer"), - // Publisher: to.Ptr("Canonical"), - // SKU: to.Ptr("18.04-LTS"), - // Version: to.Ptr("18.04.201804262"), - // }, - // OSDisk: &armhybridnetwork.OsDisk{ - // Name: to.Ptr("vhdName"), - // DiskSizeGB: to.Ptr[int32](30), - // OSType: to.Ptr(armhybridnetwork.OperatingSystemTypesLinux), - // Vhd: &armhybridnetwork.VirtualHardDisk{ - // }, - // }, - // }, - // VirtualMachineSize: to.Ptr(armhybridnetwork.VirtualMachineSizeTypesStandardD3V2), - // }}, - // }, - // Preview: to.Ptr(true), - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("TestSku2"), - // Type: to.Ptr("Microsoft.HybridNetwork/vendors/vendorskus"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HybridNetwork/vendors/TestVendor/vendorskus/TestSku2"), - // Properties: &armhybridnetwork.VendorSKUPropertiesFormat{ - // DeploymentMode: to.Ptr(armhybridnetwork.SKUDeploymentModePrivateEdgeZone), - // ManagedApplicationTemplate: map[string]any{ - // }, - // NetworkFunctionTemplate: &armhybridnetwork.NetworkFunctionTemplate{ - // NetworkFunctionRoleConfigurations: []*armhybridnetwork.NetworkFunctionRoleConfiguration{ - // { - // CustomProfile: &armhybridnetwork.CustomProfile{ - // MetadataConfigurationPath: to.Ptr("/var/logs/network.cfg"), - // }, - // NetworkInterfaces: []*armhybridnetwork.NetworkInterface{ - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic1"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchType("")), - // }, - // { - // IPConfigurations: []*armhybridnetwork.NetworkInterfaceIPConfiguration{ - // { - // Gateway: to.Ptr(""), - // IPAddress: to.Ptr(""), - // IPAllocationMethod: to.Ptr(armhybridnetwork.IPAllocationMethodDynamic), - // IPVersion: to.Ptr(armhybridnetwork.IPVersionIPv4), - // Subnet: to.Ptr(""), - // }}, - // MacAddress: to.Ptr(""), - // NetworkInterfaceName: to.Ptr("nic2"), - // VMSwitchType: to.Ptr(armhybridnetwork.VMSwitchType("")), - // }}, - // OSProfile: &armhybridnetwork.OsProfile{ - // AdminUsername: to.Ptr("dummyuser"), - // CustomData: to.Ptr("base-64 encoded string of custom data"), - // LinuxConfiguration: &armhybridnetwork.LinuxConfiguration{ - // SSH: &armhybridnetwork.SSHConfiguration{ - // PublicKeys: []*armhybridnetwork.SSHPublicKey{ - // { - // Path: to.Ptr("home/user/.ssh/authorized_keys"), - // KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAwrr66r8n6B8Y0zMF3dOpXEapIQD9DiYQ6D6/zwor9o39jSkHNiMMER/GETBbzP83LOcekm02aRjo55ArO7gPPVvCXbrirJu9pkm4AC4BBre5xSLS= user@constoso-DSH"), - // }}, - // }, - // }, - // }, - // RoleName: to.Ptr("test"), - // RoleType: to.Ptr(armhybridnetwork.NetworkFunctionRoleConfigurationTypeVirtualMachine), - // StorageProfile: &armhybridnetwork.StorageProfile{ - // DataDisks: []*armhybridnetwork.DataDisk{ - // { - // Name: to.Ptr("DataDisk1"), - // CreateOption: to.Ptr(armhybridnetwork.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](10), - // }}, - // ImageReference: &armhybridnetwork.ImageReference{ - // Offer: to.Ptr("UbuntuServer"), - // Publisher: to.Ptr("Canonical"), - // SKU: to.Ptr("18.04-LTS"), - // Version: to.Ptr("18.04.201804262"), - // }, - // OSDisk: &armhybridnetwork.OsDisk{ - // Name: to.Ptr("vhdName"), - // DiskSizeGB: to.Ptr[int32](30), - // OSType: to.Ptr(armhybridnetwork.OperatingSystemTypesLinux), - // Vhd: &armhybridnetwork.VirtualHardDisk{ - // }, - // }, - // }, - // VirtualMachineSize: to.Ptr(armhybridnetwork.VirtualMachineSizeTypesStandardD3V2), - // }}, - // }, - // Preview: to.Ptr(true), - // ProvisioningState: to.Ptr(armhybridnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -}