From 28636bd99849d3227960801bce61a8089bf4bda9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 11 Jul 2022 12:42:52 +0000 Subject: [PATCH] CodeGen from PR 17666 in Azure/azure-rest-api-specs Merge 507c81e8320b74cb1bd0421cc2114898e602e1d0 into 53740f04d2b1f9fab8ba6b0bdc0fde9b178c5987 --- .../devtestlabs/armdevtestlabs/CHANGELOG.md | 262 + ...lates_client.go => armtemplates_client.go} | 9 +- ...rtifacts_client.go => artifacts_client.go} | 13 +- ...es_client.go => artifactsources_client.go} | 23 +- .../devtestlabs/armdevtestlabs/autorest.md | 6 +- .../armdevtestlabs/bastionhosts_client.go | 420 + ...zz_generated_constants.go => constants.go} | 327 +- ...erated_costs_client.go => costs_client.go} | 9 +- ...mages_client.go => customimages_client.go} | 27 +- ...erated_disks_client.go => disks_client.go} | 39 +- ...ments_client.go => environments_client.go} | 27 +- ..._formulas_client.go => formulas_client.go} | 29 +- ...ages_client.go => galleryimages_client.go} | 66 +- ...es_client.go => globalschedules_client.go} | 39 +- .../devtestlabs/armdevtestlabs/go.mod | 16 +- .../devtestlabs/armdevtestlabs/go.sum | 24 +- ...enerated_labs_client.go => labs_client.go} | 111 +- .../armdevtestlabs/labsecrets_client.go | 394 + .../{zz_generated_models.go => models.go} | 1571 +++- .../armdevtestlabs/models_serde.go | 7955 +++++++++++++++++ ...ient.go => notificationchannels_client.go} | 29 +- ...rations_client.go => operations_client.go} | 5 +- ..._policies_client.go => policies_client.go} | 23 +- ...icysets_client.go => policysets_client.go} | 84 +- ...client.go => provideroperations_client.go} | 5 +- ...ed_response_types.go => response_types.go} | 126 + ...chedules_client.go => schedules_client.go} | 33 +- ...ed_secrets_client.go => secrets_client.go} | 25 +- ...ics_client.go => servicefabrics_client.go} | 47 +- ...nt.go => servicefabricschedules_client.go} | 29 +- ...ers_client.go => servicerunners_client.go} | 166 +- .../armdevtestlabs/sharedgalleries_client.go | 379 + .../armdevtestlabs/sharedimages_client.go | 404 + ...erated_time_rfc3339.go => time_rfc3339.go} | 1 + ...erated_users_client.go => users_client.go} | 27 +- ...es_client.go => virtualmachines_client.go} | 158 +- ...t.go => virtualmachineschedules_client.go} | 29 +- ...ks_client.go => virtualnetworks_client.go} | 27 +- ...erated_example_armtemplates_client_test.go | 72 - ...generated_example_artifacts_client_test.go | 102 - ...ted_example_artifactsources_client_test.go | 158 - .../ze_generated_example_costs_client_test.go | 121 - ...erated_example_customimages_client_test.go | 165 - .../ze_generated_example_disks_client_test.go | 221 - ...erated_example_environments_client_test.go | 164 - ..._generated_example_formulas_client_test.go | 188 - ...rated_example_galleryimages_client_test.go | 47 - ...ted_example_globalschedules_client_test.go | 235 - .../ze_generated_example_labs_client_test.go | 311 - ...xample_notificationchannels_client_test.go | 176 - ...enerated_example_operations_client_test.go | 39 - ..._generated_example_policies_client_test.go | 162 - ...enerated_example_policysets_client_test.go | 48 - ..._example_provideroperations_client_test.go | 41 - ...generated_example_schedules_client_test.go | 227 - ...e_generated_example_secrets_client_test.go | 157 - ...ated_example_servicefabrics_client_test.go | 242 - ...mple_servicefabricschedules_client_test.go | 216 - ...ated_example_servicerunners_client_test.go | 97 - .../ze_generated_example_users_client_test.go | 170 - ...ted_example_virtualmachines_client_test.go | 510 -- ...ple_virtualmachineschedules_client_test.go | 206 - ...ted_example_virtualnetworks_client_test.go | 157 - .../zz_generated_models_serde.go | 1853 ---- 64 files changed, 12243 insertions(+), 6806 deletions(-) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_armtemplates_client.go => armtemplates_client.go} (98%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_artifacts_client.go => artifacts_client.go} (97%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_artifactsources_client.go => artifactsources_client.go} (97%) create mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/bastionhosts_client.go rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_constants.go => constants.go} (57%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_costs_client.go => costs_client.go} (97%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_customimages_client.go => customimages_client.go} (96%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_disks_client.go => disks_client.go} (96%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_environments_client.go => environments_client.go} (96%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_formulas_client.go => formulas_client.go} (96%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_galleryimages_client.go => galleryimages_client.go} (64%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_globalschedules_client.go => globalschedules_client.go} (96%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_labs_client.go => labs_client.go} (90%) create mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/labsecrets_client.go rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_models.go => models.go} (65%) create mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/models_serde.go rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_notificationchannels_client.go => notificationchannels_client.go} (96%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_operations_client.go => operations_client.go} (97%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_policies_client.go => policies_client.go} (97%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_policysets_client.go => policysets_client.go} (59%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_provideroperations_client.go => provideroperations_client.go} (97%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_response_types.go => response_types.go} (84%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_schedules_client.go => schedules_client.go} (96%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_secrets_client.go => secrets_client.go} (97%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_servicefabrics_client.go => servicefabrics_client.go} (96%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_servicefabricschedules_client.go => servicefabricschedules_client.go} (97%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_servicerunners_client.go => servicerunners_client.go} (56%) create mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/sharedgalleries_client.go create mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/sharedimages_client.go rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_time_rfc3339.go => time_rfc3339.go} (99%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_users_client.go => users_client.go} (96%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_virtualmachines_client.go => virtualmachines_client.go} (92%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_virtualmachineschedules_client.go => virtualmachineschedules_client.go} (97%) rename sdk/resourcemanager/devtestlabs/armdevtestlabs/{zz_generated_virtualnetworks_client.go => virtualnetworks_client.go} (96%) delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_armtemplates_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifacts_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifactsources_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_costs_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_customimages_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_disks_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_environments_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_formulas_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_galleryimages_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_globalschedules_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_labs_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_notificationchannels_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_operations_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_policies_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_policysets_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_provideroperations_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_schedules_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_secrets_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_servicefabrics_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_servicefabricschedules_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_servicerunners_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_users_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_virtualmachines_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_virtualmachineschedules_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_virtualnetworks_client_test.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_models_serde.go diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/CHANGELOG.md b/sdk/resourcemanager/devtestlabs/armdevtestlabs/CHANGELOG.md index 1c224d6b5d00..c857284642a8 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/CHANGELOG.md +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/CHANGELOG.md @@ -1,5 +1,267 @@ # Release History +## 2.0.0 (2022-07-11) +### Breaking Changes + +- Type of `LabVirtualMachineCreationParameterProperties.StorageType` has been changed from `*string` to `*StorageType` +- Type of `LabVirtualMachineProperties.StorageType` has been changed from `*string` to `*StorageTypes` +- Function `*ServiceRunnersClient.CreateOrUpdate` has been removed +- Function `*ServiceRunnersClient.Delete` has been removed +- Struct `ApplicableScheduleFragment` has been removed +- Struct `ServiceRunnersClientCreateOrUpdateOptions` has been removed +- Struct `ServiceRunnersClientDeleteOptions` has been removed +- Struct `ShutdownNotificationContent` has been removed + +### Features Added + +- New const `HTTPStatusCodeUnprocessableEntity` +- New const `HTTPStatusCodeVariantAlsoNegotiates` +- New const `OsTypeLinux` +- New const `OriginUser` +- New const `HTTPStatusCodeInsufficientStorage` +- New const `HTTPStatusCodeMultiStatus` +- New const `EncryptionStatusEnabled` +- New const `HTTPStatusCodeIMUsed` +- New const `EncryptionTypeEncryptionAtRestWithCustomerKey` +- New const `HTTPStatusCodeRequestHeaderFieldsTooLarge` +- New const `SKUTierBasic` +- New const `HTTPStatusCodeLocked` +- New const `OriginSystem` +- New const `HTTPStatusCodeFailedDependency` +- New const `EncryptionStatusDisabled` +- New const `HTTPStatusCodeUnavailableForLegalReasons` +- New const `HTTPStatusCodeNotExtended` +- New const `ImageTypeGeneralized` +- New const `CreatedByTypeManagedIdentity` +- New const `CheckNameAvailabilityReasonInvalid` +- New const `HTTPStatusCodePermanentRedirect` +- New const `EnableStateDisabled` +- New const `EncryptionTypeEncryptionAtRestWithPlatformKey` +- New const `HTTPStatusCodePreconditionRequired` +- New const `HTTPStatusCodeTooManyRequests` +- New const `OriginUserSystem` +- New const `HTTPStatusCodeMisdirectedRequest` +- New const `ImageTypeSpecialized` +- New const `StorageTypesPremium` +- New const `CheckNameAvailabilityReasonAlreadyExists` +- New const `CreatedByTypeUser` +- New const `CreatedByTypeApplication` +- New const `SKUTierFree` +- New const `HTTPStatusCodeProcessing` +- New const `SKUTierPremium` +- New const `StorageTypesStandardSSD` +- New const `CreatedByTypeKey` +- New const `HTTPStatusCodeNetworkAuthenticationRequired` +- New const `OsTypeWindows` +- New const `ActionTypeInternal` +- New const `HTTPStatusCodeLoopDetected` +- New const `HTTPStatusCodeAlreadyReported` +- New const `StorageTypesStandard` +- New const `EnableStateEnabled` +- New const `HTTPStatusCodeEarlyHints` +- New const `SKUTierStandard` +- New function `*SharedImagesClient.Get(context.Context, string, string, string, string, *SharedImagesClientGetOptions) (SharedImagesClientGetResponse, error)` +- New function `PossibleEncryptionStatusValues() []EncryptionStatus` +- New function `*SharedGalleriesClient.Delete(context.Context, string, string, string, *SharedGalleriesClientDeleteOptions) (SharedGalleriesClientDeleteResponse, error)` +- New function `*BastionHostsClient.Get(context.Context, string, string, string, string, *BastionHostsClientGetOptions) (BastionHostsClientGetResponse, error)` +- New function `PossibleEnableStateValues() []EnableState` +- New function `*ServiceRunnersClient.BeginCreateOrUpdate(context.Context, string, string, string, ServiceRunner, *ServiceRunnersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServiceRunnersClientCreateOrUpdateResponse], error)` +- New function `*LabsClient.EnsureCurrentUserProfile(context.Context, string, string, *LabsClientEnsureCurrentUserProfileOptions) (LabsClientEnsureCurrentUserProfileResponse, error)` +- New function `*BastionHostsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, BastionHost, *BastionHostsClientBeginCreateOrUpdateOptions) (*runtime.Poller[BastionHostsClientCreateOrUpdateResponse], error)` +- New function `NewSharedImagesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SharedImagesClient, error)` +- New function `*LabSecretsClient.NewListPager(string, string, *LabSecretsClientListOptions) *runtime.Pager[LabSecretsClientListResponse]` +- New function `PossibleStorageTypesValues() []StorageTypes` +- New function `PossibleSKUTierValues() []SKUTier` +- New function `*LabSecretsClient.BeginDelete(context.Context, string, string, string, *LabSecretsClientBeginDeleteOptions) (*runtime.Poller[LabSecretsClientDeleteResponse], error)` +- New function `*ServiceRunnersClient.BeginDelete(context.Context, string, string, string, *ServiceRunnersClientBeginDeleteOptions) (*runtime.Poller[ServiceRunnersClientDeleteResponse], error)` +- New function `PossibleActionTypeValues() []ActionType` +- New function `*SharedGalleriesClient.Update(context.Context, string, string, string, SharedGalleryFragment, *SharedGalleriesClientUpdateOptions) (SharedGalleriesClientUpdateResponse, error)` +- New function `PossibleOriginValues() []Origin` +- New function `PossibleOsTypeValues() []OsType` +- New function `*SharedImagesClient.CreateOrUpdate(context.Context, string, string, string, string, SharedImage, *SharedImagesClientCreateOrUpdateOptions) (SharedImagesClientCreateOrUpdateResponse, error)` +- New function `*SharedGalleriesClient.NewListPager(string, string, *SharedGalleriesClientListOptions) *runtime.Pager[SharedGalleriesClientListResponse]` +- New function `NewBastionHostsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*BastionHostsClient, error)` +- New function `NewSharedGalleriesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SharedGalleriesClient, error)` +- New function `*LabSecretsClient.Update(context.Context, string, string, string, SecretFragment, *LabSecretsClientUpdateOptions) (LabSecretsClientUpdateResponse, error)` +- New function `*SharedGalleriesClient.Get(context.Context, string, string, string, *SharedGalleriesClientGetOptions) (SharedGalleriesClientGetResponse, error)` +- New function `*ServiceRunnersClient.NewListPager(string, string, *ServiceRunnersClientListOptions) *runtime.Pager[ServiceRunnersClientListResponse]` +- New function `*LabSecretsClient.BeginCreateOrUpdate(context.Context, string, string, string, LabSecret, *LabSecretsClientBeginCreateOrUpdateOptions) (*runtime.Poller[LabSecretsClientCreateOrUpdateResponse], error)` +- New function `NewLabSecretsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LabSecretsClient, error)` +- New function `*GalleryImagesClient.Get(context.Context, string, string, string, *GalleryImagesClientGetOptions) (GalleryImagesClientGetResponse, error)` +- New function `*VirtualMachinesClient.ClearArtifactResults(context.Context, string, string, string, *VirtualMachinesClientClearArtifactResultsOptions) (VirtualMachinesClientClearArtifactResultsResponse, error)` +- New function `PossibleImageTypeValues() []ImageType` +- New function `PossibleCreatedByTypeValues() []CreatedByType` +- New function `PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason` +- New function `PossibleEncryptionTypeValues() []EncryptionType` +- New function `*BastionHostsClient.NewListPager(string, string, string, *BastionHostsClientListOptions) *runtime.Pager[BastionHostsClientListResponse]` +- New function `*BastionHostsClient.Update(context.Context, string, string, string, string, BastionHostFragment, *BastionHostsClientUpdateOptions) (BastionHostsClientUpdateResponse, error)` +- New function `*LabSecretsClient.Get(context.Context, string, string, string, *LabSecretsClientGetOptions) (LabSecretsClientGetResponse, error)` +- New function `*SharedGalleriesClient.CreateOrUpdate(context.Context, string, string, string, SharedGallery, *SharedGalleriesClientCreateOrUpdateOptions) (SharedGalleriesClientCreateOrUpdateResponse, error)` +- New function `*PolicySetsClient.NewListPager(string, string, *PolicySetsClientListOptions) *runtime.Pager[PolicySetsClientListResponse]` +- New function `*SharedImagesClient.Delete(context.Context, string, string, string, string, *SharedImagesClientDeleteOptions) (SharedImagesClientDeleteResponse, error)` +- New function `*SharedImagesClient.Update(context.Context, string, string, string, string, SharedImageFragment, *SharedImagesClientUpdateOptions) (SharedImagesClientUpdateResponse, error)` +- New function `*BastionHostsClient.BeginDelete(context.Context, string, string, string, string, *BastionHostsClientBeginDeleteOptions) (*runtime.Poller[BastionHostsClientDeleteResponse], error)` +- New function `*SharedImagesClient.NewListPager(string, string, string, *SharedImagesClientListOptions) *runtime.Pager[SharedImagesClientListResponse]` +- New struct `AzureEntityResource` +- New struct `BastionHost` +- New struct `BastionHostFragment` +- New struct `BastionHostList` +- New struct `BastionHostProperties` +- New struct `BastionHostsClient` +- New struct `BastionHostsClientBeginCreateOrUpdateOptions` +- New struct `BastionHostsClientBeginDeleteOptions` +- New struct `BastionHostsClientCreateOrUpdateResponse` +- New struct `BastionHostsClientDeleteResponse` +- New struct `BastionHostsClientGetOptions` +- New struct `BastionHostsClientGetResponse` +- New struct `BastionHostsClientListOptions` +- New struct `BastionHostsClientListResponse` +- New struct `BastionHostsClientUpdateOptions` +- New struct `BastionHostsClientUpdateResponse` +- New struct `CheckNameAvailabilityRequest` +- New struct `CheckNameAvailabilityResponse` +- New struct `Cost` +- New struct `CustomImagePropertiesFromPlanFragment` +- New struct `Encryption` +- New struct `EncryptionProperties` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `ErrorResponse` +- New struct `GalleryImagesClientGetOptions` +- New struct `GalleryImagesClientGetResponse` +- New struct `Identity` +- New struct `ImageVersionProperties` +- New struct `KeyVaultProperties` +- New struct `LabCostList` +- New struct `LabSecret` +- New struct `LabSecretFragment` +- New struct `LabSecretList` +- New struct `LabSecretProperties` +- New struct `LabSecretsClient` +- New struct `LabSecretsClientBeginCreateOrUpdateOptions` +- New struct `LabSecretsClientBeginDeleteOptions` +- New struct `LabSecretsClientCreateOrUpdateResponse` +- New struct `LabSecretsClientDeleteResponse` +- New struct `LabSecretsClientGetOptions` +- New struct `LabSecretsClientGetResponse` +- New struct `LabSecretsClientListOptions` +- New struct `LabSecretsClientListResponse` +- New struct `LabSecretsClientUpdateOptions` +- New struct `LabSecretsClientUpdateResponse` +- New struct `LabsClientEnsureCurrentUserProfileOptions` +- New struct `LabsClientEnsureCurrentUserProfileResponse` +- New struct `LocationData` +- New struct `Operation` +- New struct `OperationDisplay` +- New struct `OperationListResult` +- New struct `OperationStatusResult` +- New struct `Plan` +- New struct `PolicySet` +- New struct `PolicySetList` +- New struct `PolicySetProperties` +- New struct `PolicySetsClientListOptions` +- New struct `PolicySetsClientListResponse` +- New struct `ProxyResource` +- New struct `ResourceModelWithAllowedPropertySet` +- New struct `ResourceModelWithAllowedPropertySetIdentity` +- New struct `ResourceModelWithAllowedPropertySetPlan` +- New struct `ResourceModelWithAllowedPropertySetSKU` +- New struct `SKU` +- New struct `ServiceRunnerProperties` +- New struct `ServiceRunnersClientBeginCreateOrUpdateOptions` +- New struct `ServiceRunnersClientBeginDeleteOptions` +- New struct `ServiceRunnersClientListOptions` +- New struct `ServiceRunnersClientListResponse` +- New struct `SharedGalleriesClient` +- New struct `SharedGalleriesClientCreateOrUpdateOptions` +- New struct `SharedGalleriesClientCreateOrUpdateResponse` +- New struct `SharedGalleriesClientDeleteOptions` +- New struct `SharedGalleriesClientDeleteResponse` +- New struct `SharedGalleriesClientGetOptions` +- New struct `SharedGalleriesClientGetResponse` +- New struct `SharedGalleriesClientListOptions` +- New struct `SharedGalleriesClientListResponse` +- New struct `SharedGalleriesClientUpdateOptions` +- New struct `SharedGalleriesClientUpdateResponse` +- New struct `SharedGallery` +- New struct `SharedGalleryFragment` +- New struct `SharedGalleryList` +- New struct `SharedGalleryProperties` +- New struct `SharedImage` +- New struct `SharedImageFragment` +- New struct `SharedImageList` +- New struct `SharedImageProperties` +- New struct `SharedImagesClient` +- New struct `SharedImagesClientCreateOrUpdateOptions` +- New struct `SharedImagesClientCreateOrUpdateResponse` +- New struct `SharedImagesClientDeleteOptions` +- New struct `SharedImagesClientDeleteResponse` +- New struct `SharedImagesClientGetOptions` +- New struct `SharedImagesClientGetResponse` +- New struct `SharedImagesClientListOptions` +- New struct `SharedImagesClientListResponse` +- New struct `SharedImagesClientUpdateOptions` +- New struct `SharedImagesClientUpdateResponse` +- New struct `SystemData` +- New struct `VirtualMachinesClientClearArtifactResultsOptions` +- New struct `VirtualMachinesClientClearArtifactResultsResponse` +- New struct `WeekDetailsFragment` +- New field `SystemData` in struct `Secret` +- New field `SystemData` in struct `Formula` +- New field `BrowserConnect` in struct `LabProperties` +- New field `IsolateLabResources` in struct `LabProperties` +- New field `ManagementIdentities` in struct `LabProperties` +- New field `DefaultSecretName` in struct `LabProperties` +- New field `DisableAutoUpgradeCseMinorVersion` in struct `LabProperties` +- New field `Encryption` in struct `LabProperties` +- New field `ProvisioningState` in struct `LabVirtualMachineCreationParameterProperties` +- New field `Fqdn` in struct `LabVirtualMachineCreationParameterProperties` +- New field `ApplicableSchedule` in struct `LabVirtualMachineCreationParameterProperties` +- New field `CreatedByUserID` in struct `LabVirtualMachineCreationParameterProperties` +- New field `SharedImageVersion` in struct `LabVirtualMachineCreationParameterProperties` +- New field `ComputeID` in struct `LabVirtualMachineCreationParameterProperties` +- New field `GalleryImageVersionID` in struct `LabVirtualMachineCreationParameterProperties` +- New field `CreatedByUser` in struct `LabVirtualMachineCreationParameterProperties` +- New field `ArtifactDeploymentStatus` in struct `LabVirtualMachineCreationParameterProperties` +- New field `OSDiskSizeGb` in struct `LabVirtualMachineCreationParameterProperties` +- New field `LastKnownPowerState` in struct `LabVirtualMachineCreationParameterProperties` +- New field `UniqueIdentifier` in struct `LabVirtualMachineCreationParameterProperties` +- New field `OSType` in struct `LabVirtualMachineCreationParameterProperties` +- New field `VirtualMachineCreationSource` in struct `LabVirtualMachineCreationParameterProperties` +- New field `SharedImageID` in struct `LabVirtualMachineCreationParameterProperties` +- New field `ComputeVM` in struct `LabVirtualMachineCreationParameterProperties` +- New field `CanApplyArtifacts` in struct `LabVirtualMachineCreationParameterProperties` +- New field `CreatedDate` in struct `ScheduleCreationParameterProperties` +- New field `ProvisioningState` in struct `ScheduleCreationParameterProperties` +- New field `UniqueIdentifier` in struct `ScheduleCreationParameterProperties` +- New field `SystemData` in struct `NotificationChannel` +- New field `SystemData` in struct `LabVirtualMachine` +- New field `SystemData` in struct `VirtualNetwork` +- New field `SystemData` in struct `ServiceFabric` +- New field `SharedImageVersion` in struct `LabVirtualMachineProperties` +- New field `CanApplyArtifacts` in struct `LabVirtualMachineProperties` +- New field `GalleryImageVersionID` in struct `LabVirtualMachineProperties` +- New field `OSDiskSizeGb` in struct `LabVirtualMachineProperties` +- New field `SharedImageID` in struct `LabVirtualMachineProperties` +- New field `UserAssignedIdentities` in struct `IdentityProperties` +- New field `SystemData` in struct `Lab` +- New field `Identity` in struct `Lab` +- New field `SystemData` in struct `GalleryImage` +- New field `SystemData` in struct `Artifact` +- New field `SystemData` in struct `LabCost` +- New field `SystemData` in struct `Schedule` +- New field `SystemData` in struct `ArmTemplate` +- New field `SystemData` in struct `User` +- New field `SystemData` in struct `DtlEnvironment` +- New field `SystemData` in struct `Disk` +- New field `Properties` in struct `ServiceRunner` +- New field `SystemData` in struct `ServiceRunner` +- New field `SystemData` in struct `CustomImage` +- New field `SystemData` in struct `ArtifactSource` +- New field `SystemData` in struct `Policy` +- New field `SystemData` in struct `ApplicableSchedule` + + ## 1.0.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_armtemplates_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/armtemplates_client.go similarity index 98% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_armtemplates_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/armtemplates_client.go index 972376d1a4ea..43a68a4f53b4 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_armtemplates_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/armtemplates_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -57,7 +58,7 @@ func NewArmTemplatesClient(subscriptionID string, credential azcore.TokenCredent // Get - Get azure resource manager template. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // artifactSourceName - The name of the artifact source. @@ -109,7 +110,7 @@ func (client *ArmTemplatesClient) getCreateRequest(ctx context.Context, resource if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -126,7 +127,7 @@ func (client *ArmTemplatesClient) getHandleResponse(resp *http.Response) (ArmTem // NewListPager - List azure resource manager templates in a given artifact source. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // artifactSourceName - The name of the artifact source. @@ -195,7 +196,7 @@ func (client *ArmTemplatesClient) listCreateRequest(ctx context.Context, resourc if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_artifacts_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/artifacts_client.go similarity index 97% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_artifacts_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/artifacts_client.go index 09c4dc7f0595..b5f3cec76338 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_artifacts_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/artifacts_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -58,7 +59,7 @@ func NewArtifactsClient(subscriptionID string, credential azcore.TokenCredential // GenerateArmTemplate - Generates an ARM template for the given artifact, uploads the required files to a storage account, // and validates the generated artifact. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // artifactSourceName - The name of the artifact source. @@ -109,7 +110,7 @@ func (client *ArtifactsClient) generateArmTemplateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, generateArmTemplateRequest) @@ -126,7 +127,7 @@ func (client *ArtifactsClient) generateArmTemplateHandleResponse(resp *http.Resp // Get - Get artifact. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // artifactSourceName - The name of the artifact source. @@ -178,7 +179,7 @@ func (client *ArtifactsClient) getCreateRequest(ctx context.Context, resourceGro if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -195,7 +196,7 @@ func (client *ArtifactsClient) getHandleResponse(resp *http.Response) (Artifacts // NewListPager - List artifacts in a given artifact source. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // artifactSourceName - The name of the artifact source. @@ -264,7 +265,7 @@ func (client *ArtifactsClient) listCreateRequest(ctx context.Context, resourceGr if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_artifactsources_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/artifactsources_client.go similarity index 97% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_artifactsources_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/artifactsources_client.go index c8b5c1ea8246..c6f6e21663f9 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_artifactsources_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/artifactsources_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -57,7 +58,7 @@ func NewArtifactSourcesClient(subscriptionID string, credential azcore.TokenCred // CreateOrUpdate - Create or replace an existing artifact source. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the artifact source. @@ -103,7 +104,7 @@ func (client *ArtifactSourcesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, artifactSource) @@ -120,7 +121,7 @@ func (client *ArtifactSourcesClient) createOrUpdateHandleResponse(resp *http.Res // Delete - Delete artifact source. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the artifact source. @@ -164,7 +165,7 @@ func (client *ArtifactSourcesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +173,7 @@ func (client *ArtifactSourcesClient) deleteCreateRequest(ctx context.Context, re // Get - Get artifact source. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the artifact source. @@ -219,7 +220,7 @@ func (client *ArtifactSourcesClient) getCreateRequest(ctx context.Context, resou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,7 +237,7 @@ func (client *ArtifactSourcesClient) getHandleResponse(resp *http.Response) (Art // NewListPager - List artifact sources in a given lab. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // options - ArtifactSourcesClientListOptions contains the optional parameters for the ArtifactSourcesClient.List method. @@ -300,7 +301,7 @@ func (client *ArtifactSourcesClient) listCreateRequest(ctx context.Context, reso if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -317,11 +318,11 @@ func (client *ArtifactSourcesClient) listHandleResponse(resp *http.Response) (Ar // Update - Allows modifying tags of artifact sources. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the artifact source. -// artifactSource - Properties of an artifact source. +// artifactSource - Allows modifying tags of artifact sources. All other properties will be ignored. // options - ArtifactSourcesClientUpdateOptions contains the optional parameters for the ArtifactSourcesClient.Update method. func (client *ArtifactSourcesClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, artifactSource ArtifactSourceFragment, options *ArtifactSourcesClientUpdateOptions) (ArtifactSourcesClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, name, artifactSource, options) @@ -362,7 +363,7 @@ func (client *ArtifactSourcesClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, artifactSource) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/autorest.md b/sdk/resourcemanager/devtestlabs/armdevtestlabs/autorest.md index 288146e0a692..3a8a5497be46 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/autorest.md +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/devtestlabs/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/devtestlabs/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/bastionhosts_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/bastionhosts_client.go new file mode 100644 index 000000000000..99c1a88c94e8 --- /dev/null +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/bastionhosts_client.go @@ -0,0 +1,420 @@ +//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 armdevtestlabs + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// BastionHostsClient contains the methods for the BastionHosts group. +// Don't use this type directly, use NewBastionHostsClient() instead. +type BastionHostsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewBastionHostsClient creates a new instance of BastionHostsClient with the specified values. +// subscriptionID - The subscription ID. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewBastionHostsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BastionHostsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &BastionHostsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or replace an existing bastionHost. This operation can take a while to complete. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// virtualNetworkName - The name of the virtual network. +// name - The name of the bastionhost. +// bastionHost - Profile of a Bastion Host +// options - BastionHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the BastionHostsClient.BeginCreateOrUpdate +// method. +func (client *BastionHostsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, virtualNetworkName string, name string, bastionHost BastionHost, options *BastionHostsClientBeginCreateOrUpdateOptions) (*runtime.Poller[BastionHostsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, labName, virtualNetworkName, name, bastionHost, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[BastionHostsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[BastionHostsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create or replace an existing bastionHost. This operation can take a while to complete. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +func (client *BastionHostsClient) createOrUpdate(ctx context.Context, resourceGroupName string, labName string, virtualNetworkName string, name string, bastionHost BastionHost, options *BastionHostsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, labName, virtualNetworkName, name, bastionHost, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *BastionHostsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, labName string, virtualNetworkName string, name string, bastionHost BastionHost, options *BastionHostsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, bastionHost) +} + +// BeginDelete - Delete bastionhost. This operation can take a while to complete. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// virtualNetworkName - The name of the virtual network. +// name - The name of the bastionhost. +// options - BastionHostsClientBeginDeleteOptions contains the optional parameters for the BastionHostsClient.BeginDelete +// method. +func (client *BastionHostsClient) BeginDelete(ctx context.Context, resourceGroupName string, labName string, virtualNetworkName string, name string, options *BastionHostsClientBeginDeleteOptions) (*runtime.Poller[BastionHostsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, labName, virtualNetworkName, name, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[BastionHostsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[BastionHostsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete bastionhost. This operation can take a while to complete. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +func (client *BastionHostsClient) deleteOperation(ctx context.Context, resourceGroupName string, labName string, virtualNetworkName string, name string, options *BastionHostsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, labName, virtualNetworkName, name, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *BastionHostsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, labName string, virtualNetworkName string, name string, options *BastionHostsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get bastionhost. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// virtualNetworkName - The name of the virtual network. +// name - The name of the bastionhost. +// options - BastionHostsClientGetOptions contains the optional parameters for the BastionHostsClient.Get method. +func (client *BastionHostsClient) Get(ctx context.Context, resourceGroupName string, labName string, virtualNetworkName string, name string, options *BastionHostsClientGetOptions) (BastionHostsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, labName, virtualNetworkName, name, options) + if err != nil { + return BastionHostsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BastionHostsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BastionHostsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *BastionHostsClient) getCreateRequest(ctx context.Context, resourceGroupName string, labName string, virtualNetworkName string, name string, options *BastionHostsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-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 *BastionHostsClient) getHandleResponse(resp *http.Response) (BastionHostsClientGetResponse, error) { + result := BastionHostsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BastionHost); err != nil { + return BastionHostsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List bastionhosts in a given virtual network. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// virtualNetworkName - The name of the virtual network. +// options - BastionHostsClientListOptions contains the optional parameters for the BastionHostsClient.List method. +func (client *BastionHostsClient) NewListPager(resourceGroupName string, labName string, virtualNetworkName string, options *BastionHostsClientListOptions) *runtime.Pager[BastionHostsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[BastionHostsClientListResponse]{ + More: func(page BastionHostsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *BastionHostsClientListResponse) (BastionHostsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, labName, virtualNetworkName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return BastionHostsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BastionHostsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BastionHostsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *BastionHostsClient) listCreateRequest(ctx context.Context, resourceGroupName string, labName string, virtualNetworkName string, options *BastionHostsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Orderby != nil { + reqQP.Set("$orderby", *options.Orderby) + } + reqQP.Set("api-version", "2021-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 *BastionHostsClient) listHandleResponse(resp *http.Response) (BastionHostsClientListResponse, error) { + result := BastionHostsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BastionHostList); err != nil { + return BastionHostsClientListResponse{}, err + } + return result, nil +} + +// Update - Allows modifying tags of bastionhosts. All other properties will be ignored. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// virtualNetworkName - The name of the virtual network. +// name - The name of the bastionhost. +// bastionHost - Allows modifying tags of bastionhosts. All other properties will be ignored. +// options - BastionHostsClientUpdateOptions contains the optional parameters for the BastionHostsClient.Update method. +func (client *BastionHostsClient) Update(ctx context.Context, resourceGroupName string, labName string, virtualNetworkName string, name string, bastionHost BastionHostFragment, options *BastionHostsClientUpdateOptions) (BastionHostsClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, virtualNetworkName, name, bastionHost, options) + if err != nil { + return BastionHostsClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BastionHostsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BastionHostsClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *BastionHostsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, labName string, virtualNetworkName string, name string, bastionHost BastionHostFragment, options *BastionHostsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, bastionHost) +} + +// updateHandleResponse handles the Update response. +func (client *BastionHostsClient) updateHandleResponse(resp *http.Response) (BastionHostsClientUpdateResponse, error) { + result := BastionHostsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BastionHost); err != nil { + return BastionHostsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_constants.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/constants.go similarity index 57% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_constants.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/constants.go index 4849c50f60f1..e55a572d5102 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_constants.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/constants.go @@ -5,14 +5,45 @@ // 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 armdevtestlabs const ( moduleName = "armdevtestlabs" - moduleVersion = "v1.0.0" + 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, + } +} + +// CheckNameAvailabilityReason - The reason why the given name is not available. +type CheckNameAvailabilityReason string + +const ( + CheckNameAvailabilityReasonAlreadyExists CheckNameAvailabilityReason = "AlreadyExists" + CheckNameAvailabilityReasonInvalid CheckNameAvailabilityReason = "Invalid" +) + +// PossibleCheckNameAvailabilityReasonValues returns the possible values for the CheckNameAvailabilityReason const type. +func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { + return []CheckNameAvailabilityReason{ + CheckNameAvailabilityReasonAlreadyExists, + CheckNameAvailabilityReasonInvalid, + } +} + // CostThresholdStatus - Indicates whether this threshold will be displayed on cost charts. type CostThresholdStatus string @@ -47,6 +78,26 @@ func PossibleCostTypeValues() []CostType { } } +// CreatedByType - The type of identity that created the resource. +type CreatedByType string + +const ( + CreatedByTypeApplication CreatedByType = "Application" + CreatedByTypeKey CreatedByType = "Key" + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + // CustomImageOsType - The OS type of the custom image (i.e. Windows, Linux) type CustomImageOsType string @@ -65,6 +116,23 @@ func PossibleCustomImageOsTypeValues() []CustomImageOsType { } } +// EnableState - Enables all images in the gallery to be available in the lab for VM creation. This will override the EnableState +// on shared images +type EnableState string + +const ( + EnableStateDisabled EnableState = "Disabled" + EnableStateEnabled EnableState = "Enabled" +) + +// PossibleEnableStateValues returns the possible values for the EnableState const type. +func PossibleEnableStateValues() []EnableState { + return []EnableState{ + EnableStateDisabled, + EnableStateEnabled, + } +} + // EnableStatus - Indicates if the artifact source is enabled (values: Enabled, Disabled). type EnableStatus string @@ -81,6 +149,39 @@ func PossibleEnableStatusValues() []EnableStatus { } } +// EncryptionStatus - Indicates whether or not the encryption is enabled for container registry. +type EncryptionStatus string + +const ( + EncryptionStatusDisabled EncryptionStatus = "disabled" + EncryptionStatusEnabled EncryptionStatus = "enabled" +) + +// PossibleEncryptionStatusValues returns the possible values for the EncryptionStatus const type. +func PossibleEncryptionStatusValues() []EncryptionStatus { + return []EncryptionStatus{ + EncryptionStatusDisabled, + EncryptionStatusEnabled, + } +} + +// EncryptionType - Gets or sets the type of key used to encrypt the data of the disk. Possible values include: 'EncryptionAtRestWithPlatformKey', +// 'EncryptionAtRestWithCustomerKey' +type EncryptionType string + +const ( + EncryptionTypeEncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" + EncryptionTypeEncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" +) + +// PossibleEncryptionTypeValues returns the possible values for the EncryptionType const type. +func PossibleEncryptionTypeValues() []EncryptionType { + return []EncryptionType{ + EncryptionTypeEncryptionAtRestWithCustomerKey, + EncryptionTypeEncryptionAtRestWithPlatformKey, + } +} + // EnvironmentPermission - The access rights to be granted to the user when provisioning an environment type EnvironmentPermission string @@ -117,92 +218,126 @@ func PossibleFileUploadOptionsValues() []FileUploadOptions { type HTTPStatusCode string const ( - HTTPStatusCodeAccepted HTTPStatusCode = "Accepted" - HTTPStatusCodeAmbiguous HTTPStatusCode = "Ambiguous" - HTTPStatusCodeBadGateway HTTPStatusCode = "BadGateway" - HTTPStatusCodeBadRequest HTTPStatusCode = "BadRequest" - HTTPStatusCodeConflict HTTPStatusCode = "Conflict" - HTTPStatusCodeContinue HTTPStatusCode = "Continue" - HTTPStatusCodeCreated HTTPStatusCode = "Created" - HTTPStatusCodeExpectationFailed HTTPStatusCode = "ExpectationFailed" - HTTPStatusCodeForbidden HTTPStatusCode = "Forbidden" - HTTPStatusCodeFound HTTPStatusCode = "Found" - HTTPStatusCodeGatewayTimeout HTTPStatusCode = "GatewayTimeout" - HTTPStatusCodeGone HTTPStatusCode = "Gone" - HTTPStatusCodeHTTPVersionNotSupported HTTPStatusCode = "HttpVersionNotSupported" - HTTPStatusCodeInternalServerError HTTPStatusCode = "InternalServerError" - HTTPStatusCodeLengthRequired HTTPStatusCode = "LengthRequired" - HTTPStatusCodeMethodNotAllowed HTTPStatusCode = "MethodNotAllowed" - HTTPStatusCodeMoved HTTPStatusCode = "Moved" - HTTPStatusCodeMovedPermanently HTTPStatusCode = "MovedPermanently" - HTTPStatusCodeMultipleChoices HTTPStatusCode = "MultipleChoices" - HTTPStatusCodeNoContent HTTPStatusCode = "NoContent" - HTTPStatusCodeNonAuthoritativeInformation HTTPStatusCode = "NonAuthoritativeInformation" - HTTPStatusCodeNotAcceptable HTTPStatusCode = "NotAcceptable" - HTTPStatusCodeNotFound HTTPStatusCode = "NotFound" - HTTPStatusCodeNotImplemented HTTPStatusCode = "NotImplemented" - HTTPStatusCodeNotModified HTTPStatusCode = "NotModified" - HTTPStatusCodeOK HTTPStatusCode = "OK" - HTTPStatusCodePartialContent HTTPStatusCode = "PartialContent" - HTTPStatusCodePaymentRequired HTTPStatusCode = "PaymentRequired" - HTTPStatusCodePreconditionFailed HTTPStatusCode = "PreconditionFailed" - HTTPStatusCodeProxyAuthenticationRequired HTTPStatusCode = "ProxyAuthenticationRequired" - HTTPStatusCodeRedirect HTTPStatusCode = "Redirect" - HTTPStatusCodeRedirectKeepVerb HTTPStatusCode = "RedirectKeepVerb" - HTTPStatusCodeRedirectMethod HTTPStatusCode = "RedirectMethod" - HTTPStatusCodeRequestEntityTooLarge HTTPStatusCode = "RequestEntityTooLarge" - HTTPStatusCodeRequestTimeout HTTPStatusCode = "RequestTimeout" - HTTPStatusCodeRequestURITooLong HTTPStatusCode = "RequestUriTooLong" - HTTPStatusCodeRequestedRangeNotSatisfiable HTTPStatusCode = "RequestedRangeNotSatisfiable" - HTTPStatusCodeResetContent HTTPStatusCode = "ResetContent" - HTTPStatusCodeSeeOther HTTPStatusCode = "SeeOther" - HTTPStatusCodeServiceUnavailable HTTPStatusCode = "ServiceUnavailable" - HTTPStatusCodeSwitchingProtocols HTTPStatusCode = "SwitchingProtocols" - HTTPStatusCodeTemporaryRedirect HTTPStatusCode = "TemporaryRedirect" - HTTPStatusCodeUnauthorized HTTPStatusCode = "Unauthorized" - HTTPStatusCodeUnsupportedMediaType HTTPStatusCode = "UnsupportedMediaType" - HTTPStatusCodeUnused HTTPStatusCode = "Unused" - HTTPStatusCodeUpgradeRequired HTTPStatusCode = "UpgradeRequired" - HTTPStatusCodeUseProxy HTTPStatusCode = "UseProxy" + HTTPStatusCodeAccepted HTTPStatusCode = "Accepted" + HTTPStatusCodeAlreadyReported HTTPStatusCode = "AlreadyReported" + HTTPStatusCodeAmbiguous HTTPStatusCode = "Ambiguous" + HTTPStatusCodeBadGateway HTTPStatusCode = "BadGateway" + HTTPStatusCodeBadRequest HTTPStatusCode = "BadRequest" + HTTPStatusCodeConflict HTTPStatusCode = "Conflict" + HTTPStatusCodeContinue HTTPStatusCode = "Continue" + HTTPStatusCodeCreated HTTPStatusCode = "Created" + HTTPStatusCodeEarlyHints HTTPStatusCode = "EarlyHints" + HTTPStatusCodeExpectationFailed HTTPStatusCode = "ExpectationFailed" + HTTPStatusCodeFailedDependency HTTPStatusCode = "FailedDependency" + HTTPStatusCodeForbidden HTTPStatusCode = "Forbidden" + HTTPStatusCodeFound HTTPStatusCode = "Found" + HTTPStatusCodeGatewayTimeout HTTPStatusCode = "GatewayTimeout" + HTTPStatusCodeGone HTTPStatusCode = "Gone" + HTTPStatusCodeHTTPVersionNotSupported HTTPStatusCode = "HttpVersionNotSupported" + HTTPStatusCodeIMUsed HTTPStatusCode = "IMUsed" + HTTPStatusCodeInsufficientStorage HTTPStatusCode = "InsufficientStorage" + HTTPStatusCodeInternalServerError HTTPStatusCode = "InternalServerError" + HTTPStatusCodeLengthRequired HTTPStatusCode = "LengthRequired" + HTTPStatusCodeLocked HTTPStatusCode = "Locked" + HTTPStatusCodeLoopDetected HTTPStatusCode = "LoopDetected" + HTTPStatusCodeMethodNotAllowed HTTPStatusCode = "MethodNotAllowed" + HTTPStatusCodeMisdirectedRequest HTTPStatusCode = "MisdirectedRequest" + HTTPStatusCodeMoved HTTPStatusCode = "Moved" + HTTPStatusCodeMovedPermanently HTTPStatusCode = "MovedPermanently" + HTTPStatusCodeMultiStatus HTTPStatusCode = "MultiStatus" + HTTPStatusCodeMultipleChoices HTTPStatusCode = "MultipleChoices" + HTTPStatusCodeNetworkAuthenticationRequired HTTPStatusCode = "NetworkAuthenticationRequired" + HTTPStatusCodeNoContent HTTPStatusCode = "NoContent" + HTTPStatusCodeNonAuthoritativeInformation HTTPStatusCode = "NonAuthoritativeInformation" + HTTPStatusCodeNotAcceptable HTTPStatusCode = "NotAcceptable" + HTTPStatusCodeNotExtended HTTPStatusCode = "NotExtended" + HTTPStatusCodeNotFound HTTPStatusCode = "NotFound" + HTTPStatusCodeNotImplemented HTTPStatusCode = "NotImplemented" + HTTPStatusCodeNotModified HTTPStatusCode = "NotModified" + HTTPStatusCodeOK HTTPStatusCode = "OK" + HTTPStatusCodePartialContent HTTPStatusCode = "PartialContent" + HTTPStatusCodePaymentRequired HTTPStatusCode = "PaymentRequired" + HTTPStatusCodePermanentRedirect HTTPStatusCode = "PermanentRedirect" + HTTPStatusCodePreconditionFailed HTTPStatusCode = "PreconditionFailed" + HTTPStatusCodePreconditionRequired HTTPStatusCode = "PreconditionRequired" + HTTPStatusCodeProcessing HTTPStatusCode = "Processing" + HTTPStatusCodeProxyAuthenticationRequired HTTPStatusCode = "ProxyAuthenticationRequired" + HTTPStatusCodeRedirect HTTPStatusCode = "Redirect" + HTTPStatusCodeRedirectKeepVerb HTTPStatusCode = "RedirectKeepVerb" + HTTPStatusCodeRedirectMethod HTTPStatusCode = "RedirectMethod" + HTTPStatusCodeRequestEntityTooLarge HTTPStatusCode = "RequestEntityTooLarge" + HTTPStatusCodeRequestHeaderFieldsTooLarge HTTPStatusCode = "RequestHeaderFieldsTooLarge" + HTTPStatusCodeRequestTimeout HTTPStatusCode = "RequestTimeout" + HTTPStatusCodeRequestURITooLong HTTPStatusCode = "RequestUriTooLong" + HTTPStatusCodeRequestedRangeNotSatisfiable HTTPStatusCode = "RequestedRangeNotSatisfiable" + HTTPStatusCodeResetContent HTTPStatusCode = "ResetContent" + HTTPStatusCodeSeeOther HTTPStatusCode = "SeeOther" + HTTPStatusCodeServiceUnavailable HTTPStatusCode = "ServiceUnavailable" + HTTPStatusCodeSwitchingProtocols HTTPStatusCode = "SwitchingProtocols" + HTTPStatusCodeTemporaryRedirect HTTPStatusCode = "TemporaryRedirect" + HTTPStatusCodeTooManyRequests HTTPStatusCode = "TooManyRequests" + HTTPStatusCodeUnauthorized HTTPStatusCode = "Unauthorized" + HTTPStatusCodeUnavailableForLegalReasons HTTPStatusCode = "UnavailableForLegalReasons" + HTTPStatusCodeUnprocessableEntity HTTPStatusCode = "UnprocessableEntity" + HTTPStatusCodeUnsupportedMediaType HTTPStatusCode = "UnsupportedMediaType" + HTTPStatusCodeUnused HTTPStatusCode = "Unused" + HTTPStatusCodeUpgradeRequired HTTPStatusCode = "UpgradeRequired" + HTTPStatusCodeUseProxy HTTPStatusCode = "UseProxy" + HTTPStatusCodeVariantAlsoNegotiates HTTPStatusCode = "VariantAlsoNegotiates" ) // PossibleHTTPStatusCodeValues returns the possible values for the HTTPStatusCode const type. func PossibleHTTPStatusCodeValues() []HTTPStatusCode { return []HTTPStatusCode{ HTTPStatusCodeAccepted, + HTTPStatusCodeAlreadyReported, HTTPStatusCodeAmbiguous, HTTPStatusCodeBadGateway, HTTPStatusCodeBadRequest, HTTPStatusCodeConflict, HTTPStatusCodeContinue, HTTPStatusCodeCreated, + HTTPStatusCodeEarlyHints, HTTPStatusCodeExpectationFailed, + HTTPStatusCodeFailedDependency, HTTPStatusCodeForbidden, HTTPStatusCodeFound, HTTPStatusCodeGatewayTimeout, HTTPStatusCodeGone, HTTPStatusCodeHTTPVersionNotSupported, + HTTPStatusCodeIMUsed, + HTTPStatusCodeInsufficientStorage, HTTPStatusCodeInternalServerError, HTTPStatusCodeLengthRequired, + HTTPStatusCodeLocked, + HTTPStatusCodeLoopDetected, HTTPStatusCodeMethodNotAllowed, + HTTPStatusCodeMisdirectedRequest, HTTPStatusCodeMoved, HTTPStatusCodeMovedPermanently, + HTTPStatusCodeMultiStatus, HTTPStatusCodeMultipleChoices, + HTTPStatusCodeNetworkAuthenticationRequired, HTTPStatusCodeNoContent, HTTPStatusCodeNonAuthoritativeInformation, HTTPStatusCodeNotAcceptable, + HTTPStatusCodeNotExtended, HTTPStatusCodeNotFound, HTTPStatusCodeNotImplemented, HTTPStatusCodeNotModified, HTTPStatusCodeOK, HTTPStatusCodePartialContent, HTTPStatusCodePaymentRequired, + HTTPStatusCodePermanentRedirect, HTTPStatusCodePreconditionFailed, + HTTPStatusCodePreconditionRequired, + HTTPStatusCodeProcessing, HTTPStatusCodeProxyAuthenticationRequired, HTTPStatusCodeRedirect, HTTPStatusCodeRedirectKeepVerb, HTTPStatusCodeRedirectMethod, HTTPStatusCodeRequestEntityTooLarge, + HTTPStatusCodeRequestHeaderFieldsTooLarge, HTTPStatusCodeRequestTimeout, HTTPStatusCodeRequestURITooLong, HTTPStatusCodeRequestedRangeNotSatisfiable, @@ -211,11 +346,15 @@ func PossibleHTTPStatusCodeValues() []HTTPStatusCode { HTTPStatusCodeServiceUnavailable, HTTPStatusCodeSwitchingProtocols, HTTPStatusCodeTemporaryRedirect, + HTTPStatusCodeTooManyRequests, HTTPStatusCodeUnauthorized, + HTTPStatusCodeUnavailableForLegalReasons, + HTTPStatusCodeUnprocessableEntity, HTTPStatusCodeUnsupportedMediaType, HTTPStatusCodeUnused, HTTPStatusCodeUpgradeRequired, HTTPStatusCodeUseProxy, + HTTPStatusCodeVariantAlsoNegotiates, } } @@ -237,6 +376,22 @@ func PossibleHostCachingOptionsValues() []HostCachingOptions { } } +// ImageType - The type of image in the gallery (generalized or specialized) +type ImageType string + +const ( + ImageTypeGeneralized ImageType = "Generalized" + ImageTypeSpecialized ImageType = "Specialized" +) + +// PossibleImageTypeValues returns the possible values for the ImageType const type. +func PossibleImageTypeValues() []ImageType { + return []ImageType{ + ImageTypeGeneralized, + ImageTypeSpecialized, + } +} + // LinuxOsState - The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, DeprovisionApplied). type LinuxOsState string @@ -255,7 +410,7 @@ func PossibleLinuxOsStateValues() []LinuxOsState { } } -// ManagedIdentityType - Managed identity. +// ManagedIdentityType - Type of identity (SystemAssigned, UserAssigned, None) type ManagedIdentityType string const ( @@ -291,6 +446,41 @@ func PossibleNotificationChannelEventTypeValues() []NotificationChannelEventType } } +// 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, + } +} + +// OsType - The operating system of the image +type OsType string + +const ( + OsTypeLinux OsType = "Linux" + OsTypeWindows OsType = "Windows" +) + +// PossibleOsTypeValues returns the possible values for the OsType const type. +func PossibleOsTypeValues() []OsType { + return []OsType{ + OsTypeLinux, + OsTypeWindows, + } +} + // PolicyEvaluatorType - The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy). type PolicyEvaluatorType string @@ -389,6 +579,27 @@ func PossibleReportingCycleTypeValues() []ReportingCycleType { } } +// SKUTier - This field is required to be implemented by the Resource Provider if the service has more than one tier, but +// is not required on a PUT. +type SKUTier string + +const ( + SKUTierFree SKUTier = "Free" + SKUTierBasic SKUTier = "Basic" + SKUTierStandard SKUTier = "Standard" + SKUTierPremium SKUTier = "Premium" +) + +// PossibleSKUTierValues returns the possible values for the SKUTier const type. +func PossibleSKUTierValues() []SKUTier { + return []SKUTier{ + SKUTierFree, + SKUTierBasic, + SKUTierStandard, + SKUTierPremium, + } +} + // SourceControlType - The artifact source's type. type SourceControlType string @@ -425,6 +636,24 @@ func PossibleStorageTypeValues() []StorageType { } } +// StorageTypes - Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). +type StorageTypes string + +const ( + StorageTypesPremium StorageTypes = "Premium" + StorageTypesStandard StorageTypes = "Standard" + StorageTypesStandardSSD StorageTypes = "StandardSSD" +) + +// PossibleStorageTypesValues returns the possible values for the StorageTypes const type. +func PossibleStorageTypesValues() []StorageTypes { + return []StorageTypes{ + StorageTypesPremium, + StorageTypesStandard, + StorageTypesStandardSSD, + } +} + // TargetCostStatus - Target cost status type TargetCostStatus string diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_costs_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/costs_client.go similarity index 97% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_costs_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/costs_client.go index f312c04ce8f6..442dee4e2ca0 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_costs_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/costs_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -56,7 +57,7 @@ func NewCostsClient(subscriptionID string, credential azcore.TokenCredential, op // CreateOrUpdate - Create or replace an existing cost. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the cost. @@ -101,7 +102,7 @@ func (client *CostsClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, labCost) @@ -118,7 +119,7 @@ func (client *CostsClient) createOrUpdateHandleResponse(resp *http.Response) (Co // Get - Get cost. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the cost. @@ -165,7 +166,7 @@ func (client *CostsClient) getCreateRequest(ctx context.Context, resourceGroupNa if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_customimages_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/customimages_client.go similarity index 96% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_customimages_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/customimages_client.go index 187caa4bda76..1eaf5b698e3d 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_customimages_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/customimages_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -57,7 +58,7 @@ func NewCustomImagesClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Create or replace an existing custom image. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the custom image. @@ -78,7 +79,7 @@ func (client *CustomImagesClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Create or replace an existing custom image. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *CustomImagesClient) createOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, customImage CustomImage, options *CustomImagesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, labName, name, customImage, options) if err != nil { @@ -118,7 +119,7 @@ func (client *CustomImagesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, customImage) @@ -126,7 +127,7 @@ func (client *CustomImagesClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Delete custom image. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the custom image. @@ -146,7 +147,7 @@ func (client *CustomImagesClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete custom image. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *CustomImagesClient) deleteOperation(ctx context.Context, resourceGroupName string, labName string, name string, options *CustomImagesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, labName, name, options) if err != nil { @@ -186,7 +187,7 @@ func (client *CustomImagesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,7 +195,7 @@ func (client *CustomImagesClient) deleteCreateRequest(ctx context.Context, resou // Get - Get custom image. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the custom image. @@ -241,7 +242,7 @@ func (client *CustomImagesClient) getCreateRequest(ctx context.Context, resource if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,7 +259,7 @@ func (client *CustomImagesClient) getHandleResponse(resp *http.Response) (Custom // NewListPager - List custom images in a given lab. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // options - CustomImagesClientListOptions contains the optional parameters for the CustomImagesClient.List method. @@ -322,7 +323,7 @@ func (client *CustomImagesClient) listCreateRequest(ctx context.Context, resourc if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -339,11 +340,11 @@ func (client *CustomImagesClient) listHandleResponse(resp *http.Response) (Custo // Update - Allows modifying tags of custom images. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the custom image. -// customImage - A custom image. +// customImage - Allows modifying tags of custom images. All other properties will be ignored. // options - CustomImagesClientUpdateOptions contains the optional parameters for the CustomImagesClient.Update method. func (client *CustomImagesClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, customImage CustomImageFragment, options *CustomImagesClientUpdateOptions) (CustomImagesClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, name, customImage, options) @@ -384,7 +385,7 @@ func (client *CustomImagesClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, customImage) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_disks_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/disks_client.go similarity index 96% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_disks_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/disks_client.go index c98c631a5523..2fc0cccefffd 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_disks_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/disks_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -57,7 +58,7 @@ func NewDisksClient(subscriptionID string, credential azcore.TokenCredential, op // BeginAttach - Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -78,7 +79,7 @@ func (client *DisksClient) BeginAttach(ctx context.Context, resourceGroupName st // Attach - Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *DisksClient) attach(ctx context.Context, resourceGroupName string, labName string, userName string, name string, attachDiskProperties AttachDiskProperties, options *DisksClientBeginAttachOptions) (*http.Response, error) { req, err := client.attachCreateRequest(ctx, resourceGroupName, labName, userName, name, attachDiskProperties, options) if err != nil { @@ -122,7 +123,7 @@ func (client *DisksClient) attachCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, attachDiskProperties) @@ -130,7 +131,7 @@ func (client *DisksClient) attachCreateRequest(ctx context.Context, resourceGrou // BeginCreateOrUpdate - Create or replace an existing disk. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -152,7 +153,7 @@ func (client *DisksClient) BeginCreateOrUpdate(ctx context.Context, resourceGrou // CreateOrUpdate - Create or replace an existing disk. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *DisksClient) createOrUpdate(ctx context.Context, resourceGroupName string, labName string, userName string, name string, disk Disk, options *DisksClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, labName, userName, name, disk, options) if err != nil { @@ -196,7 +197,7 @@ func (client *DisksClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, disk) @@ -204,7 +205,7 @@ func (client *DisksClient) createOrUpdateCreateRequest(ctx context.Context, reso // BeginDelete - Delete disk. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -224,7 +225,7 @@ func (client *DisksClient) BeginDelete(ctx context.Context, resourceGroupName st // Delete - Delete disk. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *DisksClient) deleteOperation(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *DisksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, labName, userName, name, options) if err != nil { @@ -268,7 +269,7 @@ func (client *DisksClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +278,7 @@ func (client *DisksClient) deleteCreateRequest(ctx context.Context, resourceGrou // BeginDetach - Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to // complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -298,7 +299,7 @@ func (client *DisksClient) BeginDetach(ctx context.Context, resourceGroupName st // Detach - Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *DisksClient) detach(ctx context.Context, resourceGroupName string, labName string, userName string, name string, detachDiskProperties DetachDiskProperties, options *DisksClientBeginDetachOptions) (*http.Response, error) { req, err := client.detachCreateRequest(ctx, resourceGroupName, labName, userName, name, detachDiskProperties, options) if err != nil { @@ -342,7 +343,7 @@ func (client *DisksClient) detachCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, detachDiskProperties) @@ -350,7 +351,7 @@ func (client *DisksClient) detachCreateRequest(ctx context.Context, resourceGrou // Get - Get disk. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -402,7 +403,7 @@ func (client *DisksClient) getCreateRequest(ctx context.Context, resourceGroupNa if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -419,7 +420,7 @@ func (client *DisksClient) getHandleResponse(resp *http.Response) (DisksClientGe // NewListPager - List disks in a given user profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -488,7 +489,7 @@ func (client *DisksClient) listCreateRequest(ctx context.Context, resourceGroupN if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -505,12 +506,12 @@ func (client *DisksClient) listHandleResponse(resp *http.Response) (DisksClientL // Update - Allows modifying tags of disks. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. // name - The name of the disk. -// disk - A Disk. +// disk - Allows modifying tags of disks. All other properties will be ignored. // options - DisksClientUpdateOptions contains the optional parameters for the DisksClient.Update method. func (client *DisksClient) Update(ctx context.Context, resourceGroupName string, labName string, userName string, name string, disk DiskFragment, options *DisksClientUpdateOptions) (DisksClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, userName, name, disk, options) @@ -555,7 +556,7 @@ func (client *DisksClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, disk) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_environments_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/environments_client.go similarity index 96% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_environments_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/environments_client.go index 0bef25f26d64..de4100322833 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_environments_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/environments_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -57,7 +58,7 @@ func NewEnvironmentsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Create or replace an existing environment. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -79,7 +80,7 @@ func (client *EnvironmentsClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Create or replace an existing environment. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *EnvironmentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, labName string, userName string, name string, dtlEnvironment DtlEnvironment, options *EnvironmentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, labName, userName, name, dtlEnvironment, options) if err != nil { @@ -123,7 +124,7 @@ func (client *EnvironmentsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, dtlEnvironment) @@ -131,7 +132,7 @@ func (client *EnvironmentsClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Delete environment. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -152,7 +153,7 @@ func (client *EnvironmentsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete environment. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *EnvironmentsClient) deleteOperation(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *EnvironmentsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, labName, userName, name, options) if err != nil { @@ -196,7 +197,7 @@ func (client *EnvironmentsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +205,7 @@ func (client *EnvironmentsClient) deleteCreateRequest(ctx context.Context, resou // Get - Get environment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -256,7 +257,7 @@ func (client *EnvironmentsClient) getCreateRequest(ctx context.Context, resource if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -273,7 +274,7 @@ func (client *EnvironmentsClient) getHandleResponse(resp *http.Response) (Enviro // NewListPager - List environments in a given user profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -342,7 +343,7 @@ func (client *EnvironmentsClient) listCreateRequest(ctx context.Context, resourc if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -359,12 +360,12 @@ func (client *EnvironmentsClient) listHandleResponse(resp *http.Response) (Envir // Update - Allows modifying tags of environments. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. // name - The name of the environment. -// dtlEnvironment - An environment, which is essentially an ARM template deployment. +// dtlEnvironment - Allows modifying tags of environments. All other properties will be ignored. // options - EnvironmentsClientUpdateOptions contains the optional parameters for the EnvironmentsClient.Update method. func (client *EnvironmentsClient) Update(ctx context.Context, resourceGroupName string, labName string, userName string, name string, dtlEnvironment DtlEnvironmentFragment, options *EnvironmentsClientUpdateOptions) (EnvironmentsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, userName, name, dtlEnvironment, options) @@ -409,7 +410,7 @@ func (client *EnvironmentsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, dtlEnvironment) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_formulas_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/formulas_client.go similarity index 96% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_formulas_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/formulas_client.go index 8aefb3b219a5..ae4148bab9a5 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_formulas_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/formulas_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -55,9 +56,9 @@ func NewFormulasClient(subscriptionID string, credential azcore.TokenCredential, return client, nil } -// BeginCreateOrUpdate - Create or replace an existing formula. This operation can take a while to complete. +// BeginCreateOrUpdate - Create or replace an existing Formula. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the formula. @@ -76,9 +77,9 @@ func (client *FormulasClient) BeginCreateOrUpdate(ctx context.Context, resourceG } } -// CreateOrUpdate - Create or replace an existing formula. This operation can take a while to complete. +// CreateOrUpdate - Create or replace an existing Formula. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *FormulasClient) createOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, formula Formula, options *FormulasClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, labName, name, formula, options) if err != nil { @@ -118,7 +119,7 @@ func (client *FormulasClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, formula) @@ -126,7 +127,7 @@ func (client *FormulasClient) createOrUpdateCreateRequest(ctx context.Context, r // Delete - Delete formula. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the formula. @@ -170,7 +171,7 @@ func (client *FormulasClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -178,7 +179,7 @@ func (client *FormulasClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get formula. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the formula. @@ -225,7 +226,7 @@ func (client *FormulasClient) getCreateRequest(ctx context.Context, resourceGrou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +243,7 @@ func (client *FormulasClient) getHandleResponse(resp *http.Response) (FormulasCl // NewListPager - List formulas in a given lab. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // options - FormulasClientListOptions contains the optional parameters for the FormulasClient.List method. @@ -306,7 +307,7 @@ func (client *FormulasClient) listCreateRequest(ctx context.Context, resourceGro if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,11 +324,11 @@ func (client *FormulasClient) listHandleResponse(resp *http.Response) (FormulasC // Update - Allows modifying tags of formulas. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the formula. -// formula - A formula for creating a VM, specifying an image base and other parameters +// formula - Allows modifying tags of formulas. All other properties will be ignored. // options - FormulasClientUpdateOptions contains the optional parameters for the FormulasClient.Update method. func (client *FormulasClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, formula FormulaFragment, options *FormulasClientUpdateOptions) (FormulasClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, name, formula, options) @@ -368,7 +369,7 @@ func (client *FormulasClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, formula) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_galleryimages_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/galleryimages_client.go similarity index 64% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_galleryimages_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/galleryimages_client.go index 380172754219..af22b2447206 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_galleryimages_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/galleryimages_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -55,9 +56,70 @@ func NewGalleryImagesClient(subscriptionID string, credential azcore.TokenCreden return client, nil } +// Get - Get gallery image. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// name - The name of the gallery image. +// options - GalleryImagesClientGetOptions contains the optional parameters for the GalleryImagesClient.Get method. +func (client *GalleryImagesClient) Get(ctx context.Context, resourceGroupName string, labName string, name string, options *GalleryImagesClientGetOptions) (GalleryImagesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, labName, name, options) + if err != nil { + return GalleryImagesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GalleryImagesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GalleryImagesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *GalleryImagesClient) getCreateRequest(ctx context.Context, resourceGroupName string, labName string, name string, options *GalleryImagesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/galleryimages/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-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 *GalleryImagesClient) getHandleResponse(resp *http.Response) (GalleryImagesClientGetResponse, error) { + result := GalleryImagesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImage); err != nil { + return GalleryImagesClientGetResponse{}, err + } + return result, nil +} + // NewListPager - List gallery images in a given lab. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // options - GalleryImagesClientListOptions contains the optional parameters for the GalleryImagesClient.List method. @@ -121,7 +183,7 @@ func (client *GalleryImagesClient) listCreateRequest(ctx context.Context, resour if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_globalschedules_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/globalschedules_client.go similarity index 96% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_globalschedules_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/globalschedules_client.go index 75af4797f0d5..3a5d4b5f5b89 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_globalschedules_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/globalschedules_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -57,7 +58,7 @@ func NewGlobalSchedulesClient(subscriptionID string, credential azcore.TokenCred // CreateOrUpdate - Create or replace an existing schedule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the schedule. // schedule - A schedule. @@ -98,7 +99,7 @@ func (client *GlobalSchedulesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, schedule) @@ -115,7 +116,7 @@ func (client *GlobalSchedulesClient) createOrUpdateHandleResponse(resp *http.Res // Delete - Delete schedule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the schedule. // options - GlobalSchedulesClientDeleteOptions contains the optional parameters for the GlobalSchedulesClient.Delete method. @@ -154,7 +155,7 @@ func (client *GlobalSchedulesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -162,7 +163,7 @@ func (client *GlobalSchedulesClient) deleteCreateRequest(ctx context.Context, re // BeginExecute - Execute a schedule. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the schedule. // options - GlobalSchedulesClientBeginExecuteOptions contains the optional parameters for the GlobalSchedulesClient.BeginExecute @@ -181,7 +182,7 @@ func (client *GlobalSchedulesClient) BeginExecute(ctx context.Context, resourceG // Execute - Execute a schedule. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *GlobalSchedulesClient) execute(ctx context.Context, resourceGroupName string, name string, options *GlobalSchedulesClientBeginExecuteOptions) (*http.Response, error) { req, err := client.executeCreateRequest(ctx, resourceGroupName, name, options) if err != nil { @@ -217,7 +218,7 @@ func (client *GlobalSchedulesClient) executeCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -225,7 +226,7 @@ func (client *GlobalSchedulesClient) executeCreateRequest(ctx context.Context, r // Get - Get schedule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the schedule. // options - GlobalSchedulesClientGetOptions contains the optional parameters for the GlobalSchedulesClient.Get method. @@ -267,7 +268,7 @@ func (client *GlobalSchedulesClient) getCreateRequest(ctx context.Context, resou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +285,7 @@ func (client *GlobalSchedulesClient) getHandleResponse(resp *http.Response) (Glo // NewListByResourceGroupPager - List schedules in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // options - GlobalSchedulesClientListByResourceGroupOptions contains the optional parameters for the GlobalSchedulesClient.ListByResourceGroup // method. @@ -344,7 +345,7 @@ func (client *GlobalSchedulesClient) listByResourceGroupCreateRequest(ctx contex if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -361,7 +362,7 @@ func (client *GlobalSchedulesClient) listByResourceGroupHandleResponse(resp *htt // NewListBySubscriptionPager - List schedules in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // options - GlobalSchedulesClientListBySubscriptionOptions contains the optional parameters for the GlobalSchedulesClient.ListBySubscription // method. func (client *GlobalSchedulesClient) NewListBySubscriptionPager(options *GlobalSchedulesClientListBySubscriptionOptions) *runtime.Pager[GlobalSchedulesClientListBySubscriptionResponse] { @@ -416,7 +417,7 @@ func (client *GlobalSchedulesClient) listBySubscriptionCreateRequest(ctx context if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -433,7 +434,7 @@ func (client *GlobalSchedulesClient) listBySubscriptionHandleResponse(resp *http // BeginRetarget - Updates a schedule's target resource Id. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the schedule. // retargetScheduleProperties - Properties for retargeting a virtual machine schedule. @@ -453,7 +454,7 @@ func (client *GlobalSchedulesClient) BeginRetarget(ctx context.Context, resource // Retarget - Updates a schedule's target resource Id. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *GlobalSchedulesClient) retarget(ctx context.Context, resourceGroupName string, name string, retargetScheduleProperties RetargetScheduleProperties, options *GlobalSchedulesClientBeginRetargetOptions) (*http.Response, error) { req, err := client.retargetCreateRequest(ctx, resourceGroupName, name, retargetScheduleProperties, options) if err != nil { @@ -489,7 +490,7 @@ func (client *GlobalSchedulesClient) retargetCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, retargetScheduleProperties) @@ -497,10 +498,10 @@ func (client *GlobalSchedulesClient) retargetCreateRequest(ctx context.Context, // Update - Allows modifying tags of schedules. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the schedule. -// schedule - A schedule. +// schedule - Allows modifying tags of schedules. All other properties will be ignored. // options - GlobalSchedulesClientUpdateOptions contains the optional parameters for the GlobalSchedulesClient.Update method. func (client *GlobalSchedulesClient) Update(ctx context.Context, resourceGroupName string, name string, schedule ScheduleFragment, options *GlobalSchedulesClientUpdateOptions) (GlobalSchedulesClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, name, schedule, options) @@ -537,7 +538,7 @@ func (client *GlobalSchedulesClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, schedule) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.mod b/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.mod index ba8d7dd4c3ce..8ccac9a817b3 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.mod +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.sum b/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.sum +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_labs_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/labs_client.go similarity index 90% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_labs_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/labs_client.go index be2c62ab9c03..286497464b43 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_labs_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/labs_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -57,7 +58,7 @@ func NewLabsClient(subscriptionID string, credential azcore.TokenCredential, opt // BeginClaimAnyVM - Claim a random claimable virtual machine in the lab. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the lab. // options - LabsClientBeginClaimAnyVMOptions contains the optional parameters for the LabsClient.BeginClaimAnyVM method. @@ -75,7 +76,7 @@ func (client *LabsClient) BeginClaimAnyVM(ctx context.Context, resourceGroupName // ClaimAnyVM - Claim a random claimable virtual machine in the lab. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *LabsClient) claimAnyVM(ctx context.Context, resourceGroupName string, name string, options *LabsClientBeginClaimAnyVMOptions) (*http.Response, error) { req, err := client.claimAnyVMCreateRequest(ctx, resourceGroupName, name, options) if err != nil { @@ -111,7 +112,7 @@ func (client *LabsClient) claimAnyVMCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,7 +120,7 @@ func (client *LabsClient) claimAnyVMCreateRequest(ctx context.Context, resourceG // BeginCreateEnvironment - Create virtual machines in a lab. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the lab. // labVirtualMachineCreationParameter - Properties for creating a virtual machine. @@ -139,7 +140,7 @@ func (client *LabsClient) BeginCreateEnvironment(ctx context.Context, resourceGr // CreateEnvironment - Create virtual machines in a lab. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *LabsClient) createEnvironment(ctx context.Context, resourceGroupName string, name string, labVirtualMachineCreationParameter LabVirtualMachineCreationParameter, options *LabsClientBeginCreateEnvironmentOptions) (*http.Response, error) { req, err := client.createEnvironmentCreateRequest(ctx, resourceGroupName, name, labVirtualMachineCreationParameter, options) if err != nil { @@ -175,7 +176,7 @@ func (client *LabsClient) createEnvironmentCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, labVirtualMachineCreationParameter) @@ -183,7 +184,7 @@ func (client *LabsClient) createEnvironmentCreateRequest(ctx context.Context, re // BeginCreateOrUpdate - Create or replace an existing lab. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the lab. // lab - A lab. @@ -203,7 +204,7 @@ func (client *LabsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroup // CreateOrUpdate - Create or replace an existing lab. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *LabsClient) createOrUpdate(ctx context.Context, resourceGroupName string, name string, lab Lab, options *LabsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, name, lab, options) if err != nil { @@ -239,7 +240,7 @@ func (client *LabsClient) createOrUpdateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, lab) @@ -247,7 +248,7 @@ func (client *LabsClient) createOrUpdateCreateRequest(ctx context.Context, resou // BeginDelete - Delete lab. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the lab. // options - LabsClientBeginDeleteOptions contains the optional parameters for the LabsClient.BeginDelete method. @@ -265,7 +266,7 @@ func (client *LabsClient) BeginDelete(ctx context.Context, resourceGroupName str // Delete - Delete lab. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *LabsClient) deleteOperation(ctx context.Context, resourceGroupName string, name string, options *LabsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, name, options) if err != nil { @@ -301,7 +302,55 @@ func (client *LabsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// EnsureCurrentUserProfile - Ensure the current user has a valid profile in the lab. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// name - The name of the lab. +// options - LabsClientEnsureCurrentUserProfileOptions contains the optional parameters for the LabsClient.EnsureCurrentUserProfile +// method. +func (client *LabsClient) EnsureCurrentUserProfile(ctx context.Context, resourceGroupName string, name string, options *LabsClientEnsureCurrentUserProfileOptions) (LabsClientEnsureCurrentUserProfileResponse, error) { + req, err := client.ensureCurrentUserProfileCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return LabsClientEnsureCurrentUserProfileResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return LabsClientEnsureCurrentUserProfileResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LabsClientEnsureCurrentUserProfileResponse{}, runtime.NewResponseError(resp) + } + return LabsClientEnsureCurrentUserProfileResponse{}, nil +} + +// ensureCurrentUserProfileCreateRequest creates the EnsureCurrentUserProfile request. +func (client *LabsClient) ensureCurrentUserProfileCreateRequest(ctx context.Context, resourceGroupName string, name string, options *LabsClientEnsureCurrentUserProfileOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/ensureCurrentUserProfile" + 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 name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -309,7 +358,7 @@ func (client *LabsClient) deleteCreateRequest(ctx context.Context, resourceGroup // BeginExportResourceUsage - Exports the lab resource usage into a storage account This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the lab. // exportResourceUsageParameters - The parameters of the export operation. @@ -329,7 +378,7 @@ func (client *LabsClient) BeginExportResourceUsage(ctx context.Context, resource // ExportResourceUsage - Exports the lab resource usage into a storage account This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *LabsClient) exportResourceUsage(ctx context.Context, resourceGroupName string, name string, exportResourceUsageParameters ExportResourceUsageParameters, options *LabsClientBeginExportResourceUsageOptions) (*http.Response, error) { req, err := client.exportResourceUsageCreateRequest(ctx, resourceGroupName, name, exportResourceUsageParameters, options) if err != nil { @@ -365,7 +414,7 @@ func (client *LabsClient) exportResourceUsageCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, exportResourceUsageParameters) @@ -373,7 +422,7 @@ func (client *LabsClient) exportResourceUsageCreateRequest(ctx context.Context, // GenerateUploadURI - Generate a URI for uploading custom disk images to a Lab. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the lab. // generateUploadURIParameter - Properties for generating an upload URI. @@ -413,7 +462,7 @@ func (client *LabsClient) generateUploadURICreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, generateUploadURIParameter) @@ -430,7 +479,7 @@ func (client *LabsClient) generateUploadURIHandleResponse(resp *http.Response) ( // Get - Get lab. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the lab. // options - LabsClientGetOptions contains the optional parameters for the LabsClient.Get method. @@ -472,7 +521,7 @@ func (client *LabsClient) getCreateRequest(ctx context.Context, resourceGroupNam if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -489,7 +538,7 @@ func (client *LabsClient) getHandleResponse(resp *http.Response) (LabsClientGetR // BeginImportVirtualMachine - Import a virtual machine into a different lab. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the lab. // importLabVirtualMachineRequest - This represents the payload required to import a virtual machine from a different lab @@ -510,7 +559,7 @@ func (client *LabsClient) BeginImportVirtualMachine(ctx context.Context, resourc // ImportVirtualMachine - Import a virtual machine into a different lab. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *LabsClient) importVirtualMachine(ctx context.Context, resourceGroupName string, name string, importLabVirtualMachineRequest ImportLabVirtualMachineRequest, options *LabsClientBeginImportVirtualMachineOptions) (*http.Response, error) { req, err := client.importVirtualMachineCreateRequest(ctx, resourceGroupName, name, importLabVirtualMachineRequest, options) if err != nil { @@ -546,7 +595,7 @@ func (client *LabsClient) importVirtualMachineCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, importLabVirtualMachineRequest) @@ -554,7 +603,7 @@ func (client *LabsClient) importVirtualMachineCreateRequest(ctx context.Context, // NewListByResourceGroupPager - List labs in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // options - LabsClientListByResourceGroupOptions contains the optional parameters for the LabsClient.ListByResourceGroup // method. @@ -614,7 +663,7 @@ func (client *LabsClient) listByResourceGroupCreateRequest(ctx context.Context, if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -631,7 +680,7 @@ func (client *LabsClient) listByResourceGroupHandleResponse(resp *http.Response) // NewListBySubscriptionPager - List labs in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // options - LabsClientListBySubscriptionOptions contains the optional parameters for the LabsClient.ListBySubscription method. func (client *LabsClient) NewListBySubscriptionPager(options *LabsClientListBySubscriptionOptions) *runtime.Pager[LabsClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[LabsClientListBySubscriptionResponse]{ @@ -685,7 +734,7 @@ func (client *LabsClient) listBySubscriptionCreateRequest(ctx context.Context, o if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -702,7 +751,7 @@ func (client *LabsClient) listBySubscriptionHandleResponse(resp *http.Response) // NewListVhdsPager - List disk images available for custom image creation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the lab. // options - LabsClientListVhdsOptions contains the optional parameters for the LabsClient.ListVhds method. @@ -754,7 +803,7 @@ func (client *LabsClient) listVhdsCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -771,10 +820,10 @@ func (client *LabsClient) listVhdsHandleResponse(resp *http.Response) (LabsClien // Update - Allows modifying tags of labs. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // name - The name of the lab. -// lab - A lab. +// lab - Allows modifying tags of labs. All other properties will be ignored. // options - LabsClientUpdateOptions contains the optional parameters for the LabsClient.Update method. func (client *LabsClient) Update(ctx context.Context, resourceGroupName string, name string, lab LabFragment, options *LabsClientUpdateOptions) (LabsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, name, lab, options) @@ -811,7 +860,7 @@ func (client *LabsClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, lab) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/labsecrets_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/labsecrets_client.go new file mode 100644 index 000000000000..77fb9e3be4e8 --- /dev/null +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/labsecrets_client.go @@ -0,0 +1,394 @@ +//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 armdevtestlabs + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// LabSecretsClient contains the methods for the LabSecrets group. +// Don't use this type directly, use NewLabSecretsClient() instead. +type LabSecretsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewLabSecretsClient creates a new instance of LabSecretsClient with the specified values. +// subscriptionID - The subscription ID. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewLabSecretsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LabSecretsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &LabSecretsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or replace an existing Lab Secret. This operation can take a while to complete. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// name - The name of the lab secret. +// labSecret - A shared secret in a lab. +// options - LabSecretsClientBeginCreateOrUpdateOptions contains the optional parameters for the LabSecretsClient.BeginCreateOrUpdate +// method. +func (client *LabSecretsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, labSecret LabSecret, options *LabSecretsClientBeginCreateOrUpdateOptions) (*runtime.Poller[LabSecretsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, labName, name, labSecret, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[LabSecretsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[LabSecretsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create or replace an existing Lab Secret. This operation can take a while to complete. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +func (client *LabSecretsClient) createOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, labSecret LabSecret, options *LabSecretsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, labName, name, labSecret, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *LabSecretsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, labName string, name string, labSecret LabSecret, options *LabSecretsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/secrets/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, labSecret) +} + +// BeginDelete - Delete lab secret. This operation can take a while to complete. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// name - The name of the lab secret. +// options - LabSecretsClientBeginDeleteOptions contains the optional parameters for the LabSecretsClient.BeginDelete method. +func (client *LabSecretsClient) BeginDelete(ctx context.Context, resourceGroupName string, labName string, name string, options *LabSecretsClientBeginDeleteOptions) (*runtime.Poller[LabSecretsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, labName, name, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[LabSecretsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[LabSecretsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete lab secret. This operation can take a while to complete. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +func (client *LabSecretsClient) deleteOperation(ctx context.Context, resourceGroupName string, labName string, name string, options *LabSecretsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, labName, name, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *LabSecretsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, labName string, name string, options *LabSecretsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/secrets/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get lab secret. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// name - The name of the lab secret. +// options - LabSecretsClientGetOptions contains the optional parameters for the LabSecretsClient.Get method. +func (client *LabSecretsClient) Get(ctx context.Context, resourceGroupName string, labName string, name string, options *LabSecretsClientGetOptions) (LabSecretsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, labName, name, options) + if err != nil { + return LabSecretsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return LabSecretsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LabSecretsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *LabSecretsClient) getCreateRequest(ctx context.Context, resourceGroupName string, labName string, name string, options *LabSecretsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/secrets/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-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 *LabSecretsClient) getHandleResponse(resp *http.Response) (LabSecretsClientGetResponse, error) { + result := LabSecretsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LabSecret); err != nil { + return LabSecretsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List lab secrets in a given lab. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// options - LabSecretsClientListOptions contains the optional parameters for the LabSecretsClient.List method. +func (client *LabSecretsClient) NewListPager(resourceGroupName string, labName string, options *LabSecretsClientListOptions) *runtime.Pager[LabSecretsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[LabSecretsClientListResponse]{ + More: func(page LabSecretsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LabSecretsClientListResponse) (LabSecretsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, labName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return LabSecretsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return LabSecretsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LabSecretsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *LabSecretsClient) listCreateRequest(ctx context.Context, resourceGroupName string, labName string, options *LabSecretsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/secrets" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Orderby != nil { + reqQP.Set("$orderby", *options.Orderby) + } + reqQP.Set("api-version", "2021-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 *LabSecretsClient) listHandleResponse(resp *http.Response) (LabSecretsClientListResponse, error) { + result := LabSecretsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LabSecretList); err != nil { + return LabSecretsClientListResponse{}, err + } + return result, nil +} + +// Update - Allows modifying tags of lab secrets. All other properties will be ignored. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// name - The name of the lab secret. +// secret - Allows modifying tags of lab secrets. All other properties will be ignored. +// options - LabSecretsClientUpdateOptions contains the optional parameters for the LabSecretsClient.Update method. +func (client *LabSecretsClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, secret SecretFragment, options *LabSecretsClientUpdateOptions) (LabSecretsClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, name, secret, options) + if err != nil { + return LabSecretsClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return LabSecretsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusCreated) { + return LabSecretsClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *LabSecretsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, labName string, name string, secret SecretFragment, options *LabSecretsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/secrets/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, secret) +} + +// updateHandleResponse handles the Update response. +func (client *LabSecretsClient) updateHandleResponse(resp *http.Response) (LabSecretsClientUpdateResponse, error) { + result := LabSecretsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LabSecret); err != nil { + return LabSecretsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_models.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/models.go similarity index 65% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_models.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/models.go index 1b6ae15e1876..d3158385d673 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_models.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/models.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -15,27 +16,23 @@ type ApplicableSchedule struct { // REQUIRED; The properties of the resource. Properties *ApplicableScheduleProperties `json:"properties,omitempty"` - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` -// ApplicableScheduleFragment - Schedules applicable to a virtual machine. The schedules may have been defined on a VM or -// on lab level. -type ApplicableScheduleFragment struct { - // The tags of the resource. - Tags map[string]*string `json:"tags,omitempty"` + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` } // ApplicableScheduleProperties - Properties of a schedules applicable to a virtual machine. @@ -58,19 +55,22 @@ type ArmTemplate struct { // REQUIRED; The properties of the resource. Properties *ArmTemplateProperties `json:"properties,omitempty"` - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } @@ -83,12 +83,12 @@ type ArmTemplateInfo struct { Template interface{} `json:"template,omitempty"` } -// ArmTemplateList - The response of a list operation. +// ArmTemplateList - Contains a list of armTemplates and their properties type ArmTemplateList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of armTemplates and their properties Value []*ArmTemplate `json:"value,omitempty"` } @@ -138,7 +138,7 @@ type ArmTemplatesClientGetOptions struct { type ArmTemplatesClientListOptions struct { // Specify the $expand query. Example: 'properties($select=displayName)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -151,19 +151,22 @@ type Artifact struct { // REQUIRED; The properties of the resource. Properties *ArtifactProperties `json:"properties,omitempty"` - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } @@ -203,12 +206,12 @@ type ArtifactInstallProperties struct { VMExtensionStatusMessage *string `json:"vmExtensionStatusMessage,omitempty"` } -// ArtifactList - The response of a list operation. +// ArtifactList - Contains a list of artifacts and their properties type ArtifactList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of artifacts and their properties Value []*Artifact `json:"value,omitempty"` } @@ -253,34 +256,37 @@ type ArtifactSource struct { // REQUIRED; The properties of the resource. Properties *ArtifactSourceProperties `json:"properties,omitempty"` - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } -// ArtifactSourceFragment - Properties of an artifact source. +// ArtifactSourceFragment - Patch type ArtifactSourceFragment struct { // The tags of the resource. Tags map[string]*string `json:"tags,omitempty"` } -// ArtifactSourceList - The response of a list operation. +// ArtifactSourceList - Contains a list of artifactSources and their properties type ArtifactSourceList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of artifactSources and their properties Value []*ArtifactSource `json:"value,omitempty"` } @@ -341,7 +347,7 @@ type ArtifactSourcesClientGetOptions struct { type ArtifactSourcesClientListOptions struct { // Specify the $expand query. Example: 'properties($select=displayName)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -370,7 +376,7 @@ type ArtifactsClientGetOptions struct { type ArtifactsClientListOptions struct { // Specify the $expand query. Example: 'properties($select=title)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -396,12 +402,141 @@ type AttachNewDataDiskOptions struct { DiskType *StorageType `json:"diskType,omitempty"` } +// AzureEntityResource - The resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty" azure:"ro"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// BastionHost - Profile of a Bastion Host +type BastionHost struct { + // REQUIRED; The properties of the resource. + Properties *BastionHostProperties `json:"properties,omitempty"` + + // The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// BastionHostFragment - Patch +type BastionHostFragment struct { + // The tags of the resource. + Tags map[string]*string `json:"tags,omitempty"` +} + +// BastionHostList - Contains a list of bastionHosts and their properties +type BastionHostList struct { + // URL to get the next set of operation list results if there are any + NextLink *string `json:"nextLink,omitempty"` + + // List of bastionHosts and their properties + Value []*BastionHost `json:"value,omitempty"` +} + +// BastionHostProperties - Properties of a BastionHost profile. +type BastionHostProperties struct { + // READ-ONLY; The ID of the external BastionHost resource that corresponds to this DTL BastionHost + ExternalBastionHostID *string `json:"externalBastionHostId,omitempty" azure:"ro"` + + // READ-ONLY; The ID of the PublicIpAddress resource that is created by and paired with this BastionHost + IPAddressID *string `json:"ipAddressId,omitempty" azure:"ro"` + + // READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty" azure:"ro"` +} + +// BastionHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the BastionHostsClient.BeginCreateOrUpdate +// method. +type BastionHostsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BastionHostsClientBeginDeleteOptions contains the optional parameters for the BastionHostsClient.BeginDelete method. +type BastionHostsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BastionHostsClientGetOptions contains the optional parameters for the BastionHostsClient.Get method. +type BastionHostsClientGetOptions struct { + // placeholder for future optional parameters +} + +// BastionHostsClientListOptions contains the optional parameters for the BastionHostsClient.List method. +type BastionHostsClientListOptions struct { + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' + Filter *string + // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' + Orderby *string + // The maximum number of resources to return from the operation. Example: '$top=10' + Top *int32 +} + +// BastionHostsClientUpdateOptions contains the optional parameters for the BastionHostsClient.Update method. +type BastionHostsClientUpdateOptions struct { + // placeholder for future optional parameters +} + // BulkCreationParameters - Parameters for creating multiple virtual machines as a single action. type BulkCreationParameters struct { // The number of virtual machine instances to create. InstanceCount *int32 `json:"instanceCount,omitempty"` } +// CheckNameAvailabilityRequest - The check availability request body. +type CheckNameAvailabilityRequest struct { + // The name of the resource for which availability needs to be checked. + Name *string `json:"name,omitempty"` + + // The resource type. + Type *string `json:"type,omitempty"` +} + +// CheckNameAvailabilityResponse - The check availability result. +type CheckNameAvailabilityResponse struct { + // Detailed reason why the given name is available. + Message *string `json:"message,omitempty"` + + // Indicates if the resource name is available. + NameAvailable *bool `json:"nameAvailable,omitempty"` + + // The reason why the given name is not available. + Reason *CheckNameAvailabilityReason `json:"reason,omitempty"` +} + // CloudError - Error from a REST request. type CloudError struct { // The cloud error that occurred @@ -474,6 +609,30 @@ type ComputeVMProperties struct { VMSize *string `json:"vmSize,omitempty"` } +// Cost - A cost item. +type Cost struct { + // REQUIRED; The properties of the resource. + Properties *LabCostProperties `json:"properties,omitempty"` + + // The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + // CostThresholdProperties - Properties of a cost threshold item. type CostThresholdProperties struct { // Indicates whether this threshold will be displayed on cost charts. @@ -508,34 +667,37 @@ type CustomImage struct { // REQUIRED; The properties of the resource. Properties *CustomImageProperties `json:"properties,omitempty"` - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } -// CustomImageFragment - A custom image. +// CustomImageFragment - Patch type CustomImageFragment struct { // The tags of the resource. Tags map[string]*string `json:"tags,omitempty"` } -// CustomImageList - The response of a list operation. +// CustomImageList - Contains a list of customImages and their properties type CustomImageList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of customImages and their properties Value []*CustomImage `json:"value,omitempty"` } @@ -602,6 +764,18 @@ type CustomImagePropertiesFromPlan struct { Publisher *string `json:"publisher,omitempty"` } +// CustomImagePropertiesFromPlanFragment - Properties for plan on a custom image. +type CustomImagePropertiesFromPlanFragment struct { + // The id of the plan, equivalent to name of the plan + ID *string `json:"id,omitempty"` + + // The offer for the plan from the marketplace image the custom image is derived from + Offer *string `json:"offer,omitempty"` + + // The publisher for the plan from the marketplace image the custom image is derived from + Publisher *string `json:"publisher,omitempty"` +} + // CustomImagePropertiesFromVM - Properties for creating a custom image from a virtual machine. type CustomImagePropertiesFromVM struct { // The Linux OS information of the VM. @@ -637,7 +811,7 @@ type CustomImagesClientGetOptions struct { type CustomImagesClientListOptions struct { // Specify the $expand query. Example: 'properties($select=vm)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -694,34 +868,37 @@ type Disk struct { // REQUIRED; The properties of the resource. Properties *DiskProperties `json:"properties,omitempty"` - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } -// DiskFragment - A Disk. +// DiskFragment - Patch type DiskFragment struct { // The tags of the resource. Tags map[string]*string `json:"tags,omitempty"` } -// DiskList - The response of a list operation. +// DiskList - Contains a list of disks and their properties type DiskList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of disks and their properties Value []*Disk `json:"value,omitempty"` } @@ -795,7 +972,7 @@ type DisksClientGetOptions struct { type DisksClientListOptions struct { // Specify the $expand query. Example: 'properties($select=diskType)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -813,37 +990,59 @@ type DtlEnvironment struct { // REQUIRED; The properties of the resource. Properties *EnvironmentProperties `json:"properties,omitempty"` - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } -// DtlEnvironmentFragment - An environment, which is essentially an ARM template deployment. +// DtlEnvironmentFragment - Patch type DtlEnvironmentFragment struct { // The tags of the resource. Tags map[string]*string `json:"tags,omitempty"` } -// DtlEnvironmentList - The response of a list operation. +// DtlEnvironmentList - Contains a list of environments and their properties type DtlEnvironmentList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of environments and their properties Value []*DtlEnvironment `json:"value,omitempty"` } +// Encryption settings +type Encryption struct { + // Gets or sets resourceId of the disk encryption set to use for enabling encryption at rest. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + + // Gets or sets the type of key used to encrypt the data of the disk. Possible values include: 'EncryptionAtRestWithPlatformKey', + // 'EncryptionAtRestWithCustomerKey' + Type *EncryptionType `json:"type,omitempty"` +} + +// EncryptionProperties - Configuration of key for data encryption +type EncryptionProperties struct { + // Key vault properties. + KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` + + // Indicates whether or not the encryption is enabled for container registry. + Status *EncryptionStatus `json:"status,omitempty"` +} + // EnvironmentDeploymentProperties - Properties of an environment deployment. type EnvironmentDeploymentProperties struct { // The Azure Resource Manager template's identifier. @@ -897,7 +1096,7 @@ type EnvironmentsClientGetOptions struct { type EnvironmentsClientListOptions struct { // Specify the $expand query. Example: 'properties($select=deploymentProperties)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -910,6 +1109,40 @@ type EnvironmentsClientUpdateOptions struct { // placeholder for future optional parameters } +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty" azure:"ro"` + + // READ-ONLY; The additional info type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` + + // READ-ONLY; The error code. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; The error details. + Details []*ErrorDetail `json:"details,omitempty" azure:"ro"` + + // READ-ONLY; The error message. + Message *string `json:"message,omitempty" azure:"ro"` + + // READ-ONLY; The error target. + Target *string `json:"target,omitempty" azure:"ro"` +} + +// 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 `json:"error,omitempty"` +} + // EvaluatePoliciesProperties - Properties for evaluating a policy set. type EvaluatePoliciesProperties struct { // The fact data. @@ -966,34 +1199,37 @@ type Formula struct { // REQUIRED; The properties of the resource. Properties *FormulaProperties `json:"properties,omitempty"` - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } -// FormulaFragment - A formula for creating a VM, specifying an image base and other parameters +// FormulaFragment - Patch type FormulaFragment struct { // The tags of the resource. Tags map[string]*string `json:"tags,omitempty"` } -// FormulaList - The response of a list operation. +// FormulaList - Contains a list of formulas and their properties type FormulaList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of formulas and their properties Value []*Formula `json:"value,omitempty"` } @@ -1051,7 +1287,7 @@ type FormulasClientGetOptions struct { type FormulasClientListOptions struct { // Specify the $expand query. Example: 'properties($select=description)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -1069,28 +1305,31 @@ type GalleryImage struct { // REQUIRED; The properties of the resource. Properties *GalleryImageProperties `json:"properties,omitempty"` - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } -// GalleryImageList - The response of a list operation. +// GalleryImageList - Contains a list of galleryImages and their properties type GalleryImageList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of galleryImages and their properties Value []*GalleryImage `json:"value,omitempty"` } @@ -1139,11 +1378,16 @@ type GalleryImageReference struct { Version *string `json:"version,omitempty"` } +// GalleryImagesClientGetOptions contains the optional parameters for the GalleryImagesClient.Get method. +type GalleryImagesClientGetOptions struct { + // placeholder for future optional parameters +} + // GalleryImagesClientListOptions contains the optional parameters for the GalleryImagesClient.List method. type GalleryImagesClientListOptions struct { // Specify the $expand query. Example: 'properties($select=author)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -1213,7 +1457,7 @@ type GlobalSchedulesClientGetOptions struct { type GlobalSchedulesClientListByResourceGroupOptions struct { // Specify the $expand query. Example: 'properties($select=status)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -1226,7 +1470,7 @@ type GlobalSchedulesClientListByResourceGroupOptions struct { type GlobalSchedulesClientListBySubscriptionOptions struct { // Specify the $expand query. Example: 'properties($select=status)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -1245,6 +1489,18 @@ type HourDetails struct { Minute *int32 `json:"minute,omitempty"` } +// Identity for the resource. +type Identity struct { + // The identity type. + Type *string `json:"type,omitempty"` + + // READ-ONLY; The principal ID of resource identity. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + + // READ-ONLY; The tenant ID of resource. + TenantID *string `json:"tenantId,omitempty" azure:"ro"` +} + // IdentityProperties - Properties of a managed identity type IdentityProperties struct { // The client secret URL of the identity. @@ -1256,8 +1512,17 @@ type IdentityProperties struct { // The tenant identifier of resource. TenantID *string `json:"tenantId,omitempty"` - // Managed identity. + // Type of identity (SystemAssigned, UserAssigned, None) Type *ManagedIdentityType `json:"type,omitempty"` + + // If Type is 'UserAssigned': List of user assigned identities. + UserAssignedIdentities map[string]interface{} `json:"userAssignedIdentities,omitempty"` +} + +// ImageVersionProperties - Properties for a shared image version. +type ImageVersionProperties struct { + // Image version name + Name *string `json:"name,omitempty"` } // ImportLabVirtualMachineRequest - This represents the payload required to import a virtual machine from a different lab @@ -1283,24 +1548,38 @@ type InboundNatRule struct { TransportProtocol *TransportProtocol `json:"transportProtocol,omitempty"` } +type KeyVaultProperties struct { + // The client ID of the identity which will be used to access key vault. + Identity *string `json:"identity,omitempty"` + + // Key vault uri to access the encryption key. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` +} + // Lab - A lab. type Lab struct { - // The location of the resource. + // The identity of the resource. + Identity *IdentityProperties `json:"identity,omitempty"` + + // The geo-location where the resource lives Location *string `json:"location,omitempty"` // The properties of the resource. Properties *LabProperties `json:"properties,omitempty"` - // The tags of the resource. + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } @@ -1330,22 +1609,25 @@ type LabAnnouncementProperties struct { // LabCost - A cost item. type LabCost struct { - // REQUIRED; The properties of the resource. - Properties *LabCostProperties `json:"properties,omitempty"` - - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // The properties of the resource. + Properties *LabCostProperties `json:"properties,omitempty"` + + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } @@ -1361,6 +1643,15 @@ type LabCostDetailsProperties struct { Date *time.Time `json:"date,omitempty"` } +// LabCostList - Contains a list of costs and their properties +type LabCostList struct { + // URL to get the next set of operation list results if there are any + NextLink *string `json:"nextLink,omitempty"` + + // List of costs and their properties + Value []*LabCost `json:"value,omitempty"` +} + // LabCostProperties - Properties of a cost item. type LabCostProperties struct { // The creation date of the cost. @@ -1400,18 +1691,18 @@ type LabCostSummaryProperties struct { EstimatedLabCost *float64 `json:"estimatedLabCost,omitempty"` } -// LabFragment - A lab. +// LabFragment - Patch type LabFragment struct { // The tags of the resource. Tags map[string]*string `json:"tags,omitempty"` } -// LabList - The response of a list operation. +// LabList - Contains a list of labs and their properties type LabList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of labs and their properties Value []*Lab `json:"value,omitempty"` } @@ -1420,15 +1711,33 @@ type LabProperties struct { // The properties of any lab announcement associated with this lab Announcement *LabAnnouncementProperties `json:"announcement,omitempty"` + // Is browser connect enabled for the lab + BrowserConnect *EnableStatus `json:"browserConnect,omitempty"` + + // Default secret for creating virtual machines. + DefaultSecretName *string `json:"defaultSecretName,omitempty"` + + // Is auto upgrade of CSE disabled for the lab? + DisableAutoUpgradeCseMinorVersion *bool `json:"disableAutoUpgradeCseMinorVersion,omitempty"` + + // Mechanism used for encryption of resources in a lab (such as virtual machines). + Encryption *Encryption `json:"encryption,omitempty"` + // The access rights to be granted to the user when provisioning an environment EnvironmentPermission *EnvironmentPermission `json:"environmentPermission,omitempty"` // Extended properties of the lab used for experimental features ExtendedProperties map[string]*string `json:"extendedProperties,omitempty"` + // Indicates whether to create Lab resources (e.g. Storage accounts and Key Vaults) in network isolation. + IsolateLabResources *EnableStatus `json:"isolateLabResources,omitempty"` + // Type of storage used by the lab. It can be either Premium or Standard. Default is Premium. LabStorageType *StorageType `json:"labStorageType,omitempty"` + // List of identities which can be used for management of resources. + ManagementIdentities map[string]interface{} `json:"managementIdentities,omitempty"` + // The ordered list of artifact resource IDs that should be applied on all Linux VM creations by default, prior to the artifacts // specified by the user. MandatoryArtifactsResourceIDsLinux []*string `json:"mandatoryArtifactsResourceIdsLinux,omitempty"` @@ -1475,8 +1784,8 @@ type LabProperties struct { // READ-ONLY; The unique immutable identifier of a resource (Guid). UniqueIdentifier *string `json:"uniqueIdentifier,omitempty" azure:"ro"` - // READ-ONLY; The resource group in which all new lab virtual machines will be created. To let DevTest Labs manage resource - // group creation, set this value to null. + // READ-ONLY; The resource group ID in which all new lab virtual machines will be created. Ex: /subscriptions/subId/resourceGroups/rgName + // To let DevTest Labs manage resource group creation, set this value to null. VMCreationResourceGroup *string `json:"vmCreationResourceGroup,omitempty" azure:"ro"` // READ-ONLY; The lab's Key vault. @@ -1513,6 +1822,102 @@ type LabResourceCostProperties struct { Resourcename *string `json:"resourcename,omitempty"` } +// LabSecret - A shared secret in a lab. +type LabSecret struct { + // REQUIRED; The properties of the resource. + Properties *LabSecretProperties `json:"properties,omitempty"` + + // The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// LabSecretFragment - Patch +type LabSecretFragment struct { + // The tags of the resource. + Tags map[string]*string `json:"tags,omitempty"` +} + +// LabSecretList - Contains a list of secrets and their properties +type LabSecretList struct { + // URL to get the next set of operation list results if there are any + NextLink *string `json:"nextLink,omitempty"` + + // List of secrets and their properties + Value []*LabSecret `json:"value,omitempty"` +} + +// LabSecretProperties - The properties of labs secrets +type LabSecretProperties struct { + // Is the secret enabled for use with ARM environments? + EnabledForArmEnvironments *bool `json:"enabledForArmEnvironments,omitempty"` + + // Is the secret enabled for use with artifacts? + EnabledForArtifacts *bool `json:"enabledForArtifacts,omitempty"` + + // Is the secret enabled for use with creation of VMs? + EnabledForVMCreation *bool `json:"enabledForVmCreation,omitempty"` + + // The value of the secret for secret creation. + Value *string `json:"value,omitempty"` + + // READ-ONLY; The name of the entry in the lab KeyVault. + KeyVaultEntry *string `json:"keyVaultEntry,omitempty" azure:"ro"` + + // READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty" azure:"ro"` +} + +// LabSecretsClientBeginCreateOrUpdateOptions contains the optional parameters for the LabSecretsClient.BeginCreateOrUpdate +// method. +type LabSecretsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LabSecretsClientBeginDeleteOptions contains the optional parameters for the LabSecretsClient.BeginDelete method. +type LabSecretsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LabSecretsClientGetOptions contains the optional parameters for the LabSecretsClient.Get method. +type LabSecretsClientGetOptions struct { + // placeholder for future optional parameters +} + +// LabSecretsClientListOptions contains the optional parameters for the LabSecretsClient.List method. +type LabSecretsClientListOptions struct { + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' + Filter *string + // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' + Orderby *string + // The maximum number of resources to return from the operation. Example: '$top=10' + Top *int32 +} + +// LabSecretsClientUpdateOptions contains the optional parameters for the LabSecretsClient.Update method. +type LabSecretsClientUpdateOptions struct { + // placeholder for future optional parameters +} + // LabSupportProperties - Properties of a lab's support banner type LabSupportProperties struct { // Is the lab support banner active/enabled at this time? @@ -1528,33 +1933,36 @@ type LabVhd struct { ID *string `json:"id,omitempty"` } -// LabVhdList - The response of a list operation. +// LabVhdList - Contains a list of Lab Vhd and their properties type LabVhdList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of Lab Vhd and their properties Value []*LabVhd `json:"value,omitempty"` } // LabVirtualMachine - A virtual machine. type LabVirtualMachine struct { - // REQUIRED; The properties of the resource. - Properties *LabVirtualMachineProperties `json:"properties,omitempty"` - - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // The properties of the resource. + Properties *LabVirtualMachineProperties `json:"properties,omitempty"` + + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } @@ -1605,6 +2013,9 @@ type LabVirtualMachineCreationParameterProperties struct { // The Microsoft Azure Marketplace image reference of the virtual machine. GalleryImageReference *GalleryImageReference `json:"galleryImageReference,omitempty"` + // The shared gallery image version resource identifier of the virtual machine. + GalleryImageVersionID *string `json:"galleryImageVersionId,omitempty"` + // Indicates whether this virtual machine uses an SSH key for authentication. IsAuthenticationWithSSHKey *bool `json:"isAuthenticationWithSshKey,omitempty"` @@ -1620,6 +2031,10 @@ type LabVirtualMachineCreationParameterProperties struct { // The notes of the virtual machine. Notes *string `json:"notes,omitempty"` + // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a + // virtual machine image. + OSDiskSizeGb *int32 `json:"osDiskSizeGb,omitempty"` + // The object identifier of the owner of the virtual machine. OwnerObjectID *string `json:"ownerObjectId,omitempty"` @@ -1638,28 +2053,73 @@ type LabVirtualMachineCreationParameterProperties struct { // Virtual Machine schedules to be created ScheduleParameters []*ScheduleCreationParameter `json:"scheduleParameters,omitempty"` + // The shared image resource identifier of the virtual machine. + SharedImageID *string `json:"sharedImageId,omitempty"` + + // The shared image version for the specified shared image Id. Will use latest if not specified. + SharedImageVersion *string `json:"sharedImageVersion,omitempty"` + // The size of the virtual machine. Size *string `json:"size,omitempty"` - // Storage type to use for virtual machine (i.e. Standard, Premium). - StorageType *string `json:"storageType,omitempty"` + // Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + StorageType *StorageType `json:"storageType,omitempty"` // The user name of the virtual machine. UserName *string `json:"userName,omitempty"` -} -// LabVirtualMachineFragment - A virtual machine. -type LabVirtualMachineFragment struct { - // The tags of the resource. - Tags map[string]*string `json:"tags,omitempty"` -} + // READ-ONLY; The applicable schedule for the virtual machine. + ApplicableSchedule *ApplicableSchedule `json:"applicableSchedule,omitempty" azure:"ro"` -// LabVirtualMachineList - The response of a list operation. -type LabVirtualMachineList struct { - // Link for next set of results. - NextLink *string `json:"nextLink,omitempty"` + // READ-ONLY; The artifact deployment status for the virtual machine. + ArtifactDeploymentStatus *ArtifactDeploymentStatusProperties `json:"artifactDeploymentStatus,omitempty" azure:"ro"` + + // READ-ONLY; Flag to determine if apply artifacts can be triggered at the time of fetching the document. + CanApplyArtifacts *bool `json:"canApplyArtifacts,omitempty" azure:"ro"` + + // READ-ONLY; The resource identifier (Microsoft.Compute) of the virtual machine. + ComputeID *string `json:"computeId,omitempty" azure:"ro"` + + // READ-ONLY; The compute virtual machine properties. + ComputeVM *ComputeVMProperties `json:"computeVm,omitempty" azure:"ro"` + + // READ-ONLY; The email address of creator of the virtual machine. + CreatedByUser *string `json:"createdByUser,omitempty" azure:"ro"` + + // READ-ONLY; The object identifier of the creator of the virtual machine. + CreatedByUserID *string `json:"createdByUserId,omitempty" azure:"ro"` + + // READ-ONLY; The fully-qualified domain name of the virtual machine. + Fqdn *string `json:"fqdn,omitempty" azure:"ro"` + + // READ-ONLY; Last known compute power state captured in DTL + LastKnownPowerState *string `json:"lastKnownPowerState,omitempty" azure:"ro"` + + // READ-ONLY; The OS type of the virtual machine. + OSType *string `json:"osType,omitempty" azure:"ro"` - // Results of the list operation. + // READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty" azure:"ro"` + + // READ-ONLY; Tells source of creation of lab virtual machine. Output property only. + VirtualMachineCreationSource *VirtualMachineCreationSource `json:"virtualMachineCreationSource,omitempty" azure:"ro"` +} + +// LabVirtualMachineFragment - Patch +type LabVirtualMachineFragment struct { + // The tags of the resource. + Tags map[string]*string `json:"tags,omitempty"` +} + +// LabVirtualMachineList - Contains a list of virtualMachines and their properties +type LabVirtualMachineList struct { + // URL to get the next set of operation list results if there are any + NextLink *string `json:"nextLink,omitempty"` + + // List of virtualMachines and their properties Value []*LabVirtualMachine `json:"value,omitempty"` } @@ -1692,6 +2152,9 @@ type LabVirtualMachineProperties struct { // The Microsoft Azure Marketplace image reference of the virtual machine. GalleryImageReference *GalleryImageReference `json:"galleryImageReference,omitempty"` + // The shared gallery image version resource identifier of the virtual machine. + GalleryImageVersionID *string `json:"galleryImageVersionId,omitempty"` + // Indicates whether this virtual machine uses an SSH key for authentication. IsAuthenticationWithSSHKey *bool `json:"isAuthenticationWithSshKey,omitempty"` @@ -1707,6 +2170,10 @@ type LabVirtualMachineProperties struct { // The notes of the virtual machine. Notes *string `json:"notes,omitempty"` + // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a + // virtual machine image. + OSDiskSizeGb *int32 `json:"osDiskSizeGb,omitempty"` + // The object identifier of the owner of the virtual machine. OwnerObjectID *string `json:"ownerObjectId,omitempty"` @@ -1725,11 +2192,17 @@ type LabVirtualMachineProperties struct { // Virtual Machine schedules to be created ScheduleParameters []*ScheduleCreationParameter `json:"scheduleParameters,omitempty"` + // The shared image resource identifier of the virtual machine. + SharedImageID *string `json:"sharedImageId,omitempty"` + + // The shared image version for the specified shared image Id. Will use latest if not specified. + SharedImageVersion *string `json:"sharedImageVersion,omitempty"` + // The size of the virtual machine. Size *string `json:"size,omitempty"` - // Storage type to use for virtual machine (i.e. Standard, Premium). - StorageType *string `json:"storageType,omitempty"` + // Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + StorageType *StorageTypes `json:"storageType,omitempty"` // The user name of the virtual machine. UserName *string `json:"userName,omitempty"` @@ -1740,6 +2213,9 @@ type LabVirtualMachineProperties struct { // READ-ONLY; The artifact deployment status for the virtual machine. ArtifactDeploymentStatus *ArtifactDeploymentStatusProperties `json:"artifactDeploymentStatus,omitempty" azure:"ro"` + // READ-ONLY; Flag to determine if apply artifacts can be triggered at the time of fetching the document. + CanApplyArtifacts *bool `json:"canApplyArtifacts,omitempty" azure:"ro"` + // READ-ONLY; The resource identifier (Microsoft.Compute) of the virtual machine. ComputeID *string `json:"computeId,omitempty" azure:"ro"` @@ -1809,6 +2285,12 @@ type LabsClientBeginImportVirtualMachineOptions struct { ResumeToken string } +// LabsClientEnsureCurrentUserProfileOptions contains the optional parameters for the LabsClient.EnsureCurrentUserProfile +// method. +type LabsClientEnsureCurrentUserProfileOptions struct { + // placeholder for future optional parameters +} + // LabsClientGenerateUploadURIOptions contains the optional parameters for the LabsClient.GenerateUploadURI method. type LabsClientGenerateUploadURIOptions struct { // placeholder for future optional parameters @@ -1824,7 +2306,7 @@ type LabsClientGetOptions struct { type LabsClientListByResourceGroupOptions struct { // Specify the $expand query. Example: 'properties($select=defaultStorageAccount)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -1836,7 +2318,7 @@ type LabsClientListByResourceGroupOptions struct { type LabsClientListBySubscriptionOptions struct { // Specify the $expand query. Example: 'properties($select=defaultStorageAccount)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -1860,6 +2342,21 @@ type LinuxOsInfo struct { LinuxOsState *LinuxOsState `json:"linuxOsState,omitempty"` } +// LocationData - Metadata pertaining to the geographic location of the resource. +type LocationData struct { + // REQUIRED; A canonical name for the geographic or physical location. + Name *string `json:"name,omitempty"` + + // The city or locality where the resource is located. + City *string `json:"city,omitempty"` + + // The country or region where the resource is located + CountryOrRegion *string `json:"countryOrRegion,omitempty"` + + // The district, state, or province where the resource is located. + District *string `json:"district,omitempty"` +} + // NetworkInterfaceProperties - Properties of a network interface. type NetworkInterfaceProperties struct { // The DNS name. @@ -1893,37 +2390,40 @@ type NetworkInterfaceProperties struct { // NotificationChannel - A notification. type NotificationChannel struct { - // REQUIRED; The properties of the resource. - Properties *NotificationChannelProperties `json:"properties,omitempty"` - - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // The properties of the resource. + Properties *NotificationChannelProperties `json:"properties,omitempty"` + + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } -// NotificationChannelFragment - A notification. +// NotificationChannelFragment - Patch type NotificationChannelFragment struct { // The tags of the resource. Tags map[string]*string `json:"tags,omitempty"` } -// NotificationChannelList - The response of a list operation. +// NotificationChannelList - Contains a list of notificationChannels and their properties type NotificationChannelList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of notificationChannels and their properties Value []*NotificationChannel `json:"value,omitempty"` } @@ -1975,7 +2475,7 @@ type NotificationChannelsClientGetOptions struct { type NotificationChannelsClientListOptions struct { // Specify the $expand query. Example: 'properties($select=webHookUrl)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -2020,6 +2520,45 @@ type NotifyParameters struct { JSONPayload *string `json:"jsonPayload,omitempty"` } +// Operation - Details of a REST API operation, returned from the Resource Provider Operations API +type Operation struct { + // Localized display information for this particular operation. + Display *OperationDisplay `json:"display,omitempty"` + + // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType `json:"actionType,omitempty" azure:"ro"` + + // 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 `json:"isDataAction,omitempty" azure:"ro"` + + // 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 `json:"name,omitempty" azure:"ro"` + + // 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 `json:"origin,omitempty" azure:"ro"` +} + +// 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 `json:"description,omitempty" azure:"ro"` + + // 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 `json:"operation,omitempty" azure:"ro"` + + // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + // Compute". + Provider *string `json:"provider,omitempty" azure:"ro"` + + // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + // Schedule Collections". + Resource *string `json:"resource,omitempty" azure:"ro"` +} + // OperationError - Error details for the operation in case of a failure. type OperationError struct { // The error code of the operation error. @@ -2029,6 +2568,16 @@ type OperationError struct { Message *string `json:"message,omitempty"` } +// 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 `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; List of operations supported by the resource provider + Value []*Operation `json:"value,omitempty" azure:"ro"` +} + // OperationMetadata - The REST API operation supported by DevTestLab ResourceProvider. type OperationMetadata struct { // The object that describes the operations @@ -2065,6 +2614,33 @@ type OperationResult struct { StatusCode *HTTPStatusCode `json:"statusCode,omitempty"` } +// OperationStatusResult - The current status of an async operation. +type OperationStatusResult struct { + // REQUIRED; Operation status. + Status *string `json:"status,omitempty"` + + // The end time of the operation. + EndTime *time.Time `json:"endTime,omitempty"` + + // If present, details of the operation error. + Error *ErrorDetail `json:"error,omitempty"` + + // Fully qualified ID for the async operation. + ID *string `json:"id,omitempty"` + + // Name of the async operation. + Name *string `json:"name,omitempty"` + + // The operations list. + Operations []*OperationStatusResult `json:"operations,omitempty"` + + // Percent of the operation that is complete. + PercentComplete *float32 `json:"percentComplete,omitempty"` + + // The start time of the operation. + StartTime *time.Time `json:"startTime,omitempty"` +} + // OperationsClientGetOptions contains the optional parameters for the OperationsClient.Get method. type OperationsClientGetOptions struct { // placeholder for future optional parameters @@ -2094,6 +2670,25 @@ type PercentageCostThresholdProperties struct { ThresholdValue *float64 `json:"thresholdValue,omitempty"` } +// Plan for the resource. +type Plan struct { + // REQUIRED; A user defined name of the 3rd Party Artifact that is being procured. + Name *string `json:"name,omitempty"` + + // REQUIRED; The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact + // at the time of Data Market onboarding. + Product *string `json:"product,omitempty"` + + // REQUIRED; The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic + Publisher *string `json:"publisher,omitempty"` + + // A publisher provided promotion code as provisioned in Data Market for the said product/artifact. + PromotionCode *string `json:"promotionCode,omitempty"` + + // The version of the desired product/artifact. + Version *string `json:"version,omitempty"` +} + // PoliciesClientCreateOrUpdateOptions contains the optional parameters for the PoliciesClient.CreateOrUpdate method. type PoliciesClientCreateOrUpdateOptions struct { // placeholder for future optional parameters @@ -2114,7 +2709,7 @@ type PoliciesClientGetOptions struct { type PoliciesClientListOptions struct { // Specify the $expand query. Example: 'properties($select=description)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -2129,37 +2724,40 @@ type PoliciesClientUpdateOptions struct { // Policy - A Policy. type Policy struct { - // REQUIRED; The properties of the resource. - Properties *PolicyProperties `json:"properties,omitempty"` - - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // The properties of the resource. + Properties *PolicyProperties `json:"properties,omitempty"` + + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } -// PolicyFragment - A Policy. +// PolicyFragment - Patch type PolicyFragment struct { // The tags of the resource. Tags map[string]*string `json:"tags,omitempty"` } -// PolicyList - The response of a list operation. +// PolicyList - Contains a list of policies and their properties type PolicyList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of policies and their properties Value []*Policy `json:"value,omitempty"` } @@ -2193,6 +2791,48 @@ type PolicyProperties struct { UniqueIdentifier *string `json:"uniqueIdentifier,omitempty" azure:"ro"` } +// PolicySet - A PolicySet. +type PolicySet struct { + // The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // The properties of the resource. + Properties *PolicySetProperties `json:"properties,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PolicySetList - Contains a list of policySets and their properties +type PolicySetList struct { + // URL to get the next set of operation list results if there are any + NextLink *string `json:"nextLink,omitempty"` + + // READ-ONLY; List of policySets and their properties + Value []*PolicySet `json:"value,omitempty" azure:"ro"` +} + +// PolicySetProperties - Properties of a PolicySet. +type PolicySetProperties struct { + // READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty" azure:"ro"` +} + // PolicySetResult - Result of a policy set evaluation. type PolicySetResult struct { // A value indicating whether this policy set evaluation has discovered violations. @@ -2207,6 +2847,16 @@ type PolicySetsClientEvaluatePoliciesOptions struct { // placeholder for future optional parameters } +// PolicySetsClientListOptions contains the optional parameters for the PolicySetsClient.List method. +type PolicySetsClientListOptions struct { + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' + Filter *string + // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' + Orderby *string + // The maximum number of resources to return from the operation. Example: '$top=10' + Top *int32 +} + // PolicyViolation - Policy violation. type PolicyViolation struct { // The code of the policy violation. @@ -2239,6 +2889,25 @@ type ProviderOperationsClientListOptions 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 { + // The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + // RdpConnection - Represents a .rdp file type RdpConnection struct { // The contents of the .rdp file @@ -2251,24 +2920,111 @@ type ResizeLabVirtualMachineProperties struct { Size *string `json:"size,omitempty"` } -// Resource - An Azure resource. +// Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ResourceModelWithAllowedPropertySet - The resource model definition containing the full set of allowed properties for a +// resource. Except properties bag, there cannot be a top level property outside of this set. +type ResourceModelWithAllowedPropertySet struct { + Identity *ResourceModelWithAllowedPropertySetIdentity `json:"identity,omitempty"` + + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are + // a kind of Microsoft.Web/sites type. If supported, the resource provider must + // validate and persist this value. + Kind *string `json:"kind,omitempty"` + + // The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another + // Azure resource. If this is present, complete mode deployment will not + // delete the resource if it is removed from the template since it is managed by another resource. + ManagedBy *string `json:"managedBy,omitempty"` + Plan *ResourceModelWithAllowedPropertySetPlan `json:"plan,omitempty"` + SKU *ResourceModelWithAllowedPropertySetSKU `json:"sku,omitempty"` + + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; The etag field is not required. If it is provided in the response body, it must also be provided as a header + // per the normal etag convention. Entity tags are used for comparing two or more entities + // from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match + // (section 14.26), and If-Range (section 14.27) header fields. + Etag *string `json:"etag,omitempty" azure:"ro"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } +type ResourceModelWithAllowedPropertySetIdentity struct { + // The identity type. + Type *string `json:"type,omitempty"` + + // READ-ONLY; The principal ID of resource identity. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + + // READ-ONLY; The tenant ID of resource. + TenantID *string `json:"tenantId,omitempty" azure:"ro"` +} + +type ResourceModelWithAllowedPropertySetPlan struct { + // REQUIRED; A user defined name of the 3rd Party Artifact that is being procured. + Name *string `json:"name,omitempty"` + + // REQUIRED; The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact + // at the time of Data Market onboarding. + Product *string `json:"product,omitempty"` + + // REQUIRED; The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic + Publisher *string `json:"publisher,omitempty"` + + // A publisher provided promotion code as provisioned in Data Market for the said product/artifact. + PromotionCode *string `json:"promotionCode,omitempty"` + + // The version of the desired product/artifact. + Version *string `json:"version,omitempty"` +} + +type ResourceModelWithAllowedPropertySetSKU struct { + // REQUIRED; The name of the SKU. Ex - P3. It is typically a letter+number code + Name *string `json:"name,omitempty"` + + // If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the + // resource this may be omitted. + Capacity *int32 `json:"capacity,omitempty"` + + // If the service has different generations of hardware, for the same SKU, then that can be captured here. + Family *string `json:"family,omitempty"` + + // The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + Size *string `json:"size,omitempty"` + + // This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required + // on a PUT. + Tier *SKUTier `json:"tier,omitempty"` +} + // RetargetScheduleProperties - Properties for retargeting a virtual machine schedule. type RetargetScheduleProperties struct { // The resource Id of the virtual machine on which the schedule operates @@ -2278,24 +3034,47 @@ type RetargetScheduleProperties struct { TargetResourceID *string `json:"targetResourceId,omitempty"` } +// SKU - The resource model definition representing SKU +type SKU struct { + // REQUIRED; The name of the SKU. Ex - P3. It is typically a letter+number code + Name *string `json:"name,omitempty"` + + // If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the + // resource this may be omitted. + Capacity *int32 `json:"capacity,omitempty"` + + // If the service has different generations of hardware, for the same SKU, then that can be captured here. + Family *string `json:"family,omitempty"` + + // The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + Size *string `json:"size,omitempty"` + + // This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required + // on a PUT. + Tier *SKUTier `json:"tier,omitempty"` +} + // Schedule - A schedule. type Schedule struct { - // REQUIRED; The properties of the resource. - Properties *ScheduleProperties `json:"properties,omitempty"` - - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // The properties of the resource. + Properties *ScheduleProperties `json:"properties,omitempty"` + + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } @@ -2339,20 +3118,29 @@ type ScheduleCreationParameterProperties struct { // If the schedule will occur only some days of the week, specify the weekly recurrence. WeeklyRecurrence *WeekDetails `json:"weeklyRecurrence,omitempty"` + + // READ-ONLY; The creation date of the schedule. + CreatedDate *time.Time `json:"createdDate,omitempty" azure:"ro"` + + // READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty" azure:"ro"` } -// ScheduleFragment - A schedule. +// ScheduleFragment - Patch type ScheduleFragment struct { // The tags of the resource. Tags map[string]*string `json:"tags,omitempty"` } -// ScheduleList - The response of a list operation. +// ScheduleList - Contains a list of schedules and their properties type ScheduleList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of schedules and their properties Value []*Schedule `json:"value,omitempty"` } @@ -2423,7 +3211,7 @@ type SchedulesClientListApplicableOptions struct { type SchedulesClientListOptions struct { // Specify the $expand query. Example: 'properties($select=status)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -2438,37 +3226,40 @@ type SchedulesClientUpdateOptions struct { // Secret - A secret. type Secret struct { - // REQUIRED; The properties of the resource. - Properties *SecretProperties `json:"properties,omitempty"` - - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // The properties of the resource. + Properties *SecretProperties `json:"properties,omitempty"` + + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } -// SecretFragment - A secret. +// SecretFragment - Patch type SecretFragment struct { // The tags of the resource. Tags map[string]*string `json:"tags,omitempty"` } -// SecretList - The response of a list operation. +// SecretList - Contains a list of secrets and their properties type SecretList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of secrets and their properties Value []*Secret `json:"value,omitempty"` } @@ -2505,7 +3296,7 @@ type SecretsClientGetOptions struct { type SecretsClientListOptions struct { // Specify the $expand query. Example: 'properties($select=value)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -2520,37 +3311,40 @@ type SecretsClientUpdateOptions struct { // ServiceFabric - A Service Fabric. type ServiceFabric struct { - // REQUIRED; The properties of the resource. - Properties *ServiceFabricProperties `json:"properties,omitempty"` - - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // The properties of the resource. + Properties *ServiceFabricProperties `json:"properties,omitempty"` + + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } -// ServiceFabricFragment - A Service Fabric. +// ServiceFabricFragment - Patch type ServiceFabricFragment struct { // The tags of the resource. Tags map[string]*string `json:"tags,omitempty"` } -// ServiceFabricList - The response of a list operation. +// ServiceFabricList - Contains a list of serviceFabrics and their properties type ServiceFabricList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of serviceFabrics and their properties Value []*ServiceFabric `json:"value,omitempty"` } @@ -2601,7 +3395,7 @@ type ServiceFabricSchedulesClientGetOptions struct { type ServiceFabricSchedulesClientListOptions struct { // Specify the $expand query. Example: 'properties($select=status)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -2656,7 +3450,7 @@ type ServiceFabricsClientListApplicableSchedulesOptions struct { type ServiceFabricsClientListOptions struct { // Specify the $expand query. Example: 'properties($expand=applicableSchedule)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -2674,40 +3468,60 @@ type ServiceRunner struct { // The identity of the resource. Identity *IdentityProperties `json:"identity,omitempty"` - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The tags of the resource. + // The properties of the resource. + Properties *ServiceRunnerProperties `json:"properties,omitempty"` + + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } -// ServiceRunnerList - The response of a list operation. +// ServiceRunnerList - Contains a list of serviceRunners and their properties type ServiceRunnerList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of serviceRunners and their properties Value []*ServiceRunner `json:"value,omitempty"` } -// ServiceRunnersClientCreateOrUpdateOptions contains the optional parameters for the ServiceRunnersClient.CreateOrUpdate +// ServiceRunnerProperties - Properties of a virtual machine. +type ServiceRunnerProperties struct { + // The purpose of bringing the identity to the lab. Ex: To use during Environment creation or to deploy on the VMs. + IdentityUsageType *string `json:"identityUsageType,omitempty"` + + // READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty" azure:"ro"` +} + +// ServiceRunnersClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceRunnersClient.BeginCreateOrUpdate // method. -type ServiceRunnersClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +type ServiceRunnersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// ServiceRunnersClientDeleteOptions contains the optional parameters for the ServiceRunnersClient.Delete method. -type ServiceRunnersClientDeleteOptions struct { - // placeholder for future optional parameters +// ServiceRunnersClientBeginDeleteOptions contains the optional parameters for the ServiceRunnersClient.BeginDelete method. +type ServiceRunnersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // ServiceRunnersClientGetOptions contains the optional parameters for the ServiceRunnersClient.Get method. @@ -2715,53 +3529,208 @@ type ServiceRunnersClientGetOptions struct { // placeholder for future optional parameters } -// SharedPublicIPAddressConfiguration - Properties of a virtual machine that determine how it is connected to a load balancer. -type SharedPublicIPAddressConfiguration struct { - // The incoming NAT rules - InboundNatRules []*InboundNatRule `json:"inboundNatRules,omitempty"` +// ServiceRunnersClientListOptions contains the optional parameters for the ServiceRunnersClient.List method. +type ServiceRunnersClientListOptions struct { + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' + Filter *string + // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' + Orderby *string + // The maximum number of resources to return from the operation. Example: '$top=10' + Top *int32 } -// ShutdownNotificationContent - The contents of a shutdown notification. Webhooks can use this type to deserialize the request -// body when they get notified of an imminent shutdown. -type ShutdownNotificationContent struct { - // The URL to delay shutdown by 2 hours. - DelayUrl120 *string `json:"delayUrl120,omitempty"` +// SharedGalleriesClientCreateOrUpdateOptions contains the optional parameters for the SharedGalleriesClient.CreateOrUpdate +// method. +type SharedGalleriesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} - // The URL to delay shutdown by 60 minutes. - DelayUrl60 *string `json:"delayUrl60,omitempty"` +// SharedGalleriesClientDeleteOptions contains the optional parameters for the SharedGalleriesClient.Delete method. +type SharedGalleriesClientDeleteOptions struct { + // placeholder for future optional parameters +} - // The event for which a notification will be sent. - EventType *string `json:"eventType,omitempty"` +// SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method. +type SharedGalleriesClientGetOptions struct { + // Specify the $expand query. Example: 'properties($select=identity)' + Expand *string +} - // The GUID for the virtual machine to be shut down. - GUID *string `json:"guid,omitempty"` +// SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.List method. +type SharedGalleriesClientListOptions struct { + // Specify the $expand query. Example: 'properties($select=identity)' + Expand *string + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' + Filter *string + // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' + Orderby *string + // The maximum number of resources to return from the operation. Example: '$top=10' + Top *int32 +} - // The lab for the schedule. - LabName *string `json:"labName,omitempty"` +// SharedGalleriesClientUpdateOptions contains the optional parameters for the SharedGalleriesClient.Update method. +type SharedGalleriesClientUpdateOptions struct { + // placeholder for future optional parameters +} - // Minutes remaining until shutdown - MinutesUntilShutdown *string `json:"minutesUntilShutdown,omitempty"` +// SharedGallery - Properties of a shared gallery +type SharedGallery struct { + // The geo-location where the resource lives + Location *string `json:"location,omitempty"` - // The owner of the virtual machine. - Owner *string `json:"owner,omitempty"` + // The properties of the resource. + Properties *SharedGalleryProperties `json:"properties,omitempty"` - // The resource group name for the schedule. - ResourceGroupName *string `json:"resourceGroupName,omitempty"` + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` - // The URL to skip auto-shutdown. - SkipURL *string `json:"skipUrl,omitempty"` + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` - // The subscription ID for the schedule. - SubscriptionID *string `json:"subscriptionId,omitempty"` + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` - // The text for the notification. - Text *string `json:"text,omitempty"` + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - // The virtual machine to be shut down. - VMName *string `json:"vmName,omitempty"` + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} - // The URL of the virtual machine. - VMURL *string `json:"vmUrl,omitempty"` +// SharedGalleryFragment - Patch +type SharedGalleryFragment struct { + // The tags of the resource. + Tags map[string]*string `json:"tags,omitempty"` +} + +// SharedGalleryList - Contains a list of sharedGalleries and their properties +type SharedGalleryList struct { + // URL to get the next set of operation list results if there are any + NextLink *string `json:"nextLink,omitempty"` + + // List of sharedGalleries and their properties + Value []*SharedGallery `json:"value,omitempty"` +} + +// SharedGalleryProperties - Properties of a shared gallery +type SharedGalleryProperties struct { + // Enables all images in the gallery to be available in the lab for VM creation. This will override the EnableState on shared + // images + AllowAllImages *EnableState `json:"allowAllImages,omitempty"` + + // The shared image gallery resource Id + GalleryID *string `json:"galleryId,omitempty"` + + // READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty" azure:"ro"` +} + +// SharedImage - Properties of a shared image +type SharedImage struct { + // The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // The properties of the resource. + Properties *SharedImageProperties `json:"properties,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// SharedImageFragment - Patch +type SharedImageFragment struct { + // The tags of the resource. + Tags map[string]*string `json:"tags,omitempty"` +} + +// SharedImageList - Contains a list of sharedImages and their properties +type SharedImageList struct { + // URL to get the next set of operation list results if there are any + NextLink *string `json:"nextLink,omitempty"` + + // List of sharedImages and their properties + Value []*SharedImage `json:"value,omitempty"` +} + +// SharedImageProperties - Properties of a shared image +type SharedImageProperties struct { + // Shared Image definition name in shared image gallery + DefinitionName *string `json:"definitionName,omitempty"` + + // Display name of the image + DisplayName *string `json:"displayName,omitempty"` + + // Whether or not the image is enabled. + EnableState *EnableState `json:"enableState,omitempty"` + + // The type of image in the gallery (generalized or specialized) + ImageType *ImageType `json:"imageType,omitempty"` + + // The operating system of the image + OSType *OsType `json:"osType,omitempty"` + + // List of image versions in definition + Versions []*ImageVersionProperties `json:"versions,omitempty"` + + // READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty" azure:"ro"` +} + +// SharedImagesClientCreateOrUpdateOptions contains the optional parameters for the SharedImagesClient.CreateOrUpdate method. +type SharedImagesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// SharedImagesClientDeleteOptions contains the optional parameters for the SharedImagesClient.Delete method. +type SharedImagesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// SharedImagesClientGetOptions contains the optional parameters for the SharedImagesClient.Get method. +type SharedImagesClientGetOptions struct { + // Specify the $expand query. Example: 'properties($expand=versions)' + Expand *string +} + +// SharedImagesClientListOptions contains the optional parameters for the SharedImagesClient.List method. +type SharedImagesClientListOptions struct { + // Specify the $expand query. Example: 'properties($expand=versions)' + Expand *string + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' + Filter *string + // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' + Orderby *string + // The maximum number of resources to return from the operation. Example: '$top=10' + Top *int32 +} + +// SharedImagesClientUpdateOptions contains the optional parameters for the SharedImagesClient.Update method. +type SharedImagesClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// SharedPublicIPAddressConfiguration - Properties of a virtual machine that determine how it is connected to a load balancer. +type SharedPublicIPAddressConfiguration struct { + // The incoming NAT rules + InboundNatRules []*InboundNatRule `json:"inboundNatRules,omitempty"` } // Subnet information. @@ -2803,6 +3772,27 @@ type SubnetSharedPublicIPAddressConfiguration struct { AllowedPorts []*Port `json:"allowedPorts,omitempty"` } +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time `json:"createdAt,omitempty"` + + // The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + + // The type of identity that created the resource. + CreatedByType *CreatedByType `json:"createdByType,omitempty"` + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + + // The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` +} + // TargetCostProperties - Properties of a cost target. type TargetCostProperties struct { // Cost thresholds. @@ -2832,26 +3822,29 @@ type UpdateResource struct { // User - Profile of a lab user. type User struct { - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` // The properties of the resource. Properties *UserProperties `json:"properties,omitempty"` - // The tags of the resource. + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } -// UserFragment - Profile of a lab user. +// UserFragment - Patch type UserFragment struct { // The tags of the resource. Tags map[string]*string `json:"tags,omitempty"` @@ -2876,12 +3869,12 @@ type UserIdentity struct { TenantID *string `json:"tenantId,omitempty"` } -// UserList - The response of a list operation. +// UserList - Contains a list of users and their properties type UserList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of users and their properties Value []*User `json:"value,omitempty"` } @@ -2934,7 +3927,7 @@ type UsersClientGetOptions struct { type UsersClientListOptions struct { // Specify the $expand query. Example: 'properties($select=identity)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -2976,7 +3969,7 @@ type VirtualMachineSchedulesClientGetOptions struct { type VirtualMachineSchedulesClientListOptions struct { // Specify the $expand query. Example: 'properties($select=status)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -3074,6 +4067,12 @@ type VirtualMachinesClientBeginUnClaimOptions struct { ResumeToken string } +// VirtualMachinesClientClearArtifactResultsOptions contains the optional parameters for the VirtualMachinesClient.ClearArtifactResults +// method. +type VirtualMachinesClientClearArtifactResultsOptions struct { + // placeholder for future optional parameters +} + // VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method. type VirtualMachinesClientGetOptions struct { // Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' @@ -3096,7 +4095,7 @@ type VirtualMachinesClientListApplicableSchedulesOptions struct { type VirtualMachinesClientListOptions struct { // Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -3111,37 +4110,40 @@ type VirtualMachinesClientUpdateOptions struct { // VirtualNetwork - A virtual network. type VirtualNetwork struct { - // The location of the resource. + // The geo-location where the resource lives Location *string `json:"location,omitempty"` // The properties of the resource. Properties *VirtualNetworkProperties `json:"properties,omitempty"` - // The tags of the resource. + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The identifier of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The name of the resource. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. + // READ-ONLY; The system metadata relating to this resource + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } -// VirtualNetworkFragment - A virtual network. +// VirtualNetworkFragment - Patch type VirtualNetworkFragment struct { // The tags of the resource. Tags map[string]*string `json:"tags,omitempty"` } -// VirtualNetworkList - The response of a list operation. +// VirtualNetworkList - Contains a list of virtualNetworks and their properties type VirtualNetworkList struct { - // Link for next set of results. + // URL to get the next set of operation list results if there are any NextLink *string `json:"nextLink,omitempty"` - // Results of the list operation. + // List of virtualNetworks and their properties Value []*VirtualNetwork `json:"value,omitempty"` } @@ -3195,7 +4197,7 @@ type VirtualNetworksClientGetOptions struct { type VirtualNetworksClientListOptions struct { // Specify the $expand query. Example: 'properties($expand=externalSubnets)' Expand *string - // The filter to apply to the operation. Example: '$filter=contains(name,'myName') + // The filter to apply to the operation. Example: '$filter=contains(name,'myName')' Filter *string // The ordering expression for the results, using OData notation. Example: '$orderby=name desc' Orderby *string @@ -3217,6 +4219,15 @@ type WeekDetails struct { Weekdays []*string `json:"weekdays,omitempty"` } +// WeekDetailsFragment - Properties of a weekly schedule. +type WeekDetailsFragment struct { + // The time of the day the schedule will occur. + Time *string `json:"time,omitempty"` + + // The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, etc.). + Weekdays []*string `json:"weekdays,omitempty"` +} + // WindowsOsInfo - Information about a Windows OS. type WindowsOsInfo struct { // The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, SysprepApplied). diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/models_serde.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/models_serde.go new file mode 100644 index 000000000000..914c7025429d --- /dev/null +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/models_serde.go @@ -0,0 +1,7955 @@ +//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 armdevtestlabs + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type ApplicableSchedule. +func (a ApplicableSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 ApplicableSchedule. +func (a *ApplicableSchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "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", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicableScheduleProperties. +func (a ApplicableScheduleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "labVmsShutdown", a.LabVMsShutdown) + populate(objectMap, "labVmsStartup", a.LabVMsStartup) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicableScheduleProperties. +func (a *ApplicableScheduleProperties) UnmarshalJSON(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 "labVmsShutdown": + err = unpopulate(val, "LabVMsShutdown", &a.LabVMsShutdown) + delete(rawMsg, key) + case "labVmsStartup": + err = unpopulate(val, "LabVMsStartup", &a.LabVMsStartup) + 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 ApplyArtifactsRequest. +func (a ApplyArtifactsRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "artifacts", a.Artifacts) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplyArtifactsRequest. +func (a *ApplyArtifactsRequest) UnmarshalJSON(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 "artifacts": + err = unpopulate(val, "Artifacts", &a.Artifacts) + 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 ArmTemplate. +func (a ArmTemplate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 ArmTemplate. +func (a *ArmTemplate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "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", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArmTemplateInfo. +func (a ArmTemplateInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "parameters", &a.Parameters) + populate(objectMap, "template", &a.Template) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmTemplateInfo. +func (a *ArmTemplateInfo) UnmarshalJSON(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 "parameters": + err = unpopulate(val, "Parameters", &a.Parameters) + delete(rawMsg, key) + case "template": + err = unpopulate(val, "Template", &a.Template) + 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 ArmTemplateList. +func (a ArmTemplateList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmTemplateList. +func (a *ArmTemplateList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArmTemplateParameterProperties. +func (a ArmTemplateParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", a.Name) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmTemplateParameterProperties. +func (a *ArmTemplateParameterProperties) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArmTemplateProperties. +func (a ArmTemplateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contents", &a.Contents) + populateTimeRFC3339(objectMap, "createdDate", a.CreatedDate) + populate(objectMap, "description", a.Description) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "enabled", a.Enabled) + populate(objectMap, "icon", a.Icon) + populate(objectMap, "parametersValueFilesInfo", a.ParametersValueFilesInfo) + populate(objectMap, "publisher", a.Publisher) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmTemplateProperties. +func (a *ArmTemplateProperties) UnmarshalJSON(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 "contents": + err = unpopulate(val, "Contents", &a.Contents) + delete(rawMsg, key) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &a.CreatedDate) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &a.Enabled) + delete(rawMsg, key) + case "icon": + err = unpopulate(val, "Icon", &a.Icon) + delete(rawMsg, key) + case "parametersValueFilesInfo": + err = unpopulate(val, "ParametersValueFilesInfo", &a.ParametersValueFilesInfo) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &a.Publisher) + 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 Artifact. +func (a Artifact) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 Artifact. +func (a *Artifact) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "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", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArtifactDeploymentStatusProperties. +func (a ArtifactDeploymentStatusProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "artifactsApplied", a.ArtifactsApplied) + populate(objectMap, "deploymentStatus", a.DeploymentStatus) + populate(objectMap, "totalArtifacts", a.TotalArtifacts) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactDeploymentStatusProperties. +func (a *ArtifactDeploymentStatusProperties) UnmarshalJSON(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 "artifactsApplied": + err = unpopulate(val, "ArtifactsApplied", &a.ArtifactsApplied) + delete(rawMsg, key) + case "deploymentStatus": + err = unpopulate(val, "DeploymentStatus", &a.DeploymentStatus) + delete(rawMsg, key) + case "totalArtifacts": + err = unpopulate(val, "TotalArtifacts", &a.TotalArtifacts) + 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 ArtifactInstallProperties. +func (a ArtifactInstallProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "artifactId", a.ArtifactID) + populate(objectMap, "artifactTitle", a.ArtifactTitle) + populate(objectMap, "deploymentStatusMessage", a.DeploymentStatusMessage) + populateTimeRFC3339(objectMap, "installTime", a.InstallTime) + populate(objectMap, "parameters", a.Parameters) + populate(objectMap, "status", a.Status) + populate(objectMap, "vmExtensionStatusMessage", a.VMExtensionStatusMessage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactInstallProperties. +func (a *ArtifactInstallProperties) UnmarshalJSON(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 "artifactId": + err = unpopulate(val, "ArtifactID", &a.ArtifactID) + delete(rawMsg, key) + case "artifactTitle": + err = unpopulate(val, "ArtifactTitle", &a.ArtifactTitle) + delete(rawMsg, key) + case "deploymentStatusMessage": + err = unpopulate(val, "DeploymentStatusMessage", &a.DeploymentStatusMessage) + delete(rawMsg, key) + case "installTime": + err = unpopulateTimeRFC3339(val, "InstallTime", &a.InstallTime) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &a.Parameters) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + case "vmExtensionStatusMessage": + err = unpopulate(val, "VMExtensionStatusMessage", &a.VMExtensionStatusMessage) + 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 ArtifactList. +func (a ArtifactList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactList. +func (a *ArtifactList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArtifactParameterProperties. +func (a ArtifactParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", a.Name) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactParameterProperties. +func (a *ArtifactParameterProperties) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArtifactProperties. +func (a ArtifactProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdDate", a.CreatedDate) + populate(objectMap, "description", a.Description) + populate(objectMap, "filePath", a.FilePath) + populate(objectMap, "icon", a.Icon) + populate(objectMap, "parameters", &a.Parameters) + populate(objectMap, "publisher", a.Publisher) + populate(objectMap, "targetOsType", a.TargetOsType) + populate(objectMap, "title", a.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactProperties. +func (a *ArtifactProperties) UnmarshalJSON(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 "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &a.CreatedDate) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "filePath": + err = unpopulate(val, "FilePath", &a.FilePath) + delete(rawMsg, key) + case "icon": + err = unpopulate(val, "Icon", &a.Icon) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &a.Parameters) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &a.Publisher) + delete(rawMsg, key) + case "targetOsType": + err = unpopulate(val, "TargetOsType", &a.TargetOsType) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &a.Title) + 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 ArtifactSource. +func (a ArtifactSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 ArtifactSource. +func (a *ArtifactSource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "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", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArtifactSourceFragment. +func (a ArtifactSourceFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactSourceFragment. +func (a *ArtifactSourceFragment) UnmarshalJSON(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 "tags": + err = unpopulate(val, "Tags", &a.Tags) + 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 ArtifactSourceList. +func (a ArtifactSourceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactSourceList. +func (a *ArtifactSourceList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArtifactSourceProperties. +func (a ArtifactSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "armTemplateFolderPath", a.ArmTemplateFolderPath) + populate(objectMap, "branchRef", a.BranchRef) + populateTimeRFC3339(objectMap, "createdDate", a.CreatedDate) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "folderPath", a.FolderPath) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "securityToken", a.SecurityToken) + populate(objectMap, "sourceType", a.SourceType) + populate(objectMap, "status", a.Status) + populate(objectMap, "uri", a.URI) + populate(objectMap, "uniqueIdentifier", a.UniqueIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactSourceProperties. +func (a *ArtifactSourceProperties) UnmarshalJSON(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 "armTemplateFolderPath": + err = unpopulate(val, "ArmTemplateFolderPath", &a.ArmTemplateFolderPath) + delete(rawMsg, key) + case "branchRef": + err = unpopulate(val, "BranchRef", &a.BranchRef) + delete(rawMsg, key) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &a.CreatedDate) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "folderPath": + err = unpopulate(val, "FolderPath", &a.FolderPath) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "securityToken": + err = unpopulate(val, "SecurityToken", &a.SecurityToken) + delete(rawMsg, key) + case "sourceType": + err = unpopulate(val, "SourceType", &a.SourceType) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &a.URI) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &a.UniqueIdentifier) + 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 AttachDiskProperties. +func (a AttachDiskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "leasedByLabVmId", a.LeasedByLabVMID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AttachDiskProperties. +func (a *AttachDiskProperties) UnmarshalJSON(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 "leasedByLabVmId": + err = unpopulate(val, "LeasedByLabVMID", &a.LeasedByLabVMID) + 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 AttachNewDataDiskOptions. +func (a AttachNewDataDiskOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "diskName", a.DiskName) + populate(objectMap, "diskSizeGiB", a.DiskSizeGiB) + populate(objectMap, "diskType", a.DiskType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AttachNewDataDiskOptions. +func (a *AttachNewDataDiskOptions) UnmarshalJSON(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 "diskName": + err = unpopulate(val, "DiskName", &a.DiskName) + delete(rawMsg, key) + case "diskSizeGiB": + err = unpopulate(val, "DiskSizeGiB", &a.DiskSizeGiB) + delete(rawMsg, key) + case "diskType": + err = unpopulate(val, "DiskType", &a.DiskType) + 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 AzureEntityResource. +func (a AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureEntityResource. +func (a *AzureEntityResource) UnmarshalJSON(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 "etag": + err = unpopulate(val, "Etag", &a.Etag) + delete(rawMsg, key) + 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 "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BastionHost. +func (b BastionHost) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", b.ID) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "systemData", b.SystemData) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionHost. +func (b *BastionHost) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &b.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &b.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &b.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BastionHostFragment. +func (b BastionHostFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", b.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionHostFragment. +func (b *BastionHostFragment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &b.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BastionHostList. +func (b BastionHostList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionHostList. +func (b *BastionHostList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &b.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BastionHostProperties. +func (b BastionHostProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "externalBastionHostId", b.ExternalBastionHostID) + populate(objectMap, "ipAddressId", b.IPAddressID) + populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "uniqueIdentifier", b.UniqueIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionHostProperties. +func (b *BastionHostProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "externalBastionHostId": + err = unpopulate(val, "ExternalBastionHostID", &b.ExternalBastionHostID) + delete(rawMsg, key) + case "ipAddressId": + err = unpopulate(val, "IPAddressID", &b.IPAddressID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &b.UniqueIdentifier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BulkCreationParameters. +func (b BulkCreationParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "instanceCount", b.InstanceCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BulkCreationParameters. +func (b *BulkCreationParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "instanceCount": + err = unpopulate(val, "InstanceCount", &b.InstanceCount) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest. +func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", c.Name) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest. +func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResponse. +func (c CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "message", c.Message) + populate(objectMap, "nameAvailable", c.NameAvailable) + populate(objectMap, "reason", c.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResponse. +func (c *CheckNameAvailabilityResponse) UnmarshalJSON(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 "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &c.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &c.Reason) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudError. +func (c CloudError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", c.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudError. +func (c *CloudError) UnmarshalJSON(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 "error": + err = unpopulate(val, "Error", &c.Error) + 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 CloudErrorBody. +func (c CloudErrorBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", c.Code) + populate(objectMap, "details", c.Details) + populate(objectMap, "message", c.Message) + populate(objectMap, "target", c.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudErrorBody. +func (c *CloudErrorBody) UnmarshalJSON(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 "code": + err = unpopulate(val, "Code", &c.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &c.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &c.Target) + 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 ComputeDataDisk. +func (c ComputeDataDisk) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "diskSizeGiB", c.DiskSizeGiB) + populate(objectMap, "diskUri", c.DiskURI) + populate(objectMap, "managedDiskId", c.ManagedDiskID) + populate(objectMap, "name", c.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeDataDisk. +func (c *ComputeDataDisk) UnmarshalJSON(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 "diskSizeGiB": + err = unpopulate(val, "DiskSizeGiB", &c.DiskSizeGiB) + delete(rawMsg, key) + case "diskUri": + err = unpopulate(val, "DiskURI", &c.DiskURI) + delete(rawMsg, key) + case "managedDiskId": + err = unpopulate(val, "ManagedDiskID", &c.ManagedDiskID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + 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 ComputeVMInstanceViewStatus. +func (c ComputeVMInstanceViewStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", c.Code) + populate(objectMap, "displayStatus", c.DisplayStatus) + populate(objectMap, "message", c.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeVMInstanceViewStatus. +func (c *ComputeVMInstanceViewStatus) UnmarshalJSON(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 "code": + err = unpopulate(val, "Code", &c.Code) + delete(rawMsg, key) + case "displayStatus": + err = unpopulate(val, "DisplayStatus", &c.DisplayStatus) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &c.Message) + 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 ComputeVMProperties. +func (c ComputeVMProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataDiskIds", c.DataDiskIDs) + populate(objectMap, "dataDisks", c.DataDisks) + populate(objectMap, "networkInterfaceId", c.NetworkInterfaceID) + populate(objectMap, "osDiskId", c.OSDiskID) + populate(objectMap, "osType", c.OSType) + populate(objectMap, "statuses", c.Statuses) + populate(objectMap, "vmSize", c.VMSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeVMProperties. +func (c *ComputeVMProperties) UnmarshalJSON(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 "dataDiskIds": + err = unpopulate(val, "DataDiskIDs", &c.DataDiskIDs) + delete(rawMsg, key) + case "dataDisks": + err = unpopulate(val, "DataDisks", &c.DataDisks) + delete(rawMsg, key) + case "networkInterfaceId": + err = unpopulate(val, "NetworkInterfaceID", &c.NetworkInterfaceID) + delete(rawMsg, key) + case "osDiskId": + err = unpopulate(val, "OSDiskID", &c.OSDiskID) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &c.OSType) + delete(rawMsg, key) + case "statuses": + err = unpopulate(val, "Statuses", &c.Statuses) + delete(rawMsg, key) + case "vmSize": + err = unpopulate(val, "VMSize", &c.VMSize) + 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 Cost. +func (c Cost) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 Cost. +func (c *Cost) UnmarshalJSON(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 CostThresholdProperties. +func (c CostThresholdProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayOnChart", c.DisplayOnChart) + populate(objectMap, "notificationSent", c.NotificationSent) + populate(objectMap, "percentageThreshold", c.PercentageThreshold) + populate(objectMap, "sendNotificationWhenExceeded", c.SendNotificationWhenExceeded) + populate(objectMap, "thresholdId", c.ThresholdID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CostThresholdProperties. +func (c *CostThresholdProperties) UnmarshalJSON(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 "displayOnChart": + err = unpopulate(val, "DisplayOnChart", &c.DisplayOnChart) + delete(rawMsg, key) + case "notificationSent": + err = unpopulate(val, "NotificationSent", &c.NotificationSent) + delete(rawMsg, key) + case "percentageThreshold": + err = unpopulate(val, "PercentageThreshold", &c.PercentageThreshold) + delete(rawMsg, key) + case "sendNotificationWhenExceeded": + err = unpopulate(val, "SendNotificationWhenExceeded", &c.SendNotificationWhenExceeded) + delete(rawMsg, key) + case "thresholdId": + err = unpopulate(val, "ThresholdID", &c.ThresholdID) + 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 CustomImage. +func (c CustomImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 CustomImage. +func (c *CustomImage) UnmarshalJSON(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 CustomImageFragment. +func (c CustomImageFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", c.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomImageFragment. +func (c *CustomImageFragment) UnmarshalJSON(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 "tags": + err = unpopulate(val, "Tags", &c.Tags) + 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 CustomImageList. +func (c CustomImageList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomImageList. +func (c *CustomImageList) UnmarshalJSON(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 CustomImageProperties. +func (c CustomImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "author", c.Author) + populateTimeRFC3339(objectMap, "creationDate", c.CreationDate) + populate(objectMap, "customImagePlan", c.CustomImagePlan) + populate(objectMap, "dataDiskStorageInfo", c.DataDiskStorageInfo) + populate(objectMap, "description", c.Description) + populate(objectMap, "isPlanAuthorized", c.IsPlanAuthorized) + populate(objectMap, "managedImageId", c.ManagedImageID) + populate(objectMap, "managedSnapshotId", c.ManagedSnapshotID) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "uniqueIdentifier", c.UniqueIdentifier) + populate(objectMap, "vm", c.VM) + populate(objectMap, "vhd", c.Vhd) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomImageProperties. +func (c *CustomImageProperties) UnmarshalJSON(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 "author": + err = unpopulate(val, "Author", &c.Author) + delete(rawMsg, key) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &c.CreationDate) + delete(rawMsg, key) + case "customImagePlan": + err = unpopulate(val, "CustomImagePlan", &c.CustomImagePlan) + delete(rawMsg, key) + case "dataDiskStorageInfo": + err = unpopulate(val, "DataDiskStorageInfo", &c.DataDiskStorageInfo) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "isPlanAuthorized": + err = unpopulate(val, "IsPlanAuthorized", &c.IsPlanAuthorized) + delete(rawMsg, key) + case "managedImageId": + err = unpopulate(val, "ManagedImageID", &c.ManagedImageID) + delete(rawMsg, key) + case "managedSnapshotId": + err = unpopulate(val, "ManagedSnapshotID", &c.ManagedSnapshotID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &c.UniqueIdentifier) + delete(rawMsg, key) + case "vm": + err = unpopulate(val, "VM", &c.VM) + delete(rawMsg, key) + case "vhd": + err = unpopulate(val, "Vhd", &c.Vhd) + 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 CustomImagePropertiesCustom. +func (c CustomImagePropertiesCustom) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "imageName", c.ImageName) + populate(objectMap, "osType", c.OSType) + populate(objectMap, "sysPrep", c.SysPrep) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomImagePropertiesCustom. +func (c *CustomImagePropertiesCustom) UnmarshalJSON(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 "imageName": + err = unpopulate(val, "ImageName", &c.ImageName) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &c.OSType) + delete(rawMsg, key) + case "sysPrep": + err = unpopulate(val, "SysPrep", &c.SysPrep) + 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 CustomImagePropertiesFromPlan. +func (c CustomImagePropertiesFromPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "offer", c.Offer) + populate(objectMap, "publisher", c.Publisher) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomImagePropertiesFromPlan. +func (c *CustomImagePropertiesFromPlan) UnmarshalJSON(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 "offer": + err = unpopulate(val, "Offer", &c.Offer) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &c.Publisher) + 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 CustomImagePropertiesFromPlanFragment. +func (c CustomImagePropertiesFromPlanFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "offer", c.Offer) + populate(objectMap, "publisher", c.Publisher) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomImagePropertiesFromPlanFragment. +func (c *CustomImagePropertiesFromPlanFragment) UnmarshalJSON(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 "offer": + err = unpopulate(val, "Offer", &c.Offer) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &c.Publisher) + 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 CustomImagePropertiesFromVM. +func (c CustomImagePropertiesFromVM) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "linuxOsInfo", c.LinuxOsInfo) + populate(objectMap, "sourceVmId", c.SourceVMID) + populate(objectMap, "windowsOsInfo", c.WindowsOsInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomImagePropertiesFromVM. +func (c *CustomImagePropertiesFromVM) UnmarshalJSON(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 "linuxOsInfo": + err = unpopulate(val, "LinuxOsInfo", &c.LinuxOsInfo) + delete(rawMsg, key) + case "sourceVmId": + err = unpopulate(val, "SourceVMID", &c.SourceVMID) + delete(rawMsg, key) + case "windowsOsInfo": + err = unpopulate(val, "WindowsOsInfo", &c.WindowsOsInfo) + 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 DataDiskProperties. +func (d DataDiskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "attachNewDataDiskOptions", d.AttachNewDataDiskOptions) + populate(objectMap, "existingLabDiskId", d.ExistingLabDiskID) + populate(objectMap, "hostCaching", d.HostCaching) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataDiskProperties. +func (d *DataDiskProperties) UnmarshalJSON(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 "attachNewDataDiskOptions": + err = unpopulate(val, "AttachNewDataDiskOptions", &d.AttachNewDataDiskOptions) + delete(rawMsg, key) + case "existingLabDiskId": + err = unpopulate(val, "ExistingLabDiskID", &d.ExistingLabDiskID) + delete(rawMsg, key) + case "hostCaching": + err = unpopulate(val, "HostCaching", &d.HostCaching) + 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 DataDiskStorageTypeInfo. +func (d DataDiskStorageTypeInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "lun", d.Lun) + populate(objectMap, "storageType", d.StorageType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataDiskStorageTypeInfo. +func (d *DataDiskStorageTypeInfo) UnmarshalJSON(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 "lun": + err = unpopulate(val, "Lun", &d.Lun) + delete(rawMsg, key) + case "storageType": + err = unpopulate(val, "StorageType", &d.StorageType) + 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 DayDetails. +func (d DayDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "time", d.Time) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DayDetails. +func (d *DayDetails) UnmarshalJSON(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 "time": + err = unpopulate(val, "Time", &d.Time) + 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 DetachDataDiskProperties. +func (d DetachDataDiskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "existingLabDiskId", d.ExistingLabDiskID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DetachDataDiskProperties. +func (d *DetachDataDiskProperties) UnmarshalJSON(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 "existingLabDiskId": + err = unpopulate(val, "ExistingLabDiskID", &d.ExistingLabDiskID) + 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 DetachDiskProperties. +func (d DetachDiskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "leasedByLabVmId", d.LeasedByLabVMID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DetachDiskProperties. +func (d *DetachDiskProperties) UnmarshalJSON(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 "leasedByLabVmId": + err = unpopulate(val, "LeasedByLabVMID", &d.LeasedByLabVMID) + 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 Disk. +func (d Disk) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Disk. +func (d *Disk) UnmarshalJSON(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 "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": + err = unpopulate(val, "Properties", &d.Properties) + 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) + 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 DiskFragment. +func (d DiskFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", d.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskFragment. +func (d *DiskFragment) UnmarshalJSON(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 "tags": + err = unpopulate(val, "Tags", &d.Tags) + 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 DiskList. +func (d DiskList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskList. +func (d *DiskList) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + 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 DiskProperties. +func (d DiskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdDate", d.CreatedDate) + populate(objectMap, "diskBlobName", d.DiskBlobName) + populate(objectMap, "diskSizeGiB", d.DiskSizeGiB) + populate(objectMap, "diskType", d.DiskType) + populate(objectMap, "diskUri", d.DiskURI) + populate(objectMap, "hostCaching", d.HostCaching) + populate(objectMap, "leasedByLabVmId", d.LeasedByLabVMID) + populate(objectMap, "managedDiskId", d.ManagedDiskID) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "storageAccountId", d.StorageAccountID) + populate(objectMap, "uniqueIdentifier", d.UniqueIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskProperties. +func (d *DiskProperties) UnmarshalJSON(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 "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &d.CreatedDate) + delete(rawMsg, key) + case "diskBlobName": + err = unpopulate(val, "DiskBlobName", &d.DiskBlobName) + delete(rawMsg, key) + case "diskSizeGiB": + err = unpopulate(val, "DiskSizeGiB", &d.DiskSizeGiB) + delete(rawMsg, key) + case "diskType": + err = unpopulate(val, "DiskType", &d.DiskType) + delete(rawMsg, key) + case "diskUri": + err = unpopulate(val, "DiskURI", &d.DiskURI) + delete(rawMsg, key) + case "hostCaching": + err = unpopulate(val, "HostCaching", &d.HostCaching) + delete(rawMsg, key) + case "leasedByLabVmId": + err = unpopulate(val, "LeasedByLabVMID", &d.LeasedByLabVMID) + delete(rawMsg, key) + case "managedDiskId": + err = unpopulate(val, "ManagedDiskID", &d.ManagedDiskID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "storageAccountId": + err = unpopulate(val, "StorageAccountID", &d.StorageAccountID) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &d.UniqueIdentifier) + 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 DtlEnvironment. +func (d DtlEnvironment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DtlEnvironment. +func (d *DtlEnvironment) UnmarshalJSON(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 "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": + err = unpopulate(val, "Properties", &d.Properties) + 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) + 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 DtlEnvironmentFragment. +func (d DtlEnvironmentFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", d.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DtlEnvironmentFragment. +func (d *DtlEnvironmentFragment) UnmarshalJSON(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 "tags": + err = unpopulate(val, "Tags", &d.Tags) + 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 DtlEnvironmentList. +func (d DtlEnvironmentList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DtlEnvironmentList. +func (d *DtlEnvironmentList) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + 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 Encryption. +func (e Encryption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "diskEncryptionSetId", e.DiskEncryptionSetID) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Encryption. +func (e *Encryption) UnmarshalJSON(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 "diskEncryptionSetId": + err = unpopulate(val, "DiskEncryptionSetID", &e.DiskEncryptionSetID) + 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 EncryptionProperties. +func (e EncryptionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "keyVaultProperties", e.KeyVaultProperties) + populate(objectMap, "status", e.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProperties. +func (e *EncryptionProperties) UnmarshalJSON(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 "keyVaultProperties": + err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + 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 EnvironmentDeploymentProperties. +func (e EnvironmentDeploymentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "armTemplateId", e.ArmTemplateID) + populate(objectMap, "parameters", e.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentDeploymentProperties. +func (e *EnvironmentDeploymentProperties) UnmarshalJSON(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 "armTemplateId": + err = unpopulate(val, "ArmTemplateID", &e.ArmTemplateID) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &e.Parameters) + 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 EnvironmentProperties. +func (e EnvironmentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "armTemplateDisplayName", e.ArmTemplateDisplayName) + populate(objectMap, "createdByUser", e.CreatedByUser) + populate(objectMap, "deploymentProperties", e.DeploymentProperties) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "resourceGroupId", e.ResourceGroupID) + populate(objectMap, "uniqueIdentifier", e.UniqueIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentProperties. +func (e *EnvironmentProperties) UnmarshalJSON(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 "armTemplateDisplayName": + err = unpopulate(val, "ArmTemplateDisplayName", &e.ArmTemplateDisplayName) + delete(rawMsg, key) + case "createdByUser": + err = unpopulate(val, "CreatedByUser", &e.CreatedByUser) + delete(rawMsg, key) + case "deploymentProperties": + err = unpopulate(val, "DeploymentProperties", &e.DeploymentProperties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "resourceGroupId": + err = unpopulate(val, "ResourceGroupID", &e.ResourceGroupID) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &e.UniqueIdentifier) + 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 ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(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]interface{}) + 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]interface{}) + 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 EvaluatePoliciesProperties. +func (e EvaluatePoliciesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "factData", e.FactData) + populate(objectMap, "factName", e.FactName) + populate(objectMap, "userObjectId", e.UserObjectID) + populate(objectMap, "valueOffset", e.ValueOffset) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EvaluatePoliciesProperties. +func (e *EvaluatePoliciesProperties) UnmarshalJSON(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 "factData": + err = unpopulate(val, "FactData", &e.FactData) + delete(rawMsg, key) + case "factName": + err = unpopulate(val, "FactName", &e.FactName) + delete(rawMsg, key) + case "userObjectId": + err = unpopulate(val, "UserObjectID", &e.UserObjectID) + delete(rawMsg, key) + case "valueOffset": + err = unpopulate(val, "ValueOffset", &e.ValueOffset) + 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 EvaluatePoliciesRequest. +func (e EvaluatePoliciesRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "policies", e.Policies) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EvaluatePoliciesRequest. +func (e *EvaluatePoliciesRequest) UnmarshalJSON(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 "policies": + err = unpopulate(val, "Policies", &e.Policies) + 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 EvaluatePoliciesResponse. +func (e EvaluatePoliciesResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "results", e.Results) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EvaluatePoliciesResponse. +func (e *EvaluatePoliciesResponse) UnmarshalJSON(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 "results": + err = unpopulate(val, "Results", &e.Results) + 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 Event. +func (e Event) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eventName", e.EventName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Event. +func (e *Event) UnmarshalJSON(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 "eventName": + err = unpopulate(val, "EventName", &e.EventName) + 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 ExportResourceUsageParameters. +func (e ExportResourceUsageParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blobStorageAbsoluteSasUri", e.BlobStorageAbsoluteSasURI) + populateTimeRFC3339(objectMap, "usageStartDate", e.UsageStartDate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExportResourceUsageParameters. +func (e *ExportResourceUsageParameters) UnmarshalJSON(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 "blobStorageAbsoluteSasUri": + err = unpopulate(val, "BlobStorageAbsoluteSasURI", &e.BlobStorageAbsoluteSasURI) + delete(rawMsg, key) + case "usageStartDate": + err = unpopulateTimeRFC3339(val, "UsageStartDate", &e.UsageStartDate) + 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 ExternalSubnet. +func (e ExternalSubnet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalSubnet. +func (e *ExternalSubnet) UnmarshalJSON(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 "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + 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 Formula. +func (f Formula) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", f.ID) + populate(objectMap, "location", f.Location) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "tags", f.Tags) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Formula. +func (f *Formula) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &f.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FormulaFragment. +func (f FormulaFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", f.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FormulaFragment. +func (f *FormulaFragment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &f.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FormulaList. +func (f FormulaList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FormulaList. +func (f *FormulaList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FormulaProperties. +func (f FormulaProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "author", f.Author) + populateTimeRFC3339(objectMap, "creationDate", f.CreationDate) + populate(objectMap, "description", f.Description) + populate(objectMap, "formulaContent", f.FormulaContent) + populate(objectMap, "osType", f.OSType) + populate(objectMap, "provisioningState", f.ProvisioningState) + populate(objectMap, "uniqueIdentifier", f.UniqueIdentifier) + populate(objectMap, "vm", f.VM) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FormulaProperties. +func (f *FormulaProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "author": + err = unpopulate(val, "Author", &f.Author) + delete(rawMsg, key) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &f.CreationDate) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &f.Description) + delete(rawMsg, key) + case "formulaContent": + err = unpopulate(val, "FormulaContent", &f.FormulaContent) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &f.OSType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &f.UniqueIdentifier) + delete(rawMsg, key) + case "vm": + err = unpopulate(val, "VM", &f.VM) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FormulaPropertiesFromVM. +func (f FormulaPropertiesFromVM) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "labVmId", f.LabVMID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FormulaPropertiesFromVM. +func (f *FormulaPropertiesFromVM) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "labVmId": + err = unpopulate(val, "LabVMID", &f.LabVMID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GalleryImage. +func (g GalleryImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", g.ID) + populate(objectMap, "location", g.Location) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "systemData", g.SystemData) + populate(objectMap, "tags", g.Tags) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImage. +func (g *GalleryImage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &g.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &g.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &g.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GalleryImageList. +func (g GalleryImageList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageList. +func (g *GalleryImageList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GalleryImageProperties. +func (g GalleryImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "author", g.Author) + populateTimeRFC3339(objectMap, "createdDate", g.CreatedDate) + populate(objectMap, "description", g.Description) + populate(objectMap, "enabled", g.Enabled) + populate(objectMap, "icon", g.Icon) + populate(objectMap, "imageReference", g.ImageReference) + populate(objectMap, "isPlanAuthorized", g.IsPlanAuthorized) + populate(objectMap, "planId", g.PlanID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageProperties. +func (g *GalleryImageProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "author": + err = unpopulate(val, "Author", &g.Author) + delete(rawMsg, key) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &g.CreatedDate) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &g.Description) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &g.Enabled) + delete(rawMsg, key) + case "icon": + err = unpopulate(val, "Icon", &g.Icon) + delete(rawMsg, key) + case "imageReference": + err = unpopulate(val, "ImageReference", &g.ImageReference) + delete(rawMsg, key) + case "isPlanAuthorized": + err = unpopulate(val, "IsPlanAuthorized", &g.IsPlanAuthorized) + delete(rawMsg, key) + case "planId": + err = unpopulate(val, "PlanID", &g.PlanID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GalleryImageReference. +func (g GalleryImageReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "osType", g.OSType) + populate(objectMap, "offer", g.Offer) + populate(objectMap, "publisher", g.Publisher) + populate(objectMap, "sku", g.SKU) + populate(objectMap, "version", g.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageReference. +func (g *GalleryImageReference) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "osType": + err = unpopulate(val, "OSType", &g.OSType) + delete(rawMsg, key) + case "offer": + err = unpopulate(val, "Offer", &g.Offer) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &g.Publisher) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &g.SKU) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &g.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GenerateArmTemplateRequest. +func (g GenerateArmTemplateRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "fileUploadOptions", g.FileUploadOptions) + populate(objectMap, "location", g.Location) + populate(objectMap, "parameters", g.Parameters) + populate(objectMap, "virtualMachineName", g.VirtualMachineName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateArmTemplateRequest. +func (g *GenerateArmTemplateRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "fileUploadOptions": + err = unpopulate(val, "FileUploadOptions", &g.FileUploadOptions) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &g.Location) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &g.Parameters) + delete(rawMsg, key) + case "virtualMachineName": + err = unpopulate(val, "VirtualMachineName", &g.VirtualMachineName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GenerateUploadURIParameter. +func (g GenerateUploadURIParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blobName", g.BlobName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateUploadURIParameter. +func (g *GenerateUploadURIParameter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobName": + err = unpopulate(val, "BlobName", &g.BlobName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GenerateUploadURIResponse. +func (g GenerateUploadURIResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "uploadUri", g.UploadURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateUploadURIResponse. +func (g *GenerateUploadURIResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "uploadUri": + err = unpopulate(val, "UploadURI", &g.UploadURI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HourDetails. +func (h HourDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "minute", h.Minute) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HourDetails. +func (h *HourDetails) UnmarshalJSON(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 "minute": + err = unpopulate(val, "Minute", &h.Minute) + 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 Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + objectMap["type"] = "SystemAssigned" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Identity. +func (i *Identity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + 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 IdentityProperties. +func (i IdentityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientSecretUrl", i.ClientSecretURL) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + populate(objectMap, "type", i.Type) + populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProperties. +func (i *IdentityProperties) UnmarshalJSON(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 "clientSecretUrl": + err = unpopulate(val, "ClientSecretURL", &i.ClientSecretURL) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageVersionProperties. +func (i ImageVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", i.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageVersionProperties. +func (i *ImageVersionProperties) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &i.Name) + 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 ImportLabVirtualMachineRequest. +func (i ImportLabVirtualMachineRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "destinationVirtualMachineName", i.DestinationVirtualMachineName) + populate(objectMap, "sourceVirtualMachineResourceId", i.SourceVirtualMachineResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportLabVirtualMachineRequest. +func (i *ImportLabVirtualMachineRequest) UnmarshalJSON(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 "destinationVirtualMachineName": + err = unpopulate(val, "DestinationVirtualMachineName", &i.DestinationVirtualMachineName) + delete(rawMsg, key) + case "sourceVirtualMachineResourceId": + err = unpopulate(val, "SourceVirtualMachineResourceID", &i.SourceVirtualMachineResourceID) + 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 InboundNatRule. +func (i InboundNatRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backendPort", i.BackendPort) + populate(objectMap, "frontendPort", i.FrontendPort) + populate(objectMap, "transportProtocol", i.TransportProtocol) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InboundNatRule. +func (i *InboundNatRule) UnmarshalJSON(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 "backendPort": + err = unpopulate(val, "BackendPort", &i.BackendPort) + delete(rawMsg, key) + case "frontendPort": + err = unpopulate(val, "FrontendPort", &i.FrontendPort) + delete(rawMsg, key) + case "transportProtocol": + err = unpopulate(val, "TransportProtocol", &i.TransportProtocol) + 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 KeyVaultProperties. +func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", k.Identity) + populate(objectMap, "keyIdentifier", k.KeyIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties. +func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &k.Identity) + delete(rawMsg, key) + case "keyIdentifier": + err = unpopulate(val, "KeyIdentifier", &k.KeyIdentifier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Lab. +func (l Lab) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "identity", l.Identity) + populate(objectMap, "location", l.Location) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "tags", l.Tags) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Lab. +func (l *Lab) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &l.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &l.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabAnnouncementProperties. +func (l LabAnnouncementProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabled", l.Enabled) + populateTimeRFC3339(objectMap, "expirationDate", l.ExpirationDate) + populate(objectMap, "expired", l.Expired) + populate(objectMap, "markdown", l.Markdown) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "title", l.Title) + populate(objectMap, "uniqueIdentifier", l.UniqueIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabAnnouncementProperties. +func (l *LabAnnouncementProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &l.Enabled) + delete(rawMsg, key) + case "expirationDate": + err = unpopulateTimeRFC3339(val, "ExpirationDate", &l.ExpirationDate) + delete(rawMsg, key) + case "expired": + err = unpopulate(val, "Expired", &l.Expired) + delete(rawMsg, key) + case "markdown": + err = unpopulate(val, "Markdown", &l.Markdown) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &l.Title) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &l.UniqueIdentifier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabCost. +func (l LabCost) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "location", l.Location) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "tags", l.Tags) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabCost. +func (l *LabCost) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &l.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabCostDetailsProperties. +func (l LabCostDetailsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cost", l.Cost) + populate(objectMap, "costType", l.CostType) + populateTimeRFC3339(objectMap, "date", l.Date) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabCostDetailsProperties. +func (l *LabCostDetailsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cost": + err = unpopulate(val, "Cost", &l.Cost) + delete(rawMsg, key) + case "costType": + err = unpopulate(val, "CostType", &l.CostType) + delete(rawMsg, key) + case "date": + err = unpopulateTimeRFC3339(val, "Date", &l.Date) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabCostList. +func (l LabCostList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabCostList. +func (l *LabCostList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabCostProperties. +func (l LabCostProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdDate", l.CreatedDate) + populate(objectMap, "currencyCode", l.CurrencyCode) + populateTimeRFC3339(objectMap, "endDateTime", l.EndDateTime) + populate(objectMap, "labCostDetails", l.LabCostDetails) + populate(objectMap, "labCostSummary", l.LabCostSummary) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "resourceCosts", l.ResourceCosts) + populateTimeRFC3339(objectMap, "startDateTime", l.StartDateTime) + populate(objectMap, "targetCost", l.TargetCost) + populate(objectMap, "uniqueIdentifier", l.UniqueIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabCostProperties. +func (l *LabCostProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &l.CreatedDate) + delete(rawMsg, key) + case "currencyCode": + err = unpopulate(val, "CurrencyCode", &l.CurrencyCode) + delete(rawMsg, key) + case "endDateTime": + err = unpopulateTimeRFC3339(val, "EndDateTime", &l.EndDateTime) + delete(rawMsg, key) + case "labCostDetails": + err = unpopulate(val, "LabCostDetails", &l.LabCostDetails) + delete(rawMsg, key) + case "labCostSummary": + err = unpopulate(val, "LabCostSummary", &l.LabCostSummary) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "resourceCosts": + err = unpopulate(val, "ResourceCosts", &l.ResourceCosts) + delete(rawMsg, key) + case "startDateTime": + err = unpopulateTimeRFC3339(val, "StartDateTime", &l.StartDateTime) + delete(rawMsg, key) + case "targetCost": + err = unpopulate(val, "TargetCost", &l.TargetCost) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &l.UniqueIdentifier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabCostSummaryProperties. +func (l LabCostSummaryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "estimatedLabCost", l.EstimatedLabCost) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabCostSummaryProperties. +func (l *LabCostSummaryProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "estimatedLabCost": + err = unpopulate(val, "EstimatedLabCost", &l.EstimatedLabCost) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabFragment. +func (l LabFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", l.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabFragment. +func (l *LabFragment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabList. +func (l LabList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabList. +func (l *LabList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabProperties. +func (l LabProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "announcement", l.Announcement) + populate(objectMap, "artifactsStorageAccount", l.ArtifactsStorageAccount) + populate(objectMap, "browserConnect", l.BrowserConnect) + populateTimeRFC3339(objectMap, "createdDate", l.CreatedDate) + populate(objectMap, "defaultPremiumStorageAccount", l.DefaultPremiumStorageAccount) + populate(objectMap, "defaultSecretName", l.DefaultSecretName) + populate(objectMap, "defaultStorageAccount", l.DefaultStorageAccount) + populate(objectMap, "disableAutoUpgradeCseMinorVersion", l.DisableAutoUpgradeCseMinorVersion) + populate(objectMap, "encryption", l.Encryption) + populate(objectMap, "environmentPermission", l.EnvironmentPermission) + populate(objectMap, "extendedProperties", l.ExtendedProperties) + populate(objectMap, "isolateLabResources", l.IsolateLabResources) + populate(objectMap, "labStorageType", l.LabStorageType) + populate(objectMap, "loadBalancerId", l.LoadBalancerID) + populate(objectMap, "managementIdentities", l.ManagementIdentities) + populate(objectMap, "mandatoryArtifactsResourceIdsLinux", l.MandatoryArtifactsResourceIDsLinux) + populate(objectMap, "mandatoryArtifactsResourceIdsWindows", l.MandatoryArtifactsResourceIDsWindows) + populate(objectMap, "networkSecurityGroupId", l.NetworkSecurityGroupID) + populate(objectMap, "premiumDataDiskStorageAccount", l.PremiumDataDiskStorageAccount) + populate(objectMap, "premiumDataDisks", l.PremiumDataDisks) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "publicIpId", l.PublicIPID) + populate(objectMap, "support", l.Support) + populate(objectMap, "uniqueIdentifier", l.UniqueIdentifier) + populate(objectMap, "vmCreationResourceGroup", l.VMCreationResourceGroup) + populate(objectMap, "vaultName", l.VaultName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabProperties. +func (l *LabProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "announcement": + err = unpopulate(val, "Announcement", &l.Announcement) + delete(rawMsg, key) + case "artifactsStorageAccount": + err = unpopulate(val, "ArtifactsStorageAccount", &l.ArtifactsStorageAccount) + delete(rawMsg, key) + case "browserConnect": + err = unpopulate(val, "BrowserConnect", &l.BrowserConnect) + delete(rawMsg, key) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &l.CreatedDate) + delete(rawMsg, key) + case "defaultPremiumStorageAccount": + err = unpopulate(val, "DefaultPremiumStorageAccount", &l.DefaultPremiumStorageAccount) + delete(rawMsg, key) + case "defaultSecretName": + err = unpopulate(val, "DefaultSecretName", &l.DefaultSecretName) + delete(rawMsg, key) + case "defaultStorageAccount": + err = unpopulate(val, "DefaultStorageAccount", &l.DefaultStorageAccount) + delete(rawMsg, key) + case "disableAutoUpgradeCseMinorVersion": + err = unpopulate(val, "DisableAutoUpgradeCseMinorVersion", &l.DisableAutoUpgradeCseMinorVersion) + delete(rawMsg, key) + case "encryption": + err = unpopulate(val, "Encryption", &l.Encryption) + delete(rawMsg, key) + case "environmentPermission": + err = unpopulate(val, "EnvironmentPermission", &l.EnvironmentPermission) + delete(rawMsg, key) + case "extendedProperties": + err = unpopulate(val, "ExtendedProperties", &l.ExtendedProperties) + delete(rawMsg, key) + case "isolateLabResources": + err = unpopulate(val, "IsolateLabResources", &l.IsolateLabResources) + delete(rawMsg, key) + case "labStorageType": + err = unpopulate(val, "LabStorageType", &l.LabStorageType) + delete(rawMsg, key) + case "loadBalancerId": + err = unpopulate(val, "LoadBalancerID", &l.LoadBalancerID) + delete(rawMsg, key) + case "managementIdentities": + err = unpopulate(val, "ManagementIdentities", &l.ManagementIdentities) + delete(rawMsg, key) + case "mandatoryArtifactsResourceIdsLinux": + err = unpopulate(val, "MandatoryArtifactsResourceIDsLinux", &l.MandatoryArtifactsResourceIDsLinux) + delete(rawMsg, key) + case "mandatoryArtifactsResourceIdsWindows": + err = unpopulate(val, "MandatoryArtifactsResourceIDsWindows", &l.MandatoryArtifactsResourceIDsWindows) + delete(rawMsg, key) + case "networkSecurityGroupId": + err = unpopulate(val, "NetworkSecurityGroupID", &l.NetworkSecurityGroupID) + delete(rawMsg, key) + case "premiumDataDiskStorageAccount": + err = unpopulate(val, "PremiumDataDiskStorageAccount", &l.PremiumDataDiskStorageAccount) + delete(rawMsg, key) + case "premiumDataDisks": + err = unpopulate(val, "PremiumDataDisks", &l.PremiumDataDisks) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "publicIpId": + err = unpopulate(val, "PublicIPID", &l.PublicIPID) + delete(rawMsg, key) + case "support": + err = unpopulate(val, "Support", &l.Support) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &l.UniqueIdentifier) + delete(rawMsg, key) + case "vmCreationResourceGroup": + err = unpopulate(val, "VMCreationResourceGroup", &l.VMCreationResourceGroup) + delete(rawMsg, key) + case "vaultName": + err = unpopulate(val, "VaultName", &l.VaultName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabResourceCostProperties. +func (l LabResourceCostProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "externalResourceId", l.ExternalResourceID) + populate(objectMap, "resourceCost", l.ResourceCost) + populate(objectMap, "resourceId", l.ResourceID) + populate(objectMap, "resourceOwner", l.ResourceOwner) + populate(objectMap, "resourcePricingTier", l.ResourcePricingTier) + populate(objectMap, "resourceStatus", l.ResourceStatus) + populate(objectMap, "resourceType", l.ResourceType) + populate(objectMap, "resourceUId", l.ResourceUID) + populate(objectMap, "resourcename", l.Resourcename) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabResourceCostProperties. +func (l *LabResourceCostProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "externalResourceId": + err = unpopulate(val, "ExternalResourceID", &l.ExternalResourceID) + delete(rawMsg, key) + case "resourceCost": + err = unpopulate(val, "ResourceCost", &l.ResourceCost) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &l.ResourceID) + delete(rawMsg, key) + case "resourceOwner": + err = unpopulate(val, "ResourceOwner", &l.ResourceOwner) + delete(rawMsg, key) + case "resourcePricingTier": + err = unpopulate(val, "ResourcePricingTier", &l.ResourcePricingTier) + delete(rawMsg, key) + case "resourceStatus": + err = unpopulate(val, "ResourceStatus", &l.ResourceStatus) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &l.ResourceType) + delete(rawMsg, key) + case "resourceUId": + err = unpopulate(val, "ResourceUID", &l.ResourceUID) + delete(rawMsg, key) + case "resourcename": + err = unpopulate(val, "Resourcename", &l.Resourcename) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabSecret. +func (l LabSecret) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "location", l.Location) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "tags", l.Tags) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabSecret. +func (l *LabSecret) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &l.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabSecretFragment. +func (l LabSecretFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", l.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabSecretFragment. +func (l *LabSecretFragment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabSecretList. +func (l LabSecretList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabSecretList. +func (l *LabSecretList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabSecretProperties. +func (l LabSecretProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabledForArmEnvironments", l.EnabledForArmEnvironments) + populate(objectMap, "enabledForArtifacts", l.EnabledForArtifacts) + populate(objectMap, "enabledForVmCreation", l.EnabledForVMCreation) + populate(objectMap, "keyVaultEntry", l.KeyVaultEntry) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "uniqueIdentifier", l.UniqueIdentifier) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabSecretProperties. +func (l *LabSecretProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabledForArmEnvironments": + err = unpopulate(val, "EnabledForArmEnvironments", &l.EnabledForArmEnvironments) + delete(rawMsg, key) + case "enabledForArtifacts": + err = unpopulate(val, "EnabledForArtifacts", &l.EnabledForArtifacts) + delete(rawMsg, key) + case "enabledForVmCreation": + err = unpopulate(val, "EnabledForVMCreation", &l.EnabledForVMCreation) + delete(rawMsg, key) + case "keyVaultEntry": + err = unpopulate(val, "KeyVaultEntry", &l.KeyVaultEntry) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &l.UniqueIdentifier) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabSupportProperties. +func (l LabSupportProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabled", l.Enabled) + populate(objectMap, "markdown", l.Markdown) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabSupportProperties. +func (l *LabSupportProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &l.Enabled) + delete(rawMsg, key) + case "markdown": + err = unpopulate(val, "Markdown", &l.Markdown) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabVhd. +func (l LabVhd) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabVhd. +func (l *LabVhd) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabVhdList. +func (l LabVhdList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabVhdList. +func (l *LabVhdList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabVirtualMachine. +func (l LabVirtualMachine) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "location", l.Location) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "tags", l.Tags) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabVirtualMachine. +func (l *LabVirtualMachine) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &l.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabVirtualMachineCreationParameter. +func (l LabVirtualMachineCreationParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "location", l.Location) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "tags", l.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabVirtualMachineCreationParameter. +func (l *LabVirtualMachineCreationParameter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "location": + err = unpopulate(val, "Location", &l.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabVirtualMachineCreationParameterProperties. +func (l LabVirtualMachineCreationParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowClaim", l.AllowClaim) + populate(objectMap, "applicableSchedule", l.ApplicableSchedule) + populate(objectMap, "artifactDeploymentStatus", l.ArtifactDeploymentStatus) + populate(objectMap, "artifacts", l.Artifacts) + populate(objectMap, "bulkCreationParameters", l.BulkCreationParameters) + populate(objectMap, "canApplyArtifacts", l.CanApplyArtifacts) + populate(objectMap, "computeId", l.ComputeID) + populate(objectMap, "computeVm", l.ComputeVM) + populate(objectMap, "createdByUser", l.CreatedByUser) + populate(objectMap, "createdByUserId", l.CreatedByUserID) + populateTimeRFC3339(objectMap, "createdDate", l.CreatedDate) + populate(objectMap, "customImageId", l.CustomImageID) + populate(objectMap, "dataDiskParameters", l.DataDiskParameters) + populate(objectMap, "disallowPublicIpAddress", l.DisallowPublicIPAddress) + populate(objectMap, "environmentId", l.EnvironmentID) + populateTimeRFC3339(objectMap, "expirationDate", l.ExpirationDate) + populate(objectMap, "fqdn", l.Fqdn) + populate(objectMap, "galleryImageReference", l.GalleryImageReference) + populate(objectMap, "galleryImageVersionId", l.GalleryImageVersionID) + populate(objectMap, "isAuthenticationWithSshKey", l.IsAuthenticationWithSSHKey) + populate(objectMap, "labSubnetName", l.LabSubnetName) + populate(objectMap, "labVirtualNetworkId", l.LabVirtualNetworkID) + populate(objectMap, "lastKnownPowerState", l.LastKnownPowerState) + populate(objectMap, "networkInterface", l.NetworkInterface) + populate(objectMap, "notes", l.Notes) + populate(objectMap, "osDiskSizeGb", l.OSDiskSizeGb) + populate(objectMap, "osType", l.OSType) + populate(objectMap, "ownerObjectId", l.OwnerObjectID) + populate(objectMap, "ownerUserPrincipalName", l.OwnerUserPrincipalName) + populate(objectMap, "password", l.Password) + populate(objectMap, "planId", l.PlanID) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "sshKey", l.SSHKey) + populate(objectMap, "scheduleParameters", l.ScheduleParameters) + populate(objectMap, "sharedImageId", l.SharedImageID) + populate(objectMap, "sharedImageVersion", l.SharedImageVersion) + populate(objectMap, "size", l.Size) + populate(objectMap, "storageType", l.StorageType) + populate(objectMap, "uniqueIdentifier", l.UniqueIdentifier) + populate(objectMap, "userName", l.UserName) + populate(objectMap, "virtualMachineCreationSource", l.VirtualMachineCreationSource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabVirtualMachineCreationParameterProperties. +func (l *LabVirtualMachineCreationParameterProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowClaim": + err = unpopulate(val, "AllowClaim", &l.AllowClaim) + delete(rawMsg, key) + case "applicableSchedule": + err = unpopulate(val, "ApplicableSchedule", &l.ApplicableSchedule) + delete(rawMsg, key) + case "artifactDeploymentStatus": + err = unpopulate(val, "ArtifactDeploymentStatus", &l.ArtifactDeploymentStatus) + delete(rawMsg, key) + case "artifacts": + err = unpopulate(val, "Artifacts", &l.Artifacts) + delete(rawMsg, key) + case "bulkCreationParameters": + err = unpopulate(val, "BulkCreationParameters", &l.BulkCreationParameters) + delete(rawMsg, key) + case "canApplyArtifacts": + err = unpopulate(val, "CanApplyArtifacts", &l.CanApplyArtifacts) + delete(rawMsg, key) + case "computeId": + err = unpopulate(val, "ComputeID", &l.ComputeID) + delete(rawMsg, key) + case "computeVm": + err = unpopulate(val, "ComputeVM", &l.ComputeVM) + delete(rawMsg, key) + case "createdByUser": + err = unpopulate(val, "CreatedByUser", &l.CreatedByUser) + delete(rawMsg, key) + case "createdByUserId": + err = unpopulate(val, "CreatedByUserID", &l.CreatedByUserID) + delete(rawMsg, key) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &l.CreatedDate) + delete(rawMsg, key) + case "customImageId": + err = unpopulate(val, "CustomImageID", &l.CustomImageID) + delete(rawMsg, key) + case "dataDiskParameters": + err = unpopulate(val, "DataDiskParameters", &l.DataDiskParameters) + delete(rawMsg, key) + case "disallowPublicIpAddress": + err = unpopulate(val, "DisallowPublicIPAddress", &l.DisallowPublicIPAddress) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &l.EnvironmentID) + delete(rawMsg, key) + case "expirationDate": + err = unpopulateTimeRFC3339(val, "ExpirationDate", &l.ExpirationDate) + delete(rawMsg, key) + case "fqdn": + err = unpopulate(val, "Fqdn", &l.Fqdn) + delete(rawMsg, key) + case "galleryImageReference": + err = unpopulate(val, "GalleryImageReference", &l.GalleryImageReference) + delete(rawMsg, key) + case "galleryImageVersionId": + err = unpopulate(val, "GalleryImageVersionID", &l.GalleryImageVersionID) + delete(rawMsg, key) + case "isAuthenticationWithSshKey": + err = unpopulate(val, "IsAuthenticationWithSSHKey", &l.IsAuthenticationWithSSHKey) + delete(rawMsg, key) + case "labSubnetName": + err = unpopulate(val, "LabSubnetName", &l.LabSubnetName) + delete(rawMsg, key) + case "labVirtualNetworkId": + err = unpopulate(val, "LabVirtualNetworkID", &l.LabVirtualNetworkID) + delete(rawMsg, key) + case "lastKnownPowerState": + err = unpopulate(val, "LastKnownPowerState", &l.LastKnownPowerState) + delete(rawMsg, key) + case "networkInterface": + err = unpopulate(val, "NetworkInterface", &l.NetworkInterface) + delete(rawMsg, key) + case "notes": + err = unpopulate(val, "Notes", &l.Notes) + delete(rawMsg, key) + case "osDiskSizeGb": + err = unpopulate(val, "OSDiskSizeGb", &l.OSDiskSizeGb) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &l.OSType) + delete(rawMsg, key) + case "ownerObjectId": + err = unpopulate(val, "OwnerObjectID", &l.OwnerObjectID) + delete(rawMsg, key) + case "ownerUserPrincipalName": + err = unpopulate(val, "OwnerUserPrincipalName", &l.OwnerUserPrincipalName) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &l.Password) + delete(rawMsg, key) + case "planId": + err = unpopulate(val, "PlanID", &l.PlanID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "sshKey": + err = unpopulate(val, "SSHKey", &l.SSHKey) + delete(rawMsg, key) + case "scheduleParameters": + err = unpopulate(val, "ScheduleParameters", &l.ScheduleParameters) + delete(rawMsg, key) + case "sharedImageId": + err = unpopulate(val, "SharedImageID", &l.SharedImageID) + delete(rawMsg, key) + case "sharedImageVersion": + err = unpopulate(val, "SharedImageVersion", &l.SharedImageVersion) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &l.Size) + delete(rawMsg, key) + case "storageType": + err = unpopulate(val, "StorageType", &l.StorageType) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &l.UniqueIdentifier) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &l.UserName) + delete(rawMsg, key) + case "virtualMachineCreationSource": + err = unpopulate(val, "VirtualMachineCreationSource", &l.VirtualMachineCreationSource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabVirtualMachineFragment. +func (l LabVirtualMachineFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", l.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabVirtualMachineFragment. +func (l *LabVirtualMachineFragment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabVirtualMachineList. +func (l LabVirtualMachineList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabVirtualMachineList. +func (l *LabVirtualMachineList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabVirtualMachineProperties. +func (l LabVirtualMachineProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowClaim", l.AllowClaim) + populate(objectMap, "applicableSchedule", l.ApplicableSchedule) + populate(objectMap, "artifactDeploymentStatus", l.ArtifactDeploymentStatus) + populate(objectMap, "artifacts", l.Artifacts) + populate(objectMap, "canApplyArtifacts", l.CanApplyArtifacts) + populate(objectMap, "computeId", l.ComputeID) + populate(objectMap, "computeVm", l.ComputeVM) + populate(objectMap, "createdByUser", l.CreatedByUser) + populate(objectMap, "createdByUserId", l.CreatedByUserID) + populateTimeRFC3339(objectMap, "createdDate", l.CreatedDate) + populate(objectMap, "customImageId", l.CustomImageID) + populate(objectMap, "dataDiskParameters", l.DataDiskParameters) + populate(objectMap, "disallowPublicIpAddress", l.DisallowPublicIPAddress) + populate(objectMap, "environmentId", l.EnvironmentID) + populateTimeRFC3339(objectMap, "expirationDate", l.ExpirationDate) + populate(objectMap, "fqdn", l.Fqdn) + populate(objectMap, "galleryImageReference", l.GalleryImageReference) + populate(objectMap, "galleryImageVersionId", l.GalleryImageVersionID) + populate(objectMap, "isAuthenticationWithSshKey", l.IsAuthenticationWithSSHKey) + populate(objectMap, "labSubnetName", l.LabSubnetName) + populate(objectMap, "labVirtualNetworkId", l.LabVirtualNetworkID) + populate(objectMap, "lastKnownPowerState", l.LastKnownPowerState) + populate(objectMap, "networkInterface", l.NetworkInterface) + populate(objectMap, "notes", l.Notes) + populate(objectMap, "osDiskSizeGb", l.OSDiskSizeGb) + populate(objectMap, "osType", l.OSType) + populate(objectMap, "ownerObjectId", l.OwnerObjectID) + populate(objectMap, "ownerUserPrincipalName", l.OwnerUserPrincipalName) + populate(objectMap, "password", l.Password) + populate(objectMap, "planId", l.PlanID) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "sshKey", l.SSHKey) + populate(objectMap, "scheduleParameters", l.ScheduleParameters) + populate(objectMap, "sharedImageId", l.SharedImageID) + populate(objectMap, "sharedImageVersion", l.SharedImageVersion) + populate(objectMap, "size", l.Size) + populate(objectMap, "storageType", l.StorageType) + populate(objectMap, "uniqueIdentifier", l.UniqueIdentifier) + populate(objectMap, "userName", l.UserName) + populate(objectMap, "virtualMachineCreationSource", l.VirtualMachineCreationSource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabVirtualMachineProperties. +func (l *LabVirtualMachineProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowClaim": + err = unpopulate(val, "AllowClaim", &l.AllowClaim) + delete(rawMsg, key) + case "applicableSchedule": + err = unpopulate(val, "ApplicableSchedule", &l.ApplicableSchedule) + delete(rawMsg, key) + case "artifactDeploymentStatus": + err = unpopulate(val, "ArtifactDeploymentStatus", &l.ArtifactDeploymentStatus) + delete(rawMsg, key) + case "artifacts": + err = unpopulate(val, "Artifacts", &l.Artifacts) + delete(rawMsg, key) + case "canApplyArtifacts": + err = unpopulate(val, "CanApplyArtifacts", &l.CanApplyArtifacts) + delete(rawMsg, key) + case "computeId": + err = unpopulate(val, "ComputeID", &l.ComputeID) + delete(rawMsg, key) + case "computeVm": + err = unpopulate(val, "ComputeVM", &l.ComputeVM) + delete(rawMsg, key) + case "createdByUser": + err = unpopulate(val, "CreatedByUser", &l.CreatedByUser) + delete(rawMsg, key) + case "createdByUserId": + err = unpopulate(val, "CreatedByUserID", &l.CreatedByUserID) + delete(rawMsg, key) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &l.CreatedDate) + delete(rawMsg, key) + case "customImageId": + err = unpopulate(val, "CustomImageID", &l.CustomImageID) + delete(rawMsg, key) + case "dataDiskParameters": + err = unpopulate(val, "DataDiskParameters", &l.DataDiskParameters) + delete(rawMsg, key) + case "disallowPublicIpAddress": + err = unpopulate(val, "DisallowPublicIPAddress", &l.DisallowPublicIPAddress) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &l.EnvironmentID) + delete(rawMsg, key) + case "expirationDate": + err = unpopulateTimeRFC3339(val, "ExpirationDate", &l.ExpirationDate) + delete(rawMsg, key) + case "fqdn": + err = unpopulate(val, "Fqdn", &l.Fqdn) + delete(rawMsg, key) + case "galleryImageReference": + err = unpopulate(val, "GalleryImageReference", &l.GalleryImageReference) + delete(rawMsg, key) + case "galleryImageVersionId": + err = unpopulate(val, "GalleryImageVersionID", &l.GalleryImageVersionID) + delete(rawMsg, key) + case "isAuthenticationWithSshKey": + err = unpopulate(val, "IsAuthenticationWithSSHKey", &l.IsAuthenticationWithSSHKey) + delete(rawMsg, key) + case "labSubnetName": + err = unpopulate(val, "LabSubnetName", &l.LabSubnetName) + delete(rawMsg, key) + case "labVirtualNetworkId": + err = unpopulate(val, "LabVirtualNetworkID", &l.LabVirtualNetworkID) + delete(rawMsg, key) + case "lastKnownPowerState": + err = unpopulate(val, "LastKnownPowerState", &l.LastKnownPowerState) + delete(rawMsg, key) + case "networkInterface": + err = unpopulate(val, "NetworkInterface", &l.NetworkInterface) + delete(rawMsg, key) + case "notes": + err = unpopulate(val, "Notes", &l.Notes) + delete(rawMsg, key) + case "osDiskSizeGb": + err = unpopulate(val, "OSDiskSizeGb", &l.OSDiskSizeGb) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &l.OSType) + delete(rawMsg, key) + case "ownerObjectId": + err = unpopulate(val, "OwnerObjectID", &l.OwnerObjectID) + delete(rawMsg, key) + case "ownerUserPrincipalName": + err = unpopulate(val, "OwnerUserPrincipalName", &l.OwnerUserPrincipalName) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &l.Password) + delete(rawMsg, key) + case "planId": + err = unpopulate(val, "PlanID", &l.PlanID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "sshKey": + err = unpopulate(val, "SSHKey", &l.SSHKey) + delete(rawMsg, key) + case "scheduleParameters": + err = unpopulate(val, "ScheduleParameters", &l.ScheduleParameters) + delete(rawMsg, key) + case "sharedImageId": + err = unpopulate(val, "SharedImageID", &l.SharedImageID) + delete(rawMsg, key) + case "sharedImageVersion": + err = unpopulate(val, "SharedImageVersion", &l.SharedImageVersion) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &l.Size) + delete(rawMsg, key) + case "storageType": + err = unpopulate(val, "StorageType", &l.StorageType) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &l.UniqueIdentifier) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &l.UserName) + delete(rawMsg, key) + case "virtualMachineCreationSource": + err = unpopulate(val, "VirtualMachineCreationSource", &l.VirtualMachineCreationSource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LinuxOsInfo. +func (l LinuxOsInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "linuxOsState", l.LinuxOsState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxOsInfo. +func (l *LinuxOsInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "linuxOsState": + err = unpopulate(val, "LinuxOsState", &l.LinuxOsState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LocationData. +func (l LocationData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "city", l.City) + populate(objectMap, "countryOrRegion", l.CountryOrRegion) + populate(objectMap, "district", l.District) + populate(objectMap, "name", l.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocationData. +func (l *LocationData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "city": + err = unpopulate(val, "City", &l.City) + delete(rawMsg, key) + case "countryOrRegion": + err = unpopulate(val, "CountryOrRegion", &l.CountryOrRegion) + delete(rawMsg, key) + case "district": + err = unpopulate(val, "District", &l.District) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkInterfaceProperties. +func (n NetworkInterfaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dnsName", n.DNSName) + populate(objectMap, "privateIpAddress", n.PrivateIPAddress) + populate(objectMap, "publicIpAddress", n.PublicIPAddress) + populate(objectMap, "publicIpAddressId", n.PublicIPAddressID) + populate(objectMap, "rdpAuthority", n.RdpAuthority) + populate(objectMap, "sshAuthority", n.SSHAuthority) + populate(objectMap, "sharedPublicIpAddressConfiguration", n.SharedPublicIPAddressConfiguration) + populate(objectMap, "subnetId", n.SubnetID) + populate(objectMap, "virtualNetworkId", n.VirtualNetworkID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceProperties. +func (n *NetworkInterfaceProperties) UnmarshalJSON(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 "dnsName": + err = unpopulate(val, "DNSName", &n.DNSName) + delete(rawMsg, key) + case "privateIpAddress": + err = unpopulate(val, "PrivateIPAddress", &n.PrivateIPAddress) + delete(rawMsg, key) + case "publicIpAddress": + err = unpopulate(val, "PublicIPAddress", &n.PublicIPAddress) + delete(rawMsg, key) + case "publicIpAddressId": + err = unpopulate(val, "PublicIPAddressID", &n.PublicIPAddressID) + delete(rawMsg, key) + case "rdpAuthority": + err = unpopulate(val, "RdpAuthority", &n.RdpAuthority) + delete(rawMsg, key) + case "sshAuthority": + err = unpopulate(val, "SSHAuthority", &n.SSHAuthority) + delete(rawMsg, key) + case "sharedPublicIpAddressConfiguration": + err = unpopulate(val, "SharedPublicIPAddressConfiguration", &n.SharedPublicIPAddressConfiguration) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &n.SubnetID) + delete(rawMsg, key) + case "virtualNetworkId": + err = unpopulate(val, "VirtualNetworkID", &n.VirtualNetworkID) + 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 NotificationChannel. +func (n NotificationChannel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 NotificationChannel. +func (n *NotificationChannel) UnmarshalJSON(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 NotificationChannelFragment. +func (n NotificationChannelFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", n.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationChannelFragment. +func (n *NotificationChannelFragment) UnmarshalJSON(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 "tags": + err = unpopulate(val, "Tags", &n.Tags) + 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 NotificationChannelList. +func (n NotificationChannelList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationChannelList. +func (n *NotificationChannelList) UnmarshalJSON(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 NotificationChannelProperties. +func (n NotificationChannelProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdDate", n.CreatedDate) + populate(objectMap, "description", n.Description) + populate(objectMap, "emailRecipient", n.EmailRecipient) + populate(objectMap, "events", n.Events) + populate(objectMap, "notificationLocale", n.NotificationLocale) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "uniqueIdentifier", n.UniqueIdentifier) + populate(objectMap, "webHookUrl", n.WebHookURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationChannelProperties. +func (n *NotificationChannelProperties) UnmarshalJSON(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 "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &n.CreatedDate) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &n.Description) + delete(rawMsg, key) + case "emailRecipient": + err = unpopulate(val, "EmailRecipient", &n.EmailRecipient) + delete(rawMsg, key) + case "events": + err = unpopulate(val, "Events", &n.Events) + delete(rawMsg, key) + case "notificationLocale": + err = unpopulate(val, "NotificationLocale", &n.NotificationLocale) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &n.UniqueIdentifier) + delete(rawMsg, key) + case "webHookUrl": + err = unpopulate(val, "WebHookURL", &n.WebHookURL) + 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 NotificationSettings. +func (n NotificationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "emailRecipient", n.EmailRecipient) + populate(objectMap, "notificationLocale", n.NotificationLocale) + populate(objectMap, "status", n.Status) + populate(objectMap, "timeInMinutes", n.TimeInMinutes) + populate(objectMap, "webhookUrl", n.WebhookURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationSettings. +func (n *NotificationSettings) UnmarshalJSON(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 "emailRecipient": + err = unpopulate(val, "EmailRecipient", &n.EmailRecipient) + delete(rawMsg, key) + case "notificationLocale": + err = unpopulate(val, "NotificationLocale", &n.NotificationLocale) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &n.Status) + delete(rawMsg, key) + case "timeInMinutes": + err = unpopulate(val, "TimeInMinutes", &n.TimeInMinutes) + delete(rawMsg, key) + case "webhookUrl": + err = unpopulate(val, "WebhookURL", &n.WebhookURL) + 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 NotifyParameters. +func (n NotifyParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eventName", n.EventName) + populate(objectMap, "jsonPayload", n.JSONPayload) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotifyParameters. +func (n *NotifyParameters) UnmarshalJSON(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 "eventName": + err = unpopulate(val, "EventName", &n.EventName) + delete(rawMsg, key) + case "jsonPayload": + err = unpopulate(val, "JSONPayload", &n.JSONPayload) + 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 Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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]interface{}) + 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 OperationError. +func (o OperationError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", o.Code) + populate(objectMap, "message", o.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationError. +func (o *OperationError) UnmarshalJSON(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 "code": + err = unpopulate(val, "Code", &o.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &o.Message) + 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]interface{}) + 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 OperationMetadata. +func (o OperationMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetadata. +func (o *OperationMetadata) UnmarshalJSON(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 "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + 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 OperationMetadataDisplay. +func (o OperationMetadataDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 OperationMetadataDisplay. +func (o *OperationMetadataDisplay) UnmarshalJSON(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 OperationResult. +func (o OperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", o.Error) + populate(objectMap, "status", o.Status) + populate(objectMap, "statusCode", o.StatusCode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResult. +func (o *OperationResult) UnmarshalJSON(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 "error": + err = unpopulate(val, "Error", &o.Error) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &o.Status) + delete(rawMsg, key) + case "statusCode": + err = unpopulate(val, "StatusCode", &o.StatusCode) + 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 OperationStatusResult. +func (o OperationStatusResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", o.EndTime) + populate(objectMap, "error", o.Error) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "operations", o.Operations) + populate(objectMap, "percentComplete", o.PercentComplete) + populateTimeRFC3339(objectMap, "startTime", o.StartTime) + populate(objectMap, "status", o.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusResult. +func (o *OperationStatusResult) UnmarshalJSON(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 "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &o.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &o.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "operations": + err = unpopulate(val, "Operations", &o.Operations) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &o.PercentComplete) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &o.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &o.Status) + 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 ParameterInfo. +func (p ParameterInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", p.Name) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ParameterInfo. +func (p *ParameterInfo) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &p.Name) + 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 ParametersValueFileInfo. +func (p ParametersValueFileInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "fileName", p.FileName) + populate(objectMap, "parametersValueInfo", &p.ParametersValueInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ParametersValueFileInfo. +func (p *ParametersValueFileInfo) UnmarshalJSON(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 "fileName": + err = unpopulate(val, "FileName", &p.FileName) + delete(rawMsg, key) + case "parametersValueInfo": + err = unpopulate(val, "ParametersValueInfo", &p.ParametersValueInfo) + 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 PercentageCostThresholdProperties. +func (p PercentageCostThresholdProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "thresholdValue", p.ThresholdValue) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PercentageCostThresholdProperties. +func (p *PercentageCostThresholdProperties) UnmarshalJSON(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 "thresholdValue": + err = unpopulate(val, "ThresholdValue", &p.ThresholdValue) + 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 Plan. +func (p Plan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", p.Name) + populate(objectMap, "product", p.Product) + populate(objectMap, "promotionCode", p.PromotionCode) + populate(objectMap, "publisher", p.Publisher) + populate(objectMap, "version", p.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Plan. +func (p *Plan) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "product": + err = unpopulate(val, "Product", &p.Product) + delete(rawMsg, key) + case "promotionCode": + err = unpopulate(val, "PromotionCode", &p.PromotionCode) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &p.Publisher) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &p.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Policy. +func (p Policy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Policy. +func (p *Policy) UnmarshalJSON(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 "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 PolicyFragment. +func (p PolicyFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyFragment. +func (p *PolicyFragment) UnmarshalJSON(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 "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PolicyList. +func (p PolicyList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyList. +func (p *PolicyList) UnmarshalJSON(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 PolicyProperties. +func (p PolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdDate", p.CreatedDate) + populate(objectMap, "description", p.Description) + populate(objectMap, "evaluatorType", p.EvaluatorType) + populate(objectMap, "factData", p.FactData) + populate(objectMap, "factName", p.FactName) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "status", p.Status) + populate(objectMap, "threshold", p.Threshold) + populate(objectMap, "uniqueIdentifier", p.UniqueIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyProperties. +func (p *PolicyProperties) UnmarshalJSON(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 "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &p.CreatedDate) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "evaluatorType": + err = unpopulate(val, "EvaluatorType", &p.EvaluatorType) + delete(rawMsg, key) + case "factData": + err = unpopulate(val, "FactData", &p.FactData) + delete(rawMsg, key) + case "factName": + err = unpopulate(val, "FactName", &p.FactName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + case "threshold": + err = unpopulate(val, "Threshold", &p.Threshold) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &p.UniqueIdentifier) + 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 PolicySet. +func (p PolicySet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicySet. +func (p *PolicySet) UnmarshalJSON(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 "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 PolicySetList. +func (p PolicySetList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicySetList. +func (p *PolicySetList) UnmarshalJSON(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 PolicySetProperties. +func (p PolicySetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "uniqueIdentifier", p.UniqueIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicySetProperties. +func (p *PolicySetProperties) UnmarshalJSON(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 "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &p.UniqueIdentifier) + 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 PolicySetResult. +func (p PolicySetResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "hasError", p.HasError) + populate(objectMap, "policyViolations", p.PolicyViolations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicySetResult. +func (p *PolicySetResult) UnmarshalJSON(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 "hasError": + err = unpopulate(val, "HasError", &p.HasError) + delete(rawMsg, key) + case "policyViolations": + err = unpopulate(val, "PolicyViolations", &p.PolicyViolations) + 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 PolicyViolation. +func (p PolicyViolation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", p.Code) + populate(objectMap, "message", p.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyViolation. +func (p *PolicyViolation) UnmarshalJSON(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 "code": + err = unpopulate(val, "Code", &p.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &p.Message) + 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 Port. +func (p Port) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backendPort", p.BackendPort) + populate(objectMap, "transportProtocol", p.TransportProtocol) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Port. +func (p *Port) UnmarshalJSON(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 "backendPort": + err = unpopulate(val, "BackendPort", &p.BackendPort) + delete(rawMsg, key) + case "transportProtocol": + err = unpopulate(val, "TransportProtocol", &p.TransportProtocol) + 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 ProviderOperationResult. +func (p ProviderOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderOperationResult. +func (p *ProviderOperationResult) UnmarshalJSON(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]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "tags", p.Tags) + 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 "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + 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 RdpConnection. +func (r RdpConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contents", r.Contents) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RdpConnection. +func (r *RdpConnection) UnmarshalJSON(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 "contents": + err = unpopulate(val, "Contents", &r.Contents) + 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 ResizeLabVirtualMachineProperties. +func (r ResizeLabVirtualMachineProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "size", r.Size) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResizeLabVirtualMachineProperties. +func (r *ResizeLabVirtualMachineProperties) UnmarshalJSON(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 "size": + err = unpopulate(val, "Size", &r.Size) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceModelWithAllowedPropertySet. +func (r ResourceModelWithAllowedPropertySet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", r.Etag) + populate(objectMap, "id", r.ID) + populate(objectMap, "identity", r.Identity) + populate(objectMap, "kind", r.Kind) + populate(objectMap, "location", r.Location) + populate(objectMap, "managedBy", r.ManagedBy) + populate(objectMap, "name", r.Name) + populate(objectMap, "plan", r.Plan) + populate(objectMap, "sku", r.SKU) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceModelWithAllowedPropertySet. +func (r *ResourceModelWithAllowedPropertySet) UnmarshalJSON(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 "etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &r.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &r.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "managedBy": + err = unpopulate(val, "ManagedBy", &r.ManagedBy) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "plan": + err = unpopulate(val, "Plan", &r.Plan) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &r.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceModelWithAllowedPropertySetIdentity. +func (r ResourceModelWithAllowedPropertySetIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", r.PrincipalID) + populate(objectMap, "tenantId", r.TenantID) + objectMap["type"] = "SystemAssigned" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceModelWithAllowedPropertySetIdentity. +func (r *ResourceModelWithAllowedPropertySetIdentity) UnmarshalJSON(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 "principalId": + err = unpopulate(val, "PrincipalID", &r.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &r.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceModelWithAllowedPropertySetPlan. +func (r ResourceModelWithAllowedPropertySetPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", r.Name) + populate(objectMap, "product", r.Product) + populate(objectMap, "promotionCode", r.PromotionCode) + populate(objectMap, "publisher", r.Publisher) + populate(objectMap, "version", r.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceModelWithAllowedPropertySetPlan. +func (r *ResourceModelWithAllowedPropertySetPlan) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "product": + err = unpopulate(val, "Product", &r.Product) + delete(rawMsg, key) + case "promotionCode": + err = unpopulate(val, "PromotionCode", &r.PromotionCode) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &r.Publisher) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &r.Version) + 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 ResourceModelWithAllowedPropertySetSKU. +func (r ResourceModelWithAllowedPropertySetSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capacity", r.Capacity) + populate(objectMap, "family", r.Family) + populate(objectMap, "name", r.Name) + populate(objectMap, "size", r.Size) + populate(objectMap, "tier", r.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceModelWithAllowedPropertySetSKU. +func (r *ResourceModelWithAllowedPropertySetSKU) UnmarshalJSON(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 "capacity": + err = unpopulate(val, "Capacity", &r.Capacity) + delete(rawMsg, key) + case "family": + err = unpopulate(val, "Family", &r.Family) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &r.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &r.Tier) + 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 RetargetScheduleProperties. +func (r RetargetScheduleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentResourceId", r.CurrentResourceID) + populate(objectMap, "targetResourceId", r.TargetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RetargetScheduleProperties. +func (r *RetargetScheduleProperties) UnmarshalJSON(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 "currentResourceId": + err = unpopulate(val, "CurrentResourceID", &r.CurrentResourceID) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &r.TargetResourceID) + 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 SKU. +func (s SKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "family", s.Family) + populate(objectMap, "name", s.Name) + populate(objectMap, "size", s.Size) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) + delete(rawMsg, key) + case "family": + err = unpopulate(val, "Family", &s.Family) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &s.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Schedule. +func (s Schedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Schedule. +func (s *Schedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "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 "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScheduleCreationParameter. +func (s ScheduleCreationParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleCreationParameter. +func (s *ScheduleCreationParameter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "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 "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScheduleCreationParameterProperties. +func (s ScheduleCreationParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdDate", s.CreatedDate) + populate(objectMap, "dailyRecurrence", s.DailyRecurrence) + populate(objectMap, "hourlyRecurrence", s.HourlyRecurrence) + populate(objectMap, "notificationSettings", s.NotificationSettings) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "status", s.Status) + populate(objectMap, "targetResourceId", s.TargetResourceID) + populate(objectMap, "taskType", s.TaskType) + populate(objectMap, "timeZoneId", s.TimeZoneID) + populate(objectMap, "uniqueIdentifier", s.UniqueIdentifier) + populate(objectMap, "weeklyRecurrence", s.WeeklyRecurrence) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleCreationParameterProperties. +func (s *ScheduleCreationParameterProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &s.CreatedDate) + delete(rawMsg, key) + case "dailyRecurrence": + err = unpopulate(val, "DailyRecurrence", &s.DailyRecurrence) + delete(rawMsg, key) + case "hourlyRecurrence": + err = unpopulate(val, "HourlyRecurrence", &s.HourlyRecurrence) + delete(rawMsg, key) + case "notificationSettings": + err = unpopulate(val, "NotificationSettings", &s.NotificationSettings) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &s.TargetResourceID) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &s.TaskType) + delete(rawMsg, key) + case "timeZoneId": + err = unpopulate(val, "TimeZoneID", &s.TimeZoneID) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &s.UniqueIdentifier) + delete(rawMsg, key) + case "weeklyRecurrence": + err = unpopulate(val, "WeeklyRecurrence", &s.WeeklyRecurrence) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScheduleFragment. +func (s ScheduleFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleFragment. +func (s *ScheduleFragment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScheduleList. +func (s ScheduleList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleList. +func (s *ScheduleList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScheduleProperties. +func (s ScheduleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdDate", s.CreatedDate) + populate(objectMap, "dailyRecurrence", s.DailyRecurrence) + populate(objectMap, "hourlyRecurrence", s.HourlyRecurrence) + populate(objectMap, "notificationSettings", s.NotificationSettings) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "status", s.Status) + populate(objectMap, "targetResourceId", s.TargetResourceID) + populate(objectMap, "taskType", s.TaskType) + populate(objectMap, "timeZoneId", s.TimeZoneID) + populate(objectMap, "uniqueIdentifier", s.UniqueIdentifier) + populate(objectMap, "weeklyRecurrence", s.WeeklyRecurrence) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleProperties. +func (s *ScheduleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &s.CreatedDate) + delete(rawMsg, key) + case "dailyRecurrence": + err = unpopulate(val, "DailyRecurrence", &s.DailyRecurrence) + delete(rawMsg, key) + case "hourlyRecurrence": + err = unpopulate(val, "HourlyRecurrence", &s.HourlyRecurrence) + delete(rawMsg, key) + case "notificationSettings": + err = unpopulate(val, "NotificationSettings", &s.NotificationSettings) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &s.TargetResourceID) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &s.TaskType) + delete(rawMsg, key) + case "timeZoneId": + err = unpopulate(val, "TimeZoneID", &s.TimeZoneID) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &s.UniqueIdentifier) + delete(rawMsg, key) + case "weeklyRecurrence": + err = unpopulate(val, "WeeklyRecurrence", &s.WeeklyRecurrence) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Secret. +func (s Secret) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Secret. +func (s *Secret) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "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 "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecretFragment. +func (s SecretFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretFragment. +func (s *SecretFragment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecretList. +func (s SecretList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretList. +func (s *SecretList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecretProperties. +func (s SecretProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "uniqueIdentifier", s.UniqueIdentifier) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretProperties. +func (s *SecretProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &s.UniqueIdentifier) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceFabric. +func (s ServiceFabric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceFabric. +func (s *ServiceFabric) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "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 "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceFabricFragment. +func (s ServiceFabricFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceFabricFragment. +func (s *ServiceFabricFragment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceFabricList. +func (s ServiceFabricList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceFabricList. +func (s *ServiceFabricList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceFabricProperties. +func (s ServiceFabricProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "applicableSchedule", s.ApplicableSchedule) + populate(objectMap, "environmentId", s.EnvironmentID) + populate(objectMap, "externalServiceFabricId", s.ExternalServiceFabricID) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "uniqueIdentifier", s.UniqueIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceFabricProperties. +func (s *ServiceFabricProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "applicableSchedule": + err = unpopulate(val, "ApplicableSchedule", &s.ApplicableSchedule) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &s.EnvironmentID) + delete(rawMsg, key) + case "externalServiceFabricId": + err = unpopulate(val, "ExternalServiceFabricID", &s.ExternalServiceFabricID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &s.UniqueIdentifier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceRunner. +func (s ServiceRunner) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceRunner. +func (s *ServiceRunner) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &s.Identity) + delete(rawMsg, key) + 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 "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceRunnerList. +func (s ServiceRunnerList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceRunnerList. +func (s *ServiceRunnerList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceRunnerProperties. +func (s ServiceRunnerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identityUsageType", s.IdentityUsageType) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "uniqueIdentifier", s.UniqueIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceRunnerProperties. +func (s *ServiceRunnerProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identityUsageType": + err = unpopulate(val, "IdentityUsageType", &s.IdentityUsageType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &s.UniqueIdentifier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SharedGallery. +func (s SharedGallery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGallery. +func (s *SharedGallery) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "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 "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SharedGalleryFragment. +func (s SharedGalleryFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryFragment. +func (s *SharedGalleryFragment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SharedGalleryList. +func (s SharedGalleryList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryList. +func (s *SharedGalleryList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SharedGalleryProperties. +func (s SharedGalleryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowAllImages", s.AllowAllImages) + populate(objectMap, "galleryId", s.GalleryID) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "uniqueIdentifier", s.UniqueIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryProperties. +func (s *SharedGalleryProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowAllImages": + err = unpopulate(val, "AllowAllImages", &s.AllowAllImages) + delete(rawMsg, key) + case "galleryId": + err = unpopulate(val, "GalleryID", &s.GalleryID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &s.UniqueIdentifier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SharedImage. +func (s SharedImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedImage. +func (s *SharedImage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "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 "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SharedImageFragment. +func (s SharedImageFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedImageFragment. +func (s *SharedImageFragment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SharedImageList. +func (s SharedImageList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedImageList. +func (s *SharedImageList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SharedImageProperties. +func (s SharedImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "definitionName", s.DefinitionName) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "enableState", s.EnableState) + populate(objectMap, "imageType", s.ImageType) + populate(objectMap, "osType", s.OSType) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "uniqueIdentifier", s.UniqueIdentifier) + populate(objectMap, "versions", s.Versions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedImageProperties. +func (s *SharedImageProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "definitionName": + err = unpopulate(val, "DefinitionName", &s.DefinitionName) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "enableState": + err = unpopulate(val, "EnableState", &s.EnableState) + delete(rawMsg, key) + case "imageType": + err = unpopulate(val, "ImageType", &s.ImageType) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &s.OSType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &s.UniqueIdentifier) + delete(rawMsg, key) + case "versions": + err = unpopulate(val, "Versions", &s.Versions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SharedPublicIPAddressConfiguration. +func (s SharedPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "inboundNatRules", s.InboundNatRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedPublicIPAddressConfiguration. +func (s *SharedPublicIPAddressConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "inboundNatRules": + err = unpopulate(val, "InboundNatRules", &s.InboundNatRules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Subnet. +func (s Subnet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowPublicIp", s.AllowPublicIP) + populate(objectMap, "labSubnetName", s.LabSubnetName) + populate(objectMap, "resourceId", s.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Subnet. +func (s *Subnet) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowPublicIp": + err = unpopulate(val, "AllowPublicIP", &s.AllowPublicIP) + delete(rawMsg, key) + case "labSubnetName": + err = unpopulate(val, "LabSubnetName", &s.LabSubnetName) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &s.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubnetOverride. +func (s SubnetOverride) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "labSubnetName", s.LabSubnetName) + populate(objectMap, "resourceId", s.ResourceID) + populate(objectMap, "sharedPublicIpAddressConfiguration", s.SharedPublicIPAddressConfiguration) + populate(objectMap, "useInVmCreationPermission", s.UseInVMCreationPermission) + populate(objectMap, "usePublicIpAddressPermission", s.UsePublicIPAddressPermission) + populate(objectMap, "virtualNetworkPoolName", s.VirtualNetworkPoolName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubnetOverride. +func (s *SubnetOverride) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "labSubnetName": + err = unpopulate(val, "LabSubnetName", &s.LabSubnetName) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &s.ResourceID) + delete(rawMsg, key) + case "sharedPublicIpAddressConfiguration": + err = unpopulate(val, "SharedPublicIPAddressConfiguration", &s.SharedPublicIPAddressConfiguration) + delete(rawMsg, key) + case "useInVmCreationPermission": + err = unpopulate(val, "UseInVMCreationPermission", &s.UseInVMCreationPermission) + delete(rawMsg, key) + case "usePublicIpAddressPermission": + err = unpopulate(val, "UsePublicIPAddressPermission", &s.UsePublicIPAddressPermission) + delete(rawMsg, key) + case "virtualNetworkPoolName": + err = unpopulate(val, "VirtualNetworkPoolName", &s.VirtualNetworkPoolName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubnetSharedPublicIPAddressConfiguration. +func (s SubnetSharedPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowedPorts", s.AllowedPorts) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubnetSharedPublicIPAddressConfiguration. +func (s *SubnetSharedPublicIPAddressConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowedPorts": + err = unpopulate(val, "AllowedPorts", &s.AllowedPorts) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TargetCostProperties. +func (t TargetCostProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "costThresholds", t.CostThresholds) + populateTimeRFC3339(objectMap, "cycleEndDateTime", t.CycleEndDateTime) + populateTimeRFC3339(objectMap, "cycleStartDateTime", t.CycleStartDateTime) + populate(objectMap, "cycleType", t.CycleType) + populate(objectMap, "status", t.Status) + populate(objectMap, "target", t.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TargetCostProperties. +func (t *TargetCostProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "costThresholds": + err = unpopulate(val, "CostThresholds", &t.CostThresholds) + delete(rawMsg, key) + case "cycleEndDateTime": + err = unpopulateTimeRFC3339(val, "CycleEndDateTime", &t.CycleEndDateTime) + delete(rawMsg, key) + case "cycleStartDateTime": + err = unpopulateTimeRFC3339(val, "CycleStartDateTime", &t.CycleStartDateTime) + delete(rawMsg, key) + case "cycleType": + err = unpopulate(val, "CycleType", &t.CycleType) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &t.Status) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &t.Target) + 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 UpdateResource. +func (u UpdateResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", u.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateResource. +func (u *UpdateResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &u.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type User. +func (u User) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", u.ID) + populate(objectMap, "location", u.Location) + populate(objectMap, "name", u.Name) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "systemData", u.SystemData) + populate(objectMap, "tags", u.Tags) + populate(objectMap, "type", u.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type User. +func (u *User) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &u.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &u.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &u.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &u.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserFragment. +func (u UserFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", u.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserFragment. +func (u *UserFragment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &u.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserIdentity. +func (u UserIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appId", u.AppID) + populate(objectMap, "objectId", u.ObjectID) + populate(objectMap, "principalId", u.PrincipalID) + populate(objectMap, "principalName", u.PrincipalName) + populate(objectMap, "tenantId", u.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentity. +func (u *UserIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "appId": + err = unpopulate(val, "AppID", &u.AppID) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, "ObjectID", &u.ObjectID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + delete(rawMsg, key) + case "principalName": + err = unpopulate(val, "PrincipalName", &u.PrincipalName) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &u.TenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserList. +func (u UserList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserList. +func (u *UserList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &u.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserProperties. +func (u UserProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdDate", u.CreatedDate) + populate(objectMap, "identity", u.Identity) + populate(objectMap, "provisioningState", u.ProvisioningState) + populate(objectMap, "secretStore", u.SecretStore) + populate(objectMap, "uniqueIdentifier", u.UniqueIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserProperties. +func (u *UserProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &u.CreatedDate) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &u.Identity) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &u.ProvisioningState) + delete(rawMsg, key) + case "secretStore": + err = unpopulate(val, "SecretStore", &u.SecretStore) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &u.UniqueIdentifier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserSecretStore. +func (u UserSecretStore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "keyVaultId", u.KeyVaultID) + populate(objectMap, "keyVaultUri", u.KeyVaultURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserSecretStore. +func (u *UserSecretStore) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyVaultId": + err = unpopulate(val, "KeyVaultID", &u.KeyVaultID) + delete(rawMsg, key) + case "keyVaultUri": + err = unpopulate(val, "KeyVaultURI", &u.KeyVaultURI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetwork. +func (v VirtualNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "systemData", v.SystemData) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetwork. +func (v *VirtualNetwork) UnmarshalJSON(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) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + 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) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkFragment. +func (v VirtualNetworkFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", v.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkFragment. +func (v *VirtualNetworkFragment) UnmarshalJSON(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 "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkList. +func (v VirtualNetworkList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkList. +func (v *VirtualNetworkList) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkProperties. +func (v VirtualNetworkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowedSubnets", v.AllowedSubnets) + populateTimeRFC3339(objectMap, "createdDate", v.CreatedDate) + populate(objectMap, "description", v.Description) + populate(objectMap, "externalProviderResourceId", v.ExternalProviderResourceID) + populate(objectMap, "externalSubnets", v.ExternalSubnets) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "subnetOverrides", v.SubnetOverrides) + populate(objectMap, "uniqueIdentifier", v.UniqueIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkProperties. +func (v *VirtualNetworkProperties) UnmarshalJSON(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 "allowedSubnets": + err = unpopulate(val, "AllowedSubnets", &v.AllowedSubnets) + delete(rawMsg, key) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &v.CreatedDate) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &v.Description) + delete(rawMsg, key) + case "externalProviderResourceId": + err = unpopulate(val, "ExternalProviderResourceID", &v.ExternalProviderResourceID) + delete(rawMsg, key) + case "externalSubnets": + err = unpopulate(val, "ExternalSubnets", &v.ExternalSubnets) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "subnetOverrides": + err = unpopulate(val, "SubnetOverrides", &v.SubnetOverrides) + delete(rawMsg, key) + case "uniqueIdentifier": + err = unpopulate(val, "UniqueIdentifier", &v.UniqueIdentifier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WeekDetails. +func (w WeekDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "time", w.Time) + populate(objectMap, "weekdays", w.Weekdays) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WeekDetails. +func (w *WeekDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "time": + err = unpopulate(val, "Time", &w.Time) + delete(rawMsg, key) + case "weekdays": + err = unpopulate(val, "Weekdays", &w.Weekdays) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WeekDetailsFragment. +func (w WeekDetailsFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "time", w.Time) + populate(objectMap, "weekdays", w.Weekdays) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WeekDetailsFragment. +func (w *WeekDetailsFragment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "time": + err = unpopulate(val, "Time", &w.Time) + delete(rawMsg, key) + case "weekdays": + err = unpopulate(val, "Weekdays", &w.Weekdays) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WindowsOsInfo. +func (w WindowsOsInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "windowsOsState", w.WindowsOsState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WindowsOsInfo. +func (w *WindowsOsInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "windowsOsState": + err = unpopulate(val, "WindowsOsState", &w.WindowsOsState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v interface{}) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_notificationchannels_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/notificationchannels_client.go similarity index 96% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_notificationchannels_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/notificationchannels_client.go index 0531470b255f..822b44ff4137 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_notificationchannels_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/notificationchannels_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -55,9 +56,9 @@ func NewNotificationChannelsClient(subscriptionID string, credential azcore.Toke return client, nil } -// CreateOrUpdate - Create or replace an existing notification channel. +// CreateOrUpdate - Create or replace an existing Notification Channel. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the notification channel. @@ -103,7 +104,7 @@ func (client *NotificationChannelsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, notificationChannel) @@ -120,7 +121,7 @@ func (client *NotificationChannelsClient) createOrUpdateHandleResponse(resp *htt // Delete - Delete notification channel. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the notification channel. @@ -165,7 +166,7 @@ func (client *NotificationChannelsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,7 +174,7 @@ func (client *NotificationChannelsClient) deleteCreateRequest(ctx context.Contex // Get - Get notification channel. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the notification channel. @@ -221,7 +222,7 @@ func (client *NotificationChannelsClient) getCreateRequest(ctx context.Context, if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,7 +239,7 @@ func (client *NotificationChannelsClient) getHandleResponse(resp *http.Response) // NewListPager - List notification channels in a given lab. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // options - NotificationChannelsClientListOptions contains the optional parameters for the NotificationChannelsClient.List @@ -303,7 +304,7 @@ func (client *NotificationChannelsClient) listCreateRequest(ctx context.Context, if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -320,7 +321,7 @@ func (client *NotificationChannelsClient) listHandleResponse(resp *http.Response // Notify - Send notification to provided channel. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the notification channel. @@ -366,7 +367,7 @@ func (client *NotificationChannelsClient) notifyCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, notifyParameters) @@ -374,11 +375,11 @@ func (client *NotificationChannelsClient) notifyCreateRequest(ctx context.Contex // Update - Allows modifying tags of notification channels. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the notification channel. -// notificationChannel - A notification. +// notificationChannel - Allows modifying tags of notification channels. All other properties will be ignored. // options - NotificationChannelsClientUpdateOptions contains the optional parameters for the NotificationChannelsClient.Update // method. func (client *NotificationChannelsClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, notificationChannel NotificationChannelFragment, options *NotificationChannelsClientUpdateOptions) (NotificationChannelsClientUpdateResponse, error) { @@ -420,7 +421,7 @@ func (client *NotificationChannelsClient) updateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, notificationChannel) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_operations_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/operations_client.go similarity index 97% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_operations_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/operations_client.go index b7e88ba44750..40a3d616cd0a 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_operations_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/operations_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -56,7 +57,7 @@ func NewOperationsClient(subscriptionID string, credential azcore.TokenCredentia // Get - Get operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // locationName - The name of the location. // name - The name of the operation. // options - OperationsClientGetOptions contains the optional parameters for the OperationsClient.Get method. @@ -95,7 +96,7 @@ func (client *OperationsClient) getCreateRequest(ctx context.Context, locationNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_policies_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/policies_client.go similarity index 97% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_policies_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/policies_client.go index e75774aaf659..4afe12b67734 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_policies_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/policies_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -57,7 +58,7 @@ func NewPoliciesClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Create or replace an existing policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // policySetName - The name of the policy set. @@ -107,7 +108,7 @@ func (client *PoliciesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, policy) @@ -124,7 +125,7 @@ func (client *PoliciesClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Delete policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // policySetName - The name of the policy set. @@ -173,7 +174,7 @@ func (client *PoliciesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +182,7 @@ func (client *PoliciesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // policySetName - The name of the policy set. @@ -233,7 +234,7 @@ func (client *PoliciesClient) getCreateRequest(ctx context.Context, resourceGrou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +251,7 @@ func (client *PoliciesClient) getHandleResponse(resp *http.Response) (PoliciesCl // NewListPager - List policies in a given policy set. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // policySetName - The name of the policy set. @@ -319,7 +320,7 @@ func (client *PoliciesClient) listCreateRequest(ctx context.Context, resourceGro if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -336,12 +337,12 @@ func (client *PoliciesClient) listHandleResponse(resp *http.Response) (PoliciesC // Update - Allows modifying tags of policies. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // policySetName - The name of the policy set. // name - The name of the policy. -// policy - A Policy. +// policy - Allows modifying tags of policies. All other properties will be ignored. // options - PoliciesClientUpdateOptions contains the optional parameters for the PoliciesClient.Update method. func (client *PoliciesClient) Update(ctx context.Context, resourceGroupName string, labName string, policySetName string, name string, policy PolicyFragment, options *PoliciesClientUpdateOptions) (PoliciesClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, policySetName, name, policy, options) @@ -386,7 +387,7 @@ func (client *PoliciesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, policy) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_policysets_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/policysets_client.go similarity index 59% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_policysets_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/policysets_client.go index 875b43d1b747..2b8dc16c42d0 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_policysets_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/policysets_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -19,6 +20,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -56,7 +58,7 @@ func NewPolicySetsClient(subscriptionID string, credential azcore.TokenCredentia // EvaluatePolicies - Evaluates lab policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the policy set. @@ -102,7 +104,7 @@ func (client *PolicySetsClient) evaluatePoliciesCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, evaluatePoliciesRequest) @@ -116,3 +118,81 @@ func (client *PolicySetsClient) evaluatePoliciesHandleResponse(resp *http.Respon } return result, nil } + +// NewListPager - List policy sets in a given lab. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// options - PolicySetsClientListOptions contains the optional parameters for the PolicySetsClient.List method. +func (client *PolicySetsClient) NewListPager(resourceGroupName string, labName string, options *PolicySetsClientListOptions) *runtime.Pager[PolicySetsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PolicySetsClientListResponse]{ + More: func(page PolicySetsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PolicySetsClientListResponse) (PolicySetsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, labName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PolicySetsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PolicySetsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PolicySetsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PolicySetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, labName string, options *PolicySetsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Orderby != nil { + reqQP.Set("$orderby", *options.Orderby) + } + reqQP.Set("api-version", "2021-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 *PolicySetsClient) listHandleResponse(resp *http.Response) (PolicySetsClientListResponse, error) { + result := PolicySetsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PolicySetList); err != nil { + return PolicySetsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_provideroperations_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/provideroperations_client.go similarity index 97% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_provideroperations_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/provideroperations_client.go index 3c589c6a4aa8..54c603627933 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_provideroperations_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/provideroperations_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -50,7 +51,7 @@ func NewProviderOperationsClient(credential azcore.TokenCredential, options *arm // NewListPager - Result of the request to list REST API operations // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // options - ProviderOperationsClientListOptions contains the optional parameters for the ProviderOperationsClient.List method. func (client *ProviderOperationsClient) NewListPager(options *ProviderOperationsClientListOptions) *runtime.Pager[ProviderOperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ProviderOperationsClientListResponse]{ @@ -88,7 +89,7 @@ func (client *ProviderOperationsClient) listCreateRequest(ctx context.Context, o return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_response_types.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/response_types.go similarity index 84% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_response_types.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/response_types.go index 719a28021754..666b3d5544a3 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_response_types.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/response_types.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -58,6 +59,31 @@ type ArtifactsClientListResponse struct { ArtifactList } +// BastionHostsClientCreateOrUpdateResponse contains the response from method BastionHostsClient.CreateOrUpdate. +type BastionHostsClientCreateOrUpdateResponse struct { + BastionHost +} + +// BastionHostsClientDeleteResponse contains the response from method BastionHostsClient.Delete. +type BastionHostsClientDeleteResponse struct { + // placeholder for future response values +} + +// BastionHostsClientGetResponse contains the response from method BastionHostsClient.Get. +type BastionHostsClientGetResponse struct { + BastionHost +} + +// BastionHostsClientListResponse contains the response from method BastionHostsClient.List. +type BastionHostsClientListResponse struct { + BastionHostList +} + +// BastionHostsClientUpdateResponse contains the response from method BastionHostsClient.Update. +type BastionHostsClientUpdateResponse struct { + BastionHost +} + // CostsClientCreateOrUpdateResponse contains the response from method CostsClient.CreateOrUpdate. type CostsClientCreateOrUpdateResponse struct { LabCost @@ -178,6 +204,11 @@ type FormulasClientUpdateResponse struct { Formula } +// GalleryImagesClientGetResponse contains the response from method GalleryImagesClient.Get. +type GalleryImagesClientGetResponse struct { + GalleryImage +} + // GalleryImagesClientListResponse contains the response from method GalleryImagesClient.List. type GalleryImagesClientListResponse struct { GalleryImageList @@ -223,6 +254,31 @@ type GlobalSchedulesClientUpdateResponse struct { Schedule } +// LabSecretsClientCreateOrUpdateResponse contains the response from method LabSecretsClient.CreateOrUpdate. +type LabSecretsClientCreateOrUpdateResponse struct { + LabSecret +} + +// LabSecretsClientDeleteResponse contains the response from method LabSecretsClient.Delete. +type LabSecretsClientDeleteResponse struct { + // placeholder for future response values +} + +// LabSecretsClientGetResponse contains the response from method LabSecretsClient.Get. +type LabSecretsClientGetResponse struct { + LabSecret +} + +// LabSecretsClientListResponse contains the response from method LabSecretsClient.List. +type LabSecretsClientListResponse struct { + LabSecretList +} + +// LabSecretsClientUpdateResponse contains the response from method LabSecretsClient.Update. +type LabSecretsClientUpdateResponse struct { + LabSecret +} + // LabsClientClaimAnyVMResponse contains the response from method LabsClient.ClaimAnyVM. type LabsClientClaimAnyVMResponse struct { // placeholder for future response values @@ -243,6 +299,11 @@ type LabsClientDeleteResponse struct { // placeholder for future response values } +// LabsClientEnsureCurrentUserProfileResponse contains the response from method LabsClient.EnsureCurrentUserProfile. +type LabsClientEnsureCurrentUserProfileResponse struct { + // placeholder for future response values +} + // LabsClientExportResourceUsageResponse contains the response from method LabsClient.ExportResourceUsage. type LabsClientExportResourceUsageResponse struct { // placeholder for future response values @@ -348,6 +409,11 @@ type PolicySetsClientEvaluatePoliciesResponse struct { EvaluatePoliciesResponse } +// PolicySetsClientListResponse contains the response from method PolicySetsClient.List. +type PolicySetsClientListResponse struct { + PolicySetList +} + // ProviderOperationsClientListResponse contains the response from method ProviderOperationsClient.List. type ProviderOperationsClientListResponse struct { ProviderOperationResult @@ -498,6 +564,61 @@ type ServiceRunnersClientGetResponse struct { ServiceRunner } +// ServiceRunnersClientListResponse contains the response from method ServiceRunnersClient.List. +type ServiceRunnersClientListResponse struct { + ServiceRunnerList +} + +// SharedGalleriesClientCreateOrUpdateResponse contains the response from method SharedGalleriesClient.CreateOrUpdate. +type SharedGalleriesClientCreateOrUpdateResponse struct { + SharedGallery +} + +// SharedGalleriesClientDeleteResponse contains the response from method SharedGalleriesClient.Delete. +type SharedGalleriesClientDeleteResponse struct { + // placeholder for future response values +} + +// SharedGalleriesClientGetResponse contains the response from method SharedGalleriesClient.Get. +type SharedGalleriesClientGetResponse struct { + SharedGallery +} + +// SharedGalleriesClientListResponse contains the response from method SharedGalleriesClient.List. +type SharedGalleriesClientListResponse struct { + SharedGalleryList +} + +// SharedGalleriesClientUpdateResponse contains the response from method SharedGalleriesClient.Update. +type SharedGalleriesClientUpdateResponse struct { + SharedGallery +} + +// SharedImagesClientCreateOrUpdateResponse contains the response from method SharedImagesClient.CreateOrUpdate. +type SharedImagesClientCreateOrUpdateResponse struct { + SharedImage +} + +// SharedImagesClientDeleteResponse contains the response from method SharedImagesClient.Delete. +type SharedImagesClientDeleteResponse struct { + // placeholder for future response values +} + +// SharedImagesClientGetResponse contains the response from method SharedImagesClient.Get. +type SharedImagesClientGetResponse struct { + SharedImage +} + +// SharedImagesClientListResponse contains the response from method SharedImagesClient.List. +type SharedImagesClientListResponse struct { + SharedImageList +} + +// SharedImagesClientUpdateResponse contains the response from method SharedImagesClient.Update. +type SharedImagesClientUpdateResponse struct { + SharedImage +} + // UsersClientCreateOrUpdateResponse contains the response from method UsersClient.CreateOrUpdate. type UsersClientCreateOrUpdateResponse struct { User @@ -568,6 +689,11 @@ type VirtualMachinesClientClaimResponse struct { // placeholder for future response values } +// VirtualMachinesClientClearArtifactResultsResponse contains the response from method VirtualMachinesClient.ClearArtifactResults. +type VirtualMachinesClientClearArtifactResultsResponse struct { + // placeholder for future response values +} + // VirtualMachinesClientCreateOrUpdateResponse contains the response from method VirtualMachinesClient.CreateOrUpdate. type VirtualMachinesClientCreateOrUpdateResponse struct { LabVirtualMachine diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_schedules_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/schedules_client.go similarity index 96% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_schedules_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/schedules_client.go index 028759890174..0ce4cb971f3b 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_schedules_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/schedules_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -57,7 +58,7 @@ func NewSchedulesClient(subscriptionID string, credential azcore.TokenCredential // CreateOrUpdate - Create or replace an existing schedule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the schedule. @@ -103,7 +104,7 @@ func (client *SchedulesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, schedule) @@ -120,7 +121,7 @@ func (client *SchedulesClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Delete schedule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the schedule. @@ -164,7 +165,7 @@ func (client *SchedulesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +173,7 @@ func (client *SchedulesClient) deleteCreateRequest(ctx context.Context, resource // BeginExecute - Execute a schedule. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the schedule. @@ -191,7 +192,7 @@ func (client *SchedulesClient) BeginExecute(ctx context.Context, resourceGroupNa // Execute - Execute a schedule. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *SchedulesClient) execute(ctx context.Context, resourceGroupName string, labName string, name string, options *SchedulesClientBeginExecuteOptions) (*http.Response, error) { req, err := client.executeCreateRequest(ctx, resourceGroupName, labName, name, options) if err != nil { @@ -231,7 +232,7 @@ func (client *SchedulesClient) executeCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,7 +240,7 @@ func (client *SchedulesClient) executeCreateRequest(ctx context.Context, resourc // Get - Get schedule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the schedule. @@ -286,7 +287,7 @@ func (client *SchedulesClient) getCreateRequest(ctx context.Context, resourceGro if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,7 +304,7 @@ func (client *SchedulesClient) getHandleResponse(resp *http.Response) (Schedules // NewListPager - List schedules in a given lab. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // options - SchedulesClientListOptions contains the optional parameters for the SchedulesClient.List method. @@ -367,7 +368,7 @@ func (client *SchedulesClient) listCreateRequest(ctx context.Context, resourceGr if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,7 +385,7 @@ func (client *SchedulesClient) listHandleResponse(resp *http.Response) (Schedule // NewListApplicablePager - Lists all applicable schedules // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the schedule. @@ -442,7 +443,7 @@ func (client *SchedulesClient) listApplicableCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -459,11 +460,11 @@ func (client *SchedulesClient) listApplicableHandleResponse(resp *http.Response) // Update - Allows modifying tags of schedules. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the schedule. -// schedule - A schedule. +// schedule - Allows modifying tags of schedules. All other properties will be ignored. // options - SchedulesClientUpdateOptions contains the optional parameters for the SchedulesClient.Update method. func (client *SchedulesClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, schedule ScheduleFragment, options *SchedulesClientUpdateOptions) (SchedulesClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, name, schedule, options) @@ -504,7 +505,7 @@ func (client *SchedulesClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, schedule) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_secrets_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/secrets_client.go similarity index 97% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_secrets_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/secrets_client.go index f7d3508e68e9..0558e728a1d9 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_secrets_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/secrets_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -57,7 +58,7 @@ func NewSecretsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or replace an existing secret. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -79,7 +80,7 @@ func (client *SecretsClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Create or replace an existing secret. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *SecretsClient) createOrUpdate(ctx context.Context, resourceGroupName string, labName string, userName string, name string, secret Secret, options *SecretsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, labName, userName, name, secret, options) if err != nil { @@ -123,7 +124,7 @@ func (client *SecretsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, secret) @@ -131,7 +132,7 @@ func (client *SecretsClient) createOrUpdateCreateRequest(ctx context.Context, re // Delete - Delete secret. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -180,7 +181,7 @@ func (client *SecretsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,7 +189,7 @@ func (client *SecretsClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Get secret. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -240,7 +241,7 @@ func (client *SecretsClient) getCreateRequest(ctx context.Context, resourceGroup if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +258,7 @@ func (client *SecretsClient) getHandleResponse(resp *http.Response) (SecretsClie // NewListPager - List secrets in a given user profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -326,7 +327,7 @@ func (client *SecretsClient) listCreateRequest(ctx context.Context, resourceGrou if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -343,12 +344,12 @@ func (client *SecretsClient) listHandleResponse(resp *http.Response) (SecretsCli // Update - Allows modifying tags of secrets. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. // name - The name of the secret. -// secret - A secret. +// secret - Allows modifying tags of secrets. All other properties will be ignored. // options - SecretsClientUpdateOptions contains the optional parameters for the SecretsClient.Update method. func (client *SecretsClient) Update(ctx context.Context, resourceGroupName string, labName string, userName string, name string, secret SecretFragment, options *SecretsClientUpdateOptions) (SecretsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, userName, name, secret, options) @@ -393,7 +394,7 @@ func (client *SecretsClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, secret) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_servicefabrics_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/servicefabrics_client.go similarity index 96% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_servicefabrics_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/servicefabrics_client.go index fadc574de54f..f5a21e8c77ff 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_servicefabrics_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/servicefabrics_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -55,9 +56,9 @@ func NewServiceFabricsClient(subscriptionID string, credential azcore.TokenCrede return client, nil } -// BeginCreateOrUpdate - Create or replace an existing service fabric. This operation can take a while to complete. +// BeginCreateOrUpdate - Create or replace an existing Service Fabric. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -77,9 +78,9 @@ func (client *ServiceFabricsClient) BeginCreateOrUpdate(ctx context.Context, res } } -// CreateOrUpdate - Create or replace an existing service fabric. This operation can take a while to complete. +// CreateOrUpdate - Create or replace an existing Service Fabric. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *ServiceFabricsClient) createOrUpdate(ctx context.Context, resourceGroupName string, labName string, userName string, name string, serviceFabric ServiceFabric, options *ServiceFabricsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, labName, userName, name, serviceFabric, options) if err != nil { @@ -123,7 +124,7 @@ func (client *ServiceFabricsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, serviceFabric) @@ -131,7 +132,7 @@ func (client *ServiceFabricsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Delete service fabric. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -152,7 +153,7 @@ func (client *ServiceFabricsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Delete service fabric. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *ServiceFabricsClient) deleteOperation(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *ServiceFabricsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, labName, userName, name, options) if err != nil { @@ -196,7 +197,7 @@ func (client *ServiceFabricsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +205,7 @@ func (client *ServiceFabricsClient) deleteCreateRequest(ctx context.Context, res // Get - Get service fabric. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -256,7 +257,7 @@ func (client *ServiceFabricsClient) getCreateRequest(ctx context.Context, resour if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -273,7 +274,7 @@ func (client *ServiceFabricsClient) getHandleResponse(resp *http.Response) (Serv // NewListPager - List service fabrics in a given user profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -342,7 +343,7 @@ func (client *ServiceFabricsClient) listCreateRequest(ctx context.Context, resou if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -359,7 +360,7 @@ func (client *ServiceFabricsClient) listHandleResponse(resp *http.Response) (Ser // ListApplicableSchedules - Lists the applicable start/stop schedules, if any. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -409,7 +410,7 @@ func (client *ServiceFabricsClient) listApplicableSchedulesCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -426,7 +427,7 @@ func (client *ServiceFabricsClient) listApplicableSchedulesHandleResponse(resp * // BeginStart - Start a service fabric. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -447,7 +448,7 @@ func (client *ServiceFabricsClient) BeginStart(ctx context.Context, resourceGrou // Start - Start a service fabric. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *ServiceFabricsClient) start(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *ServiceFabricsClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, labName, userName, name, options) if err != nil { @@ -491,7 +492,7 @@ func (client *ServiceFabricsClient) startCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -499,7 +500,7 @@ func (client *ServiceFabricsClient) startCreateRequest(ctx context.Context, reso // BeginStop - Stop a service fabric This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -520,7 +521,7 @@ func (client *ServiceFabricsClient) BeginStop(ctx context.Context, resourceGroup // Stop - Stop a service fabric This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *ServiceFabricsClient) stop(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *ServiceFabricsClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, labName, userName, name, options) if err != nil { @@ -564,7 +565,7 @@ func (client *ServiceFabricsClient) stopCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -572,12 +573,12 @@ func (client *ServiceFabricsClient) stopCreateRequest(ctx context.Context, resou // Update - Allows modifying tags of service fabrics. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. // name - The name of the service fabric. -// serviceFabric - A Service Fabric. +// serviceFabric - Allows modifying tags of service fabrics. All other properties will be ignored. // options - ServiceFabricsClientUpdateOptions contains the optional parameters for the ServiceFabricsClient.Update method. func (client *ServiceFabricsClient) Update(ctx context.Context, resourceGroupName string, labName string, userName string, name string, serviceFabric ServiceFabricFragment, options *ServiceFabricsClientUpdateOptions) (ServiceFabricsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, userName, name, serviceFabric, options) @@ -622,7 +623,7 @@ func (client *ServiceFabricsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, serviceFabric) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_servicefabricschedules_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/servicefabricschedules_client.go similarity index 97% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_servicefabricschedules_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/servicefabricschedules_client.go index ea5a66f58d42..422befa2899f 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_servicefabricschedules_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/servicefabricschedules_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -57,7 +58,7 @@ func NewServiceFabricSchedulesClient(subscriptionID string, credential azcore.To // CreateOrUpdate - Create or replace an existing schedule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -113,7 +114,7 @@ func (client *ServiceFabricSchedulesClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, schedule) @@ -130,7 +131,7 @@ func (client *ServiceFabricSchedulesClient) createOrUpdateHandleResponse(resp *h // Delete - Delete schedule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -185,7 +186,7 @@ func (client *ServiceFabricSchedulesClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +194,7 @@ func (client *ServiceFabricSchedulesClient) deleteCreateRequest(ctx context.Cont // BeginExecute - Execute a schedule. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -215,7 +216,7 @@ func (client *ServiceFabricSchedulesClient) BeginExecute(ctx context.Context, re // Execute - Execute a schedule. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *ServiceFabricSchedulesClient) execute(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string, options *ServiceFabricSchedulesClientBeginExecuteOptions) (*http.Response, error) { req, err := client.executeCreateRequest(ctx, resourceGroupName, labName, userName, serviceFabricName, name, options) if err != nil { @@ -263,7 +264,7 @@ func (client *ServiceFabricSchedulesClient) executeCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +272,7 @@ func (client *ServiceFabricSchedulesClient) executeCreateRequest(ctx context.Con // Get - Get schedule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -329,7 +330,7 @@ func (client *ServiceFabricSchedulesClient) getCreateRequest(ctx context.Context if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -346,7 +347,7 @@ func (client *ServiceFabricSchedulesClient) getHandleResponse(resp *http.Respons // NewListPager - List schedules in a given service fabric. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. @@ -421,7 +422,7 @@ func (client *ServiceFabricSchedulesClient) listCreateRequest(ctx context.Contex if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -438,13 +439,13 @@ func (client *ServiceFabricSchedulesClient) listHandleResponse(resp *http.Respon // Update - Allows modifying tags of schedules. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // userName - The name of the user profile. // serviceFabricName - The name of the service fabric. // name - The name of the schedule. -// schedule - A schedule. +// schedule - Allows modifying tags of schedules. All other properties will be ignored. // options - ServiceFabricSchedulesClientUpdateOptions contains the optional parameters for the ServiceFabricSchedulesClient.Update // method. func (client *ServiceFabricSchedulesClient) Update(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string, schedule ScheduleFragment, options *ServiceFabricSchedulesClientUpdateOptions) (ServiceFabricSchedulesClientUpdateResponse, error) { @@ -494,7 +495,7 @@ func (client *ServiceFabricSchedulesClient) updateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, schedule) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_servicerunners_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/servicerunners_client.go similarity index 56% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_servicerunners_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/servicerunners_client.go index f558b716e79e..8a0056aefcc5 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_servicerunners_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/servicerunners_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -19,6 +20,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -54,32 +56,47 @@ func NewServiceRunnersClient(subscriptionID string, credential azcore.TokenCrede return client, nil } -// CreateOrUpdate - Create or replace an existing service runner. +// BeginCreateOrUpdate - Create or replace an existing Service runner. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the service runner. // serviceRunner - A container for a managed identity to execute DevTest lab services. -// options - ServiceRunnersClientCreateOrUpdateOptions contains the optional parameters for the ServiceRunnersClient.CreateOrUpdate +// options - ServiceRunnersClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceRunnersClient.BeginCreateOrUpdate // method. -func (client *ServiceRunnersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, serviceRunner ServiceRunner, options *ServiceRunnersClientCreateOrUpdateOptions) (ServiceRunnersClientCreateOrUpdateResponse, error) { +func (client *ServiceRunnersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, serviceRunner ServiceRunner, options *ServiceRunnersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServiceRunnersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, labName, name, serviceRunner, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ServiceRunnersClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ServiceRunnersClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create or replace an existing Service runner. This operation can take a while to complete. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +func (client *ServiceRunnersClient) createOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, serviceRunner ServiceRunner, options *ServiceRunnersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, labName, name, serviceRunner, options) if err != nil { - return ServiceRunnersClientCreateOrUpdateResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return ServiceRunnersClientCreateOrUpdateResponse{}, err + return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ServiceRunnersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + return nil, runtime.NewResponseError(resp) } - return client.createOrUpdateHandleResponse(resp) + return resp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServiceRunnersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, labName string, name string, serviceRunner ServiceRunner, options *ServiceRunnersClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ServiceRunnersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, labName string, name string, serviceRunner ServiceRunner, options *ServiceRunnersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/servicerunners/{name}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -102,45 +119,52 @@ func (client *ServiceRunnersClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, serviceRunner) } -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *ServiceRunnersClient) createOrUpdateHandleResponse(resp *http.Response) (ServiceRunnersClientCreateOrUpdateResponse, error) { - result := ServiceRunnersClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceRunner); err != nil { - return ServiceRunnersClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete service runner. +// BeginDelete - Delete service runner. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the service runner. -// options - ServiceRunnersClientDeleteOptions contains the optional parameters for the ServiceRunnersClient.Delete method. -func (client *ServiceRunnersClient) Delete(ctx context.Context, resourceGroupName string, labName string, name string, options *ServiceRunnersClientDeleteOptions) (ServiceRunnersClientDeleteResponse, error) { +// options - ServiceRunnersClientBeginDeleteOptions contains the optional parameters for the ServiceRunnersClient.BeginDelete +// method. +func (client *ServiceRunnersClient) BeginDelete(ctx context.Context, resourceGroupName string, labName string, name string, options *ServiceRunnersClientBeginDeleteOptions) (*runtime.Poller[ServiceRunnersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, labName, name, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ServiceRunnersClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ServiceRunnersClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete service runner. This operation can take a while to complete. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +func (client *ServiceRunnersClient) deleteOperation(ctx context.Context, resourceGroupName string, labName string, name string, options *ServiceRunnersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, labName, name, options) if err != nil { - return ServiceRunnersClientDeleteResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return ServiceRunnersClientDeleteResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ServiceRunnersClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) } - return ServiceRunnersClientDeleteResponse{}, nil + return resp, nil } // deleteCreateRequest creates the Delete request. -func (client *ServiceRunnersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, labName string, name string, options *ServiceRunnersClientDeleteOptions) (*policy.Request, error) { +func (client *ServiceRunnersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, labName string, name string, options *ServiceRunnersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/servicerunners/{name}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -163,7 +187,7 @@ func (client *ServiceRunnersClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +195,7 @@ func (client *ServiceRunnersClient) deleteCreateRequest(ctx context.Context, res // Get - Get service runner. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the service runner. @@ -215,7 +239,7 @@ func (client *ServiceRunnersClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -229,3 +253,81 @@ func (client *ServiceRunnersClient) getHandleResponse(resp *http.Response) (Serv } return result, nil } + +// NewListPager - List service runners in a given lab. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// options - ServiceRunnersClientListOptions contains the optional parameters for the ServiceRunnersClient.List method. +func (client *ServiceRunnersClient) NewListPager(resourceGroupName string, labName string, options *ServiceRunnersClientListOptions) *runtime.Pager[ServiceRunnersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ServiceRunnersClientListResponse]{ + More: func(page ServiceRunnersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ServiceRunnersClientListResponse) (ServiceRunnersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, labName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ServiceRunnersClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ServiceRunnersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServiceRunnersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ServiceRunnersClient) listCreateRequest(ctx context.Context, resourceGroupName string, labName string, options *ServiceRunnersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/servicerunners" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Orderby != nil { + reqQP.Set("$orderby", *options.Orderby) + } + reqQP.Set("api-version", "2021-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 *ServiceRunnersClient) listHandleResponse(resp *http.Response) (ServiceRunnersClientListResponse, error) { + result := ServiceRunnersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceRunnerList); err != nil { + return ServiceRunnersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/sharedgalleries_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/sharedgalleries_client.go new file mode 100644 index 000000000000..baebd429f234 --- /dev/null +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/sharedgalleries_client.go @@ -0,0 +1,379 @@ +//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 armdevtestlabs + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// SharedGalleriesClient contains the methods for the SharedGalleries group. +// Don't use this type directly, use NewSharedGalleriesClient() instead. +type SharedGalleriesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewSharedGalleriesClient creates a new instance of SharedGalleriesClient with the specified values. +// subscriptionID - The subscription ID. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewSharedGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleriesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &SharedGalleriesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Create or replace an existing Shared Gallery. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// name - The name of the shared gallery. +// sharedGallery - Properties of a shared gallery +// options - SharedGalleriesClientCreateOrUpdateOptions contains the optional parameters for the SharedGalleriesClient.CreateOrUpdate +// method. +func (client *SharedGalleriesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, sharedGallery SharedGallery, options *SharedGalleriesClientCreateOrUpdateOptions) (SharedGalleriesClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, labName, name, sharedGallery, options) + if err != nil { + return SharedGalleriesClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SharedGalleriesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return SharedGalleriesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SharedGalleriesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, labName string, name string, sharedGallery SharedGallery, options *SharedGalleriesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, sharedGallery) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *SharedGalleriesClient) createOrUpdateHandleResponse(resp *http.Response) (SharedGalleriesClientCreateOrUpdateResponse, error) { + result := SharedGalleriesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SharedGallery); err != nil { + return SharedGalleriesClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete shared gallery. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// name - The name of the shared gallery. +// options - SharedGalleriesClientDeleteOptions contains the optional parameters for the SharedGalleriesClient.Delete method. +func (client *SharedGalleriesClient) Delete(ctx context.Context, resourceGroupName string, labName string, name string, options *SharedGalleriesClientDeleteOptions) (SharedGalleriesClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, labName, name, options) + if err != nil { + return SharedGalleriesClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SharedGalleriesClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return SharedGalleriesClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return SharedGalleriesClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SharedGalleriesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, labName string, name string, options *SharedGalleriesClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get shared gallery. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// name - The name of the shared gallery. +// options - SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method. +func (client *SharedGalleriesClient) Get(ctx context.Context, resourceGroupName string, labName string, name string, options *SharedGalleriesClientGetOptions) (SharedGalleriesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, labName, name, options) + if err != nil { + return SharedGalleriesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SharedGalleriesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SharedGalleriesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SharedGalleriesClient) getCreateRequest(ctx context.Context, resourceGroupName string, labName string, name string, options *SharedGalleriesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + reqQP.Set("api-version", "2021-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 *SharedGalleriesClient) getHandleResponse(resp *http.Response) (SharedGalleriesClientGetResponse, error) { + result := SharedGalleriesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SharedGallery); err != nil { + return SharedGalleriesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List shared galleries in a given lab. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// options - SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.List method. +func (client *SharedGalleriesClient) NewListPager(resourceGroupName string, labName string, options *SharedGalleriesClientListOptions) *runtime.Pager[SharedGalleriesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SharedGalleriesClientListResponse]{ + More: func(page SharedGalleriesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SharedGalleriesClientListResponse) (SharedGalleriesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, labName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SharedGalleriesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SharedGalleriesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SharedGalleriesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *SharedGalleriesClient) listCreateRequest(ctx context.Context, resourceGroupName string, labName string, options *SharedGalleriesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Orderby != nil { + reqQP.Set("$orderby", *options.Orderby) + } + reqQP.Set("api-version", "2021-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 *SharedGalleriesClient) listHandleResponse(resp *http.Response) (SharedGalleriesClientListResponse, error) { + result := SharedGalleriesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryList); err != nil { + return SharedGalleriesClientListResponse{}, err + } + return result, nil +} + +// Update - Allows modifying tags of shared galleries. All other properties will be ignored. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// name - The name of the shared gallery. +// sharedGallery - Allows modifying tags of shared galleries. All other properties will be ignored. +// options - SharedGalleriesClientUpdateOptions contains the optional parameters for the SharedGalleriesClient.Update method. +func (client *SharedGalleriesClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, sharedGallery SharedGalleryFragment, options *SharedGalleriesClientUpdateOptions) (SharedGalleriesClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, name, sharedGallery, options) + if err != nil { + return SharedGalleriesClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SharedGalleriesClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SharedGalleriesClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *SharedGalleriesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, labName string, name string, sharedGallery SharedGalleryFragment, options *SharedGalleriesClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, sharedGallery) +} + +// updateHandleResponse handles the Update response. +func (client *SharedGalleriesClient) updateHandleResponse(resp *http.Response) (SharedGalleriesClientUpdateResponse, error) { + result := SharedGalleriesClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SharedGallery); err != nil { + return SharedGalleriesClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/sharedimages_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/sharedimages_client.go new file mode 100644 index 000000000000..f1343d72304d --- /dev/null +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/sharedimages_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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armdevtestlabs + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// SharedImagesClient contains the methods for the SharedImages group. +// Don't use this type directly, use NewSharedImagesClient() instead. +type SharedImagesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewSharedImagesClient creates a new instance of SharedImagesClient with the specified values. +// subscriptionID - The subscription ID. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewSharedImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedImagesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &SharedImagesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Create or replace an existing Shared Image. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// sharedGalleryName - The name of the shared gallery. +// name - The name of the shared image. +// sharedImage - Properties of a shared image +// options - SharedImagesClientCreateOrUpdateOptions contains the optional parameters for the SharedImagesClient.CreateOrUpdate +// method. +func (client *SharedImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, sharedGalleryName string, name string, sharedImage SharedImage, options *SharedImagesClientCreateOrUpdateOptions) (SharedImagesClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, labName, sharedGalleryName, name, sharedImage, options) + if err != nil { + return SharedImagesClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SharedImagesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return SharedImagesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SharedImagesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, labName string, sharedGalleryName string, name string, sharedImage SharedImage, options *SharedImagesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{sharedGalleryName}/sharedimages/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if sharedGalleryName == "" { + return nil, errors.New("parameter sharedGalleryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sharedGalleryName}", url.PathEscape(sharedGalleryName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, sharedImage) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *SharedImagesClient) createOrUpdateHandleResponse(resp *http.Response) (SharedImagesClientCreateOrUpdateResponse, error) { + result := SharedImagesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SharedImage); err != nil { + return SharedImagesClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete shared image. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// sharedGalleryName - The name of the shared gallery. +// name - The name of the shared image. +// options - SharedImagesClientDeleteOptions contains the optional parameters for the SharedImagesClient.Delete method. +func (client *SharedImagesClient) Delete(ctx context.Context, resourceGroupName string, labName string, sharedGalleryName string, name string, options *SharedImagesClientDeleteOptions) (SharedImagesClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, labName, sharedGalleryName, name, options) + if err != nil { + return SharedImagesClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SharedImagesClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return SharedImagesClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return SharedImagesClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SharedImagesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, labName string, sharedGalleryName string, name string, options *SharedImagesClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{sharedGalleryName}/sharedimages/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if sharedGalleryName == "" { + return nil, errors.New("parameter sharedGalleryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sharedGalleryName}", url.PathEscape(sharedGalleryName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get shared image. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// sharedGalleryName - The name of the shared gallery. +// name - The name of the shared image. +// options - SharedImagesClientGetOptions contains the optional parameters for the SharedImagesClient.Get method. +func (client *SharedImagesClient) Get(ctx context.Context, resourceGroupName string, labName string, sharedGalleryName string, name string, options *SharedImagesClientGetOptions) (SharedImagesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, labName, sharedGalleryName, name, options) + if err != nil { + return SharedImagesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SharedImagesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SharedImagesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SharedImagesClient) getCreateRequest(ctx context.Context, resourceGroupName string, labName string, sharedGalleryName string, name string, options *SharedImagesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{sharedGalleryName}/sharedimages/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if sharedGalleryName == "" { + return nil, errors.New("parameter sharedGalleryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sharedGalleryName}", url.PathEscape(sharedGalleryName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + reqQP.Set("api-version", "2021-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 *SharedImagesClient) getHandleResponse(resp *http.Response) (SharedImagesClientGetResponse, error) { + result := SharedImagesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SharedImage); err != nil { + return SharedImagesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List shared images in a given shared gallery. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// sharedGalleryName - The name of the shared gallery. +// options - SharedImagesClientListOptions contains the optional parameters for the SharedImagesClient.List method. +func (client *SharedImagesClient) NewListPager(resourceGroupName string, labName string, sharedGalleryName string, options *SharedImagesClientListOptions) *runtime.Pager[SharedImagesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SharedImagesClientListResponse]{ + More: func(page SharedImagesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SharedImagesClientListResponse) (SharedImagesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, labName, sharedGalleryName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SharedImagesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SharedImagesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SharedImagesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *SharedImagesClient) listCreateRequest(ctx context.Context, resourceGroupName string, labName string, sharedGalleryName string, options *SharedImagesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{sharedGalleryName}/sharedimages" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if sharedGalleryName == "" { + return nil, errors.New("parameter sharedGalleryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sharedGalleryName}", url.PathEscape(sharedGalleryName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Orderby != nil { + reqQP.Set("$orderby", *options.Orderby) + } + reqQP.Set("api-version", "2021-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 *SharedImagesClient) listHandleResponse(resp *http.Response) (SharedImagesClientListResponse, error) { + result := SharedImagesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SharedImageList); err != nil { + return SharedImagesClientListResponse{}, err + } + return result, nil +} + +// Update - Allows modifying tags of shared images. All other properties will be ignored. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// sharedGalleryName - The name of the shared gallery. +// name - The name of the shared image. +// sharedImage - Allows modifying tags of shared images. All other properties will be ignored. +// options - SharedImagesClientUpdateOptions contains the optional parameters for the SharedImagesClient.Update method. +func (client *SharedImagesClient) Update(ctx context.Context, resourceGroupName string, labName string, sharedGalleryName string, name string, sharedImage SharedImageFragment, options *SharedImagesClientUpdateOptions) (SharedImagesClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, sharedGalleryName, name, sharedImage, options) + if err != nil { + return SharedImagesClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SharedImagesClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SharedImagesClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *SharedImagesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, labName string, sharedGalleryName string, name string, sharedImage SharedImageFragment, options *SharedImagesClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{sharedGalleryName}/sharedimages/{name}" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if sharedGalleryName == "" { + return nil, errors.New("parameter sharedGalleryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sharedGalleryName}", url.PathEscape(sharedGalleryName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, sharedImage) +} + +// updateHandleResponse handles the Update response. +func (client *SharedImagesClient) updateHandleResponse(resp *http.Response) (SharedImagesClientUpdateResponse, error) { + result := SharedImagesClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SharedImage); err != nil { + return SharedImagesClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_time_rfc3339.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/time_rfc3339.go index 6547f953cdc8..a4da2ceb4bf4 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/time_rfc3339.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_users_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/users_client.go similarity index 96% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_users_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/users_client.go index 50d22c429a2d..d05056c16523 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_users_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/users_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -57,7 +58,7 @@ func NewUsersClient(subscriptionID string, credential azcore.TokenCredential, op // BeginCreateOrUpdate - Create or replace an existing user profile. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the user profile. @@ -78,7 +79,7 @@ func (client *UsersClient) BeginCreateOrUpdate(ctx context.Context, resourceGrou // CreateOrUpdate - Create or replace an existing user profile. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *UsersClient) createOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, userParam User, options *UsersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, labName, name, userParam, options) if err != nil { @@ -118,7 +119,7 @@ func (client *UsersClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, userParam) @@ -126,7 +127,7 @@ func (client *UsersClient) createOrUpdateCreateRequest(ctx context.Context, reso // BeginDelete - Delete user profile. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the user profile. @@ -145,7 +146,7 @@ func (client *UsersClient) BeginDelete(ctx context.Context, resourceGroupName st // Delete - Delete user profile. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *UsersClient) deleteOperation(ctx context.Context, resourceGroupName string, labName string, name string, options *UsersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, labName, name, options) if err != nil { @@ -185,7 +186,7 @@ func (client *UsersClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +194,7 @@ func (client *UsersClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Get user profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the user profile. @@ -240,7 +241,7 @@ func (client *UsersClient) getCreateRequest(ctx context.Context, resourceGroupNa if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +258,7 @@ func (client *UsersClient) getHandleResponse(resp *http.Response) (UsersClientGe // NewListPager - List user profiles in a given lab. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // options - UsersClientListOptions contains the optional parameters for the UsersClient.List method. @@ -321,7 +322,7 @@ func (client *UsersClient) listCreateRequest(ctx context.Context, resourceGroupN if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -338,11 +339,11 @@ func (client *UsersClient) listHandleResponse(resp *http.Response) (UsersClientL // Update - Allows modifying tags of user profiles. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the user profile. -// userParam - Profile of a lab user. +// userParam - Allows modifying tags of user profiles. All other properties will be ignored. // options - UsersClientUpdateOptions contains the optional parameters for the UsersClient.Update method. func (client *UsersClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, userParam UserFragment, options *UsersClientUpdateOptions) (UsersClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, name, userParam, options) @@ -383,7 +384,7 @@ func (client *UsersClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, userParam) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_virtualmachines_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/virtualmachines_client.go similarity index 92% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_virtualmachines_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/virtualmachines_client.go index 3b34316a9389..b6a701c97ab2 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_virtualmachines_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/virtualmachines_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -57,7 +58,7 @@ func NewVirtualMachinesClient(subscriptionID string, credential azcore.TokenCred // BeginAddDataDisk - Attach a new or existing data disk to virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -78,7 +79,7 @@ func (client *VirtualMachinesClient) BeginAddDataDisk(ctx context.Context, resou // AddDataDisk - Attach a new or existing data disk to virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualMachinesClient) addDataDisk(ctx context.Context, resourceGroupName string, labName string, name string, dataDiskProperties DataDiskProperties, options *VirtualMachinesClientBeginAddDataDiskOptions) (*http.Response, error) { req, err := client.addDataDiskCreateRequest(ctx, resourceGroupName, labName, name, dataDiskProperties, options) if err != nil { @@ -118,7 +119,7 @@ func (client *VirtualMachinesClient) addDataDiskCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, dataDiskProperties) @@ -126,7 +127,7 @@ func (client *VirtualMachinesClient) addDataDiskCreateRequest(ctx context.Contex // BeginApplyArtifacts - Apply artifacts to virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -147,7 +148,7 @@ func (client *VirtualMachinesClient) BeginApplyArtifacts(ctx context.Context, re // ApplyArtifacts - Apply artifacts to virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualMachinesClient) applyArtifacts(ctx context.Context, resourceGroupName string, labName string, name string, applyArtifactsRequest ApplyArtifactsRequest, options *VirtualMachinesClientBeginApplyArtifactsOptions) (*http.Response, error) { req, err := client.applyArtifactsCreateRequest(ctx, resourceGroupName, labName, name, applyArtifactsRequest, options) if err != nil { @@ -187,7 +188,7 @@ func (client *VirtualMachinesClient) applyArtifactsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, applyArtifactsRequest) @@ -195,7 +196,7 @@ func (client *VirtualMachinesClient) applyArtifactsCreateRequest(ctx context.Con // BeginClaim - Take ownership of an existing virtual machine This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -215,7 +216,7 @@ func (client *VirtualMachinesClient) BeginClaim(ctx context.Context, resourceGro // Claim - Take ownership of an existing virtual machine This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualMachinesClient) claim(ctx context.Context, resourceGroupName string, labName string, name string, options *VirtualMachinesClientBeginClaimOptions) (*http.Response, error) { req, err := client.claimCreateRequest(ctx, resourceGroupName, labName, name, options) if err != nil { @@ -255,15 +256,68 @@ func (client *VirtualMachinesClient) claimCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginCreateOrUpdate - Create or replace an existing virtual machine. This operation can take a while to complete. +// ClearArtifactResults - Clears the artifact results of the virtual machine. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 +// resourceGroupName - The name of the resource group. +// labName - The name of the lab. +// name - The name of the virtual machine. +// options - VirtualMachinesClientClearArtifactResultsOptions contains the optional parameters for the VirtualMachinesClient.ClearArtifactResults +// method. +func (client *VirtualMachinesClient) ClearArtifactResults(ctx context.Context, resourceGroupName string, labName string, name string, options *VirtualMachinesClientClearArtifactResultsOptions) (VirtualMachinesClientClearArtifactResultsResponse, error) { + req, err := client.clearArtifactResultsCreateRequest(ctx, resourceGroupName, labName, name, options) + if err != nil { + return VirtualMachinesClientClearArtifactResultsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VirtualMachinesClientClearArtifactResultsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualMachinesClientClearArtifactResultsResponse{}, runtime.NewResponseError(resp) + } + return VirtualMachinesClientClearArtifactResultsResponse{}, nil +} + +// clearArtifactResultsCreateRequest creates the ClearArtifactResults request. +func (client *VirtualMachinesClient) clearArtifactResultsCreateRequest(ctx context.Context, resourceGroupName string, labName string, name string, options *VirtualMachinesClientClearArtifactResultsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/clearArtifactResults" + 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 labName == "" { + return nil, errors.New("parameter labName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginCreateOrUpdate - Create or replace an existing Virtual machine. This operation can take a while to complete. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -282,9 +336,9 @@ func (client *VirtualMachinesClient) BeginCreateOrUpdate(ctx context.Context, re } } -// CreateOrUpdate - Create or replace an existing virtual machine. This operation can take a while to complete. +// CreateOrUpdate - Create or replace an existing Virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualMachinesClient) createOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, labVirtualMachine LabVirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, labName, name, labVirtualMachine, options) if err != nil { @@ -324,7 +378,7 @@ func (client *VirtualMachinesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, labVirtualMachine) @@ -332,7 +386,7 @@ func (client *VirtualMachinesClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Delete virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -352,7 +406,7 @@ func (client *VirtualMachinesClient) BeginDelete(ctx context.Context, resourceGr // Delete - Delete virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualMachinesClient) deleteOperation(ctx context.Context, resourceGroupName string, labName string, name string, options *VirtualMachinesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, labName, name, options) if err != nil { @@ -392,7 +446,7 @@ func (client *VirtualMachinesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -400,7 +454,7 @@ func (client *VirtualMachinesClient) deleteCreateRequest(ctx context.Context, re // BeginDetachDataDisk - Detach the specified disk from the virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -421,7 +475,7 @@ func (client *VirtualMachinesClient) BeginDetachDataDisk(ctx context.Context, re // DetachDataDisk - Detach the specified disk from the virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualMachinesClient) detachDataDisk(ctx context.Context, resourceGroupName string, labName string, name string, detachDataDiskProperties DetachDataDiskProperties, options *VirtualMachinesClientBeginDetachDataDiskOptions) (*http.Response, error) { req, err := client.detachDataDiskCreateRequest(ctx, resourceGroupName, labName, name, detachDataDiskProperties, options) if err != nil { @@ -461,7 +515,7 @@ func (client *VirtualMachinesClient) detachDataDiskCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, detachDataDiskProperties) @@ -469,7 +523,7 @@ func (client *VirtualMachinesClient) detachDataDiskCreateRequest(ctx context.Con // Get - Get virtual machine. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -516,7 +570,7 @@ func (client *VirtualMachinesClient) getCreateRequest(ctx context.Context, resou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -533,7 +587,7 @@ func (client *VirtualMachinesClient) getHandleResponse(resp *http.Response) (Vir // GetRdpFileContents - Gets a string that represents the contents of the RDP file for the virtual machine // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -578,7 +632,7 @@ func (client *VirtualMachinesClient) getRdpFileContentsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -595,7 +649,7 @@ func (client *VirtualMachinesClient) getRdpFileContentsHandleResponse(resp *http // NewListPager - List virtual machines in a given lab. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // options - VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.List method. @@ -659,7 +713,7 @@ func (client *VirtualMachinesClient) listCreateRequest(ctx context.Context, reso if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -676,7 +730,7 @@ func (client *VirtualMachinesClient) listHandleResponse(resp *http.Response) (Vi // ListApplicableSchedules - Lists the applicable start/stop schedules, if any. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -721,7 +775,7 @@ func (client *VirtualMachinesClient) listApplicableSchedulesCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -738,7 +792,7 @@ func (client *VirtualMachinesClient) listApplicableSchedulesHandleResponse(resp // BeginRedeploy - Redeploy a virtual machine This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -758,7 +812,7 @@ func (client *VirtualMachinesClient) BeginRedeploy(ctx context.Context, resource // Redeploy - Redeploy a virtual machine This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualMachinesClient) redeploy(ctx context.Context, resourceGroupName string, labName string, name string, options *VirtualMachinesClientBeginRedeployOptions) (*http.Response, error) { req, err := client.redeployCreateRequest(ctx, resourceGroupName, labName, name, options) if err != nil { @@ -798,7 +852,7 @@ func (client *VirtualMachinesClient) redeployCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -806,7 +860,7 @@ func (client *VirtualMachinesClient) redeployCreateRequest(ctx context.Context, // BeginResize - Resize Virtual Machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -827,7 +881,7 @@ func (client *VirtualMachinesClient) BeginResize(ctx context.Context, resourceGr // Resize - Resize Virtual Machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualMachinesClient) resize(ctx context.Context, resourceGroupName string, labName string, name string, resizeLabVirtualMachineProperties ResizeLabVirtualMachineProperties, options *VirtualMachinesClientBeginResizeOptions) (*http.Response, error) { req, err := client.resizeCreateRequest(ctx, resourceGroupName, labName, name, resizeLabVirtualMachineProperties, options) if err != nil { @@ -867,7 +921,7 @@ func (client *VirtualMachinesClient) resizeCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resizeLabVirtualMachineProperties) @@ -875,7 +929,7 @@ func (client *VirtualMachinesClient) resizeCreateRequest(ctx context.Context, re // BeginRestart - Restart a virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -895,7 +949,7 @@ func (client *VirtualMachinesClient) BeginRestart(ctx context.Context, resourceG // Restart - Restart a virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualMachinesClient) restart(ctx context.Context, resourceGroupName string, labName string, name string, options *VirtualMachinesClientBeginRestartOptions) (*http.Response, error) { req, err := client.restartCreateRequest(ctx, resourceGroupName, labName, name, options) if err != nil { @@ -935,7 +989,7 @@ func (client *VirtualMachinesClient) restartCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -943,7 +997,7 @@ func (client *VirtualMachinesClient) restartCreateRequest(ctx context.Context, r // BeginStart - Start a virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -963,7 +1017,7 @@ func (client *VirtualMachinesClient) BeginStart(ctx context.Context, resourceGro // Start - Start a virtual machine. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualMachinesClient) start(ctx context.Context, resourceGroupName string, labName string, name string, options *VirtualMachinesClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, labName, name, options) if err != nil { @@ -1003,7 +1057,7 @@ func (client *VirtualMachinesClient) startCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1011,7 +1065,7 @@ func (client *VirtualMachinesClient) startCreateRequest(ctx context.Context, res // BeginStop - Stop a virtual machine This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -1031,7 +1085,7 @@ func (client *VirtualMachinesClient) BeginStop(ctx context.Context, resourceGrou // Stop - Stop a virtual machine This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualMachinesClient) stop(ctx context.Context, resourceGroupName string, labName string, name string, options *VirtualMachinesClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, labName, name, options) if err != nil { @@ -1071,7 +1125,7 @@ func (client *VirtualMachinesClient) stopCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1080,7 +1134,7 @@ func (client *VirtualMachinesClient) stopCreateRequest(ctx context.Context, reso // BeginTransferDisks - Transfers all data disks attached to the virtual machine to be owned by the current user. This operation // can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -1101,7 +1155,7 @@ func (client *VirtualMachinesClient) BeginTransferDisks(ctx context.Context, res // TransferDisks - Transfers all data disks attached to the virtual machine to be owned by the current user. This operation // can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualMachinesClient) transferDisks(ctx context.Context, resourceGroupName string, labName string, name string, options *VirtualMachinesClientBeginTransferDisksOptions) (*http.Response, error) { req, err := client.transferDisksCreateRequest(ctx, resourceGroupName, labName, name, options) if err != nil { @@ -1141,7 +1195,7 @@ func (client *VirtualMachinesClient) transferDisksCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1149,7 +1203,7 @@ func (client *VirtualMachinesClient) transferDisksCreateRequest(ctx context.Cont // BeginUnClaim - Release ownership of an existing virtual machine This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. @@ -1169,7 +1223,7 @@ func (client *VirtualMachinesClient) BeginUnClaim(ctx context.Context, resourceG // UnClaim - Release ownership of an existing virtual machine This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualMachinesClient) unClaim(ctx context.Context, resourceGroupName string, labName string, name string, options *VirtualMachinesClientBeginUnClaimOptions) (*http.Response, error) { req, err := client.unClaimCreateRequest(ctx, resourceGroupName, labName, name, options) if err != nil { @@ -1209,7 +1263,7 @@ func (client *VirtualMachinesClient) unClaimCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1217,11 +1271,11 @@ func (client *VirtualMachinesClient) unClaimCreateRequest(ctx context.Context, r // Update - Allows modifying tags of virtual machines. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual machine. -// labVirtualMachine - A virtual machine. +// labVirtualMachine - Allows modifying tags of virtual machines. All other properties will be ignored. // options - VirtualMachinesClientUpdateOptions contains the optional parameters for the VirtualMachinesClient.Update method. func (client *VirtualMachinesClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, labVirtualMachine LabVirtualMachineFragment, options *VirtualMachinesClientUpdateOptions) (VirtualMachinesClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, name, labVirtualMachine, options) @@ -1262,7 +1316,7 @@ func (client *VirtualMachinesClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, labVirtualMachine) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_virtualmachineschedules_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/virtualmachineschedules_client.go similarity index 97% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_virtualmachineschedules_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/virtualmachineschedules_client.go index 3c0dd744de39..e60230911757 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_virtualmachineschedules_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/virtualmachineschedules_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -57,7 +58,7 @@ func NewVirtualMachineSchedulesClient(subscriptionID string, credential azcore.T // CreateOrUpdate - Create or replace an existing schedule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // virtualMachineName - The name of the virtual machine. @@ -108,7 +109,7 @@ func (client *VirtualMachineSchedulesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, schedule) @@ -125,7 +126,7 @@ func (client *VirtualMachineSchedulesClient) createOrUpdateHandleResponse(resp * // Delete - Delete schedule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // virtualMachineName - The name of the virtual machine. @@ -175,7 +176,7 @@ func (client *VirtualMachineSchedulesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,7 +184,7 @@ func (client *VirtualMachineSchedulesClient) deleteCreateRequest(ctx context.Con // BeginExecute - Execute a schedule. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // virtualMachineName - The name of the virtual machine. @@ -204,7 +205,7 @@ func (client *VirtualMachineSchedulesClient) BeginExecute(ctx context.Context, r // Execute - Execute a schedule. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualMachineSchedulesClient) execute(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, name string, options *VirtualMachineSchedulesClientBeginExecuteOptions) (*http.Response, error) { req, err := client.executeCreateRequest(ctx, resourceGroupName, labName, virtualMachineName, name, options) if err != nil { @@ -248,7 +249,7 @@ func (client *VirtualMachineSchedulesClient) executeCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,7 +257,7 @@ func (client *VirtualMachineSchedulesClient) executeCreateRequest(ctx context.Co // Get - Get schedule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // virtualMachineName - The name of the virtual machine. @@ -309,7 +310,7 @@ func (client *VirtualMachineSchedulesClient) getCreateRequest(ctx context.Contex if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,7 +327,7 @@ func (client *VirtualMachineSchedulesClient) getHandleResponse(resp *http.Respon // NewListPager - List schedules in a given virtual machine. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // virtualMachineName - The name of the virtual machine. @@ -396,7 +397,7 @@ func (client *VirtualMachineSchedulesClient) listCreateRequest(ctx context.Conte if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -413,12 +414,12 @@ func (client *VirtualMachineSchedulesClient) listHandleResponse(resp *http.Respo // Update - Allows modifying tags of schedules. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // virtualMachineName - The name of the virtual machine. // name - The name of the schedule. -// schedule - A schedule. +// schedule - Allows modifying tags of schedules. All other properties will be ignored. // options - VirtualMachineSchedulesClientUpdateOptions contains the optional parameters for the VirtualMachineSchedulesClient.Update // method. func (client *VirtualMachineSchedulesClient) Update(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, name string, schedule ScheduleFragment, options *VirtualMachineSchedulesClientUpdateOptions) (VirtualMachineSchedulesClientUpdateResponse, error) { @@ -464,7 +465,7 @@ func (client *VirtualMachineSchedulesClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, schedule) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_virtualnetworks_client.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/virtualnetworks_client.go similarity index 96% rename from sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_virtualnetworks_client.go rename to sdk/resourcemanager/devtestlabs/armdevtestlabs/virtualnetworks_client.go index ec4b9f75337f..8e851db09a19 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_virtualnetworks_client.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/virtualnetworks_client.go @@ -5,6 +5,7 @@ // 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 armdevtestlabs @@ -57,7 +58,7 @@ func NewVirtualNetworksClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Create or replace an existing virtual network. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual network. @@ -78,7 +79,7 @@ func (client *VirtualNetworksClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Create or replace an existing virtual network. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualNetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, virtualNetwork VirtualNetwork, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, labName, name, virtualNetwork, options) if err != nil { @@ -118,7 +119,7 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, virtualNetwork) @@ -126,7 +127,7 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Delete virtual network. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual network. @@ -146,7 +147,7 @@ func (client *VirtualNetworksClient) BeginDelete(ctx context.Context, resourceGr // Delete - Delete virtual network. This operation can take a while to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 func (client *VirtualNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, labName string, name string, options *VirtualNetworksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, labName, name, options) if err != nil { @@ -186,7 +187,7 @@ func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,7 +195,7 @@ func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, re // Get - Get virtual network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual network. @@ -241,7 +242,7 @@ func (client *VirtualNetworksClient) getCreateRequest(ctx context.Context, resou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,7 +259,7 @@ func (client *VirtualNetworksClient) getHandleResponse(resp *http.Response) (Vir // NewListPager - List virtual networks in a given lab. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // options - VirtualNetworksClientListOptions contains the optional parameters for the VirtualNetworksClient.List method. @@ -322,7 +323,7 @@ func (client *VirtualNetworksClient) listCreateRequest(ctx context.Context, reso if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -339,11 +340,11 @@ func (client *VirtualNetworksClient) listHandleResponse(resp *http.Response) (Vi // Update - Allows modifying tags of virtual networks. All other properties will be ignored. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-09-15 +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. // labName - The name of the lab. // name - The name of the virtual network. -// virtualNetwork - A virtual network. +// virtualNetwork - Allows modifying tags of virtual networks. All other properties will be ignored. // options - VirtualNetworksClientUpdateOptions contains the optional parameters for the VirtualNetworksClient.Update method. func (client *VirtualNetworksClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, virtualNetwork VirtualNetworkFragment, options *VirtualNetworksClientUpdateOptions) (VirtualNetworksClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, labName, name, virtualNetwork, options) @@ -384,7 +385,7 @@ func (client *VirtualNetworksClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-09-15") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, virtualNetwork) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_armtemplates_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_armtemplates_client_test.go deleted file mode 100644 index 04ebd3195dde..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_armtemplates_client_test.go +++ /dev/null @@ -1,72 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_List.json -func ExampleArmTemplatesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewArmTemplatesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - "{artifactSourceName}", - &armdevtestlabs.ArmTemplatesClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_Get.json -func ExampleArmTemplatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewArmTemplatesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "{artifactSourceName}", - "{armTemplateName}", - &armdevtestlabs.ArmTemplatesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifacts_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifacts_client_test.go deleted file mode 100644 index 8cf62961ed5e..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifacts_client_test.go +++ /dev/null @@ -1,102 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_List.json -func ExampleArtifactsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewArtifactsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - "{artifactSourceName}", - &armdevtestlabs.ArtifactsClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_Get.json -func ExampleArtifactsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewArtifactsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "{artifactSourceName}", - "{artifactName}", - &armdevtestlabs.ArtifactsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_GenerateArmTemplate.json -func ExampleArtifactsClient_GenerateArmTemplate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewArtifactsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GenerateArmTemplate(ctx, - "resourceGroupName", - "{labName}", - "{artifactSourceName}", - "{artifactName}", - armdevtestlabs.GenerateArmTemplateRequest{ - FileUploadOptions: to.Ptr(armdevtestlabs.FileUploadOptionsNone), - Location: to.Ptr("{location}"), - VirtualMachineName: to.Ptr("{vmName}"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifactsources_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifactsources_client_test.go deleted file mode 100644 index ade05084d154..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifactsources_client_test.go +++ /dev/null @@ -1,158 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_List.json -func ExampleArtifactSourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewArtifactSourcesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - &armdevtestlabs.ArtifactSourcesClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Get.json -func ExampleArtifactSourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewArtifactSourcesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "{artifactSourceName}", - &armdevtestlabs.ArtifactSourcesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_CreateOrUpdate.json -func ExampleArtifactSourcesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewArtifactSourcesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - "{artifactSourceName}", - armdevtestlabs.ArtifactSource{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - Properties: &armdevtestlabs.ArtifactSourceProperties{ - ArmTemplateFolderPath: to.Ptr("{armTemplateFolderPath}"), - BranchRef: to.Ptr("{branchRef}"), - DisplayName: to.Ptr("{displayName}"), - FolderPath: to.Ptr("{folderPath}"), - SecurityToken: to.Ptr("{securityToken}"), - SourceType: to.Ptr(armdevtestlabs.SourceControlType("{VsoGit|GitHub|StorageAccount}")), - Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")), - URI: to.Ptr("{artifactSourceUri}"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Delete.json -func ExampleArtifactSourcesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewArtifactSourcesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "resourceGroupName", - "{labName}", - "{artifactSourceName}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Update.json -func ExampleArtifactSourcesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewArtifactSourcesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{labName}", - "{artifactSourceName}", - armdevtestlabs.ArtifactSourceFragment{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_costs_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_costs_client_test.go deleted file mode 100644 index 0cded3074844..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_costs_client_test.go +++ /dev/null @@ -1,121 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_test - -import ( - "context" - "log" - - "time" - - "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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_Get.json -func ExampleCostsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewCostsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "targetCost", - &armdevtestlabs.CostsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_CreateOrUpdate.json -func ExampleCostsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewCostsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - "targetCost", - armdevtestlabs.LabCost{ - Properties: &armdevtestlabs.LabCostProperties{ - CurrencyCode: to.Ptr("USD"), - EndDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T23:59:59Z"); return t }()), - StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00Z"); return t }()), - TargetCost: &armdevtestlabs.TargetCostProperties{ - CostThresholds: []*armdevtestlabs.CostThresholdProperties{ - { - DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), - PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{ - ThresholdValue: to.Ptr[float64](25), - }, - SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), - ThresholdID: to.Ptr("00000000-0000-0000-0000-000000000001"), - }, - { - DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusEnabled), - PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{ - ThresholdValue: to.Ptr[float64](50), - }, - SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusEnabled), - ThresholdID: to.Ptr("00000000-0000-0000-0000-000000000002"), - }, - { - DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), - PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{ - ThresholdValue: to.Ptr[float64](75), - }, - SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), - ThresholdID: to.Ptr("00000000-0000-0000-0000-000000000003"), - }, - { - DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), - PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{ - ThresholdValue: to.Ptr[float64](100), - }, - SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), - ThresholdID: to.Ptr("00000000-0000-0000-0000-000000000004"), - }, - { - DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), - PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{ - ThresholdValue: to.Ptr[float64](125), - }, - SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), - ThresholdID: to.Ptr("00000000-0000-0000-0000-000000000005"), - }}, - CycleEndDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T00:00:00.000Z"); return t }()), - CycleStartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00.000Z"); return t }()), - CycleType: to.Ptr(armdevtestlabs.ReportingCycleTypeCalendarMonth), - Status: to.Ptr(armdevtestlabs.TargetCostStatusEnabled), - Target: to.Ptr[int32](100), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_customimages_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_customimages_client_test.go deleted file mode 100644 index e4907bd9132a..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_customimages_client_test.go +++ /dev/null @@ -1,165 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_List.json -func ExampleCustomImagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewCustomImagesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - &armdevtestlabs.CustomImagesClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Get.json -func ExampleCustomImagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewCustomImagesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "{customImageName}", - &armdevtestlabs.CustomImagesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_CreateOrUpdate.json -func ExampleCustomImagesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewCustomImagesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - "{customImageName}", - armdevtestlabs.CustomImage{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - Properties: &armdevtestlabs.CustomImageProperties{ - Description: to.Ptr("My Custom Image"), - VM: &armdevtestlabs.CustomImagePropertiesFromVM{ - LinuxOsInfo: &armdevtestlabs.LinuxOsInfo{ - LinuxOsState: to.Ptr(armdevtestlabs.LinuxOsStateNonDeprovisioned), - }, - SourceVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Delete.json -func ExampleCustomImagesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewCustomImagesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "resourceGroupName", - "{labName}", - "{customImageName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Update.json -func ExampleCustomImagesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewCustomImagesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{labName}", - "{customImageName}", - armdevtestlabs.CustomImageFragment{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue2"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_disks_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_disks_client_test.go deleted file mode 100644 index 3380e67ba8e3..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_disks_client_test.go +++ /dev/null @@ -1,221 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_List.json -func ExampleDisksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewDisksClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - "@me", - &armdevtestlabs.DisksClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Get.json -func ExampleDisksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewDisksClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "@me", - "{diskName}", - &armdevtestlabs.DisksClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_CreateOrUpdate.json -func ExampleDisksClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewDisksClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - "{userId}", - "{diskName}", - armdevtestlabs.Disk{ - Properties: &armdevtestlabs.DiskProperties{ - DiskSizeGiB: to.Ptr[int32](1023), - DiskType: to.Ptr(armdevtestlabs.StorageTypeStandard), - LeasedByLabVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Delete.json -func ExampleDisksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewDisksClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "resourceGroupName", - "{labName}", - "{userId}", - "{diskName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Update.json -func ExampleDisksClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewDisksClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{labName}", - "@me", - "diskName", - armdevtestlabs.DiskFragment{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Attach.json -func ExampleDisksClient_BeginAttach() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewDisksClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginAttach(ctx, - "resourceGroupName", - "{labName}", - "{userId}", - "{diskName}", - armdevtestlabs.AttachDiskProperties{ - LeasedByLabVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"), - }, - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Detach.json -func ExampleDisksClient_BeginDetach() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewDisksClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDetach(ctx, - "resourceGroupName", - "{labName}", - "{userId}", - "{diskName}", - armdevtestlabs.DetachDiskProperties{ - LeasedByLabVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"), - }, - 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/devtestlabs/armdevtestlabs/ze_generated_example_environments_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_environments_client_test.go deleted file mode 100644 index b3296255d5d0..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_environments_client_test.go +++ /dev/null @@ -1,164 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_List.json -func ExampleEnvironmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewEnvironmentsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - "@me", - &armdevtestlabs.EnvironmentsClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Get.json -func ExampleEnvironmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewEnvironmentsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "@me", - "{environmentName}", - &armdevtestlabs.EnvironmentsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_CreateOrUpdate.json -func ExampleEnvironmentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewEnvironmentsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - "@me", - "{environmentName}", - armdevtestlabs.DtlEnvironment{ - Properties: &armdevtestlabs.EnvironmentProperties{ - DeploymentProperties: &armdevtestlabs.EnvironmentDeploymentProperties{ - ArmTemplateID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}"), - Parameters: []*armdevtestlabs.ArmTemplateParameterProperties{}, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Delete.json -func ExampleEnvironmentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewEnvironmentsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "resourceGroupName", - "{labName}", - "@me", - "{environmentName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Update.json -func ExampleEnvironmentsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewEnvironmentsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{labName}", - "@me", - "{environmentName}", - armdevtestlabs.DtlEnvironmentFragment{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_formulas_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_formulas_client_test.go deleted file mode 100644 index 11156b2386cb..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_formulas_client_test.go +++ /dev/null @@ -1,188 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_List.json -func ExampleFormulasClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewFormulasClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - &armdevtestlabs.FormulasClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Get.json -func ExampleFormulasClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewFormulasClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "{formulaName}", - &armdevtestlabs.FormulasClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_CreateOrUpdate.json -func ExampleFormulasClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewFormulasClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - "{formulaName}", - armdevtestlabs.Formula{ - Location: to.Ptr("{location}"), - Properties: &armdevtestlabs.FormulaProperties{ - Description: to.Ptr("Formula using a Linux base"), - FormulaContent: &armdevtestlabs.LabVirtualMachineCreationParameter{ - Location: to.Ptr("{location}"), - Properties: &armdevtestlabs.LabVirtualMachineCreationParameterProperties{ - AllowClaim: to.Ptr(false), - Artifacts: []*armdevtestlabs.ArtifactInstallProperties{ - { - ArtifactID: to.Ptr("/artifactsources/{artifactSourceName}/artifacts/linux-install-nodejs"), - Parameters: []*armdevtestlabs.ArtifactParameterProperties{}, - }}, - DisallowPublicIPAddress: to.Ptr(true), - GalleryImageReference: &armdevtestlabs.GalleryImageReference{ - Offer: to.Ptr("0001-com-ubuntu-server-groovy"), - OSType: to.Ptr("Linux"), - Publisher: to.Ptr("canonical"), - SKU: to.Ptr("20_10"), - Version: to.Ptr("latest"), - }, - IsAuthenticationWithSSHKey: to.Ptr(false), - LabSubnetName: to.Ptr("Dtl{labName}Subnet"), - LabVirtualNetworkID: to.Ptr("/virtualnetworks/dtl{labName}"), - NetworkInterface: &armdevtestlabs.NetworkInterfaceProperties{ - SharedPublicIPAddressConfiguration: &armdevtestlabs.SharedPublicIPAddressConfiguration{ - InboundNatRules: []*armdevtestlabs.InboundNatRule{ - { - BackendPort: to.Ptr[int32](22), - TransportProtocol: to.Ptr(armdevtestlabs.TransportProtocolTCP), - }}, - }, - }, - Notes: to.Ptr("Ubuntu Server 20.10"), - Size: to.Ptr("Standard_B1ms"), - StorageType: to.Ptr("Standard"), - UserName: to.Ptr("user"), - }, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Delete.json -func ExampleFormulasClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewFormulasClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "resourceGroupName", - "{labName}", - "{formulaName}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Update.json -func ExampleFormulasClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewFormulasClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{labName}", - "{formulaName}", - armdevtestlabs.FormulaFragment{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_galleryimages_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_galleryimages_client_test.go deleted file mode 100644 index b9b9ce46c44e..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_galleryimages_client_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GalleryImages_List.json -func ExampleGalleryImagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewGalleryImagesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - &armdevtestlabs.GalleryImagesClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_globalschedules_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_globalschedules_client_test.go deleted file mode 100644 index 8948dda93aad..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_globalschedules_client_test.go +++ /dev/null @@ -1,235 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_ListBySubscription.json -func ExampleGlobalSchedulesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewGlobalSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(&armdevtestlabs.GlobalSchedulesClientListBySubscriptionOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_ListByResourceGroup.json -func ExampleGlobalSchedulesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewGlobalSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("resourceGroupName", - &armdevtestlabs.GlobalSchedulesClientListByResourceGroupOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Get.json -func ExampleGlobalSchedulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewGlobalSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "labvmautostart", - &armdevtestlabs.GlobalSchedulesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_CreateOrUpdate.json -func ExampleGlobalSchedulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewGlobalSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "resourceGroupName", - "labvmautostart", - armdevtestlabs.Schedule{ - Properties: &armdevtestlabs.ScheduleProperties{ - Status: to.Ptr(armdevtestlabs.EnableStatusEnabled), - TaskType: to.Ptr("LabVmsStartupTask"), - TimeZoneID: to.Ptr("Hawaiian Standard Time"), - WeeklyRecurrence: &armdevtestlabs.WeekDetails{ - Time: to.Ptr("0700"), - Weekdays: []*string{ - to.Ptr("Monday"), - to.Ptr("Tuesday"), - to.Ptr("Wednesday"), - to.Ptr("Thursday"), - to.Ptr("Friday"), - to.Ptr("Saturday")}, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Delete.json -func ExampleGlobalSchedulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewGlobalSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "resourceGroupName", - "labvmautostart", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Update.json -func ExampleGlobalSchedulesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewGlobalSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "labvmautostart", - armdevtestlabs.ScheduleFragment{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Execute.json -func ExampleGlobalSchedulesClient_BeginExecute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewGlobalSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginExecute(ctx, - "resourceGroupName", - "labvmautostart", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Retarget.json -func ExampleGlobalSchedulesClient_BeginRetarget() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewGlobalSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRetarget(ctx, - "resourceGroupName", - "{scheduleName}", - armdevtestlabs.RetargetScheduleProperties{ - CurrentResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{targetLab}"), - TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{currentLab}"), - }, - 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/devtestlabs/armdevtestlabs/ze_generated_example_labs_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_labs_client_test.go deleted file mode 100644 index 541853c59432..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_labs_client_test.go +++ /dev/null @@ -1,311 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_test - -import ( - "context" - "log" - - "time" - - "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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListBySubscription.json -func ExampleLabsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewLabsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(&armdevtestlabs.LabsClientListBySubscriptionOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListByResourceGroup.json -func ExampleLabsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewLabsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("resourceGroupName", - &armdevtestlabs.LabsClientListByResourceGroupOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Get.json -func ExampleLabsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewLabsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - &armdevtestlabs.LabsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_CreateOrUpdate.json -func ExampleLabsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewLabsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - armdevtestlabs.Lab{ - Location: to.Ptr("{location}"), - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - Properties: &armdevtestlabs.LabProperties{ - LabStorageType: to.Ptr(armdevtestlabs.StorageType("{Standard|Premium}")), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Delete.json -func ExampleLabsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewLabsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "resourceGroupName", - "{labName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Update.json -func ExampleLabsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewLabsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{labName}", - armdevtestlabs.LabFragment{}, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_CreateEnvironment.json -func ExampleLabsClient_BeginCreateEnvironment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewLabsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateEnvironment(ctx, - "resourceGroupName", - "{labName}", - armdevtestlabs.LabVirtualMachineCreationParameter{ - Name: to.Ptr("{vmName}"), - Location: to.Ptr("{location}"), - Properties: &armdevtestlabs.LabVirtualMachineCreationParameterProperties{ - AllowClaim: to.Ptr(true), - DisallowPublicIPAddress: to.Ptr(true), - GalleryImageReference: &armdevtestlabs.GalleryImageReference{ - Offer: to.Ptr("UbuntuServer"), - OSType: to.Ptr("Linux"), - Publisher: to.Ptr("Canonical"), - SKU: to.Ptr("16.04-LTS"), - Version: to.Ptr("Latest"), - }, - LabSubnetName: to.Ptr("{virtualnetwork-subnet-name}"), - LabVirtualNetworkID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}"), - Password: to.Ptr("{userPassword}"), - Size: to.Ptr("Standard_A2_v2"), - StorageType: to.Ptr("Standard"), - UserName: to.Ptr("{userName}"), - }, - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - }, - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ExportResourceUsage.json -func ExampleLabsClient_BeginExportResourceUsage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewLabsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginExportResourceUsage(ctx, - "resourceGroupName", - "{labName}", - armdevtestlabs.ExportResourceUsageParameters{ - BlobStorageAbsoluteSasURI: to.Ptr("https://invalid.blob.core.windows.net/export.blob?sv=2015-07-08&sig={sas}&sp=rcw"), - UsageStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00Z"); return t }()), - }, - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ImportVirtualMachine.json -func ExampleLabsClient_BeginImportVirtualMachine() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewLabsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginImportVirtualMachine(ctx, - "resourceGroupName", - "{labName}", - armdevtestlabs.ImportLabVirtualMachineRequest{ - DestinationVirtualMachineName: to.Ptr("{vmName}"), - SourceVirtualMachineResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{otherResourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"), - }, - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListVhds.json -func ExampleLabsClient_NewListVhdsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewLabsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListVhdsPager("resourceGroupName", - "{labName}", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_notificationchannels_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_notificationchannels_client_test.go deleted file mode 100644 index 07c7aaed7302..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_notificationchannels_client_test.go +++ /dev/null @@ -1,176 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_List.json -func ExampleNotificationChannelsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewNotificationChannelsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - &armdevtestlabs.NotificationChannelsClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Get.json -func ExampleNotificationChannelsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewNotificationChannelsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "{notificationChannelName}", - &armdevtestlabs.NotificationChannelsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_CreateOrUpdate.json -func ExampleNotificationChannelsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewNotificationChannelsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - "{notificationChannelName}", - armdevtestlabs.NotificationChannel{ - Properties: &armdevtestlabs.NotificationChannelProperties{ - Description: to.Ptr("Integration configured for auto-shutdown"), - EmailRecipient: to.Ptr("{email}"), - Events: []*armdevtestlabs.Event{ - { - EventName: to.Ptr(armdevtestlabs.NotificationChannelEventTypeAutoShutdown), - }}, - NotificationLocale: to.Ptr("en"), - WebHookURL: to.Ptr("{webhookUrl}"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Delete.json -func ExampleNotificationChannelsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewNotificationChannelsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "resourceGroupName", - "{labName}", - "{notificationChannelName}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Update.json -func ExampleNotificationChannelsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewNotificationChannelsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{labName}", - "{notificationChannelName}", - armdevtestlabs.NotificationChannelFragment{}, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Notify.json -func ExampleNotificationChannelsClient_Notify() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewNotificationChannelsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Notify(ctx, - "resourceGroupName", - "{labName}", - "{notificationChannelName}", - armdevtestlabs.NotifyParameters{ - EventName: to.Ptr(armdevtestlabs.NotificationChannelEventTypeAutoShutdown), - JSONPayload: to.Ptr("{\"eventType\":\"AutoShutdown\",\"subscriptionId\":\"{subscriptionId}\",\"resourceGroupName\":\"resourceGroupName\",\"labName\":\"{labName}\"}"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_operations_client_test.go deleted file mode 100644 index 6f2bec51e69c..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Operations_Get.json -func ExampleOperationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewOperationsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "{locationName}", - "{operationName}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_policies_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_policies_client_test.go deleted file mode 100644 index f702bf8b781a..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_policies_client_test.go +++ /dev/null @@ -1,162 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_List.json -func ExamplePoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewPoliciesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - "{policySetName}", - &armdevtestlabs.PoliciesClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Get.json -func ExamplePoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewPoliciesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "{policySetName}", - "{policyName}", - &armdevtestlabs.PoliciesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_CreateOrUpdate.json -func ExamplePoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewPoliciesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - "{policySetName}", - "{policyName}", - armdevtestlabs.Policy{ - Location: to.Ptr("{location}"), - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - Properties: &armdevtestlabs.PolicyProperties{ - Description: to.Ptr("{policyDescription}"), - EvaluatorType: to.Ptr(armdevtestlabs.PolicyEvaluatorType("{policyEvaluatorType}")), - FactData: to.Ptr("{policyFactData}"), - FactName: to.Ptr(armdevtestlabs.PolicyFactName("{policyFactName}")), - Status: to.Ptr(armdevtestlabs.PolicyStatus("{policyStatus}")), - Threshold: to.Ptr("{policyThreshold}"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Delete.json -func ExamplePoliciesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewPoliciesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "resourceGroupName", - "{labName}", - "{policySetName}", - "{policyName}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Update.json -func ExamplePoliciesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewPoliciesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{labName}", - "{policySetName}", - "{policyName}", - armdevtestlabs.PolicyFragment{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_policysets_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_policysets_client_test.go deleted file mode 100644 index e5d72bd393f1..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_policysets_client_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/PolicySets_EvaluatePolicies.json -func ExamplePolicySetsClient_EvaluatePolicies() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewPolicySetsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.EvaluatePolicies(ctx, - "resourceGroupName", - "{labName}", - "{policySetName}", - armdevtestlabs.EvaluatePoliciesRequest{ - Policies: []*armdevtestlabs.EvaluatePoliciesProperties{ - { - FactName: to.Ptr("LabVmCount"), - ValueOffset: to.Ptr("1"), - }}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_provideroperations_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_provideroperations_client_test.go deleted file mode 100644 index 7789b827b050..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_provideroperations_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ProviderOperations_List.json -func ExampleProviderOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewProviderOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_schedules_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_schedules_client_test.go deleted file mode 100644 index 4d97d7d621d5..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_schedules_client_test.go +++ /dev/null @@ -1,227 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_List.json -func ExampleSchedulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - &armdevtestlabs.SchedulesClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Get.json -func ExampleSchedulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "{scheduleName}", - &armdevtestlabs.SchedulesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_CreateOrUpdate.json -func ExampleSchedulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - "{scheduleName}", - armdevtestlabs.Schedule{ - Location: to.Ptr("{location}"), - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - Properties: &armdevtestlabs.ScheduleProperties{ - DailyRecurrence: &armdevtestlabs.DayDetails{ - Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"), - }, - HourlyRecurrence: &armdevtestlabs.HourDetails{ - Minute: to.Ptr[int32](30), - }, - NotificationSettings: &armdevtestlabs.NotificationSettings{ - EmailRecipient: to.Ptr("{email}"), - NotificationLocale: to.Ptr("EN"), - Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")), - TimeInMinutes: to.Ptr[int32](15), - WebhookURL: to.Ptr("{webhookUrl}"), - }, - Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")), - TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"), - TaskType: to.Ptr("{myLabVmTaskType}"), - TimeZoneID: to.Ptr("Pacific Standard Time"), - WeeklyRecurrence: &armdevtestlabs.WeekDetails{ - Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"), - Weekdays: []*string{ - to.Ptr("Monday"), - to.Ptr("Wednesday"), - to.Ptr("Friday")}, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Delete.json -func ExampleSchedulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "resourceGroupName", - "{labName}", - "{scheduleName}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Update.json -func ExampleSchedulesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{labName}", - "{scheduleName}", - armdevtestlabs.ScheduleFragment{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Execute.json -func ExampleSchedulesClient_BeginExecute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginExecute(ctx, - "resourceGroupName", - "{labName}", - "{scheduleName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_ListApplicable.json -func ExampleSchedulesClient_NewListApplicablePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListApplicablePager("resourceGroupName", - "{labName}", - "{scheduleName}", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_secrets_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_secrets_client_test.go deleted file mode 100644 index bd155b92efee..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_secrets_client_test.go +++ /dev/null @@ -1,157 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_List.json -func ExampleSecretsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewSecretsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - "{userName}", - &armdevtestlabs.SecretsClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Get.json -func ExampleSecretsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewSecretsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "{userName}", - "{secretName}", - &armdevtestlabs.SecretsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_CreateOrUpdate.json -func ExampleSecretsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewSecretsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - "{userName}", - "{secretName}", - armdevtestlabs.Secret{ - Properties: &armdevtestlabs.SecretProperties{ - Value: to.Ptr("{secret}"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Delete.json -func ExampleSecretsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewSecretsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "resourceGroupName", - "{labName}", - "{userName}", - "{secretName}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Update.json -func ExampleSecretsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewSecretsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{labName}", - "{userName}", - "{secretName}", - armdevtestlabs.SecretFragment{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_servicefabrics_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_servicefabrics_client_test.go deleted file mode 100644 index 1e625ca970a7..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_servicefabrics_client_test.go +++ /dev/null @@ -1,242 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_List.json -func ExampleServiceFabricsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceFabricsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - "{userName}", - &armdevtestlabs.ServiceFabricsClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Get.json -func ExampleServiceFabricsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceFabricsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "{userName}", - "{serviceFabricName}", - &armdevtestlabs.ServiceFabricsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_CreateOrUpdate.json -func ExampleServiceFabricsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceFabricsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - "{userName}", - "{serviceFabricName}", - armdevtestlabs.ServiceFabric{ - Location: to.Ptr("{location}"), - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - Properties: &armdevtestlabs.ServiceFabricProperties{ - EnvironmentID: to.Ptr("{environmentId}"), - ExternalServiceFabricID: to.Ptr("{serviceFabricId}"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Delete.json -func ExampleServiceFabricsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceFabricsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "resourceGroupName", - "{labName}", - "{userName}", - "{serviceFabricName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Update.json -func ExampleServiceFabricsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceFabricsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{labName}", - "{userName}", - "{serviceFabricName}", - armdevtestlabs.ServiceFabricFragment{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_ListApplicableSchedules.json -func ExampleServiceFabricsClient_ListApplicableSchedules() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceFabricsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListApplicableSchedules(ctx, - "resourceGroupName", - "{labName}", - "{userName}", - "{serviceFabricName}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Start.json -func ExampleServiceFabricsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceFabricsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "resourceGroupName", - "{labName}", - "{userName}", - "{serviceFabricName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Stop.json -func ExampleServiceFabricsClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceFabricsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStop(ctx, - "resourceGroupName", - "{labName}", - "{userName}", - "{serviceFabricName}", - 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/devtestlabs/armdevtestlabs/ze_generated_example_servicefabricschedules_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_servicefabricschedules_client_test.go deleted file mode 100644 index 6752f7384d30..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_servicefabricschedules_client_test.go +++ /dev/null @@ -1,216 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_List.json -func ExampleServiceFabricSchedulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceFabricSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - "@me", - "{serviceFrabicName}", - &armdevtestlabs.ServiceFabricSchedulesClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Get.json -func ExampleServiceFabricSchedulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceFabricSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "@me", - "{serviceFrabicName}", - "{scheduleName}", - &armdevtestlabs.ServiceFabricSchedulesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_CreateOrUpdate.json -func ExampleServiceFabricSchedulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceFabricSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - "@me", - "{serviceFrabicName}", - "{scheduleName}", - armdevtestlabs.Schedule{ - Location: to.Ptr("{location}"), - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - Properties: &armdevtestlabs.ScheduleProperties{ - DailyRecurrence: &armdevtestlabs.DayDetails{ - Time: to.Ptr("19:00"), - }, - HourlyRecurrence: &armdevtestlabs.HourDetails{ - Minute: to.Ptr[int32](0), - }, - NotificationSettings: &armdevtestlabs.NotificationSettings{ - EmailRecipient: to.Ptr("{email}"), - NotificationLocale: to.Ptr("EN"), - Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")), - TimeInMinutes: to.Ptr[int32](15), - WebhookURL: to.Ptr("{webhoolUrl}"), - }, - Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")), - TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{uniqueIdentifier}/servicefabrics/{serviceFrabicName}"), - TaskType: to.Ptr("{Unknown|LabVmsShutdownTask|LabVmsStartupTask|LabVmReclamationTask|ComputeVmShutdownTask}"), - TimeZoneID: to.Ptr("Pacific Standard Time"), - WeeklyRecurrence: &armdevtestlabs.WeekDetails{ - Time: to.Ptr("19:00"), - Weekdays: []*string{ - to.Ptr("Monday"), - to.Ptr("Tuesday"), - to.Ptr("Wednesday"), - to.Ptr("Thursday"), - to.Ptr("Friday"), - to.Ptr("Saturday"), - to.Ptr("Sunday")}, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Delete.json -func ExampleServiceFabricSchedulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceFabricSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "resourceGroupName", - "{labName}", - "@me", - "{serviceFrabicName}", - "{scheduleName}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Update.json -func ExampleServiceFabricSchedulesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceFabricSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{labName}", - "@me", - "{serviceFrabicName}", - "{scheduleName}", - armdevtestlabs.ScheduleFragment{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Execute.json -func ExampleServiceFabricSchedulesClient_BeginExecute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceFabricSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginExecute(ctx, - "resourceGroupName", - "{labName}", - "@me", - "{serviceFrabicName}", - "{scheduleName}", - 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/devtestlabs/armdevtestlabs/ze_generated_example_servicerunners_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_servicerunners_client_test.go deleted file mode 100644 index de0dca270fee..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_servicerunners_client_test.go +++ /dev/null @@ -1,97 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_Get.json -func ExampleServiceRunnersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceRunnersClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{devtestlabName}", - "{servicerunnerName}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_CreateOrUpdate.json -func ExampleServiceRunnersClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceRunnersClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "resourceGroupName", - "{devtestlabName}", - "{servicerunnerName}", - armdevtestlabs.ServiceRunner{ - Location: to.Ptr("{location}"), - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - Identity: &armdevtestlabs.IdentityProperties{ - Type: to.Ptr(armdevtestlabs.ManagedIdentityType("{identityType}")), - ClientSecretURL: to.Ptr("{identityClientSecretUrl}"), - PrincipalID: to.Ptr("{identityPrincipalId}"), - TenantID: to.Ptr("{identityTenantId}"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_Delete.json -func ExampleServiceRunnersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewServiceRunnersClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "resourceGroupName", - "{devtestlabName}", - "{servicerunnerName}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_users_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_users_client_test.go deleted file mode 100644 index e3cee64f3fe6..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_users_client_test.go +++ /dev/null @@ -1,170 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_List.json -func ExampleUsersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewUsersClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{devtestlabName}", - &armdevtestlabs.UsersClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Get.json -func ExampleUsersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewUsersClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{devtestlabName}", - "{userName}", - &armdevtestlabs.UsersClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_CreateOrUpdate.json -func ExampleUsersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewUsersClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroupName", - "{devtestlabName}", - "{userName}", - armdevtestlabs.User{ - Location: to.Ptr("{location}"), - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - Properties: &armdevtestlabs.UserProperties{ - Identity: &armdevtestlabs.UserIdentity{ - AppID: to.Ptr("{appId}"), - ObjectID: to.Ptr("{objectId}"), - PrincipalID: to.Ptr("{principalId}"), - PrincipalName: to.Ptr("{principalName}"), - TenantID: to.Ptr("{tenantId}"), - }, - SecretStore: &armdevtestlabs.UserSecretStore{ - KeyVaultID: to.Ptr("{keyVaultId}"), - KeyVaultURI: to.Ptr("{keyVaultUri}"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Delete.json -func ExampleUsersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewUsersClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "resourceGroupName", - "{devtestlabName}", - "{userName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Update.json -func ExampleUsersClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewUsersClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{devtestlabName}", - "{userName}", - armdevtestlabs.UserFragment{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_virtualmachines_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_virtualmachines_client_test.go deleted file mode 100644 index 9e16a8b599a2..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_virtualmachines_client_test.go +++ /dev/null @@ -1,510 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_List.json -func ExampleVirtualMachinesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - &armdevtestlabs.VirtualMachinesClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Get.json -func ExampleVirtualMachinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - &armdevtestlabs.VirtualMachinesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_CreateOrUpdate.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - armdevtestlabs.LabVirtualMachine{ - Location: to.Ptr("{location}"), - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - Properties: &armdevtestlabs.LabVirtualMachineProperties{ - AllowClaim: to.Ptr(true), - DisallowPublicIPAddress: to.Ptr(true), - GalleryImageReference: &armdevtestlabs.GalleryImageReference{ - Offer: to.Ptr("UbuntuServer"), - OSType: to.Ptr("Linux"), - Publisher: to.Ptr("Canonical"), - SKU: to.Ptr("16.04-LTS"), - Version: to.Ptr("Latest"), - }, - LabSubnetName: to.Ptr("{virtualNetworkName}Subnet"), - LabVirtualNetworkID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}"), - Password: to.Ptr("{userPassword}"), - Size: to.Ptr("Standard_A2_v2"), - StorageType: to.Ptr("Standard"), - UserName: to.Ptr("{userName}"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Delete.json -func ExampleVirtualMachinesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Update.json -func ExampleVirtualMachinesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - armdevtestlabs.LabVirtualMachineFragment{}, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_AddDataDisk.json -func ExampleVirtualMachinesClient_BeginAddDataDisk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginAddDataDisk(ctx, - "resourceGroupName", - "{labName}", - "{virtualMachineName}", - armdevtestlabs.DataDiskProperties{ - AttachNewDataDiskOptions: &armdevtestlabs.AttachNewDataDiskOptions{ - DiskName: to.Ptr("{diskName}"), - DiskSizeGiB: to.Ptr[int32](127), - DiskType: to.Ptr(armdevtestlabs.StorageType("{diskType}")), - }, - }, - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_ApplyArtifacts.json -func ExampleVirtualMachinesClient_BeginApplyArtifacts() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginApplyArtifacts(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - armdevtestlabs.ApplyArtifactsRequest{ - Artifacts: []*armdevtestlabs.ArtifactInstallProperties{ - { - ArtifactID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/public repo/artifacts/windows-restart"), - }}, - }, - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Claim.json -func ExampleVirtualMachinesClient_BeginClaim() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginClaim(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_DetachDataDisk.json -func ExampleVirtualMachinesClient_BeginDetachDataDisk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDetachDataDisk(ctx, - "resourceGroupName", - "{labName}", - "{virtualMachineName}", - armdevtestlabs.DetachDataDiskProperties{ - ExistingLabDiskID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{virtualMachineName}"), - }, - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_GetRdpFileContents.json -func ExampleVirtualMachinesClient_GetRdpFileContents() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetRdpFileContents(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_ListApplicableSchedules.json -func ExampleVirtualMachinesClient_ListApplicableSchedules() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListApplicableSchedules(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Redeploy.json -func ExampleVirtualMachinesClient_BeginRedeploy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRedeploy(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Resize.json -func ExampleVirtualMachinesClient_BeginResize() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginResize(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - armdevtestlabs.ResizeLabVirtualMachineProperties{ - Size: to.Ptr("Standard_A4_v2"), - }, - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Restart.json -func ExampleVirtualMachinesClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRestart(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Start.json -func ExampleVirtualMachinesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Stop.json -func ExampleVirtualMachinesClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStop(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_TransferDisks.json -func ExampleVirtualMachinesClient_BeginTransferDisks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTransferDisks(ctx, - "resourceGroupName", - "{labName}", - "{virtualmachineName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_UnClaim.json -func ExampleVirtualMachinesClient_BeginUnClaim() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUnClaim(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - 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/devtestlabs/armdevtestlabs/ze_generated_example_virtualmachineschedules_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_virtualmachineschedules_client_test.go deleted file mode 100644 index 9945954303c0..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_virtualmachineschedules_client_test.go +++ /dev/null @@ -1,206 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_List.json -func ExampleVirtualMachineSchedulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachineSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - "{vmName}", - &armdevtestlabs.VirtualMachineSchedulesClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Get.json -func ExampleVirtualMachineSchedulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachineSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - "LabVmsShutdown", - &armdevtestlabs.VirtualMachineSchedulesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_CreateOrUpdate.json -func ExampleVirtualMachineSchedulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachineSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - "LabVmsShutdown", - armdevtestlabs.Schedule{ - Location: to.Ptr("{location}"), - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - Properties: &armdevtestlabs.ScheduleProperties{ - DailyRecurrence: &armdevtestlabs.DayDetails{ - Time: to.Ptr("1900"), - }, - HourlyRecurrence: &armdevtestlabs.HourDetails{ - Minute: to.Ptr[int32](30), - }, - NotificationSettings: &armdevtestlabs.NotificationSettings{ - EmailRecipient: to.Ptr("{email}"), - NotificationLocale: to.Ptr("EN"), - Status: to.Ptr(armdevtestlabs.EnableStatusEnabled), - TimeInMinutes: to.Ptr[int32](30), - WebhookURL: to.Ptr("{webhookUrl}"), - }, - Status: to.Ptr(armdevtestlabs.EnableStatusEnabled), - TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualMachines/{vmName}"), - TaskType: to.Ptr("LabVmsShutdownTask"), - TimeZoneID: to.Ptr("Pacific Standard Time"), - WeeklyRecurrence: &armdevtestlabs.WeekDetails{ - Time: to.Ptr("1700"), - Weekdays: []*string{ - to.Ptr("Friday"), - to.Ptr("Saturday"), - to.Ptr("Sunday")}, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Delete.json -func ExampleVirtualMachineSchedulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachineSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - "LabVmsShutdown", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Update.json -func ExampleVirtualMachineSchedulesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachineSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - "LabVmsShutdown", - armdevtestlabs.ScheduleFragment{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Execute.json -func ExampleVirtualMachineSchedulesClient_BeginExecute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualMachineSchedulesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginExecute(ctx, - "resourceGroupName", - "{labName}", - "{vmName}", - "LabVmsShutdown", - 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/devtestlabs/armdevtestlabs/ze_generated_example_virtualnetworks_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_virtualnetworks_client_test.go deleted file mode 100644 index 50adfc6fa9c8..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_virtualnetworks_client_test.go +++ /dev/null @@ -1,157 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs_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/devtestlabs/armdevtestlabs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_List.json -func ExampleVirtualNetworksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualNetworksClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroupName", - "{labName}", - &armdevtestlabs.VirtualNetworksClientListOptions{Expand: nil, - Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Get.json -func ExampleVirtualNetworksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualNetworksClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroupName", - "{labName}", - "{virtualNetworkName}", - &armdevtestlabs.VirtualNetworksClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_CreateOrUpdate.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualNetworksClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroupName", - "{labName}", - "{virtualNetworkName}", - armdevtestlabs.VirtualNetwork{ - Location: to.Ptr("{location}"), - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Delete.json -func ExampleVirtualNetworksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualNetworksClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "resourceGroupName", - "{labName}", - "{virtualNetworkName}", - 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/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Update.json -func ExampleVirtualNetworksClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdevtestlabs.NewVirtualNetworksClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroupName", - "{labName}", - "{virtualNetworkName}", - armdevtestlabs.VirtualNetworkFragment{ - Tags: map[string]*string{ - "tagName1": to.Ptr("tagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_models_serde.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_models_serde.go deleted file mode 100644 index 711601838de0..000000000000 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_models_serde.go +++ /dev/null @@ -1,1853 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdevtestlabs - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type ApplicableSchedule. -func (a ApplicableSchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicableScheduleFragment. -func (a ApplicableScheduleFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", a.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplyArtifactsRequest. -func (a ApplyArtifactsRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "artifacts", a.Artifacts) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ArmTemplate. -func (a ArmTemplate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ArmTemplateProperties. -func (a ArmTemplateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contents", &a.Contents) - populateTimeRFC3339(objectMap, "createdDate", a.CreatedDate) - populate(objectMap, "description", a.Description) - populate(objectMap, "displayName", a.DisplayName) - populate(objectMap, "enabled", a.Enabled) - populate(objectMap, "icon", a.Icon) - populate(objectMap, "parametersValueFilesInfo", a.ParametersValueFilesInfo) - populate(objectMap, "publisher", a.Publisher) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ArmTemplateProperties. -func (a *ArmTemplateProperties) UnmarshalJSON(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 "contents": - err = unpopulate(val, "Contents", &a.Contents) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &a.CreatedDate) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &a.DisplayName) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &a.Enabled) - delete(rawMsg, key) - case "icon": - err = unpopulate(val, "Icon", &a.Icon) - delete(rawMsg, key) - case "parametersValueFilesInfo": - err = unpopulate(val, "ParametersValueFilesInfo", &a.ParametersValueFilesInfo) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &a.Publisher) - 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 Artifact. -func (a Artifact) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ArtifactInstallProperties. -func (a ArtifactInstallProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "artifactId", a.ArtifactID) - populate(objectMap, "artifactTitle", a.ArtifactTitle) - populate(objectMap, "deploymentStatusMessage", a.DeploymentStatusMessage) - populateTimeRFC3339(objectMap, "installTime", a.InstallTime) - populate(objectMap, "parameters", a.Parameters) - populate(objectMap, "status", a.Status) - populate(objectMap, "vmExtensionStatusMessage", a.VMExtensionStatusMessage) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactInstallProperties. -func (a *ArtifactInstallProperties) UnmarshalJSON(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 "artifactId": - err = unpopulate(val, "ArtifactID", &a.ArtifactID) - delete(rawMsg, key) - case "artifactTitle": - err = unpopulate(val, "ArtifactTitle", &a.ArtifactTitle) - delete(rawMsg, key) - case "deploymentStatusMessage": - err = unpopulate(val, "DeploymentStatusMessage", &a.DeploymentStatusMessage) - delete(rawMsg, key) - case "installTime": - err = unpopulateTimeRFC3339(val, "InstallTime", &a.InstallTime) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &a.Parameters) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &a.Status) - delete(rawMsg, key) - case "vmExtensionStatusMessage": - err = unpopulate(val, "VMExtensionStatusMessage", &a.VMExtensionStatusMessage) - 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 ArtifactProperties. -func (a ArtifactProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdDate", a.CreatedDate) - populate(objectMap, "description", a.Description) - populate(objectMap, "filePath", a.FilePath) - populate(objectMap, "icon", a.Icon) - populate(objectMap, "parameters", &a.Parameters) - populate(objectMap, "publisher", a.Publisher) - populate(objectMap, "targetOsType", a.TargetOsType) - populate(objectMap, "title", a.Title) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactProperties. -func (a *ArtifactProperties) UnmarshalJSON(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 "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &a.CreatedDate) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "filePath": - err = unpopulate(val, "FilePath", &a.FilePath) - delete(rawMsg, key) - case "icon": - err = unpopulate(val, "Icon", &a.Icon) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &a.Parameters) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &a.Publisher) - delete(rawMsg, key) - case "targetOsType": - err = unpopulate(val, "TargetOsType", &a.TargetOsType) - delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &a.Title) - 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 ArtifactSource. -func (a ArtifactSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ArtifactSourceFragment. -func (a ArtifactSourceFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", a.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ArtifactSourceProperties. -func (a ArtifactSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "armTemplateFolderPath", a.ArmTemplateFolderPath) - populate(objectMap, "branchRef", a.BranchRef) - populateTimeRFC3339(objectMap, "createdDate", a.CreatedDate) - populate(objectMap, "displayName", a.DisplayName) - populate(objectMap, "folderPath", a.FolderPath) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "securityToken", a.SecurityToken) - populate(objectMap, "sourceType", a.SourceType) - populate(objectMap, "status", a.Status) - populate(objectMap, "uri", a.URI) - populate(objectMap, "uniqueIdentifier", a.UniqueIdentifier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactSourceProperties. -func (a *ArtifactSourceProperties) UnmarshalJSON(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 "armTemplateFolderPath": - err = unpopulate(val, "ArmTemplateFolderPath", &a.ArmTemplateFolderPath) - delete(rawMsg, key) - case "branchRef": - err = unpopulate(val, "BranchRef", &a.BranchRef) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &a.CreatedDate) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &a.DisplayName) - delete(rawMsg, key) - case "folderPath": - err = unpopulate(val, "FolderPath", &a.FolderPath) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "securityToken": - err = unpopulate(val, "SecurityToken", &a.SecurityToken) - delete(rawMsg, key) - case "sourceType": - err = unpopulate(val, "SourceType", &a.SourceType) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &a.Status) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &a.URI) - delete(rawMsg, key) - case "uniqueIdentifier": - err = unpopulate(val, "UniqueIdentifier", &a.UniqueIdentifier) - 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 ComputeVMProperties. -func (c ComputeVMProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataDiskIds", c.DataDiskIDs) - populate(objectMap, "dataDisks", c.DataDisks) - populate(objectMap, "networkInterfaceId", c.NetworkInterfaceID) - populate(objectMap, "osDiskId", c.OSDiskID) - populate(objectMap, "osType", c.OSType) - populate(objectMap, "statuses", c.Statuses) - populate(objectMap, "vmSize", c.VMSize) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CustomImage. -func (c CustomImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CustomImageFragment. -func (c CustomImageFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", c.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CustomImageProperties. -func (c CustomImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "author", c.Author) - populateTimeRFC3339(objectMap, "creationDate", c.CreationDate) - populate(objectMap, "customImagePlan", c.CustomImagePlan) - populate(objectMap, "dataDiskStorageInfo", c.DataDiskStorageInfo) - populate(objectMap, "description", c.Description) - populate(objectMap, "isPlanAuthorized", c.IsPlanAuthorized) - populate(objectMap, "managedImageId", c.ManagedImageID) - populate(objectMap, "managedSnapshotId", c.ManagedSnapshotID) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "uniqueIdentifier", c.UniqueIdentifier) - populate(objectMap, "vm", c.VM) - populate(objectMap, "vhd", c.Vhd) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomImageProperties. -func (c *CustomImageProperties) UnmarshalJSON(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 "author": - err = unpopulate(val, "Author", &c.Author) - delete(rawMsg, key) - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &c.CreationDate) - delete(rawMsg, key) - case "customImagePlan": - err = unpopulate(val, "CustomImagePlan", &c.CustomImagePlan) - delete(rawMsg, key) - case "dataDiskStorageInfo": - err = unpopulate(val, "DataDiskStorageInfo", &c.DataDiskStorageInfo) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) - delete(rawMsg, key) - case "isPlanAuthorized": - err = unpopulate(val, "IsPlanAuthorized", &c.IsPlanAuthorized) - delete(rawMsg, key) - case "managedImageId": - err = unpopulate(val, "ManagedImageID", &c.ManagedImageID) - delete(rawMsg, key) - case "managedSnapshotId": - err = unpopulate(val, "ManagedSnapshotID", &c.ManagedSnapshotID) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "uniqueIdentifier": - err = unpopulate(val, "UniqueIdentifier", &c.UniqueIdentifier) - delete(rawMsg, key) - case "vm": - err = unpopulate(val, "VM", &c.VM) - delete(rawMsg, key) - case "vhd": - err = unpopulate(val, "Vhd", &c.Vhd) - 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 Disk. -func (d Disk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DiskFragment. -func (d DiskFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DiskProperties. -func (d DiskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdDate", d.CreatedDate) - populate(objectMap, "diskBlobName", d.DiskBlobName) - populate(objectMap, "diskSizeGiB", d.DiskSizeGiB) - populate(objectMap, "diskType", d.DiskType) - populate(objectMap, "diskUri", d.DiskURI) - populate(objectMap, "hostCaching", d.HostCaching) - populate(objectMap, "leasedByLabVmId", d.LeasedByLabVMID) - populate(objectMap, "managedDiskId", d.ManagedDiskID) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "storageAccountId", d.StorageAccountID) - populate(objectMap, "uniqueIdentifier", d.UniqueIdentifier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskProperties. -func (d *DiskProperties) UnmarshalJSON(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 "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &d.CreatedDate) - delete(rawMsg, key) - case "diskBlobName": - err = unpopulate(val, "DiskBlobName", &d.DiskBlobName) - delete(rawMsg, key) - case "diskSizeGiB": - err = unpopulate(val, "DiskSizeGiB", &d.DiskSizeGiB) - delete(rawMsg, key) - case "diskType": - err = unpopulate(val, "DiskType", &d.DiskType) - delete(rawMsg, key) - case "diskUri": - err = unpopulate(val, "DiskURI", &d.DiskURI) - delete(rawMsg, key) - case "hostCaching": - err = unpopulate(val, "HostCaching", &d.HostCaching) - delete(rawMsg, key) - case "leasedByLabVmId": - err = unpopulate(val, "LeasedByLabVMID", &d.LeasedByLabVMID) - delete(rawMsg, key) - case "managedDiskId": - err = unpopulate(val, "ManagedDiskID", &d.ManagedDiskID) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "storageAccountId": - err = unpopulate(val, "StorageAccountID", &d.StorageAccountID) - delete(rawMsg, key) - case "uniqueIdentifier": - err = unpopulate(val, "UniqueIdentifier", &d.UniqueIdentifier) - 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 DtlEnvironment. -func (d DtlEnvironment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DtlEnvironmentFragment. -func (d DtlEnvironmentFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EnvironmentDeploymentProperties. -func (e EnvironmentDeploymentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "armTemplateId", e.ArmTemplateID) - populate(objectMap, "parameters", e.Parameters) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EvaluatePoliciesRequest. -func (e EvaluatePoliciesRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "policies", e.Policies) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ExportResourceUsageParameters. -func (e ExportResourceUsageParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "blobStorageAbsoluteSasUri", e.BlobStorageAbsoluteSasURI) - populateTimeRFC3339(objectMap, "usageStartDate", e.UsageStartDate) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExportResourceUsageParameters. -func (e *ExportResourceUsageParameters) UnmarshalJSON(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 "blobStorageAbsoluteSasUri": - err = unpopulate(val, "BlobStorageAbsoluteSasURI", &e.BlobStorageAbsoluteSasURI) - delete(rawMsg, key) - case "usageStartDate": - err = unpopulateTimeRFC3339(val, "UsageStartDate", &e.UsageStartDate) - 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 Formula. -func (f Formula) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", f.ID) - populate(objectMap, "location", f.Location) - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "tags", f.Tags) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FormulaFragment. -func (f FormulaFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", f.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FormulaProperties. -func (f FormulaProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "author", f.Author) - populateTimeRFC3339(objectMap, "creationDate", f.CreationDate) - populate(objectMap, "description", f.Description) - populate(objectMap, "formulaContent", f.FormulaContent) - populate(objectMap, "osType", f.OSType) - populate(objectMap, "provisioningState", f.ProvisioningState) - populate(objectMap, "uniqueIdentifier", f.UniqueIdentifier) - populate(objectMap, "vm", f.VM) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FormulaProperties. -func (f *FormulaProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "author": - err = unpopulate(val, "Author", &f.Author) - delete(rawMsg, key) - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &f.CreationDate) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &f.Description) - delete(rawMsg, key) - case "formulaContent": - err = unpopulate(val, "FormulaContent", &f.FormulaContent) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &f.OSType) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) - delete(rawMsg, key) - case "uniqueIdentifier": - err = unpopulate(val, "UniqueIdentifier", &f.UniqueIdentifier) - delete(rawMsg, key) - case "vm": - err = unpopulate(val, "VM", &f.VM) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImage. -func (g GalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageProperties. -func (g GalleryImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "author", g.Author) - populateTimeRFC3339(objectMap, "createdDate", g.CreatedDate) - populate(objectMap, "description", g.Description) - populate(objectMap, "enabled", g.Enabled) - populate(objectMap, "icon", g.Icon) - populate(objectMap, "imageReference", g.ImageReference) - populate(objectMap, "isPlanAuthorized", g.IsPlanAuthorized) - populate(objectMap, "planId", g.PlanID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageProperties. -func (g *GalleryImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "author": - err = unpopulate(val, "Author", &g.Author) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &g.CreatedDate) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &g.Enabled) - delete(rawMsg, key) - case "icon": - err = unpopulate(val, "Icon", &g.Icon) - delete(rawMsg, key) - case "imageReference": - err = unpopulate(val, "ImageReference", &g.ImageReference) - delete(rawMsg, key) - case "isPlanAuthorized": - err = unpopulate(val, "IsPlanAuthorized", &g.IsPlanAuthorized) - delete(rawMsg, key) - case "planId": - err = unpopulate(val, "PlanID", &g.PlanID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GenerateArmTemplateRequest. -func (g GenerateArmTemplateRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "fileUploadOptions", g.FileUploadOptions) - populate(objectMap, "location", g.Location) - populate(objectMap, "parameters", g.Parameters) - populate(objectMap, "virtualMachineName", g.VirtualMachineName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Lab. -func (l Lab) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", l.ID) - populate(objectMap, "location", l.Location) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "tags", l.Tags) - populate(objectMap, "type", l.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LabAnnouncementProperties. -func (l LabAnnouncementProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enabled", l.Enabled) - populateTimeRFC3339(objectMap, "expirationDate", l.ExpirationDate) - populate(objectMap, "expired", l.Expired) - populate(objectMap, "markdown", l.Markdown) - populate(objectMap, "provisioningState", l.ProvisioningState) - populate(objectMap, "title", l.Title) - populate(objectMap, "uniqueIdentifier", l.UniqueIdentifier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LabAnnouncementProperties. -func (l *LabAnnouncementProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &l.Enabled) - delete(rawMsg, key) - case "expirationDate": - err = unpopulateTimeRFC3339(val, "ExpirationDate", &l.ExpirationDate) - delete(rawMsg, key) - case "expired": - err = unpopulate(val, "Expired", &l.Expired) - delete(rawMsg, key) - case "markdown": - err = unpopulate(val, "Markdown", &l.Markdown) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) - delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &l.Title) - delete(rawMsg, key) - case "uniqueIdentifier": - err = unpopulate(val, "UniqueIdentifier", &l.UniqueIdentifier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LabCost. -func (l LabCost) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", l.ID) - populate(objectMap, "location", l.Location) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "tags", l.Tags) - populate(objectMap, "type", l.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LabCostDetailsProperties. -func (l LabCostDetailsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cost", l.Cost) - populate(objectMap, "costType", l.CostType) - populateTimeRFC3339(objectMap, "date", l.Date) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LabCostDetailsProperties. -func (l *LabCostDetailsProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "cost": - err = unpopulate(val, "Cost", &l.Cost) - delete(rawMsg, key) - case "costType": - err = unpopulate(val, "CostType", &l.CostType) - delete(rawMsg, key) - case "date": - err = unpopulateTimeRFC3339(val, "Date", &l.Date) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LabCostProperties. -func (l LabCostProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdDate", l.CreatedDate) - populate(objectMap, "currencyCode", l.CurrencyCode) - populateTimeRFC3339(objectMap, "endDateTime", l.EndDateTime) - populate(objectMap, "labCostDetails", l.LabCostDetails) - populate(objectMap, "labCostSummary", l.LabCostSummary) - populate(objectMap, "provisioningState", l.ProvisioningState) - populate(objectMap, "resourceCosts", l.ResourceCosts) - populateTimeRFC3339(objectMap, "startDateTime", l.StartDateTime) - populate(objectMap, "targetCost", l.TargetCost) - populate(objectMap, "uniqueIdentifier", l.UniqueIdentifier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LabCostProperties. -func (l *LabCostProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &l.CreatedDate) - delete(rawMsg, key) - case "currencyCode": - err = unpopulate(val, "CurrencyCode", &l.CurrencyCode) - delete(rawMsg, key) - case "endDateTime": - err = unpopulateTimeRFC3339(val, "EndDateTime", &l.EndDateTime) - delete(rawMsg, key) - case "labCostDetails": - err = unpopulate(val, "LabCostDetails", &l.LabCostDetails) - delete(rawMsg, key) - case "labCostSummary": - err = unpopulate(val, "LabCostSummary", &l.LabCostSummary) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) - delete(rawMsg, key) - case "resourceCosts": - err = unpopulate(val, "ResourceCosts", &l.ResourceCosts) - delete(rawMsg, key) - case "startDateTime": - err = unpopulateTimeRFC3339(val, "StartDateTime", &l.StartDateTime) - delete(rawMsg, key) - case "targetCost": - err = unpopulate(val, "TargetCost", &l.TargetCost) - delete(rawMsg, key) - case "uniqueIdentifier": - err = unpopulate(val, "UniqueIdentifier", &l.UniqueIdentifier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LabFragment. -func (l LabFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", l.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LabProperties. -func (l LabProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "announcement", l.Announcement) - populate(objectMap, "artifactsStorageAccount", l.ArtifactsStorageAccount) - populateTimeRFC3339(objectMap, "createdDate", l.CreatedDate) - populate(objectMap, "defaultPremiumStorageAccount", l.DefaultPremiumStorageAccount) - populate(objectMap, "defaultStorageAccount", l.DefaultStorageAccount) - populate(objectMap, "environmentPermission", l.EnvironmentPermission) - populate(objectMap, "extendedProperties", l.ExtendedProperties) - populate(objectMap, "labStorageType", l.LabStorageType) - populate(objectMap, "loadBalancerId", l.LoadBalancerID) - populate(objectMap, "mandatoryArtifactsResourceIdsLinux", l.MandatoryArtifactsResourceIDsLinux) - populate(objectMap, "mandatoryArtifactsResourceIdsWindows", l.MandatoryArtifactsResourceIDsWindows) - populate(objectMap, "networkSecurityGroupId", l.NetworkSecurityGroupID) - populate(objectMap, "premiumDataDiskStorageAccount", l.PremiumDataDiskStorageAccount) - populate(objectMap, "premiumDataDisks", l.PremiumDataDisks) - populate(objectMap, "provisioningState", l.ProvisioningState) - populate(objectMap, "publicIpId", l.PublicIPID) - populate(objectMap, "support", l.Support) - populate(objectMap, "uniqueIdentifier", l.UniqueIdentifier) - populate(objectMap, "vmCreationResourceGroup", l.VMCreationResourceGroup) - populate(objectMap, "vaultName", l.VaultName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LabProperties. -func (l *LabProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "announcement": - err = unpopulate(val, "Announcement", &l.Announcement) - delete(rawMsg, key) - case "artifactsStorageAccount": - err = unpopulate(val, "ArtifactsStorageAccount", &l.ArtifactsStorageAccount) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &l.CreatedDate) - delete(rawMsg, key) - case "defaultPremiumStorageAccount": - err = unpopulate(val, "DefaultPremiumStorageAccount", &l.DefaultPremiumStorageAccount) - delete(rawMsg, key) - case "defaultStorageAccount": - err = unpopulate(val, "DefaultStorageAccount", &l.DefaultStorageAccount) - delete(rawMsg, key) - case "environmentPermission": - err = unpopulate(val, "EnvironmentPermission", &l.EnvironmentPermission) - delete(rawMsg, key) - case "extendedProperties": - err = unpopulate(val, "ExtendedProperties", &l.ExtendedProperties) - delete(rawMsg, key) - case "labStorageType": - err = unpopulate(val, "LabStorageType", &l.LabStorageType) - delete(rawMsg, key) - case "loadBalancerId": - err = unpopulate(val, "LoadBalancerID", &l.LoadBalancerID) - delete(rawMsg, key) - case "mandatoryArtifactsResourceIdsLinux": - err = unpopulate(val, "MandatoryArtifactsResourceIDsLinux", &l.MandatoryArtifactsResourceIDsLinux) - delete(rawMsg, key) - case "mandatoryArtifactsResourceIdsWindows": - err = unpopulate(val, "MandatoryArtifactsResourceIDsWindows", &l.MandatoryArtifactsResourceIDsWindows) - delete(rawMsg, key) - case "networkSecurityGroupId": - err = unpopulate(val, "NetworkSecurityGroupID", &l.NetworkSecurityGroupID) - delete(rawMsg, key) - case "premiumDataDiskStorageAccount": - err = unpopulate(val, "PremiumDataDiskStorageAccount", &l.PremiumDataDiskStorageAccount) - delete(rawMsg, key) - case "premiumDataDisks": - err = unpopulate(val, "PremiumDataDisks", &l.PremiumDataDisks) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) - delete(rawMsg, key) - case "publicIpId": - err = unpopulate(val, "PublicIPID", &l.PublicIPID) - delete(rawMsg, key) - case "support": - err = unpopulate(val, "Support", &l.Support) - delete(rawMsg, key) - case "uniqueIdentifier": - err = unpopulate(val, "UniqueIdentifier", &l.UniqueIdentifier) - delete(rawMsg, key) - case "vmCreationResourceGroup": - err = unpopulate(val, "VMCreationResourceGroup", &l.VMCreationResourceGroup) - delete(rawMsg, key) - case "vaultName": - err = unpopulate(val, "VaultName", &l.VaultName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LabVirtualMachine. -func (l LabVirtualMachine) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", l.ID) - populate(objectMap, "location", l.Location) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "tags", l.Tags) - populate(objectMap, "type", l.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LabVirtualMachineCreationParameter. -func (l LabVirtualMachineCreationParameter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "location", l.Location) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "tags", l.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LabVirtualMachineCreationParameterProperties. -func (l LabVirtualMachineCreationParameterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowClaim", l.AllowClaim) - populate(objectMap, "artifacts", l.Artifacts) - populate(objectMap, "bulkCreationParameters", l.BulkCreationParameters) - populateTimeRFC3339(objectMap, "createdDate", l.CreatedDate) - populate(objectMap, "customImageId", l.CustomImageID) - populate(objectMap, "dataDiskParameters", l.DataDiskParameters) - populate(objectMap, "disallowPublicIpAddress", l.DisallowPublicIPAddress) - populate(objectMap, "environmentId", l.EnvironmentID) - populateTimeRFC3339(objectMap, "expirationDate", l.ExpirationDate) - populate(objectMap, "galleryImageReference", l.GalleryImageReference) - populate(objectMap, "isAuthenticationWithSshKey", l.IsAuthenticationWithSSHKey) - populate(objectMap, "labSubnetName", l.LabSubnetName) - populate(objectMap, "labVirtualNetworkId", l.LabVirtualNetworkID) - populate(objectMap, "networkInterface", l.NetworkInterface) - populate(objectMap, "notes", l.Notes) - populate(objectMap, "ownerObjectId", l.OwnerObjectID) - populate(objectMap, "ownerUserPrincipalName", l.OwnerUserPrincipalName) - populate(objectMap, "password", l.Password) - populate(objectMap, "planId", l.PlanID) - populate(objectMap, "sshKey", l.SSHKey) - populate(objectMap, "scheduleParameters", l.ScheduleParameters) - populate(objectMap, "size", l.Size) - populate(objectMap, "storageType", l.StorageType) - populate(objectMap, "userName", l.UserName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LabVirtualMachineCreationParameterProperties. -func (l *LabVirtualMachineCreationParameterProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowClaim": - err = unpopulate(val, "AllowClaim", &l.AllowClaim) - delete(rawMsg, key) - case "artifacts": - err = unpopulate(val, "Artifacts", &l.Artifacts) - delete(rawMsg, key) - case "bulkCreationParameters": - err = unpopulate(val, "BulkCreationParameters", &l.BulkCreationParameters) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &l.CreatedDate) - delete(rawMsg, key) - case "customImageId": - err = unpopulate(val, "CustomImageID", &l.CustomImageID) - delete(rawMsg, key) - case "dataDiskParameters": - err = unpopulate(val, "DataDiskParameters", &l.DataDiskParameters) - delete(rawMsg, key) - case "disallowPublicIpAddress": - err = unpopulate(val, "DisallowPublicIPAddress", &l.DisallowPublicIPAddress) - delete(rawMsg, key) - case "environmentId": - err = unpopulate(val, "EnvironmentID", &l.EnvironmentID) - delete(rawMsg, key) - case "expirationDate": - err = unpopulateTimeRFC3339(val, "ExpirationDate", &l.ExpirationDate) - delete(rawMsg, key) - case "galleryImageReference": - err = unpopulate(val, "GalleryImageReference", &l.GalleryImageReference) - delete(rawMsg, key) - case "isAuthenticationWithSshKey": - err = unpopulate(val, "IsAuthenticationWithSSHKey", &l.IsAuthenticationWithSSHKey) - delete(rawMsg, key) - case "labSubnetName": - err = unpopulate(val, "LabSubnetName", &l.LabSubnetName) - delete(rawMsg, key) - case "labVirtualNetworkId": - err = unpopulate(val, "LabVirtualNetworkID", &l.LabVirtualNetworkID) - delete(rawMsg, key) - case "networkInterface": - err = unpopulate(val, "NetworkInterface", &l.NetworkInterface) - delete(rawMsg, key) - case "notes": - err = unpopulate(val, "Notes", &l.Notes) - delete(rawMsg, key) - case "ownerObjectId": - err = unpopulate(val, "OwnerObjectID", &l.OwnerObjectID) - delete(rawMsg, key) - case "ownerUserPrincipalName": - err = unpopulate(val, "OwnerUserPrincipalName", &l.OwnerUserPrincipalName) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &l.Password) - delete(rawMsg, key) - case "planId": - err = unpopulate(val, "PlanID", &l.PlanID) - delete(rawMsg, key) - case "sshKey": - err = unpopulate(val, "SSHKey", &l.SSHKey) - delete(rawMsg, key) - case "scheduleParameters": - err = unpopulate(val, "ScheduleParameters", &l.ScheduleParameters) - delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &l.Size) - delete(rawMsg, key) - case "storageType": - err = unpopulate(val, "StorageType", &l.StorageType) - delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &l.UserName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LabVirtualMachineFragment. -func (l LabVirtualMachineFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", l.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LabVirtualMachineProperties. -func (l LabVirtualMachineProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowClaim", l.AllowClaim) - populate(objectMap, "applicableSchedule", l.ApplicableSchedule) - populate(objectMap, "artifactDeploymentStatus", l.ArtifactDeploymentStatus) - populate(objectMap, "artifacts", l.Artifacts) - populate(objectMap, "computeId", l.ComputeID) - populate(objectMap, "computeVm", l.ComputeVM) - populate(objectMap, "createdByUser", l.CreatedByUser) - populate(objectMap, "createdByUserId", l.CreatedByUserID) - populateTimeRFC3339(objectMap, "createdDate", l.CreatedDate) - populate(objectMap, "customImageId", l.CustomImageID) - populate(objectMap, "dataDiskParameters", l.DataDiskParameters) - populate(objectMap, "disallowPublicIpAddress", l.DisallowPublicIPAddress) - populate(objectMap, "environmentId", l.EnvironmentID) - populateTimeRFC3339(objectMap, "expirationDate", l.ExpirationDate) - populate(objectMap, "fqdn", l.Fqdn) - populate(objectMap, "galleryImageReference", l.GalleryImageReference) - populate(objectMap, "isAuthenticationWithSshKey", l.IsAuthenticationWithSSHKey) - populate(objectMap, "labSubnetName", l.LabSubnetName) - populate(objectMap, "labVirtualNetworkId", l.LabVirtualNetworkID) - populate(objectMap, "lastKnownPowerState", l.LastKnownPowerState) - populate(objectMap, "networkInterface", l.NetworkInterface) - populate(objectMap, "notes", l.Notes) - populate(objectMap, "osType", l.OSType) - populate(objectMap, "ownerObjectId", l.OwnerObjectID) - populate(objectMap, "ownerUserPrincipalName", l.OwnerUserPrincipalName) - populate(objectMap, "password", l.Password) - populate(objectMap, "planId", l.PlanID) - populate(objectMap, "provisioningState", l.ProvisioningState) - populate(objectMap, "sshKey", l.SSHKey) - populate(objectMap, "scheduleParameters", l.ScheduleParameters) - populate(objectMap, "size", l.Size) - populate(objectMap, "storageType", l.StorageType) - populate(objectMap, "uniqueIdentifier", l.UniqueIdentifier) - populate(objectMap, "userName", l.UserName) - populate(objectMap, "virtualMachineCreationSource", l.VirtualMachineCreationSource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LabVirtualMachineProperties. -func (l *LabVirtualMachineProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowClaim": - err = unpopulate(val, "AllowClaim", &l.AllowClaim) - delete(rawMsg, key) - case "applicableSchedule": - err = unpopulate(val, "ApplicableSchedule", &l.ApplicableSchedule) - delete(rawMsg, key) - case "artifactDeploymentStatus": - err = unpopulate(val, "ArtifactDeploymentStatus", &l.ArtifactDeploymentStatus) - delete(rawMsg, key) - case "artifacts": - err = unpopulate(val, "Artifacts", &l.Artifacts) - delete(rawMsg, key) - case "computeId": - err = unpopulate(val, "ComputeID", &l.ComputeID) - delete(rawMsg, key) - case "computeVm": - err = unpopulate(val, "ComputeVM", &l.ComputeVM) - delete(rawMsg, key) - case "createdByUser": - err = unpopulate(val, "CreatedByUser", &l.CreatedByUser) - delete(rawMsg, key) - case "createdByUserId": - err = unpopulate(val, "CreatedByUserID", &l.CreatedByUserID) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &l.CreatedDate) - delete(rawMsg, key) - case "customImageId": - err = unpopulate(val, "CustomImageID", &l.CustomImageID) - delete(rawMsg, key) - case "dataDiskParameters": - err = unpopulate(val, "DataDiskParameters", &l.DataDiskParameters) - delete(rawMsg, key) - case "disallowPublicIpAddress": - err = unpopulate(val, "DisallowPublicIPAddress", &l.DisallowPublicIPAddress) - delete(rawMsg, key) - case "environmentId": - err = unpopulate(val, "EnvironmentID", &l.EnvironmentID) - delete(rawMsg, key) - case "expirationDate": - err = unpopulateTimeRFC3339(val, "ExpirationDate", &l.ExpirationDate) - delete(rawMsg, key) - case "fqdn": - err = unpopulate(val, "Fqdn", &l.Fqdn) - delete(rawMsg, key) - case "galleryImageReference": - err = unpopulate(val, "GalleryImageReference", &l.GalleryImageReference) - delete(rawMsg, key) - case "isAuthenticationWithSshKey": - err = unpopulate(val, "IsAuthenticationWithSSHKey", &l.IsAuthenticationWithSSHKey) - delete(rawMsg, key) - case "labSubnetName": - err = unpopulate(val, "LabSubnetName", &l.LabSubnetName) - delete(rawMsg, key) - case "labVirtualNetworkId": - err = unpopulate(val, "LabVirtualNetworkID", &l.LabVirtualNetworkID) - delete(rawMsg, key) - case "lastKnownPowerState": - err = unpopulate(val, "LastKnownPowerState", &l.LastKnownPowerState) - delete(rawMsg, key) - case "networkInterface": - err = unpopulate(val, "NetworkInterface", &l.NetworkInterface) - delete(rawMsg, key) - case "notes": - err = unpopulate(val, "Notes", &l.Notes) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &l.OSType) - delete(rawMsg, key) - case "ownerObjectId": - err = unpopulate(val, "OwnerObjectID", &l.OwnerObjectID) - delete(rawMsg, key) - case "ownerUserPrincipalName": - err = unpopulate(val, "OwnerUserPrincipalName", &l.OwnerUserPrincipalName) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &l.Password) - delete(rawMsg, key) - case "planId": - err = unpopulate(val, "PlanID", &l.PlanID) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) - delete(rawMsg, key) - case "sshKey": - err = unpopulate(val, "SSHKey", &l.SSHKey) - delete(rawMsg, key) - case "scheduleParameters": - err = unpopulate(val, "ScheduleParameters", &l.ScheduleParameters) - delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &l.Size) - delete(rawMsg, key) - case "storageType": - err = unpopulate(val, "StorageType", &l.StorageType) - delete(rawMsg, key) - case "uniqueIdentifier": - err = unpopulate(val, "UniqueIdentifier", &l.UniqueIdentifier) - delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &l.UserName) - delete(rawMsg, key) - case "virtualMachineCreationSource": - err = unpopulate(val, "VirtualMachineCreationSource", &l.VirtualMachineCreationSource) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NotificationChannel. -func (n NotificationChannel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", n.ID) - populate(objectMap, "location", n.Location) - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "type", n.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NotificationChannelFragment. -func (n NotificationChannelFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", n.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NotificationChannelProperties. -func (n NotificationChannelProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdDate", n.CreatedDate) - populate(objectMap, "description", n.Description) - populate(objectMap, "emailRecipient", n.EmailRecipient) - populate(objectMap, "events", n.Events) - populate(objectMap, "notificationLocale", n.NotificationLocale) - populate(objectMap, "provisioningState", n.ProvisioningState) - populate(objectMap, "uniqueIdentifier", n.UniqueIdentifier) - populate(objectMap, "webHookUrl", n.WebHookURL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationChannelProperties. -func (n *NotificationChannelProperties) UnmarshalJSON(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 "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &n.CreatedDate) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &n.Description) - delete(rawMsg, key) - case "emailRecipient": - err = unpopulate(val, "EmailRecipient", &n.EmailRecipient) - delete(rawMsg, key) - case "events": - err = unpopulate(val, "Events", &n.Events) - delete(rawMsg, key) - case "notificationLocale": - err = unpopulate(val, "NotificationLocale", &n.NotificationLocale) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) - delete(rawMsg, key) - case "uniqueIdentifier": - err = unpopulate(val, "UniqueIdentifier", &n.UniqueIdentifier) - delete(rawMsg, key) - case "webHookUrl": - err = unpopulate(val, "WebHookURL", &n.WebHookURL) - 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 Policy. -func (p Policy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PolicyFragment. -func (p PolicyFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", p.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PolicyProperties. -func (p PolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdDate", p.CreatedDate) - populate(objectMap, "description", p.Description) - populate(objectMap, "evaluatorType", p.EvaluatorType) - populate(objectMap, "factData", p.FactData) - populate(objectMap, "factName", p.FactName) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "status", p.Status) - populate(objectMap, "threshold", p.Threshold) - populate(objectMap, "uniqueIdentifier", p.UniqueIdentifier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyProperties. -func (p *PolicyProperties) UnmarshalJSON(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 "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &p.CreatedDate) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "evaluatorType": - err = unpopulate(val, "EvaluatorType", &p.EvaluatorType) - delete(rawMsg, key) - case "factData": - err = unpopulate(val, "FactData", &p.FactData) - delete(rawMsg, key) - case "factName": - err = unpopulate(val, "FactName", &p.FactName) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) - delete(rawMsg, key) - case "threshold": - err = unpopulate(val, "Threshold", &p.Threshold) - delete(rawMsg, key) - case "uniqueIdentifier": - err = unpopulate(val, "UniqueIdentifier", &p.UniqueIdentifier) - 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 Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Schedule. -func (s Schedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ScheduleCreationParameter. -func (s ScheduleCreationParameter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ScheduleFragment. -func (s ScheduleFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ScheduleProperties. -func (s ScheduleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdDate", s.CreatedDate) - populate(objectMap, "dailyRecurrence", s.DailyRecurrence) - populate(objectMap, "hourlyRecurrence", s.HourlyRecurrence) - populate(objectMap, "notificationSettings", s.NotificationSettings) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "status", s.Status) - populate(objectMap, "targetResourceId", s.TargetResourceID) - populate(objectMap, "taskType", s.TaskType) - populate(objectMap, "timeZoneId", s.TimeZoneID) - populate(objectMap, "uniqueIdentifier", s.UniqueIdentifier) - populate(objectMap, "weeklyRecurrence", s.WeeklyRecurrence) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleProperties. -func (s *ScheduleProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &s.CreatedDate) - delete(rawMsg, key) - case "dailyRecurrence": - err = unpopulate(val, "DailyRecurrence", &s.DailyRecurrence) - delete(rawMsg, key) - case "hourlyRecurrence": - err = unpopulate(val, "HourlyRecurrence", &s.HourlyRecurrence) - delete(rawMsg, key) - case "notificationSettings": - err = unpopulate(val, "NotificationSettings", &s.NotificationSettings) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) - delete(rawMsg, key) - case "targetResourceId": - err = unpopulate(val, "TargetResourceID", &s.TargetResourceID) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &s.TaskType) - delete(rawMsg, key) - case "timeZoneId": - err = unpopulate(val, "TimeZoneID", &s.TimeZoneID) - delete(rawMsg, key) - case "uniqueIdentifier": - err = unpopulate(val, "UniqueIdentifier", &s.UniqueIdentifier) - delete(rawMsg, key) - case "weeklyRecurrence": - err = unpopulate(val, "WeeklyRecurrence", &s.WeeklyRecurrence) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Secret. -func (s Secret) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SecretFragment. -func (s SecretFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceFabric. -func (s ServiceFabric) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceFabricFragment. -func (s ServiceFabricFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceRunner. -func (s ServiceRunner) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SharedPublicIPAddressConfiguration. -func (s SharedPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "inboundNatRules", s.InboundNatRules) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SubnetSharedPublicIPAddressConfiguration. -func (s SubnetSharedPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowedPorts", s.AllowedPorts) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TargetCostProperties. -func (t TargetCostProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "costThresholds", t.CostThresholds) - populateTimeRFC3339(objectMap, "cycleEndDateTime", t.CycleEndDateTime) - populateTimeRFC3339(objectMap, "cycleStartDateTime", t.CycleStartDateTime) - populate(objectMap, "cycleType", t.CycleType) - populate(objectMap, "status", t.Status) - populate(objectMap, "target", t.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TargetCostProperties. -func (t *TargetCostProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "costThresholds": - err = unpopulate(val, "CostThresholds", &t.CostThresholds) - delete(rawMsg, key) - case "cycleEndDateTime": - err = unpopulateTimeRFC3339(val, "CycleEndDateTime", &t.CycleEndDateTime) - delete(rawMsg, key) - case "cycleStartDateTime": - err = unpopulateTimeRFC3339(val, "CycleStartDateTime", &t.CycleStartDateTime) - delete(rawMsg, key) - case "cycleType": - err = unpopulate(val, "CycleType", &t.CycleType) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &t.Status) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &t.Target) - 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 UpdateResource. -func (u UpdateResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", u.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type User. -func (u User) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", u.ID) - populate(objectMap, "location", u.Location) - populate(objectMap, "name", u.Name) - populate(objectMap, "properties", u.Properties) - populate(objectMap, "tags", u.Tags) - populate(objectMap, "type", u.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type UserFragment. -func (u UserFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", u.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type UserProperties. -func (u UserProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdDate", u.CreatedDate) - populate(objectMap, "identity", u.Identity) - populate(objectMap, "provisioningState", u.ProvisioningState) - populate(objectMap, "secretStore", u.SecretStore) - populate(objectMap, "uniqueIdentifier", u.UniqueIdentifier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserProperties. -func (u *UserProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &u.CreatedDate) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &u.Identity) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &u.ProvisioningState) - delete(rawMsg, key) - case "secretStore": - err = unpopulate(val, "SecretStore", &u.SecretStore) - delete(rawMsg, key) - case "uniqueIdentifier": - err = unpopulate(val, "UniqueIdentifier", &u.UniqueIdentifier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetwork. -func (v VirtualNetwork) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkFragment. -func (v VirtualNetworkFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkProperties. -func (v VirtualNetworkProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowedSubnets", v.AllowedSubnets) - populateTimeRFC3339(objectMap, "createdDate", v.CreatedDate) - populate(objectMap, "description", v.Description) - populate(objectMap, "externalProviderResourceId", v.ExternalProviderResourceID) - populate(objectMap, "externalSubnets", v.ExternalSubnets) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "subnetOverrides", v.SubnetOverrides) - populate(objectMap, "uniqueIdentifier", v.UniqueIdentifier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkProperties. -func (v *VirtualNetworkProperties) UnmarshalJSON(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 "allowedSubnets": - err = unpopulate(val, "AllowedSubnets", &v.AllowedSubnets) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &v.CreatedDate) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &v.Description) - delete(rawMsg, key) - case "externalProviderResourceId": - err = unpopulate(val, "ExternalProviderResourceID", &v.ExternalProviderResourceID) - delete(rawMsg, key) - case "externalSubnets": - err = unpopulate(val, "ExternalSubnets", &v.ExternalSubnets) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "subnetOverrides": - err = unpopulate(val, "SubnetOverrides", &v.SubnetOverrides) - delete(rawMsg, key) - case "uniqueIdentifier": - err = unpopulate(val, "UniqueIdentifier", &v.UniqueIdentifier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WeekDetails. -func (w WeekDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "time", w.Time) - populate(objectMap, "weekdays", w.Weekdays) - return json.Marshal(objectMap) -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}