diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/CHANGELOG.md b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/CHANGELOG.md index 266346add598..c91d21202a49 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/CHANGELOG.md +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/CHANGELOG.md @@ -1,5 +1,108 @@ # Release History +## 0.6.0 (2022-07-21) +### Breaking Changes + +- Function `*SimsClient.Get` parameter(s) have been changed from `(context.Context, string, string, *SimsClientGetOptions)` to `(context.Context, string, string, string, *SimsClientGetOptions)` +- Function `*SimsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, *SimsClientBeginDeleteOptions)` to `(context.Context, string, string, string, *SimsClientBeginDeleteOptions)` +- Function `*SimsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, Sim, *SimsClientBeginCreateOrUpdateOptions)` to `(context.Context, string, string, string, Sim, *SimsClientBeginCreateOrUpdateOptions)` +- Function `*SimsClient.NewListByResourceGroupPager` has been removed +- Function `*SimsClient.NewListBySubscriptionPager` has been removed +- Function `*SimsClient.UpdateTags` has been removed +- Struct `SimsClientListByResourceGroupOptions` has been removed +- Struct `SimsClientListByResourceGroupResponse` has been removed +- Struct `SimsClientListBySubscriptionOptions` has been removed +- Struct `SimsClientListBySubscriptionResponse` has been removed +- Struct `SimsClientUpdateTagsOptions` has been removed +- Struct `SimsClientUpdateTagsResponse` has been removed +- Field `MobileNetwork` of struct `SimPropertiesFormat` has been removed +- Field `Tags` of struct `Sim` has been removed +- Field `Location` of struct `Sim` has been removed +- Field `CustomLocation` of struct `PacketCoreControlPlanePropertiesFormat` has been removed + +### Features Added + +- New const `ManagedServiceIdentityTypeSystemAssigned` +- New const `VersionStateValidationFailed` +- New const `VersionStateUnknown` +- New const `ManagedServiceIdentityTypeNone` +- New const `RecommendedVersionNotRecommended` +- New const `BillingSKUEdgeSite2GBPS` +- New const `BillingSKULargePackage` +- New const `VersionStateActive` +- New const `PlatformTypeAKSHCI` +- New const `BillingSKUFlagshipStarterPackage` +- New const `VersionStateDeprecated` +- New const `BillingSKUEdgeSite4GBPS` +- New const `BillingSKUEdgeSite3GBPS` +- New const `PlatformTypeBaseVM` +- New const `BillingSKUEvaluationPackage` +- New const `ManagedServiceIdentityTypeSystemAssignedUserAssigned` +- New const `BillingSKUMediumPackage` +- New const `ManagedServiceIdentityTypeUserAssigned` +- New const `RecommendedVersionRecommended` +- New const `VersionStatePreview` +- New const `VersionStateValidating` +- New function `PossibleRecommendedVersionValues() []RecommendedVersion` +- New function `PossibleBillingSKUValues() []BillingSKU` +- New function `*SimGroupsClient.UpdateTags(context.Context, string, string, TagsObject, *SimGroupsClientUpdateTagsOptions) (SimGroupsClientUpdateTagsResponse, error)` +- New function `*PacketCoreControlPlaneVersionsClient.NewListByResourceGroupPager(*PacketCoreControlPlaneVersionsClientListByResourceGroupOptions) *runtime.Pager[PacketCoreControlPlaneVersionsClientListByResourceGroupResponse]` +- New function `*SimGroupsClient.NewListByResourceGroupPager(string, *SimGroupsClientListByResourceGroupOptions) *runtime.Pager[SimGroupsClientListByResourceGroupResponse]` +- New function `*PacketCoreControlPlaneVersionsClient.Get(context.Context, string, *PacketCoreControlPlaneVersionsClientGetOptions) (PacketCoreControlPlaneVersionsClientGetResponse, error)` +- New function `*SimGroupsClient.Get(context.Context, string, string, *SimGroupsClientGetOptions) (SimGroupsClientGetResponse, error)` +- New function `PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType` +- New function `*SimGroupsClient.NewListBySubscriptionPager(*SimGroupsClientListBySubscriptionOptions) *runtime.Pager[SimGroupsClientListBySubscriptionResponse]` +- New function `*SimGroupsClient.BeginDelete(context.Context, string, string, *SimGroupsClientBeginDeleteOptions) (*runtime.Poller[SimGroupsClientDeleteResponse], error)` +- New function `NewPacketCoreControlPlaneVersionsClient(azcore.TokenCredential, *arm.ClientOptions) (*PacketCoreControlPlaneVersionsClient, error)` +- New function `PossibleVersionStateValues() []VersionState` +- New function `*SimsClient.NewListBySimGroupPager(string, string, *SimsClientListBySimGroupOptions) *runtime.Pager[SimsClientListBySimGroupResponse]` +- New function `NewSimGroupsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SimGroupsClient, error)` +- New function `PossiblePlatformTypeValues() []PlatformType` +- New function `*SimGroupsClient.BeginCreateOrUpdate(context.Context, string, string, SimGroup, *SimGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SimGroupsClientCreateOrUpdateResponse], error)` +- New struct `AzureStackEdgeDeviceResourceID` +- New struct `ConnectedClusterResourceID` +- New struct `KeyVaultCertificate` +- New struct `KeyVaultKey` +- New struct `LocalDiagnosticsAccessConfiguration` +- New struct `ManagedServiceIdentity` +- New struct `PacketCoreControlPlaneVersion` +- New struct `PacketCoreControlPlaneVersionListResult` +- New struct `PacketCoreControlPlaneVersionPropertiesFormat` +- New struct `PacketCoreControlPlaneVersionsClient` +- New struct `PacketCoreControlPlaneVersionsClientGetOptions` +- New struct `PacketCoreControlPlaneVersionsClientGetResponse` +- New struct `PacketCoreControlPlaneVersionsClientListByResourceGroupOptions` +- New struct `PacketCoreControlPlaneVersionsClientListByResourceGroupResponse` +- New struct `PlatformConfiguration` +- New struct `ProxyResource` +- New struct `SimGroup` +- New struct `SimGroupListResult` +- New struct `SimGroupPropertiesFormat` +- New struct `SimGroupResourceID` +- New struct `SimGroupsClient` +- New struct `SimGroupsClientBeginCreateOrUpdateOptions` +- New struct `SimGroupsClientBeginDeleteOptions` +- New struct `SimGroupsClientCreateOrUpdateResponse` +- New struct `SimGroupsClientDeleteResponse` +- New struct `SimGroupsClientGetOptions` +- New struct `SimGroupsClientGetResponse` +- New struct `SimGroupsClientListByResourceGroupOptions` +- New struct `SimGroupsClientListByResourceGroupResponse` +- New struct `SimGroupsClientListBySubscriptionOptions` +- New struct `SimGroupsClientListBySubscriptionResponse` +- New struct `SimGroupsClientUpdateTagsOptions` +- New struct `SimGroupsClientUpdateTagsResponse` +- New struct `SimsClientListBySimGroupOptions` +- New struct `SimsClientListBySimGroupResponse` +- New struct `UserAssignedIdentity` +- New field `Identity` in struct `PacketCoreControlPlane` +- New field `InteropSettings` in struct `PacketCoreControlPlanePropertiesFormat` +- New field `SKU` in struct `PacketCoreControlPlanePropertiesFormat` +- New field `LocalDiagnosticsAccess` in struct `PacketCoreControlPlanePropertiesFormat` +- New field `Platform` in struct `PacketCoreControlPlanePropertiesFormat` +- New field `DNSAddresses` in struct `AttachedDataNetworkPropertiesFormat` + + ## 0.5.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 0.5.0, which contains breaking changes. diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_attacheddatanetworks_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/attacheddatanetworks_client.go similarity index 96% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_attacheddatanetworks_client.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/attacheddatanetworks_client.go index d26bab9edc9a..6193e889db57 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_attacheddatanetworks_client.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/attacheddatanetworks_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 armmobilenetwork @@ -56,7 +57,7 @@ func NewAttachedDataNetworksClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Creates or updates an attached data network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // packetCoreControlPlaneName - The name of the packet core control plane. // packetCoreDataPlaneName - The name of the packet core data plane. @@ -80,7 +81,7 @@ func (client *AttachedDataNetworksClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Creates or updates an attached data network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *AttachedDataNetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, packetCoreControlPlaneName string, packetCoreDataPlaneName string, attachedDataNetworkName string, parameters AttachedDataNetwork, options *AttachedDataNetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, attachedDataNetworkName, parameters, options) if err != nil { @@ -124,7 +125,7 @@ func (client *AttachedDataNetworksClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -132,7 +133,7 @@ func (client *AttachedDataNetworksClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Deletes the specified attached data network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // packetCoreControlPlaneName - The name of the packet core control plane. // packetCoreDataPlaneName - The name of the packet core data plane. @@ -155,7 +156,7 @@ func (client *AttachedDataNetworksClient) BeginDelete(ctx context.Context, resou // Delete - Deletes the specified attached data network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *AttachedDataNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, packetCoreControlPlaneName string, packetCoreDataPlaneName string, attachedDataNetworkName string, options *AttachedDataNetworksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, attachedDataNetworkName, options) if err != nil { @@ -199,7 +200,7 @@ func (client *AttachedDataNetworksClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -207,7 +208,7 @@ func (client *AttachedDataNetworksClient) deleteCreateRequest(ctx context.Contex // Get - Gets information about the specified attached data network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // packetCoreControlPlaneName - The name of the packet core control plane. // packetCoreDataPlaneName - The name of the packet core data plane. @@ -257,7 +258,7 @@ func (client *AttachedDataNetworksClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,9 +273,9 @@ func (client *AttachedDataNetworksClient) getHandleResponse(resp *http.Response) return result, nil } -// NewListByPacketCoreDataPlanePager - Gets all the data networks associated with a packet core data plane. +// NewListByPacketCoreDataPlanePager - Gets all the attached data networks associated with a packet core data plane. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // packetCoreControlPlaneName - The name of the packet core control plane. // packetCoreDataPlaneName - The name of the packet core data plane. @@ -332,7 +333,7 @@ func (client *AttachedDataNetworksClient) listByPacketCoreDataPlaneCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,9 +348,9 @@ func (client *AttachedDataNetworksClient) listByPacketCoreDataPlaneHandleRespons return result, nil } -// UpdateTags - Updates an attached data network update tags. +// UpdateTags - Updates an attached data network tags. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // packetCoreControlPlaneName - The name of the packet core control plane. // packetCoreDataPlaneName - The name of the packet core data plane. @@ -400,7 +401,7 @@ func (client *AttachedDataNetworksClient) updateTagsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_attacheddatanetworks_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/attacheddatanetworks_client_example_test.go similarity index 91% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_attacheddatanetworks_client_test.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/attacheddatanetworks_client_example_test.go index 17fa3711cdd3..5ceeefe62457 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_attacheddatanetworks_client_test.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/attacheddatanetworks_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/AttachedDataNetworkDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/AttachedDataNetworkDelete.json func ExampleAttachedDataNetworksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleAttachedDataNetworksClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/AttachedDataNetworkGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/AttachedDataNetworkGet.json func ExampleAttachedDataNetworksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -67,7 +67,7 @@ func ExampleAttachedDataNetworksClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/AttachedDataNetworkCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/AttachedDataNetworkCreate.json func ExampleAttachedDataNetworksClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -86,16 +86,18 @@ func ExampleAttachedDataNetworksClient_BeginCreateOrUpdate() { armmobilenetwork.AttachedDataNetwork{ Location: to.Ptr("eastus"), Properties: &armmobilenetwork.AttachedDataNetworkPropertiesFormat{ + DNSAddresses: []*string{ + to.Ptr("1.1.1.1")}, NaptConfiguration: &armmobilenetwork.NaptConfiguration{ Enabled: to.Ptr(armmobilenetwork.NaptEnabledEnabled), PinholeLimits: to.Ptr[int32](65536), PinholeTimeouts: &armmobilenetwork.PinholeTimeouts{ - Icmp: to.Ptr[int32](60), - TCP: to.Ptr[int32](7440), - UDP: to.Ptr[int32](300), + Icmp: to.Ptr[int32](30), + TCP: to.Ptr[int32](180), + UDP: to.Ptr[int32](30), }, PortRange: &armmobilenetwork.PortRange{ - MaxPort: to.Ptr[int32](65535), + MaxPort: to.Ptr[int32](49999), MinPort: to.Ptr[int32](1024), }, PortReuseHoldTime: &armmobilenetwork.PortReuseHoldTimes{ @@ -124,7 +126,7 @@ func ExampleAttachedDataNetworksClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/AttachedDataNetworkUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/AttachedDataNetworkUpdateTags.json func ExampleAttachedDataNetworksClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -154,7 +156,7 @@ func ExampleAttachedDataNetworksClient_UpdateTags() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/AttachedDataNetworkListByPacketCoreDataPlane.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/AttachedDataNetworkListByPacketCoreDataPlane.json func ExampleAttachedDataNetworksClient_NewListByPacketCoreDataPlanePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/autorest.md b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/autorest.md index 07e46508cc7f..6a637ff04120 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/autorest.md +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/mobilenetwork/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/mobilenetwork/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/f705a46c74af9e4c096556e914d9a45c01c47b5e/specification/mobilenetwork/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/f705a46c74af9e4c096556e914d9a45c01c47b5e/specification/mobilenetwork/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.5.0 +module-version: 0.6.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_constants.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/constants.go similarity index 52% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_constants.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/constants.go index ec256b592e90..0d511c819605 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_constants.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/constants.go @@ -5,15 +5,50 @@ // 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 armmobilenetwork const ( moduleName = "armmobilenetwork" - moduleVersion = "v0.5.0" + moduleVersion = "v0.6.0" ) -// CoreNetworkType - Core network type. +// BillingSKU - The SKU of the packet core control plane resource. The SKU list may change over time when a new SKU gets added +// or an exiting SKU gets removed. +type BillingSKU string + +const ( + // BillingSKUEdgeSite2GBPS - Edge site 2Gbps plan + BillingSKUEdgeSite2GBPS BillingSKU = "EdgeSite2GBPS" + // BillingSKUEdgeSite3GBPS - Edge site 3Gbps plan + BillingSKUEdgeSite3GBPS BillingSKU = "EdgeSite3GBPS" + // BillingSKUEdgeSite4GBPS - Edge site 4Gbps plan + BillingSKUEdgeSite4GBPS BillingSKU = "EdgeSite4GBPS" + // BillingSKUEvaluationPackage - Evaluation package plan + BillingSKUEvaluationPackage BillingSKU = "EvaluationPackage" + // BillingSKUFlagshipStarterPackage - Flagship starter package plan + BillingSKUFlagshipStarterPackage BillingSKU = "FlagshipStarterPackage" + // BillingSKULargePackage - Large package plan + BillingSKULargePackage BillingSKU = "LargePackage" + // BillingSKUMediumPackage - Medium package plan + BillingSKUMediumPackage BillingSKU = "MediumPackage" +) + +// PossibleBillingSKUValues returns the possible values for the BillingSKU const type. +func PossibleBillingSKUValues() []BillingSKU { + return []BillingSKU{ + BillingSKUEdgeSite2GBPS, + BillingSKUEdgeSite3GBPS, + BillingSKUEdgeSite4GBPS, + BillingSKUEvaluationPackage, + BillingSKUFlagshipStarterPackage, + BillingSKULargePackage, + BillingSKUMediumPackage, + } +} + +// CoreNetworkType - The core network technology generation (5G core or EPC / 4G core). type CoreNetworkType string const ( @@ -51,7 +86,27 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// NaptEnabled - Whether Network Address and Port Translation is enabled. +// ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). +type ManagedServiceIdentityType string + +const ( + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" + ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned" + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" +) + +// PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type. +func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { + return []ManagedServiceIdentityType{ + ManagedServiceIdentityTypeNone, + ManagedServiceIdentityTypeSystemAssigned, + ManagedServiceIdentityTypeSystemAssignedUserAssigned, + ManagedServiceIdentityTypeUserAssigned, + } +} + +// NaptEnabled - Whether network address and port translation is enabled. type NaptEnabled string const ( @@ -85,6 +140,26 @@ func PossiblePduSessionTypeValues() []PduSessionType { } } +// PlatformType - The platform type where packet core is deployed. The contents of this enum can change. +type PlatformType string + +const ( + // PlatformTypeAKSHCI - If this option is chosen, you must set one of "azureStackEdgeDevice", "connectedCluster" or "customLocation". + // If multiple are set then "customLocation" will take precedence over "connectedCluster" which takes precedence over "azureStackEdgeDevice". + PlatformTypeAKSHCI PlatformType = "AKS-HCI" + // PlatformTypeBaseVM - If this option is chosen, you must set one of "connectedCluster" or "customLocation". If multiple + // are set then "customLocation" will take precedence over "connectedCluster". + PlatformTypeBaseVM PlatformType = "BaseVM" +) + +// PossiblePlatformTypeValues returns the possible values for the PlatformType const type. +func PossiblePlatformTypeValues() []PlatformType { + return []PlatformType{ + PlatformTypeAKSHCI, + PlatformTypeBaseVM, + } +} + // PreemptionCapability - Preemption capability. type PreemptionCapability string @@ -147,6 +222,24 @@ func PossibleProvisioningStateValues() []ProvisioningState { } } +// RecommendedVersion - Indicates whether this is the recommended version to use for new packet core control plane deployments. +type RecommendedVersion string + +const ( + // RecommendedVersionNotRecommended - This is not the recommended version to use for new packet core control plane deployments. + RecommendedVersionNotRecommended RecommendedVersion = "NotRecommended" + // RecommendedVersionRecommended - This is the recommended version to use for new packet core control plane deployments. + RecommendedVersionRecommended RecommendedVersion = "Recommended" +) + +// PossibleRecommendedVersionValues returns the possible values for the RecommendedVersion const type. +func PossibleRecommendedVersionValues() []RecommendedVersion { + return []RecommendedVersion{ + RecommendedVersionNotRecommended, + RecommendedVersionRecommended, + } +} + // SdfDirection - Service data flow direction. type SdfDirection string @@ -168,15 +261,15 @@ func PossibleSdfDirectionValues() []SdfDirection { } } -// SimState - The state of the sim resource. +// SimState - The state of the SIM resource. type SimState string const ( - // SimStateDisabled - The sim is disabled because not all configuration required for enabling is present. + // SimStateDisabled - The SIM is disabled because not all configuration required for enabling is present. SimStateDisabled SimState = "Disabled" - // SimStateEnabled - The sim is enabled. + // SimStateEnabled - The SIM is enabled. SimStateEnabled SimState = "Enabled" - // SimStateInvalid - The sim cannot be enabled because some of the associated configuration is invalid. + // SimStateInvalid - The SIM cannot be enabled because some of the associated configuration is invalid. SimStateInvalid SimState = "Invalid" ) @@ -206,3 +299,33 @@ func PossibleTrafficControlPermissionValues() []TrafficControlPermission { TrafficControlPermissionEnabled, } } + +// VersionState - The state of this packet core control plane version. +type VersionState string + +const ( + // VersionStateActive - This version is active and suitable for production use. + VersionStateActive VersionState = "Active" + // VersionStateDeprecated - This version is deprecated and is no longer supported. + VersionStateDeprecated VersionState = "Deprecated" + // VersionStatePreview - This version is a preview and is not suitable for production use. + VersionStatePreview VersionState = "Preview" + // VersionStateUnknown - The state of this version is unknown. + VersionStateUnknown VersionState = "Unknown" + // VersionStateValidating - This version is currently being validated. + VersionStateValidating VersionState = "Validating" + // VersionStateValidationFailed - This version failed validation. + VersionStateValidationFailed VersionState = "ValidationFailed" +) + +// PossibleVersionStateValues returns the possible values for the VersionState const type. +func PossibleVersionStateValues() []VersionState { + return []VersionState{ + VersionStateActive, + VersionStateDeprecated, + VersionStatePreview, + VersionStateUnknown, + VersionStateValidating, + VersionStateValidationFailed, + } +} diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_datanetworks_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/datanetworks_client.go similarity index 92% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_datanetworks_client.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/datanetworks_client.go index 67ac9d67275b..c2cce481d71b 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_datanetworks_client.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/datanetworks_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 armmobilenetwork @@ -54,13 +55,13 @@ func NewDataNetworksClient(subscriptionID string, credential azcore.TokenCredent return client, nil } -// BeginCreateOrUpdate - Creates or updates a mobile network dataNetwork. +// BeginCreateOrUpdate - Creates or updates a data network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. -// dataNetworkName - The name of the mobile network dataNetwork. -// parameters - Parameters supplied to the create or update mobile network dataNetwork operation. +// dataNetworkName - The name of the data network. +// parameters - Parameters supplied to the create or update data network operation. // options - DataNetworksClientBeginCreateOrUpdateOptions contains the optional parameters for the DataNetworksClient.BeginCreateOrUpdate // method. func (client *DataNetworksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, mobileNetworkName string, dataNetworkName string, parameters DataNetwork, options *DataNetworksClientBeginCreateOrUpdateOptions) (*runtime.Poller[DataNetworksClientCreateOrUpdateResponse], error) { @@ -77,9 +78,9 @@ func (client *DataNetworksClient) BeginCreateOrUpdate(ctx context.Context, resou } } -// CreateOrUpdate - Creates or updates a mobile network dataNetwork. +// CreateOrUpdate - Creates or updates a data network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *DataNetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, mobileNetworkName string, dataNetworkName string, parameters DataNetwork, options *DataNetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, mobileNetworkName, dataNetworkName, parameters, options) if err != nil { @@ -119,18 +120,18 @@ func (client *DataNetworksClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } -// BeginDelete - Deletes the specified mobile network dataNetwork. +// BeginDelete - Deletes the specified data network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. -// dataNetworkName - The name of the mobile network dataNetwork. +// dataNetworkName - The name of the data network. // options - DataNetworksClientBeginDeleteOptions contains the optional parameters for the DataNetworksClient.BeginDelete // method. func (client *DataNetworksClient) BeginDelete(ctx context.Context, resourceGroupName string, mobileNetworkName string, dataNetworkName string, options *DataNetworksClientBeginDeleteOptions) (*runtime.Poller[DataNetworksClientDeleteResponse], error) { @@ -147,9 +148,9 @@ func (client *DataNetworksClient) BeginDelete(ctx context.Context, resourceGroup } } -// Delete - Deletes the specified mobile network dataNetwork. +// Delete - Deletes the specified data network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *DataNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, mobileNetworkName string, dataNetworkName string, options *DataNetworksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, mobileNetworkName, dataNetworkName, options) if err != nil { @@ -189,18 +190,18 @@ func (client *DataNetworksClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Gets information about the specified mobile network dataNetwork. +// Get - Gets information about the specified data network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. -// dataNetworkName - The name of the mobile network dataNetwork. +// dataNetworkName - The name of the data network. // options - DataNetworksClientGetOptions contains the optional parameters for the DataNetworksClient.Get method. func (client *DataNetworksClient) Get(ctx context.Context, resourceGroupName string, mobileNetworkName string, dataNetworkName string, options *DataNetworksClientGetOptions) (DataNetworksClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, mobileNetworkName, dataNetworkName, options) @@ -241,7 +242,7 @@ func (client *DataNetworksClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,9 +257,9 @@ func (client *DataNetworksClient) getHandleResponse(resp *http.Response) (DataNe return result, nil } -// NewListByMobileNetworkPager - Lists all dataNetworks in the mobile network. +// NewListByMobileNetworkPager - Lists all data networks in the mobile network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // options - DataNetworksClientListByMobileNetworkOptions contains the optional parameters for the DataNetworksClient.ListByMobileNetwork @@ -311,7 +312,7 @@ func (client *DataNetworksClient) listByMobileNetworkCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,12 +327,12 @@ func (client *DataNetworksClient) listByMobileNetworkHandleResponse(resp *http.R return result, nil } -// UpdateTags - Update data network tags. +// UpdateTags - Updates data network tags. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. -// dataNetworkName - The name of the mobile network dataNetwork. +// dataNetworkName - The name of the data network. // parameters - Parameters supplied to update data network tags. // options - DataNetworksClientUpdateTagsOptions contains the optional parameters for the DataNetworksClient.UpdateTags method. func (client *DataNetworksClient) UpdateTags(ctx context.Context, resourceGroupName string, mobileNetworkName string, dataNetworkName string, parameters TagsObject, options *DataNetworksClientUpdateTagsOptions) (DataNetworksClientUpdateTagsResponse, error) { @@ -373,7 +374,7 @@ func (client *DataNetworksClient) updateTagsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_datanetworks_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/datanetworks_client_example_test.go similarity index 93% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_datanetworks_client_test.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/datanetworks_client_example_test.go index 391a3b2fd674..e1c18bc17efd 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_datanetworks_client_test.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/datanetworks_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/DataNetworkDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/DataNetworkDelete.json func ExampleDataNetworksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +42,7 @@ func ExampleDataNetworksClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/DataNetworkGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/DataNetworkGet.json func ExampleDataNetworksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -65,7 +65,7 @@ func ExampleDataNetworksClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/DataNetworkCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/DataNetworkCreate.json func ExampleDataNetworksClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -98,7 +98,7 @@ func ExampleDataNetworksClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/DataNetworkUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/DataNetworkUpdateTags.json func ExampleDataNetworksClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -127,7 +127,7 @@ func ExampleDataNetworksClient_UpdateTags() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/DataNetworkListByMobileNetwork.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/DataNetworkListByMobileNetwork.json func ExampleDataNetworksClient_NewListByMobileNetworkPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.mod b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.mod index 973d35cce70b..ac4049365c8b 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.mod +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.mod @@ -4,12 +4,12 @@ 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 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.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/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect github.com/golang-jwt/jwt v3.2.1+incompatible // indirect github.com/google/uuid v1.1.1 // indirect github.com/kylelemons/godebug v1.1.0 // indirect diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.sum b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.sum index ed5b814680ee..8828b17b1853 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.sum +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.sum @@ -1,11 +1,11 @@ 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/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.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/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= +github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_mobilenetworks_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/mobilenetworks_client.go similarity index 95% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_mobilenetworks_client.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/mobilenetworks_client.go index d2b79cb85249..40cd8f603fbb 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_mobilenetworks_client.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/mobilenetworks_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 armmobilenetwork @@ -56,7 +57,7 @@ func NewMobileNetworksClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates or updates a mobile network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // parameters - Parameters supplied to the create or update mobile network operation. @@ -78,7 +79,7 @@ func (client *MobileNetworksClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates or updates a mobile network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *MobileNetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, mobileNetworkName string, parameters MobileNetwork, options *MobileNetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, mobileNetworkName, parameters, options) if err != nil { @@ -114,7 +115,7 @@ func (client *MobileNetworksClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -122,7 +123,7 @@ func (client *MobileNetworksClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes the specified mobile network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // options - MobileNetworksClientBeginDeleteOptions contains the optional parameters for the MobileNetworksClient.BeginDelete @@ -143,7 +144,7 @@ func (client *MobileNetworksClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes the specified mobile network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *MobileNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, mobileNetworkName string, options *MobileNetworksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, mobileNetworkName, options) if err != nil { @@ -179,7 +180,7 @@ func (client *MobileNetworksClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -187,7 +188,7 @@ func (client *MobileNetworksClient) deleteCreateRequest(ctx context.Context, res // Get - Gets information about the specified mobile network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // options - MobileNetworksClientGetOptions contains the optional parameters for the MobileNetworksClient.Get method. @@ -226,7 +227,7 @@ func (client *MobileNetworksClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -243,7 +244,7 @@ func (client *MobileNetworksClient) getHandleResponse(resp *http.Response) (Mobi // NewListByResourceGroupPager - Lists all the mobile networks in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - MobileNetworksClientListByResourceGroupOptions contains the optional parameters for the MobileNetworksClient.ListByResourceGroup // method. @@ -291,7 +292,7 @@ func (client *MobileNetworksClient) listByResourceGroupCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -308,7 +309,7 @@ func (client *MobileNetworksClient) listByResourceGroupHandleResponse(resp *http // NewListBySubscriptionPager - Lists all the mobile networks in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // options - MobileNetworksClientListBySubscriptionOptions contains the optional parameters for the MobileNetworksClient.ListBySubscription // method. func (client *MobileNetworksClient) NewListBySubscriptionPager(options *MobileNetworksClientListBySubscriptionOptions) *runtime.Pager[MobileNetworksClientListBySubscriptionResponse] { @@ -351,7 +352,7 @@ func (client *MobileNetworksClient) listBySubscriptionCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -366,9 +367,9 @@ func (client *MobileNetworksClient) listBySubscriptionHandleResponse(resp *http. return result, nil } -// BeginListSimIDs - List sim ids under a mobile network. +// BeginListSimIDs - Lists the IDs of all provisioned SIMs in a mobile network // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // options - MobileNetworksClientBeginListSimIDsOptions contains the optional parameters for the MobileNetworksClient.BeginListSimIDs @@ -387,9 +388,9 @@ func (client *MobileNetworksClient) BeginListSimIDs(ctx context.Context, resourc } } -// ListSimIDs - List sim ids under a mobile network. +// ListSimIDs - Lists the IDs of all provisioned SIMs in a mobile network // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *MobileNetworksClient) listSimIDs(ctx context.Context, resourceGroupName string, mobileNetworkName string, options *MobileNetworksClientBeginListSimIDsOptions) (*http.Response, error) { req, err := client.listSimIDsCreateRequest(ctx, resourceGroupName, mobileNetworkName, options) if err != nil { @@ -425,15 +426,15 @@ func (client *MobileNetworksClient) listSimIDsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// UpdateTags - Updates a mobile network update tags. +// UpdateTags - Updates mobile network tags. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // parameters - Parameters supplied to update mobile network tags. @@ -474,7 +475,7 @@ func (client *MobileNetworksClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_mobilenetworks_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/mobilenetworks_client_example_test.go similarity index 93% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_mobilenetworks_client_test.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/mobilenetworks_client_example_test.go index 3a665a20c050..7b2436198a87 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_mobilenetworks_client_test.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/mobilenetworks_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/MobileNetworkDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/MobileNetworkDelete.json func ExampleMobileNetworksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExampleMobileNetworksClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/MobileNetworkGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/MobileNetworkGet.json func ExampleMobileNetworksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -63,7 +63,7 @@ func ExampleMobileNetworksClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/MobileNetworkCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/MobileNetworkCreate.json func ExampleMobileNetworksClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -98,7 +98,7 @@ func ExampleMobileNetworksClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/MobileNetworkUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/MobileNetworkUpdateTags.json func ExampleMobileNetworksClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -126,7 +126,7 @@ func ExampleMobileNetworksClient_UpdateTags() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/MobileNetworkListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/MobileNetworkListBySubscription.json func ExampleMobileNetworksClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -150,7 +150,7 @@ func ExampleMobileNetworksClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/MobileNetworkListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/MobileNetworkListByResourceGroup.json func ExampleMobileNetworksClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_models.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/models.go similarity index 70% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_models.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/models.go index d24f08fdac6a..75bb54db4b9f 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_models.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/models.go @@ -5,12 +5,13 @@ // 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 armmobilenetwork import "time" -// Ambr - Aggregate Maximum Bit Rate. +// Ambr - Aggregate maximum bit rate. type Ambr struct { // REQUIRED; Downlink bit rate. Downlink *string `json:"downlink,omitempty"` @@ -66,32 +67,38 @@ type AttachedDataNetworkListResult struct { // AttachedDataNetworkPropertiesFormat - Data network properties. type AttachedDataNetworkPropertiesFormat struct { - // REQUIRED; The user plane interface on the data network. In 5G networks this is called as N6 interface whereas in 4G networks - // this is called as SGi interface. + // REQUIRED; The user plane interface on the data network. For 5G networks, this is the N6 interface. For 4G networks, this + // is the SGi interface. UserPlaneDataInterface *InterfaceProperties `json:"userPlaneDataInterface,omitempty"` - // The Network Address and Port Translation configuration. If not specified the attached data network uses a default NAPT - // configuration with NAPT enabled. + // The DNS servers to signal to UEs to use for this attached data network. + DNSAddresses []*string `json:"dnsAddresses,omitempty"` + + // The network address and port translation (NAPT) configuration. If this is not specified, the attached data network will + // use a default NAPT configuration with NAPT enabled. NaptConfiguration *NaptConfiguration `json:"naptConfiguration,omitempty"` - // The user equipment address pool prefixes for the attached data network that are dynamically assigned by the core to UEs - // when they set up a PDU session. At least one of userEquipmentAddressPoolPrefix - // and userEquipmentStaticAddressPoolPrefix must be defined. If both are defined then they must be the same size. + // The user equipment (UE) address pool prefixes for the attached data network from which the packet core instance will dynamically + // assign IP addresses to UEs. The packet core instance assigns an IP + // address to a UE when the UE sets up a PDU session. You must define at least one of userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix. + // If you define both, they must be of the same + // size. UserEquipmentAddressPoolPrefix []*string `json:"userEquipmentAddressPoolPrefix,omitempty"` - // The user equipment address pool prefixes for the attached data network that are statically assigned by the core to UEs - // when they set up a PDU session. The mapping of static IP to sim is configured in - // staticIpConfiguration on the sim resource. At least one of userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix - // must be defined. If both are defined then they must be the same size. + // The user equipment (UE) address pool prefixes for the attached data network from which the packet core instance will assign + // static IP addresses to UEs. The packet core instance assigns an IP address + // to a UE when the UE sets up a PDU session. The static IP address for a specific UE is set in StaticIPConfiguration on the + // corresponding SIM resource. At least one of userEquipmentAddressPoolPrefix and + // userEquipmentStaticAddressPoolPrefix must be defined. If both are defined, they must be of the same size. UserEquipmentStaticAddressPoolPrefix []*string `json:"userEquipmentStaticAddressPoolPrefix,omitempty"` // READ-ONLY; The provisioning state of the attached data network resource. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } -// AttachedDataNetworkResourceID - Reference to an Attached Data Network resource. +// AttachedDataNetworkResourceID - Reference to an attached data network resource. type AttachedDataNetworkResourceID struct { - // REQUIRED; Attached Data Network resource ID. + // REQUIRED; Attached data network resource ID. ID *string `json:"id,omitempty"` } @@ -126,9 +133,21 @@ type AttachedDataNetworksClientUpdateTagsOptions struct { // placeholder for future optional parameters } -// CustomLocationResourceID - Reference to an Azure ARC custom location resource. +// AzureStackEdgeDeviceResourceID - Reference to an Azure Arc custom location resource. +type AzureStackEdgeDeviceResourceID struct { + // REQUIRED; Azure Stack Edge device resource ID. + ID *string `json:"id,omitempty"` +} + +// ConnectedClusterResourceID - Reference to an Azure Arc custom location resource. +type ConnectedClusterResourceID struct { + // REQUIRED; Azure Arc connected cluster resource ID. + ID *string `json:"id,omitempty"` +} + +// CustomLocationResourceID - Reference to an Azure Arc custom location resource. type CustomLocationResourceID struct { - // REQUIRED; Azure ARC custom location resource ID. + // REQUIRED; Azure Arc custom location resource ID. ID *string `json:"id,omitempty"` } @@ -156,13 +175,13 @@ type DataNetwork struct { Type *string `json:"type,omitempty" azure:"ro"` } -// DataNetworkConfiguration - Settings controlling Data Network use +// DataNetworkConfiguration - Settings controlling data network use type DataNetworkConfiguration struct { - // REQUIRED; List of Services that can be used as part of this Sim Policy. The list must not contain duplicate items and must + // REQUIRED; List of services that can be used as part of this SIM policy. The list must not contain duplicate items and must // contain at least one item. AllowedServices []*ServiceResourceID `json:"allowedServices,omitempty"` - // REQUIRED; A reference to the Data Network that these settings apply to + // REQUIRED; A reference to the data network that these settings apply to DataNetwork *DataNetworkResourceID `json:"dataNetwork,omitempty"` // REQUIRED; Aggregate maximum bit rate across all non-GBR QoS flows of a given PDU session. See 3GPP TS23.501 section 5.7.2.6 @@ -182,26 +201,26 @@ type DataNetworkConfiguration struct { DefaultSessionType *PduSessionType `json:"defaultSessionType,omitempty"` // Default QoS Flow 5G QoS Indicator value. The 5QI identifies a specific QoS forwarding treatment to be provided to a flow. - // This must not be a standardized 5QI value selecting a GBR (Guaranteed Bit - // Rate) QoS. The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. See 3GPP - // TS23.501 section 5.7.2.1 for a full description of the 5Qi parameter, and table - // 5.7.4-1 for the definition of which are the GBR 5QI values. + // This must not be a standardized 5QI value corresponding to a GBR (guaranteed + // bit rate) QoS Flow. The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. + // See 3GPP TS23.501 section 5.7.2.1 for a full description of the 5QI parameter, + // and table 5.7.4-1 for the definition of which are the GBR 5QI values. FiveQi *int32 `json:"5qi,omitempty"` - // Default QoS Flow preemption capability. The Preemption Capability of a QoS Flow controls whether it can preempt another + // Default QoS Flow preemption capability. The preemption capability of a QoS Flow controls whether it can preempt another // QoS Flow with a lower priority level. See 3GPP TS23.501 section 5.7.2.2 for a // full description of the ARP parameters. PreemptionCapability *PreemptionCapability `json:"preemptionCapability,omitempty"` - // Default QoS Flow preemption vulnerability. The Preemption Vulnerability of a QoS Flow controls whether it can be preempted - // by QoS Flow with a higher priority level. See 3GPP TS23.501 section 5.7.2.2 + // Default QoS Flow preemption vulnerability. The preemption vulnerability of a QoS Flow controls whether it can be preempted + // by a QoS Flow with a higher priority level. See 3GPP TS23.501 section 5.7.2.2 // for a full description of the ARP parameters. PreemptionVulnerability *PreemptionVulnerability `json:"preemptionVulnerability,omitempty"` } // DataNetworkListResult - Response for data network API service call. type DataNetworkListResult struct { - // A list of data networks in a resource group. + // A list of data networks. Value []*DataNetwork `json:"value,omitempty"` // READ-ONLY; The URL to get the next set of results. @@ -217,9 +236,9 @@ type DataNetworkPropertiesFormat struct { ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } -// DataNetworkResourceID - Reference to a Data Network resource. +// DataNetworkResourceID - Reference to a data network resource. type DataNetworkResourceID struct { - // REQUIRED; Data Network resource ID. + // REQUIRED; Data network resource ID. ID *string `json:"id,omitempty"` } @@ -288,10 +307,6 @@ type ErrorResponse struct { // InterfaceProperties - Interface properties type InterfaceProperties struct { - // REQUIRED; The logical name for this interface. This should match one of the interfaces configured on your Azure Stack Edge - // machine. - Name *string `json:"name,omitempty"` - // The IPv4 address. IPv4Address *string `json:"ipv4Address,omitempty"` @@ -300,6 +315,21 @@ type InterfaceProperties struct { // The IPv4 subnet. IPv4Subnet *string `json:"ipv4Subnet,omitempty"` + + // The logical name for this interface. This should match one of the interfaces configured on your Azure Stack Edge device. + Name *string `json:"name,omitempty"` +} + +// KeyVaultCertificate - An Azure key vault certificate. +type KeyVaultCertificate struct { + // The certificate URL, unversioned. For example: https://contosovault.vault.azure.net/certificates/ingress. + CertificateURL *string `json:"certificateUrl,omitempty"` +} + +// KeyVaultKey - An Azure key vault key. +type KeyVaultKey struct { + // The key URL, unversioned. For example: https://contosovault.vault.azure.net/keys/azureKey. + KeyURL *string `json:"keyUrl,omitempty"` } // ListResult - Response for mobile networks API service call. @@ -311,6 +341,33 @@ type ListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } +// LocalDiagnosticsAccessConfiguration - The kubernetes ingress configuration to control access to packet core diagnostics +// over local APIs. +type LocalDiagnosticsAccessConfiguration struct { + // The HTTPS server TLS certificate used to secure local access to diagnostics. + HTTPSServerCertificate *KeyVaultCertificate `json:"httpsServerCertificate,omitempty"` +} + +// ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) +type ManagedServiceIdentity struct { + // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + Type *ManagedServiceIdentityType `json:"type,omitempty"` + + // The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM + // resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + // The dictionary values can be empty objects ({}) in + // requests. + UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities,omitempty"` + + // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned + // identity. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + + // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *string `json:"tenantId,omitempty" azure:"ro"` +} + // MobileNetwork - Mobile network resource. type MobileNetwork struct { // REQUIRED; The geo-location where the resource lives @@ -377,20 +434,21 @@ type MobileNetworksClientUpdateTagsOptions struct { // placeholder for future optional parameters } -// NaptConfiguration - The Network Address and Port Translation settings to use for the attached data network. +// NaptConfiguration - The network address and port translation settings to use for the attached data network. type NaptConfiguration struct { - // Whether NAPT is enabled for connections to this attachedDataNetwork. + // Whether NAPT is enabled for connections to this attached data network. Enabled *NaptEnabled `json:"enabled,omitempty"` - // Maximum number of UDP and TCP pinholes that can be open simultaneously on the core interface. + // Maximum number of UDP and TCP pinholes that can be open simultaneously on the core interface. For 5G networks, this is + // the N6 interface. For 4G networks, this is the SGi interface. PinholeLimits *int32 `json:"pinholeLimits,omitempty"` // Expiry times of inactive NAPT pinholes, in seconds. All timers must be at least 1 second. PinholeTimeouts *PinholeTimeouts `json:"pinholeTimeouts,omitempty"` // Range of port numbers to use as translated ports on each translated address. If not specified and NAPT is enabled, this - // range defaults to 1,024 - 65,535. (Ports under 1,024 should not be used because - // these are special purpose ports reserved by IANA.) + // range defaults to 1,024 - 49,999. (Ports under 1,024 should not be used because + // these are special purpose ports reserved by IANA. Ports 50,000 and above are reserved for non-NAPT use.) PortRange *PortRange `json:"portRange,omitempty"` // The minimum time (in seconds) that will pass before a port that was used by a closed pinhole can be recycled for use by @@ -447,6 +505,9 @@ type PacketCoreControlPlane struct { // REQUIRED; Packet core control plane Properties. Properties *PacketCoreControlPlanePropertiesFormat `json:"properties,omitempty"` + // The identity used to retrieve the ingress certificate from Azure key vault. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` @@ -472,20 +533,29 @@ type PacketCoreControlPlaneListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// PacketCoreControlPlanePropertiesFormat - PacketCoreControlPlane properties. +// PacketCoreControlPlanePropertiesFormat - Packet core control plane properties. type PacketCoreControlPlanePropertiesFormat struct { - // REQUIRED; The control plane interface on the access network. In 5G networks this is called as N2 interface whereas in 4G - // networks this is called as S1-MME interface. + // REQUIRED; The control plane interface on the access network. For 5G networks, this is the N2 interface. For 4G networks, + // this is the S1-MME interface. ControlPlaneAccessInterface *InterfaceProperties `json:"controlPlaneAccessInterface,omitempty"` - // REQUIRED; Mobile network that this packet core control plane belongs to + // REQUIRED; Mobile network in which this packet core control plane is deployed. MobileNetwork *ResourceID `json:"mobileNetwork,omitempty"` - // The core network technology generation. + // REQUIRED; The SKU defining the throughput and SIM allowances for this packet core control plane deployment. + SKU *BillingSKU `json:"sku,omitempty"` + + // The core network technology generation (5G core or EPC / 4G core). CoreNetworkTechnology *CoreNetworkType `json:"coreNetworkTechnology,omitempty"` - // Azure ARC custom location where the packet core is deployed. - CustomLocation *CustomLocationResourceID `json:"customLocation,omitempty"` + // Settings to allow interoperability with third party components e.g. RANs and UEs. + InteropSettings interface{} `json:"interopSettings,omitempty"` + + // The kubernetes ingress configuration to control access to packet core diagnostics over local APIs. + LocalDiagnosticsAccess *LocalDiagnosticsAccessConfiguration `json:"localDiagnosticsAccess,omitempty"` + + // The platform where the packet core is deployed. + Platform *PlatformConfiguration `json:"platform,omitempty"` // The version of the packet core software that is deployed. Version *string `json:"version,omitempty"` @@ -494,6 +564,57 @@ type PacketCoreControlPlanePropertiesFormat struct { ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } +// PacketCoreControlPlaneVersion - Packet core control plane version resource. +type PacketCoreControlPlaneVersion struct { + // REQUIRED; Packet core control plane version properties. + Properties *PacketCoreControlPlaneVersionPropertiesFormat `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PacketCoreControlPlaneVersionListResult - Response for packet core control plane version API service call. +type PacketCoreControlPlaneVersionListResult struct { + // A list of supported packet core control plane versions. + Value []*PacketCoreControlPlaneVersion `json:"value,omitempty"` + + // READ-ONLY; The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// PacketCoreControlPlaneVersionPropertiesFormat - Packet core control plane version properties. +type PacketCoreControlPlaneVersionPropertiesFormat struct { + // Indicates whether this is the recommended version to use for new packet core control plane deployments. + RecommendedVersion *RecommendedVersion `json:"recommendedVersion,omitempty"` + + // The state of this packet core control plane version. + VersionState *VersionState `json:"versionState,omitempty"` + + // READ-ONLY; The provisioning state of the packet core control plane version resource. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// PacketCoreControlPlaneVersionsClientGetOptions contains the optional parameters for the PacketCoreControlPlaneVersionsClient.Get +// method. +type PacketCoreControlPlaneVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PacketCoreControlPlaneVersionsClientListByResourceGroupOptions contains the optional parameters for the PacketCoreControlPlaneVersionsClient.ListByResourceGroup +// method. +type PacketCoreControlPlaneVersionsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + // PacketCoreControlPlanesClientBeginCreateOrUpdateOptions contains the optional parameters for the PacketCoreControlPlanesClient.BeginCreateOrUpdate // method. type PacketCoreControlPlanesClientBeginCreateOrUpdateOptions struct { @@ -564,10 +685,10 @@ type PacketCoreDataPlaneListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// PacketCoreDataPlanePropertiesFormat - PacketCoreDataPlane properties. +// PacketCoreDataPlanePropertiesFormat - Packet core data plane properties. type PacketCoreDataPlanePropertiesFormat struct { - // REQUIRED; The user plane interface on the access network. In 5G networks this is called as N3 interface whereas in 4G networks - // this is called the S1-U interface. + // REQUIRED; The user plane interface on the access network. For 5G networks, this is the N3 interface. For 4G networks, this + // is the S1-U interface. UserPlaneAccessInterface *InterfaceProperties `json:"userPlaneAccessInterface,omitempty"` // READ-ONLY; The provisioning state of the packet core data plane resource. @@ -605,30 +726,31 @@ type PacketCoreDataPlanesClientUpdateTagsOptions struct { // placeholder for future optional parameters } -// PccRuleConfiguration - PCC rule configuration +// PccRuleConfiguration - Data flow policy rule configuration type PccRuleConfiguration struct { - // REQUIRED; The name of the rule. This must be unique within the parent Service. You must not use any of the following reserved + // REQUIRED; The name of the rule. This must be unique within the parent service. You must not use any of the following reserved // strings - default, requested or service. RuleName *string `json:"ruleName,omitempty"` - // REQUIRED; A precedence value that is used to decide between PCC Rules when identifying the QoS values to use for a particular - // Sim. A lower value means a higher priority. This value should be unique among all - // PCC Rules configured in the Mobile Network. + // REQUIRED; A precedence value that is used to decide between data flow policy rules when identifying the QoS values to use + // for a particular SIM. A lower value means a higher priority. This value should be unique + // among all data flow policy rules configured in the mobile network. RulePrecedence *int32 `json:"rulePrecedence,omitempty"` - // REQUIRED; The set of service data flow templates to use for this PCC Rule. + // REQUIRED; The set of data flow templates to use for this data flow policy rule. ServiceDataFlowTemplates []*ServiceDataFlowTemplate `json:"serviceDataFlowTemplates,omitempty"` - // The QoS policy to use for packets matching this rule. If this field is null then the Service will define the QoS settings. + // The QoS policy to use for packets matching this rule. If this field is null then the parent service will define the QoS + // settings. RuleQosPolicy *PccRuleQosPolicy `json:"ruleQosPolicy,omitempty"` - // Determines whether flows that match this PCC Rule are permitted. + // Determines whether flows that match this data flow policy rule are permitted. TrafficControl *TrafficControlPermission `json:"trafficControl,omitempty"` } -// PccRuleQosPolicy - PCC rule QoS policy +// PccRuleQosPolicy - Data flow policy rule QoS policy type PccRuleQosPolicy struct { - // REQUIRED; The Maximum Bit Rate (MBR) for all service data flows that use this PCC Rule or Service. + // REQUIRED; The maximum bit rate (MBR) for all service data flows that use this data flow policy rule or service. MaximumBitRate *Ambr `json:"maximumBitRate,omitempty"` // QoS Flow allocation and retention priority (ARP) level. Flows with higher priority preempt flows with lower priority, if @@ -638,52 +760,68 @@ type PccRuleQosPolicy struct { AllocationAndRetentionPriorityLevel *int32 `json:"allocationAndRetentionPriorityLevel,omitempty"` // QoS Flow 5G QoS Indicator value. The 5QI identifies a specific QoS forwarding treatment to be provided to a flow. This - // must not be a standardized 5QI value selecting a GBR (Guaranteed Bit Rate) QoS. - // The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. See 3GPP TS23.501 section - // 5.7.2.1 for a full description of the 5Qi parameter, and table 5.7.4-1 for - // the definition of which are the GBR 5QI values. + // must not be a standardized 5QI value corresponding to a GBR (guaranteed bit rate) + // QoS Flow. The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. See 3GPP + // TS23.501 section 5.7.2.1 for a full description of the 5QI parameter, and table + // 5.7.4-1 for the definition of which are the GBR 5QI values. FiveQi *int32 `json:"5qi,omitempty"` - // The Guaranteed Bit Rate (GBR) for all service data flows that use this PCC Rule. This is an optional setting. If you do - // not provide a value, there will be no GBR set for the PCC Rule that uses this - // QoS definition. + // The guaranteed bit rate (GBR) for all service data flows that use this data flow policy rule. This is an optional setting. + // If you do not provide a value, there will be no GBR set for the data flow + // policy rule that uses this QoS definition. GuaranteedBitRate *Ambr `json:"guaranteedBitRate,omitempty"` - // QoS Flow preemption capability. The Preemption Capability of a QoS Flow controls whether it can preempt another QoS Flow + // QoS Flow preemption capability. The preemption capability of a QoS Flow controls whether it can preempt another QoS Flow // with a lower priority level. See 3GPP TS23.501 section 5.7.2.2 for a full // description of the ARP parameters. PreemptionCapability *PreemptionCapability `json:"preemptionCapability,omitempty"` - // QoS Flow preemption vulnerability. The Preemption Vulnerability of a QoS Flow controls whether it can be preempted by QoS - // Flow with a higher priority level. See 3GPP TS23.501 section 5.7.2.2 for a + // QoS Flow preemption vulnerability. The preemption vulnerability of a QoS Flow controls whether it can be preempted by a + // QoS Flow with a higher priority level. See 3GPP TS23.501 section 5.7.2.2 for a // full description of the ARP parameters. PreemptionVulnerability *PreemptionVulnerability `json:"preemptionVulnerability,omitempty"` } // PinholeTimeouts - Expiry times of inactive NAPT pinholes, in seconds. All timers must be at least 1 second. type PinholeTimeouts struct { - // Pinhole timeout for ICMP pinholes in seconds. Default for ICMP Echo is 60 seconds per RFC 5508 section 3.2. + // Pinhole timeout for ICMP pinholes in seconds. Default for ICMP Echo is 60 seconds, as per RFC 5508 section 3.2. Icmp *int32 `json:"icmp,omitempty"` - // Pinhole timeout for TCP pinholes in seconds. Default for TCP is 2 hours 4 minutes per RFC 5382 section 5. + // Pinhole timeout for TCP pinholes in seconds. Default for TCP is 2 hours 4 minutes, as per RFC 5382 section 5. TCP *int32 `json:"tcp,omitempty"` - // Pinhole timeout for UDP pinholes in seconds. Default for UDP is 5 minutes per RFC 4787 section 4.3. + // Pinhole timeout for UDP pinholes in seconds. Default for UDP is 5 minutes, as per RFC 4787 section 4.3. UDP *int32 `json:"udp,omitempty"` } -// PlmnID - Public Land Mobile Network (PLMN) ID. +// PlatformConfiguration - The platform where the packet core is deployed. +type PlatformConfiguration struct { + // REQUIRED; The platform type where packet core is deployed. + Type *PlatformType `json:"type,omitempty"` + + // The Azure Stack Edge device where where the packet core is deployed. If the device is part of a fault tolerant pair, either + // device in the pair can be specified. + AzureStackEdgeDevice *AzureStackEdgeDeviceResourceID `json:"azureStackEdgeDevice,omitempty"` + + // Azure Arc connected cluster where the packet core is deployed. + ConnectedCluster *ConnectedClusterResourceID `json:"connectedCluster,omitempty"` + + // Azure Arc custom location where the packet core is deployed. + CustomLocation *CustomLocationResourceID `json:"customLocation,omitempty"` +} + +// PlmnID - Public land mobile network (PLMN) ID. type PlmnID struct { - // REQUIRED; Mobile Country Code (MCC). + // REQUIRED; Mobile country code (MCC). Mcc *string `json:"mcc,omitempty"` - // REQUIRED; Mobile Network Code (MNC). + // REQUIRED; Mobile network code (MNC). Mnc *string `json:"mnc,omitempty"` } // PortRange - Range of port numbers to use as translated ports on each translated address. If not specified and NAPT is enabled, -// this range defaults to 1,024 - 65,535. (Ports under 1,024 should not be used because -// these are special purpose ports reserved by IANA.) +// this range defaults to 1,024 - 49,999. (Ports under 1,024 should not be used because +// these are special purpose ports reserved by IANA. Ports 50,000 and above are reserved for non-NAPT use.) type PortRange struct { // The maximum port number MaxPort *int32 `json:"maxPort,omitempty"` @@ -706,8 +844,8 @@ type PortReuseHoldTimes struct { // PropertiesFormat - Mobile network properties. type PropertiesFormat struct { - // REQUIRED; The unique public land mobile network identifier for the network. This is made up of the Mobile Country Code - // and Mobile Network Code, as defined in https://www.itu.int/rec/T-REC-E.212. The values + // REQUIRED; The unique public land mobile network identifier for the network. This is made up of the mobile country code + // and mobile network code, as defined in https://www.itu.int/rec/T-REC-E.212. The values // 001-01 and 001-001 can be used for testing and the values 999-99 and 999-999 can be used on internal private networks. PublicLandMobileNetworkIdentifier *PlmnID `json:"publicLandMobileNetworkIdentifier,omitempty"` @@ -718,9 +856,25 @@ type PropertiesFormat struct { ServiceKey *string `json:"serviceKey,omitempty" azure:"ro"` } +// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a +// location +type ProxyResource struct { + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + // QosPolicy - QoS policy type QosPolicy struct { - // REQUIRED; The Maximum Bit Rate (MBR) for all service data flows that use this PCC Rule or Service. + // REQUIRED; The maximum bit rate (MBR) for all service data flows that use this data flow policy rule or service. MaximumBitRate *Ambr `json:"maximumBitRate,omitempty"` // QoS Flow allocation and retention priority (ARP) level. Flows with higher priority preempt flows with lower priority, if @@ -730,19 +884,19 @@ type QosPolicy struct { AllocationAndRetentionPriorityLevel *int32 `json:"allocationAndRetentionPriorityLevel,omitempty"` // QoS Flow 5G QoS Indicator value. The 5QI identifies a specific QoS forwarding treatment to be provided to a flow. This - // must not be a standardized 5QI value selecting a GBR (Guaranteed Bit Rate) QoS. - // The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. See 3GPP TS23.501 section - // 5.7.2.1 for a full description of the 5Qi parameter, and table 5.7.4-1 for - // the definition of which are the GBR 5QI values. + // must not be a standardized 5QI value corresponding to a GBR (guaranteed bit rate) + // QoS Flow. The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. See 3GPP + // TS23.501 section 5.7.2.1 for a full description of the 5QI parameter, and table + // 5.7.4-1 for the definition of which are the GBR 5QI values. FiveQi *int32 `json:"5qi,omitempty"` - // QoS Flow preemption capability. The Preemption Capability of a QoS Flow controls whether it can preempt another QoS Flow + // QoS Flow preemption capability. The preemption capability of a QoS Flow controls whether it can preempt another QoS Flow // with a lower priority level. See 3GPP TS23.501 section 5.7.2.2 for a full // description of the ARP parameters. PreemptionCapability *PreemptionCapability `json:"preemptionCapability,omitempty"` - // QoS Flow preemption vulnerability. The Preemption Vulnerability of a QoS Flow controls whether it can be preempted by QoS - // Flow with a higher priority level. See 3GPP TS23.501 section 5.7.2.2 for a + // QoS Flow preemption vulnerability. The preemption vulnerability of a QoS Flow controls whether it can be preempted by a + // QoS Flow with a higher priority level. See 3GPP TS23.501 section 5.7.2.2 for a // full description of the ARP parameters. PreemptionVulnerability *PreemptionVulnerability `json:"preemptionVulnerability,omitempty"` } @@ -762,9 +916,9 @@ type Resource struct { Type *string `json:"type,omitempty" azure:"ro"` } -// ResourceID - Reference to a Mobile Network resource. +// ResourceID - Reference to a mobile network resource. type ResourceID struct { - // REQUIRED; Mobile Network resource ID. + // REQUIRED; Mobile network resource ID. ID *string `json:"id,omitempty"` } @@ -792,7 +946,7 @@ type Service struct { Type *string `json:"type,omitempty" azure:"ro"` } -// ServiceDataFlowTemplate - Service data flow (SDF) template +// ServiceDataFlowTemplate - Data flow template type ServiceDataFlowTemplate struct { // REQUIRED; The direction of this flow. Direction *SdfDirection `json:"direction,omitempty"` @@ -806,12 +960,12 @@ type ServiceDataFlowTemplate struct { // REQUIRED; The remote IP address(es) to which UEs will connect for this flow. If you want to allow connections on any IP // address, use the value any. Otherwise, you must provide each of the remote IP addresses to - // which Fusion Core will connect for this flow. You must provide each IP address in CIDR notation, including the netmask - // (for example, 192.0.2.54/24). + // which the packet core instance will connect for this flow. You must provide each IP address in CIDR notation, including + // the netmask (for example, 192.0.2.54/24). RemoteIPList []*string `json:"remoteIpList,omitempty"` - // REQUIRED; The name of the SDF template. This must be unique within the parent PccRuleConfiguration. You must not use any - // of the following reserved strings - default, requested or service. + // REQUIRED; The name of the data flow template. This must be unique within the parent data flow policy rule. You must not + // use any of the following reserved strings - default, requested or service. TemplateName *string `json:"templateName,omitempty"` // The port(s) to which UEs will connect for this flow. You can specify zero or more ports or port ranges. If you specify @@ -821,9 +975,9 @@ type ServiceDataFlowTemplate struct { Ports []*string `json:"ports,omitempty"` } -// ServiceListResult - Response for Services API service call. +// ServiceListResult - Response for services API service call. type ServiceListResult struct { - // A list of Services. + // A list of services. Value []*Service `json:"value,omitempty"` // READ-ONLY; The URL to get the next set of results. @@ -832,24 +986,24 @@ type ServiceListResult struct { // ServicePropertiesFormat - Service properties. type ServicePropertiesFormat struct { - // REQUIRED; The set of PCC Rules that make up this service. + // REQUIRED; The set of data flow policy rules that make up this service. PccRules []*PccRuleConfiguration `json:"pccRules,omitempty"` // REQUIRED; A precedence value that is used to decide between services when identifying the QoS values to use for a particular - // Sim. A lower value means a higher priority. This value should be unique among all - // services configured in the Mobile Network. + // SIM. A lower value means a higher priority. This value should be unique among all + // services configured in the mobile network. ServicePrecedence *int32 `json:"servicePrecedence,omitempty"` // The QoS policy to use for packets matching this service. This can be overridden for particular flows using the ruleQosPolicy - // field in a PccRuleConfiguration. If this field is null then the UE's - // simPolicy will define the QoS settings. + // field in a PccRuleConfiguration. If this field is null then the UE's SIM + // policy will define the QoS settings. ServiceQosPolicy *QosPolicy `json:"serviceQosPolicy,omitempty"` // READ-ONLY; The provisioning state of the service resource. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } -// ServiceResourceID - Reference to a Service resource. +// ServiceResourceID - Reference to a service resource. type ServiceResourceID struct { // REQUIRED; Service resource ID. ID *string `json:"id,omitempty"` @@ -882,13 +1036,34 @@ type ServicesClientUpdateTagsOptions struct { // placeholder for future optional parameters } -// Sim resource. +// Sim - SIM resource. type Sim struct { + // REQUIRED; SIM Properties. + Properties *SimPropertiesFormat `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// SimGroup - SIM group resource. +type SimGroup struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // REQUIRED; Sim Properties. - Properties *SimPropertiesFormat `json:"properties,omitempty"` + // REQUIRED; SIM group Properties. + Properties *SimGroupPropertiesFormat `json:"properties,omitempty"` + + // The identity used to retrieve the encryption key from Azure key vault. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` // Resource tags. Tags map[string]*string `json:"tags,omitempty"` @@ -906,18 +1081,79 @@ type Sim struct { Type *string `json:"type,omitempty" azure:"ro"` } -// SimIDListResult - Response for list sim ids API service call. +// SimGroupListResult - Response for list SIM groups API service call. +type SimGroupListResult struct { + // A list of SIM groups in a resource group. + Value []*SimGroup `json:"value,omitempty"` + + // READ-ONLY; The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// SimGroupPropertiesFormat - SIM group properties. +type SimGroupPropertiesFormat struct { + // A key to encrypt the SIM data that belongs to this SIM group. + EncryptionKey *KeyVaultKey `json:"encryptionKey,omitempty"` + + // Mobile network that this SIM belongs to + MobileNetwork *ResourceID `json:"mobileNetwork,omitempty"` + + // READ-ONLY; The provisioning state of the SIM group resource. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// SimGroupResourceID - Reference to a SIM group resource. +type SimGroupResourceID struct { + // REQUIRED; SIM group resource ID. + ID *string `json:"id,omitempty"` +} + +// SimGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the SimGroupsClient.BeginCreateOrUpdate +// method. +type SimGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SimGroupsClientBeginDeleteOptions contains the optional parameters for the SimGroupsClient.BeginDelete method. +type SimGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SimGroupsClientGetOptions contains the optional parameters for the SimGroupsClient.Get method. +type SimGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SimGroupsClientListByResourceGroupOptions contains the optional parameters for the SimGroupsClient.ListByResourceGroup +// method. +type SimGroupsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// SimGroupsClientListBySubscriptionOptions contains the optional parameters for the SimGroupsClient.ListBySubscription method. +type SimGroupsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// SimGroupsClientUpdateTagsOptions contains the optional parameters for the SimGroupsClient.UpdateTags method. +type SimGroupsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// SimIDListResult - Response for list SIM IDs API service call. type SimIDListResult struct { - // A list of sim profile ids in a resource group. + // A list of SIM IDs. Value []*SubResource `json:"value,omitempty"` // READ-ONLY; The URL to get the next set of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// SimListResult - Response for list Sims API service call. +// SimListResult - Response for list SIMs API service call. type SimListResult struct { - // A list of Sims in a resource group. + // A list of SIMs in a resource group. Value []*Sim `json:"value,omitempty"` // READ-ONLY; The URL to get the next set of results. @@ -953,12 +1189,12 @@ type SimPoliciesClientUpdateTagsOptions struct { // placeholder for future optional parameters } -// SimPolicy - Sim policy resource. +// SimPolicy - SIM policy resource. type SimPolicy struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // REQUIRED; Sim policy Properties. + // REQUIRED; SIM policy Properties. Properties *SimPolicyPropertiesFormat `json:"properties,omitempty"` // Resource tags. @@ -977,16 +1213,16 @@ type SimPolicy struct { Type *string `json:"type,omitempty" azure:"ro"` } -// SimPolicyListResult - Response for SimPolicies API service call. +// SimPolicyListResult - Response for SIM policies API service call. type SimPolicyListResult struct { - // A list of SimPolicies. + // A list of SIM policies. Value []*SimPolicy `json:"value,omitempty"` // READ-ONLY; The URL to get the next set of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// SimPolicyPropertiesFormat - SimPolicy properties. +// SimPolicyPropertiesFormat - SIM policy properties. type SimPolicyPropertiesFormat struct { // REQUIRED; The default slice to use if the UE does not explicitly specify it. This slice must exist in the sliceConfigurations // map. @@ -1006,70 +1242,67 @@ type SimPolicyPropertiesFormat struct { // RAT/Frequency Selection Priority Index, defined in 3GPP TS 36.413. This is an optional setting and by default is unspecified. RfspIndex *int32 `json:"rfspIndex,omitempty"` - // READ-ONLY; The provisioning state of the sim policy resource. + // READ-ONLY; The provisioning state of the SIM policy resource. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } -// SimPolicyResourceID - Reference to a SIM Policy resource. +// SimPolicyResourceID - Reference to a SIM policy resource. type SimPolicyResourceID struct { - // REQUIRED; SIM Policy resource ID. + // REQUIRED; SIM policy resource ID. ID *string `json:"id,omitempty"` } -// SimPropertiesFormat - Sim properties. +// SimPropertiesFormat - SIM properties. type SimPropertiesFormat struct { - // REQUIRED; The International Mobile Subscriber Identity (IMSI) for the sim. + // REQUIRED; The international mobile subscriber identity (IMSI) for the SIM. InternationalMobileSubscriberIdentity *string `json:"internationalMobileSubscriberIdentity,omitempty"` - // The ki value for the sim. + // The Ki value for the SIM. AuthenticationKey *string `json:"authenticationKey,omitempty"` - // An optional free-form text field that can be used to record the device type this sim is associated with, for example 'Video - // camera'. The Azure portal allows Sims to be grouped and filtered based on + // An optional free-form text field that can be used to record the device type this SIM is associated with, for example 'Video + // camera'. The Azure portal allows SIMs to be grouped and filtered based on // this value. DeviceType *string `json:"deviceType,omitempty"` - // The Integrated Circuit Card ID (ICC Id) for the sim. + // The integrated circuit card ID (ICCID) for the SIM. IntegratedCircuitCardIdentifier *string `json:"integratedCircuitCardIdentifier,omitempty"` - // Mobile network that this sim belongs to - MobileNetwork *ResourceID `json:"mobileNetwork,omitempty"` - - // The Opc value for the sim. + // The Opc value for the SIM. OperatorKeyCode *string `json:"operatorKeyCode,omitempty"` - // The simPolicy used by this sim. + // The SIM policy used by this SIM. SimPolicy *SimPolicyResourceID `json:"simPolicy,omitempty"` - // A list of static IP addresses assigned to this sim. Each address is assigned at a defined network scope, made up of {attached + // A list of static IP addresses assigned to this SIM. Each address is assigned at a defined network scope, made up of {attached // data network, slice}. StaticIPConfiguration []*SimStaticIPProperties `json:"staticIpConfiguration,omitempty"` - // READ-ONLY; The provisioning state of the sim resource. + // READ-ONLY; The provisioning state of the SIM resource. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - // READ-ONLY; The state of the sim resource. + // READ-ONLY; The state of the SIM resource. SimState *SimState `json:"simState,omitempty" azure:"ro"` } -// SimStaticIPProperties - Static IP configuration for a sim, scoped to a particular attached data network and slice. +// SimStaticIPProperties - Static IP configuration for a SIM, scoped to a particular attached data network and slice. type SimStaticIPProperties struct { - // The attached data network on which the static IP address will be used. The combination of attachedDataNetwork and slice + // The attached data network on which the static IP address will be used. The combination of attached data network and slice // defines the network scope of the IP address. AttachedDataNetwork *AttachedDataNetworkResourceID `json:"attachedDataNetwork,omitempty"` - // The network slice on which the static IP address will be used. The combination of attachedDataNetwork and slice defines + // The network slice on which the static IP address will be used. The combination of attached data network and slice defines // the network scope of the IP address. Slice *SliceResourceID `json:"slice,omitempty"` - // The static IP configuration for the sim to use at the defined network scope. + // The static IP configuration for the SIM to use at the defined network scope. StaticIP *SimStaticIPPropertiesStaticIP `json:"staticIp,omitempty"` } -// SimStaticIPPropertiesStaticIP - The static IP configuration for the sim to use at the defined network scope. +// SimStaticIPPropertiesStaticIP - The static IP configuration for the SIM to use at the defined network scope. type SimStaticIPPropertiesStaticIP struct { - // The IPv4 address assigned to the sim at this network scope. This address must be in the userEquipmentStaticAddressPoolPrefix - // defined in the attachedDataNetwork. + // The IPv4 address assigned to the SIM at this network scope. This address must be in the userEquipmentStaticAddressPoolPrefix + // defined in the attached data network. IPv4Address *string `json:"ipv4Address,omitempty"` } @@ -1090,18 +1323,8 @@ type SimsClientGetOptions struct { // placeholder for future optional parameters } -// SimsClientListByResourceGroupOptions contains the optional parameters for the SimsClient.ListByResourceGroup method. -type SimsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// SimsClientListBySubscriptionOptions contains the optional parameters for the SimsClient.ListBySubscription method. -type SimsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// SimsClientUpdateTagsOptions contains the optional parameters for the SimsClient.UpdateTags method. -type SimsClientUpdateTagsOptions struct { +// SimsClientListBySimGroupOptions contains the optional parameters for the SimsClient.ListBySimGroup method. +type SimsClientListBySimGroupOptions struct { // placeholder for future optional parameters } @@ -1131,7 +1354,7 @@ type Site struct { // SiteListResult - Response for sites API service call. type SiteListResult struct { - // A list of sites in a resource group. + // A list of sites in a mobile network. Value []*Site `json:"value,omitempty"` // READ-ONLY; The URL to get the next set of results. @@ -1140,10 +1363,10 @@ type SiteListResult struct { // SitePropertiesFormat - Site properties. type SitePropertiesFormat struct { - // An array of ids of the network functions deployed on the site, maintained by the user. + // An array of IDs of the network functions deployed on the site, maintained by the user. NetworkFunctions []*SubResource `json:"networkFunctions,omitempty"` - // READ-ONLY; The provisioning state of the site resource. TODO: Confirm if this is needed + // READ-ONLY; The provisioning state of the site resource. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } @@ -1208,13 +1431,13 @@ type SliceConfiguration struct { // exist in the dataNetworkConfigurations map. DefaultDataNetwork *DataNetworkResourceID `json:"defaultDataNetwork,omitempty"` - // REQUIRED; A reference to the Slice that these settings apply to + // REQUIRED; A reference to the slice that these settings apply to Slice *SliceResourceID `json:"slice,omitempty"` } -// SliceListResult - Response for attached data network API service call. +// SliceListResult - Response for network slice API service call. type SliceListResult struct { - // A list of data networks in a resource group. + // A list of network slices in a mobile network. Value []*Slice `json:"value,omitempty"` // READ-ONLY; The URL to get the next set of results. @@ -1223,7 +1446,7 @@ type SliceListResult struct { // SlicePropertiesFormat - Network slice properties. type SlicePropertiesFormat struct { - // REQUIRED; The S-NSSAI (single network slice selection assistance information). Unique at the scope of a MobileNetwork. + // REQUIRED; Single-network slice selection assistance information (S-NSSAI). Unique at the scope of a mobile network. Snssai *Snssai `json:"snssai,omitempty"` // An optional description for this network slice. @@ -1233,7 +1456,7 @@ type SlicePropertiesFormat struct { ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } -// SliceResourceID - Reference to a Slice resource. +// SliceResourceID - Reference to a slice resource. type SliceResourceID struct { // REQUIRED; Slice resource ID. ID *string `json:"id,omitempty"` @@ -1266,12 +1489,12 @@ type SlicesClientUpdateTagsOptions struct { // placeholder for future optional parameters } -// Snssai - Single-Network Slice Selection Assistance Information (S-NSSAI). +// Snssai - Single-network slice selection assistance information (S-NSSAI). type Snssai struct { - // REQUIRED; Slice/Service Type (SST). + // REQUIRED; Slice/service type (SST). Sst *int32 `json:"sst,omitempty"` - // Slice Differentiator (SD). + // Slice differentiator (SD). Sd *string `json:"sd,omitempty"` } @@ -1329,3 +1552,12 @@ type TrackedResource struct { // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } + +// UserAssignedIdentity - User assigned identity properties +type UserAssignedIdentity struct { + // READ-ONLY; The client ID of the assigned identity. + ClientID *string `json:"clientId,omitempty" azure:"ro"` + + // READ-ONLY; The principal ID of the assigned identity. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` +} diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/models_serde.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/models_serde.go new file mode 100644 index 000000000000..6b8acfd81660 --- /dev/null +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/models_serde.go @@ -0,0 +1,3059 @@ +//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 armmobilenetwork + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type Ambr. +func (a Ambr) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "downlink", a.Downlink) + populate(objectMap, "uplink", a.Uplink) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Ambr. +func (a *Ambr) UnmarshalJSON(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 "downlink": + err = unpopulate(val, "Downlink", &a.Downlink) + delete(rawMsg, key) + case "uplink": + err = unpopulate(val, "Uplink", &a.Uplink) + 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 Arp. +func (a Arp) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "preemptCap", a.PreemptCap) + populate(objectMap, "preemptVuln", a.PreemptVuln) + populate(objectMap, "priorityLevel", a.PriorityLevel) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Arp. +func (a *Arp) UnmarshalJSON(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 "preemptCap": + err = unpopulate(val, "PreemptCap", &a.PreemptCap) + delete(rawMsg, key) + case "preemptVuln": + err = unpopulate(val, "PreemptVuln", &a.PreemptVuln) + delete(rawMsg, key) + case "priorityLevel": + err = unpopulate(val, "PriorityLevel", &a.PriorityLevel) + 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 AttachedDataNetwork. +func (a AttachedDataNetwork) 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 AttachedDataNetwork. +func (a *AttachedDataNetwork) UnmarshalJSON(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 AttachedDataNetworkListResult. +func (a AttachedDataNetworkListResult) 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 AttachedDataNetworkListResult. +func (a *AttachedDataNetworkListResult) UnmarshalJSON(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 AttachedDataNetworkPropertiesFormat. +func (a AttachedDataNetworkPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dnsAddresses", a.DNSAddresses) + populate(objectMap, "naptConfiguration", a.NaptConfiguration) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "userEquipmentAddressPoolPrefix", a.UserEquipmentAddressPoolPrefix) + populate(objectMap, "userEquipmentStaticAddressPoolPrefix", a.UserEquipmentStaticAddressPoolPrefix) + populate(objectMap, "userPlaneDataInterface", a.UserPlaneDataInterface) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AttachedDataNetworkPropertiesFormat. +func (a *AttachedDataNetworkPropertiesFormat) UnmarshalJSON(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 "dnsAddresses": + err = unpopulate(val, "DNSAddresses", &a.DNSAddresses) + delete(rawMsg, key) + case "naptConfiguration": + err = unpopulate(val, "NaptConfiguration", &a.NaptConfiguration) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "userEquipmentAddressPoolPrefix": + err = unpopulate(val, "UserEquipmentAddressPoolPrefix", &a.UserEquipmentAddressPoolPrefix) + delete(rawMsg, key) + case "userEquipmentStaticAddressPoolPrefix": + err = unpopulate(val, "UserEquipmentStaticAddressPoolPrefix", &a.UserEquipmentStaticAddressPoolPrefix) + delete(rawMsg, key) + case "userPlaneDataInterface": + err = unpopulate(val, "UserPlaneDataInterface", &a.UserPlaneDataInterface) + 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 AttachedDataNetworkResourceID. +func (a AttachedDataNetworkResourceID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AttachedDataNetworkResourceID. +func (a *AttachedDataNetworkResourceID) UnmarshalJSON(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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureStackEdgeDeviceResourceID. +func (a AzureStackEdgeDeviceResourceID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureStackEdgeDeviceResourceID. +func (a *AzureStackEdgeDeviceResourceID) UnmarshalJSON(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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectedClusterResourceID. +func (c ConnectedClusterResourceID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedClusterResourceID. +func (c *ConnectedClusterResourceID) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomLocationResourceID. +func (c CustomLocationResourceID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomLocationResourceID. +func (c *CustomLocationResourceID) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataNetwork. +func (d DataNetwork) 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 DataNetwork. +func (d *DataNetwork) UnmarshalJSON(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 DataNetworkConfiguration. +func (d DataNetworkConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalAllowedSessionTypes", d.AdditionalAllowedSessionTypes) + populate(objectMap, "allocationAndRetentionPriorityLevel", d.AllocationAndRetentionPriorityLevel) + populate(objectMap, "allowedServices", d.AllowedServices) + populate(objectMap, "dataNetwork", d.DataNetwork) + populate(objectMap, "defaultSessionType", d.DefaultSessionType) + populate(objectMap, "5qi", d.FiveQi) + populate(objectMap, "preemptionCapability", d.PreemptionCapability) + populate(objectMap, "preemptionVulnerability", d.PreemptionVulnerability) + populate(objectMap, "sessionAmbr", d.SessionAmbr) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataNetworkConfiguration. +func (d *DataNetworkConfiguration) UnmarshalJSON(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 "additionalAllowedSessionTypes": + err = unpopulate(val, "AdditionalAllowedSessionTypes", &d.AdditionalAllowedSessionTypes) + delete(rawMsg, key) + case "allocationAndRetentionPriorityLevel": + err = unpopulate(val, "AllocationAndRetentionPriorityLevel", &d.AllocationAndRetentionPriorityLevel) + delete(rawMsg, key) + case "allowedServices": + err = unpopulate(val, "AllowedServices", &d.AllowedServices) + delete(rawMsg, key) + case "dataNetwork": + err = unpopulate(val, "DataNetwork", &d.DataNetwork) + delete(rawMsg, key) + case "defaultSessionType": + err = unpopulate(val, "DefaultSessionType", &d.DefaultSessionType) + delete(rawMsg, key) + case "5qi": + err = unpopulate(val, "FiveQi", &d.FiveQi) + delete(rawMsg, key) + case "preemptionCapability": + err = unpopulate(val, "PreemptionCapability", &d.PreemptionCapability) + delete(rawMsg, key) + case "preemptionVulnerability": + err = unpopulate(val, "PreemptionVulnerability", &d.PreemptionVulnerability) + delete(rawMsg, key) + case "sessionAmbr": + err = unpopulate(val, "SessionAmbr", &d.SessionAmbr) + 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 DataNetworkListResult. +func (d DataNetworkListResult) 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 DataNetworkListResult. +func (d *DataNetworkListResult) UnmarshalJSON(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 DataNetworkPropertiesFormat. +func (d DataNetworkPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", d.Description) + populate(objectMap, "provisioningState", d.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataNetworkPropertiesFormat. +func (d *DataNetworkPropertiesFormat) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + 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 DataNetworkResourceID. +func (d DataNetworkResourceID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataNetworkResourceID. +func (d *DataNetworkResourceID) UnmarshalJSON(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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]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 InterfaceProperties. +func (i InterfaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ipv4Address", i.IPv4Address) + populate(objectMap, "ipv4Gateway", i.IPv4Gateway) + populate(objectMap, "ipv4Subnet", i.IPv4Subnet) + populate(objectMap, "name", i.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceProperties. +func (i *InterfaceProperties) UnmarshalJSON(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 "ipv4Address": + err = unpopulate(val, "IPv4Address", &i.IPv4Address) + delete(rawMsg, key) + case "ipv4Gateway": + err = unpopulate(val, "IPv4Gateway", &i.IPv4Gateway) + delete(rawMsg, key) + case "ipv4Subnet": + err = unpopulate(val, "IPv4Subnet", &i.IPv4Subnet) + delete(rawMsg, 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 KeyVaultCertificate. +func (k KeyVaultCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "certificateUrl", k.CertificateURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultCertificate. +func (k *KeyVaultCertificate) UnmarshalJSON(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 "certificateUrl": + err = unpopulate(val, "CertificateURL", &k.CertificateURL) + 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 KeyVaultKey. +func (k KeyVaultKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "keyUrl", k.KeyURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultKey. +func (k *KeyVaultKey) UnmarshalJSON(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 "keyUrl": + err = unpopulate(val, "KeyURL", &k.KeyURL) + 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 ListResult. +func (l ListResult) 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 ListResult. +func (l *ListResult) UnmarshalJSON(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 LocalDiagnosticsAccessConfiguration. +func (l LocalDiagnosticsAccessConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "httpsServerCertificate", l.HTTPSServerCertificate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalDiagnosticsAccessConfiguration. +func (l *LocalDiagnosticsAccessConfiguration) UnmarshalJSON(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 "httpsServerCertificate": + err = unpopulate(val, "HTTPSServerCertificate", &l.HTTPSServerCertificate) + 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 ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. +func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MobileNetwork. +func (m MobileNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MobileNetwork. +func (m *MobileNetwork) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NaptConfiguration. +func (n NaptConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabled", n.Enabled) + populate(objectMap, "pinholeLimits", n.PinholeLimits) + populate(objectMap, "pinholeTimeouts", n.PinholeTimeouts) + populate(objectMap, "portRange", n.PortRange) + populate(objectMap, "portReuseHoldTime", n.PortReuseHoldTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NaptConfiguration. +func (n *NaptConfiguration) UnmarshalJSON(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 "enabled": + err = unpopulate(val, "Enabled", &n.Enabled) + delete(rawMsg, key) + case "pinholeLimits": + err = unpopulate(val, "PinholeLimits", &n.PinholeLimits) + delete(rawMsg, key) + case "pinholeTimeouts": + err = unpopulate(val, "PinholeTimeouts", &n.PinholeTimeouts) + delete(rawMsg, key) + case "portRange": + err = unpopulate(val, "PortRange", &n.PortRange) + delete(rawMsg, key) + case "portReuseHoldTime": + err = unpopulate(val, "PortReuseHoldTime", &n.PortReuseHoldTime) + 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, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + 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 "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) + } + 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 OperationList. +func (o OperationList) 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 OperationList. +func (o *OperationList) UnmarshalJSON(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 PacketCoreControlPlane. +func (p PacketCoreControlPlane) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCoreControlPlane. +func (p *PacketCoreControlPlane) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PacketCoreControlPlaneListResult. +func (p PacketCoreControlPlaneListResult) 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 PacketCoreControlPlaneListResult. +func (p *PacketCoreControlPlaneListResult) UnmarshalJSON(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 PacketCoreControlPlanePropertiesFormat. +func (p PacketCoreControlPlanePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "controlPlaneAccessInterface", p.ControlPlaneAccessInterface) + populate(objectMap, "coreNetworkTechnology", p.CoreNetworkTechnology) + populate(objectMap, "interopSettings", &p.InteropSettings) + populate(objectMap, "localDiagnosticsAccess", p.LocalDiagnosticsAccess) + populate(objectMap, "mobileNetwork", p.MobileNetwork) + populate(objectMap, "platform", p.Platform) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "version", p.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCoreControlPlanePropertiesFormat. +func (p *PacketCoreControlPlanePropertiesFormat) UnmarshalJSON(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 "controlPlaneAccessInterface": + err = unpopulate(val, "ControlPlaneAccessInterface", &p.ControlPlaneAccessInterface) + delete(rawMsg, key) + case "coreNetworkTechnology": + err = unpopulate(val, "CoreNetworkTechnology", &p.CoreNetworkTechnology) + delete(rawMsg, key) + case "interopSettings": + err = unpopulate(val, "InteropSettings", &p.InteropSettings) + delete(rawMsg, key) + case "localDiagnosticsAccess": + err = unpopulate(val, "LocalDiagnosticsAccess", &p.LocalDiagnosticsAccess) + delete(rawMsg, key) + case "mobileNetwork": + err = unpopulate(val, "MobileNetwork", &p.MobileNetwork) + delete(rawMsg, key) + case "platform": + err = unpopulate(val, "Platform", &p.Platform) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) + 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 PacketCoreControlPlaneVersion. +func (p PacketCoreControlPlaneVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCoreControlPlaneVersion. +func (p *PacketCoreControlPlaneVersion) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PacketCoreControlPlaneVersionListResult. +func (p PacketCoreControlPlaneVersionListResult) 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 PacketCoreControlPlaneVersionListResult. +func (p *PacketCoreControlPlaneVersionListResult) UnmarshalJSON(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 PacketCoreControlPlaneVersionPropertiesFormat. +func (p PacketCoreControlPlaneVersionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "recommendedVersion", p.RecommendedVersion) + populate(objectMap, "versionState", p.VersionState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCoreControlPlaneVersionPropertiesFormat. +func (p *PacketCoreControlPlaneVersionPropertiesFormat) UnmarshalJSON(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 "recommendedVersion": + err = unpopulate(val, "RecommendedVersion", &p.RecommendedVersion) + delete(rawMsg, key) + case "versionState": + err = unpopulate(val, "VersionState", &p.VersionState) + 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 PacketCoreDataPlane. +func (p PacketCoreDataPlane) 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 PacketCoreDataPlane. +func (p *PacketCoreDataPlane) UnmarshalJSON(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 PacketCoreDataPlaneListResult. +func (p PacketCoreDataPlaneListResult) 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 PacketCoreDataPlaneListResult. +func (p *PacketCoreDataPlaneListResult) UnmarshalJSON(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 PacketCoreDataPlanePropertiesFormat. +func (p PacketCoreDataPlanePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "userPlaneAccessInterface", p.UserPlaneAccessInterface) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCoreDataPlanePropertiesFormat. +func (p *PacketCoreDataPlanePropertiesFormat) UnmarshalJSON(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 "userPlaneAccessInterface": + err = unpopulate(val, "UserPlaneAccessInterface", &p.UserPlaneAccessInterface) + 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 PccRuleConfiguration. +func (p PccRuleConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ruleName", p.RuleName) + populate(objectMap, "rulePrecedence", p.RulePrecedence) + populate(objectMap, "ruleQosPolicy", p.RuleQosPolicy) + populate(objectMap, "serviceDataFlowTemplates", p.ServiceDataFlowTemplates) + populate(objectMap, "trafficControl", p.TrafficControl) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PccRuleConfiguration. +func (p *PccRuleConfiguration) UnmarshalJSON(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 "ruleName": + err = unpopulate(val, "RuleName", &p.RuleName) + delete(rawMsg, key) + case "rulePrecedence": + err = unpopulate(val, "RulePrecedence", &p.RulePrecedence) + delete(rawMsg, key) + case "ruleQosPolicy": + err = unpopulate(val, "RuleQosPolicy", &p.RuleQosPolicy) + delete(rawMsg, key) + case "serviceDataFlowTemplates": + err = unpopulate(val, "ServiceDataFlowTemplates", &p.ServiceDataFlowTemplates) + delete(rawMsg, key) + case "trafficControl": + err = unpopulate(val, "TrafficControl", &p.TrafficControl) + 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 PccRuleQosPolicy. +func (p PccRuleQosPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allocationAndRetentionPriorityLevel", p.AllocationAndRetentionPriorityLevel) + populate(objectMap, "5qi", p.FiveQi) + populate(objectMap, "guaranteedBitRate", p.GuaranteedBitRate) + populate(objectMap, "maximumBitRate", p.MaximumBitRate) + populate(objectMap, "preemptionCapability", p.PreemptionCapability) + populate(objectMap, "preemptionVulnerability", p.PreemptionVulnerability) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PccRuleQosPolicy. +func (p *PccRuleQosPolicy) UnmarshalJSON(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 "allocationAndRetentionPriorityLevel": + err = unpopulate(val, "AllocationAndRetentionPriorityLevel", &p.AllocationAndRetentionPriorityLevel) + delete(rawMsg, key) + case "5qi": + err = unpopulate(val, "FiveQi", &p.FiveQi) + delete(rawMsg, key) + case "guaranteedBitRate": + err = unpopulate(val, "GuaranteedBitRate", &p.GuaranteedBitRate) + delete(rawMsg, key) + case "maximumBitRate": + err = unpopulate(val, "MaximumBitRate", &p.MaximumBitRate) + delete(rawMsg, key) + case "preemptionCapability": + err = unpopulate(val, "PreemptionCapability", &p.PreemptionCapability) + delete(rawMsg, key) + case "preemptionVulnerability": + err = unpopulate(val, "PreemptionVulnerability", &p.PreemptionVulnerability) + 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 PinholeTimeouts. +func (p PinholeTimeouts) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "icmp", p.Icmp) + populate(objectMap, "tcp", p.TCP) + populate(objectMap, "udp", p.UDP) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PinholeTimeouts. +func (p *PinholeTimeouts) UnmarshalJSON(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 "icmp": + err = unpopulate(val, "Icmp", &p.Icmp) + delete(rawMsg, key) + case "tcp": + err = unpopulate(val, "TCP", &p.TCP) + delete(rawMsg, key) + case "udp": + err = unpopulate(val, "UDP", &p.UDP) + 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 PlatformConfiguration. +func (p PlatformConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureStackEdgeDevice", p.AzureStackEdgeDevice) + populate(objectMap, "connectedCluster", p.ConnectedCluster) + populate(objectMap, "customLocation", p.CustomLocation) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PlatformConfiguration. +func (p *PlatformConfiguration) UnmarshalJSON(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 "azureStackEdgeDevice": + err = unpopulate(val, "AzureStackEdgeDevice", &p.AzureStackEdgeDevice) + delete(rawMsg, key) + case "connectedCluster": + err = unpopulate(val, "ConnectedCluster", &p.ConnectedCluster) + delete(rawMsg, key) + case "customLocation": + err = unpopulate(val, "CustomLocation", &p.CustomLocation) + 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 PlmnID. +func (p PlmnID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "mcc", p.Mcc) + populate(objectMap, "mnc", p.Mnc) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PlmnID. +func (p *PlmnID) UnmarshalJSON(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 "mcc": + err = unpopulate(val, "Mcc", &p.Mcc) + delete(rawMsg, key) + case "mnc": + err = unpopulate(val, "Mnc", &p.Mnc) + 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 PortRange. +func (p PortRange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "maxPort", p.MaxPort) + populate(objectMap, "minPort", p.MinPort) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortRange. +func (p *PortRange) UnmarshalJSON(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 "maxPort": + err = unpopulate(val, "MaxPort", &p.MaxPort) + delete(rawMsg, key) + case "minPort": + err = unpopulate(val, "MinPort", &p.MinPort) + 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 PortReuseHoldTimes. +func (p PortReuseHoldTimes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tcp", p.TCP) + populate(objectMap, "udp", p.UDP) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortReuseHoldTimes. +func (p *PortReuseHoldTimes) UnmarshalJSON(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 "tcp": + err = unpopulate(val, "TCP", &p.TCP) + delete(rawMsg, key) + case "udp": + err = unpopulate(val, "UDP", &p.UDP) + 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 PropertiesFormat. +func (p PropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "publicLandMobileNetworkIdentifier", p.PublicLandMobileNetworkIdentifier) + populate(objectMap, "serviceKey", p.ServiceKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PropertiesFormat. +func (p *PropertiesFormat) UnmarshalJSON(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 "publicLandMobileNetworkIdentifier": + err = unpopulate(val, "PublicLandMobileNetworkIdentifier", &p.PublicLandMobileNetworkIdentifier) + delete(rawMsg, key) + case "serviceKey": + err = unpopulate(val, "ServiceKey", &p.ServiceKey) + 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, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QosPolicy. +func (q QosPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allocationAndRetentionPriorityLevel", q.AllocationAndRetentionPriorityLevel) + populate(objectMap, "5qi", q.FiveQi) + populate(objectMap, "maximumBitRate", q.MaximumBitRate) + populate(objectMap, "preemptionCapability", q.PreemptionCapability) + populate(objectMap, "preemptionVulnerability", q.PreemptionVulnerability) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QosPolicy. +func (q *QosPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allocationAndRetentionPriorityLevel": + err = unpopulate(val, "AllocationAndRetentionPriorityLevel", &q.AllocationAndRetentionPriorityLevel) + delete(rawMsg, key) + case "5qi": + err = unpopulate(val, "FiveQi", &q.FiveQi) + delete(rawMsg, key) + case "maximumBitRate": + err = unpopulate(val, "MaximumBitRate", &q.MaximumBitRate) + delete(rawMsg, key) + case "preemptionCapability": + err = unpopulate(val, "PreemptionCapability", &q.PreemptionCapability) + delete(rawMsg, key) + case "preemptionVulnerability": + err = unpopulate(val, "PreemptionVulnerability", &q.PreemptionVulnerability) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceID. +func (r ResourceID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceID. +func (r *ResourceID) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Service. +func (s Service) 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 Service. +func (s *Service) UnmarshalJSON(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 ServiceDataFlowTemplate. +func (s ServiceDataFlowTemplate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "direction", s.Direction) + populate(objectMap, "ports", s.Ports) + populate(objectMap, "protocol", s.Protocol) + populate(objectMap, "remoteIpList", s.RemoteIPList) + populate(objectMap, "templateName", s.TemplateName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceDataFlowTemplate. +func (s *ServiceDataFlowTemplate) UnmarshalJSON(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 "direction": + err = unpopulate(val, "Direction", &s.Direction) + delete(rawMsg, key) + case "ports": + err = unpopulate(val, "Ports", &s.Ports) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &s.Protocol) + delete(rawMsg, key) + case "remoteIpList": + err = unpopulate(val, "RemoteIPList", &s.RemoteIPList) + delete(rawMsg, key) + case "templateName": + err = unpopulate(val, "TemplateName", &s.TemplateName) + 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 ServiceListResult. +func (s ServiceListResult) 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 ServiceListResult. +func (s *ServiceListResult) UnmarshalJSON(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 ServicePropertiesFormat. +func (s ServicePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "pccRules", s.PccRules) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "servicePrecedence", s.ServicePrecedence) + populate(objectMap, "serviceQosPolicy", s.ServiceQosPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePropertiesFormat. +func (s *ServicePropertiesFormat) UnmarshalJSON(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 "pccRules": + err = unpopulate(val, "PccRules", &s.PccRules) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "servicePrecedence": + err = unpopulate(val, "ServicePrecedence", &s.ServicePrecedence) + delete(rawMsg, key) + case "serviceQosPolicy": + err = unpopulate(val, "ServiceQosPolicy", &s.ServiceQosPolicy) + 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 ServiceResourceID. +func (s ServiceResourceID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResourceID. +func (s *ServiceResourceID) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Sim. +func (s Sim) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Sim. +func (s *Sim) UnmarshalJSON(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 "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 "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 SimGroup. +func (s SimGroup) 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 SimGroup. +func (s *SimGroup) UnmarshalJSON(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 SimGroupListResult. +func (s SimGroupListResult) 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 SimGroupListResult. +func (s *SimGroupListResult) UnmarshalJSON(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 SimGroupPropertiesFormat. +func (s SimGroupPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "encryptionKey", s.EncryptionKey) + populate(objectMap, "mobileNetwork", s.MobileNetwork) + populate(objectMap, "provisioningState", s.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SimGroupPropertiesFormat. +func (s *SimGroupPropertiesFormat) UnmarshalJSON(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 "encryptionKey": + err = unpopulate(val, "EncryptionKey", &s.EncryptionKey) + delete(rawMsg, key) + case "mobileNetwork": + err = unpopulate(val, "MobileNetwork", &s.MobileNetwork) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + 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 SimGroupResourceID. +func (s SimGroupResourceID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SimGroupResourceID. +func (s *SimGroupResourceID) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SimIDListResult. +func (s SimIDListResult) 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 SimIDListResult. +func (s *SimIDListResult) UnmarshalJSON(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 SimListResult. +func (s SimListResult) 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 SimListResult. +func (s *SimListResult) UnmarshalJSON(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 SimPolicy. +func (s SimPolicy) 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 SimPolicy. +func (s *SimPolicy) UnmarshalJSON(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 SimPolicyListResult. +func (s SimPolicyListResult) 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 SimPolicyListResult. +func (s *SimPolicyListResult) UnmarshalJSON(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 SimPolicyPropertiesFormat. +func (s SimPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "defaultSlice", s.DefaultSlice) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "registrationTimer", s.RegistrationTimer) + populate(objectMap, "rfspIndex", s.RfspIndex) + populate(objectMap, "sliceConfigurations", s.SliceConfigurations) + populate(objectMap, "ueAmbr", s.UeAmbr) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SimPolicyPropertiesFormat. +func (s *SimPolicyPropertiesFormat) UnmarshalJSON(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 "defaultSlice": + err = unpopulate(val, "DefaultSlice", &s.DefaultSlice) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "registrationTimer": + err = unpopulate(val, "RegistrationTimer", &s.RegistrationTimer) + delete(rawMsg, key) + case "rfspIndex": + err = unpopulate(val, "RfspIndex", &s.RfspIndex) + delete(rawMsg, key) + case "sliceConfigurations": + err = unpopulate(val, "SliceConfigurations", &s.SliceConfigurations) + delete(rawMsg, key) + case "ueAmbr": + err = unpopulate(val, "UeAmbr", &s.UeAmbr) + 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 SimPolicyResourceID. +func (s SimPolicyResourceID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SimPolicyResourceID. +func (s *SimPolicyResourceID) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SimPropertiesFormat. +func (s SimPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationKey", s.AuthenticationKey) + populate(objectMap, "deviceType", s.DeviceType) + populate(objectMap, "integratedCircuitCardIdentifier", s.IntegratedCircuitCardIdentifier) + populate(objectMap, "internationalMobileSubscriberIdentity", s.InternationalMobileSubscriberIdentity) + populate(objectMap, "operatorKeyCode", s.OperatorKeyCode) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "simPolicy", s.SimPolicy) + populate(objectMap, "simState", s.SimState) + populate(objectMap, "staticIpConfiguration", s.StaticIPConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SimPropertiesFormat. +func (s *SimPropertiesFormat) UnmarshalJSON(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 "authenticationKey": + err = unpopulate(val, "AuthenticationKey", &s.AuthenticationKey) + delete(rawMsg, key) + case "deviceType": + err = unpopulate(val, "DeviceType", &s.DeviceType) + delete(rawMsg, key) + case "integratedCircuitCardIdentifier": + err = unpopulate(val, "IntegratedCircuitCardIdentifier", &s.IntegratedCircuitCardIdentifier) + delete(rawMsg, key) + case "internationalMobileSubscriberIdentity": + err = unpopulate(val, "InternationalMobileSubscriberIdentity", &s.InternationalMobileSubscriberIdentity) + delete(rawMsg, key) + case "operatorKeyCode": + err = unpopulate(val, "OperatorKeyCode", &s.OperatorKeyCode) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "simPolicy": + err = unpopulate(val, "SimPolicy", &s.SimPolicy) + delete(rawMsg, key) + case "simState": + err = unpopulate(val, "SimState", &s.SimState) + delete(rawMsg, key) + case "staticIpConfiguration": + err = unpopulate(val, "StaticIPConfiguration", &s.StaticIPConfiguration) + 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 SimStaticIPProperties. +func (s SimStaticIPProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "attachedDataNetwork", s.AttachedDataNetwork) + populate(objectMap, "slice", s.Slice) + populate(objectMap, "staticIp", s.StaticIP) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SimStaticIPProperties. +func (s *SimStaticIPProperties) UnmarshalJSON(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 "attachedDataNetwork": + err = unpopulate(val, "AttachedDataNetwork", &s.AttachedDataNetwork) + delete(rawMsg, key) + case "slice": + err = unpopulate(val, "Slice", &s.Slice) + delete(rawMsg, key) + case "staticIp": + err = unpopulate(val, "StaticIP", &s.StaticIP) + 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 SimStaticIPPropertiesStaticIP. +func (s SimStaticIPPropertiesStaticIP) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ipv4Address", s.IPv4Address) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SimStaticIPPropertiesStaticIP. +func (s *SimStaticIPPropertiesStaticIP) UnmarshalJSON(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 "ipv4Address": + err = unpopulate(val, "IPv4Address", &s.IPv4Address) + 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 Site. +func (s Site) 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 Site. +func (s *Site) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + 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 SiteListResult. +func (s SiteListResult) 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 SiteListResult. +func (s *SiteListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + 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 SitePropertiesFormat. +func (s SitePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "networkFunctions", s.NetworkFunctions) + populate(objectMap, "provisioningState", s.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SitePropertiesFormat. +func (s *SitePropertiesFormat) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "networkFunctions": + err = unpopulate(val, "NetworkFunctions", &s.NetworkFunctions) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + 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 Slice. +func (s Slice) 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 Slice. +func (s *Slice) UnmarshalJSON(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 SliceConfiguration. +func (s SliceConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataNetworkConfigurations", s.DataNetworkConfigurations) + populate(objectMap, "defaultDataNetwork", s.DefaultDataNetwork) + populate(objectMap, "slice", s.Slice) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SliceConfiguration. +func (s *SliceConfiguration) UnmarshalJSON(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 "dataNetworkConfigurations": + err = unpopulate(val, "DataNetworkConfigurations", &s.DataNetworkConfigurations) + delete(rawMsg, key) + case "defaultDataNetwork": + err = unpopulate(val, "DefaultDataNetwork", &s.DefaultDataNetwork) + delete(rawMsg, key) + case "slice": + err = unpopulate(val, "Slice", &s.Slice) + 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 SliceListResult. +func (s SliceListResult) 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 SliceListResult. +func (s *SliceListResult) UnmarshalJSON(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 SlicePropertiesFormat. +func (s SlicePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", s.Description) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "snssai", s.Snssai) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SlicePropertiesFormat. +func (s *SlicePropertiesFormat) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "snssai": + err = unpopulate(val, "Snssai", &s.Snssai) + 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 SliceResourceID. +func (s SliceResourceID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SliceResourceID. +func (s *SliceResourceID) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Snssai. +func (s Snssai) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "sd", s.Sd) + populate(objectMap, "sst", s.Sst) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Snssai. +func (s *Snssai) UnmarshalJSON(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 "sd": + err = unpopulate(val, "Sd", &s.Sd) + delete(rawMsg, key) + case "sst": + err = unpopulate(val, "Sst", &s.Sst) + 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 SubResource. +func (s SubResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubResource. +func (s *SubResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + } + if err != nil { + 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 TagsObject. +func (t TagsObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", t.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagsObject. +func (t *TagsObject) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. +func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity. +func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, 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/mobilenetwork/armmobilenetwork/zz_generated_operations_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/operations_client.go similarity index 97% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_operations_client.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/operations_client.go index f8797d725480..569f08bfd184 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_operations_client.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/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 armmobilenetwork @@ -50,7 +51,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Gets a list of the operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +89,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/operations_client_example_test.go similarity index 95% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_operations_client_test.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/operations_client_example_test.go index 4bc76e63cd04..4a5996d79753 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/operations_client_example_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/OperationList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/OperationList.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_packetcorecontrolplanes_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcorecontrolplanes_client.go similarity index 94% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_packetcorecontrolplanes_client.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcorecontrolplanes_client.go index 7e8c772748b8..7f26705ccfc3 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_packetcorecontrolplanes_client.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcorecontrolplanes_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 armmobilenetwork @@ -54,9 +55,9 @@ func NewPacketCoreControlPlanesClient(subscriptionID string, credential azcore.T return client, nil } -// BeginCreateOrUpdate - Creates or updates a PacketCoreControlPlane. +// BeginCreateOrUpdate - Creates or updates a packet core control plane. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // packetCoreControlPlaneName - The name of the packet core control plane. // parameters - Parameters supplied to the create or update packet core control plane operation. @@ -76,9 +77,9 @@ func (client *PacketCoreControlPlanesClient) BeginCreateOrUpdate(ctx context.Con } } -// CreateOrUpdate - Creates or updates a PacketCoreControlPlane. +// CreateOrUpdate - Creates or updates a packet core control plane. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *PacketCoreControlPlanesClient) createOrUpdate(ctx context.Context, resourceGroupName string, packetCoreControlPlaneName string, parameters PacketCoreControlPlane, options *PacketCoreControlPlanesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, packetCoreControlPlaneName, parameters, options) if err != nil { @@ -114,7 +115,7 @@ func (client *PacketCoreControlPlanesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -122,7 +123,7 @@ func (client *PacketCoreControlPlanesClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes the specified packet core control plane. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // packetCoreControlPlaneName - The name of the packet core control plane. // options - PacketCoreControlPlanesClientBeginDeleteOptions contains the optional parameters for the PacketCoreControlPlanesClient.BeginDelete @@ -143,7 +144,7 @@ func (client *PacketCoreControlPlanesClient) BeginDelete(ctx context.Context, re // Delete - Deletes the specified packet core control plane. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *PacketCoreControlPlanesClient) deleteOperation(ctx context.Context, resourceGroupName string, packetCoreControlPlaneName string, options *PacketCoreControlPlanesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, packetCoreControlPlaneName, options) if err != nil { @@ -179,7 +180,7 @@ func (client *PacketCoreControlPlanesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -187,7 +188,7 @@ func (client *PacketCoreControlPlanesClient) deleteCreateRequest(ctx context.Con // Get - Gets information about the specified packet core control plane. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // packetCoreControlPlaneName - The name of the packet core control plane. // options - PacketCoreControlPlanesClientGetOptions contains the optional parameters for the PacketCoreControlPlanesClient.Get @@ -227,7 +228,7 @@ func (client *PacketCoreControlPlanesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,9 +243,9 @@ func (client *PacketCoreControlPlanesClient) getHandleResponse(resp *http.Respon return result, nil } -// NewListByResourceGroupPager - Lists all the packetCoreControlPlanes in a resource group. +// NewListByResourceGroupPager - Lists all the packet core control planes in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - PacketCoreControlPlanesClientListByResourceGroupOptions contains the optional parameters for the PacketCoreControlPlanesClient.ListByResourceGroup // method. @@ -292,7 +293,7 @@ func (client *PacketCoreControlPlanesClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,9 +308,9 @@ func (client *PacketCoreControlPlanesClient) listByResourceGroupHandleResponse(r return result, nil } -// NewListBySubscriptionPager - Lists all the packetCoreControlPlanes in a subscription. +// NewListBySubscriptionPager - Lists all the packet core control planes in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // options - PacketCoreControlPlanesClientListBySubscriptionOptions contains the optional parameters for the PacketCoreControlPlanesClient.ListBySubscription // method. func (client *PacketCoreControlPlanesClient) NewListBySubscriptionPager(options *PacketCoreControlPlanesClientListBySubscriptionOptions) *runtime.Pager[PacketCoreControlPlanesClientListBySubscriptionResponse] { @@ -352,7 +353,7 @@ func (client *PacketCoreControlPlanesClient) listBySubscriptionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -367,12 +368,12 @@ func (client *PacketCoreControlPlanesClient) listBySubscriptionHandleResponse(re return result, nil } -// UpdateTags - Updates a PacketCoreControlPlane update tags. +// UpdateTags - Updates packet core control planes tags. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // packetCoreControlPlaneName - The name of the packet core control plane. -// parameters - Parameters supplied to update PacketCoreControlPlane tags. +// parameters - Parameters supplied to update packet core control plane tags. // options - PacketCoreControlPlanesClientUpdateTagsOptions contains the optional parameters for the PacketCoreControlPlanesClient.UpdateTags // method. func (client *PacketCoreControlPlanesClient) UpdateTags(ctx context.Context, resourceGroupName string, packetCoreControlPlaneName string, parameters TagsObject, options *PacketCoreControlPlanesClientUpdateTagsOptions) (PacketCoreControlPlanesClientUpdateTagsResponse, error) { @@ -410,7 +411,7 @@ func (client *PacketCoreControlPlanesClient) updateTagsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_packetcorecontrolplanes_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcorecontrolplanes_client_example_test.go similarity index 80% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_packetcorecontrolplanes_client_test.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcorecontrolplanes_client_example_test.go index 36b0b4ee5e5e..3c36a04766b8 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_packetcorecontrolplanes_client_test.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcorecontrolplanes_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreControlPlaneDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/PacketCoreControlPlaneDelete.json func ExamplePacketCoreControlPlanesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExamplePacketCoreControlPlanesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreControlPlaneGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/PacketCoreControlPlaneGet.json func ExamplePacketCoreControlPlanesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -63,7 +63,7 @@ func ExamplePacketCoreControlPlanesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreControlPlaneCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/PacketCoreControlPlaneCreate.json func ExamplePacketCoreControlPlanesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -84,12 +84,27 @@ func ExamplePacketCoreControlPlanesClient_BeginCreateOrUpdate() { Name: to.Ptr("N2"), }, CoreNetworkTechnology: to.Ptr(armmobilenetwork.CoreNetworkTypeFiveGC), - CustomLocation: &armmobilenetwork.CustomLocationResourceID{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ExtendedLocation/customLocations/TestCustomLocation"), + LocalDiagnosticsAccess: &armmobilenetwork.LocalDiagnosticsAccessConfiguration{ + HTTPSServerCertificate: &armmobilenetwork.KeyVaultCertificate{ + CertificateURL: to.Ptr("https://contosovault.vault.azure.net/certificates/ingress"), + }, }, MobileNetwork: &armmobilenetwork.ResourceID{ ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork"), }, + Platform: &armmobilenetwork.PlatformConfiguration{ + Type: to.Ptr(armmobilenetwork.PlatformTypeAKSHCI), + AzureStackEdgeDevice: &armmobilenetwork.AzureStackEdgeDeviceResourceID{ + ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/TestAzureStackEdgeDevice"), + }, + ConnectedCluster: &armmobilenetwork.ConnectedClusterResourceID{ + ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/TestConnectedCluster"), + }, + CustomLocation: &armmobilenetwork.CustomLocationResourceID{ + ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ExtendedLocation/customLocations/TestCustomLocation"), + }, + }, + SKU: to.Ptr(armmobilenetwork.BillingSKU("testSku")), Version: to.Ptr("0.2.0"), }, }, @@ -105,7 +120,7 @@ func ExamplePacketCoreControlPlanesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreControlPlaneUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/PacketCoreControlPlaneUpdateTags.json func ExamplePacketCoreControlPlanesClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -133,7 +148,7 @@ func ExamplePacketCoreControlPlanesClient_UpdateTags() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreControlPlaneListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/PacketCoreControlPlaneListBySubscription.json func ExamplePacketCoreControlPlanesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -157,7 +172,7 @@ func ExamplePacketCoreControlPlanesClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreControlPlaneListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/PacketCoreControlPlaneListByResourceGroup.json func ExamplePacketCoreControlPlanesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcorecontrolplaneversions_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcorecontrolplaneversions_client.go new file mode 100644 index 000000000000..9b237a40bda0 --- /dev/null +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcorecontrolplaneversions_client.go @@ -0,0 +1,157 @@ +//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 armmobilenetwork + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// PacketCoreControlPlaneVersionsClient contains the methods for the PacketCoreControlPlaneVersions group. +// Don't use this type directly, use NewPacketCoreControlPlaneVersionsClient() instead. +type PacketCoreControlPlaneVersionsClient struct { + host string + pl runtime.Pipeline +} + +// NewPacketCoreControlPlaneVersionsClient creates a new instance of PacketCoreControlPlaneVersionsClient with the specified values. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewPacketCoreControlPlaneVersionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PacketCoreControlPlaneVersionsClient, 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 := &PacketCoreControlPlaneVersionsClient{ + host: ep, + pl: pl, + } + return client, nil +} + +// Get - Gets information about the specified packet core control plane version. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01-preview +// versionName - The name of the packet core control plane version. +// options - PacketCoreControlPlaneVersionsClientGetOptions contains the optional parameters for the PacketCoreControlPlaneVersionsClient.Get +// method. +func (client *PacketCoreControlPlaneVersionsClient) Get(ctx context.Context, versionName string, options *PacketCoreControlPlaneVersionsClientGetOptions) (PacketCoreControlPlaneVersionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, versionName, options) + if err != nil { + return PacketCoreControlPlaneVersionsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PacketCoreControlPlaneVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PacketCoreControlPlaneVersionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PacketCoreControlPlaneVersionsClient) getCreateRequest(ctx context.Context, versionName string, options *PacketCoreControlPlaneVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/{versionName}" + if versionName == "" { + return nil, errors.New("parameter versionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{versionName}", url.PathEscape(versionName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PacketCoreControlPlaneVersionsClient) getHandleResponse(resp *http.Response) (PacketCoreControlPlaneVersionsClientGetResponse, error) { + result := PacketCoreControlPlaneVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PacketCoreControlPlaneVersion); err != nil { + return PacketCoreControlPlaneVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all supported packet core control planes versions. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01-preview +// options - PacketCoreControlPlaneVersionsClientListByResourceGroupOptions contains the optional parameters for the PacketCoreControlPlaneVersionsClient.ListByResourceGroup +// method. +func (client *PacketCoreControlPlaneVersionsClient) NewListByResourceGroupPager(options *PacketCoreControlPlaneVersionsClientListByResourceGroupOptions) *runtime.Pager[PacketCoreControlPlaneVersionsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[PacketCoreControlPlaneVersionsClientListByResourceGroupResponse]{ + More: func(page PacketCoreControlPlaneVersionsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PacketCoreControlPlaneVersionsClientListByResourceGroupResponse) (PacketCoreControlPlaneVersionsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PacketCoreControlPlaneVersionsClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PacketCoreControlPlaneVersionsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PacketCoreControlPlaneVersionsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *PacketCoreControlPlaneVersionsClient) listByResourceGroupCreateRequest(ctx context.Context, options *PacketCoreControlPlaneVersionsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *PacketCoreControlPlaneVersionsClient) listByResourceGroupHandleResponse(resp *http.Response) (PacketCoreControlPlaneVersionsClientListByResourceGroupResponse, error) { + result := PacketCoreControlPlaneVersionsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PacketCoreControlPlaneVersionListResult); err != nil { + return PacketCoreControlPlaneVersionsClientListByResourceGroupResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcorecontrolplaneversions_client_example_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcorecontrolplaneversions_client_example_test.go new file mode 100644 index 000000000000..8bede0bccd6b --- /dev/null +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcorecontrolplaneversions_client_example_test.go @@ -0,0 +1,62 @@ +//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 armmobilenetwork_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/PacketCoreControlPlaneVersionGet.json +func ExamplePacketCoreControlPlaneVersionsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armmobilenetwork.NewPacketCoreControlPlaneVersionsClient(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "PMN-4-11-1", + 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/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/PacketCoreControlPlaneVersionListByResourceGroup.json +func ExamplePacketCoreControlPlaneVersionsClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armmobilenetwork.NewPacketCoreControlPlaneVersionsClient(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByResourceGroupPager(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/mobilenetwork/armmobilenetwork/zz_generated_packetcoredataplanes_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcoredataplanes_client.go similarity index 95% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_packetcoredataplanes_client.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcoredataplanes_client.go index 0bf82bb5869a..8e9678c273fb 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_packetcoredataplanes_client.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcoredataplanes_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 armmobilenetwork @@ -54,9 +55,9 @@ func NewPacketCoreDataPlanesClient(subscriptionID string, credential azcore.Toke return client, nil } -// BeginCreateOrUpdate - Creates or updates a PacketCoreDataPlane. +// BeginCreateOrUpdate - Creates or updates a packet core data plane. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // packetCoreControlPlaneName - The name of the packet core control plane. // packetCoreDataPlaneName - The name of the packet core data plane. @@ -77,9 +78,9 @@ func (client *PacketCoreDataPlanesClient) BeginCreateOrUpdate(ctx context.Contex } } -// CreateOrUpdate - Creates or updates a PacketCoreDataPlane. +// CreateOrUpdate - Creates or updates a packet core data plane. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *PacketCoreDataPlanesClient) createOrUpdate(ctx context.Context, resourceGroupName string, packetCoreControlPlaneName string, packetCoreDataPlaneName string, parameters PacketCoreDataPlane, options *PacketCoreDataPlanesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, parameters, options) if err != nil { @@ -119,7 +120,7 @@ func (client *PacketCoreDataPlanesClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -127,7 +128,7 @@ func (client *PacketCoreDataPlanesClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Deletes the specified packet core data plane. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // packetCoreControlPlaneName - The name of the packet core control plane. // packetCoreDataPlaneName - The name of the packet core data plane. @@ -149,7 +150,7 @@ func (client *PacketCoreDataPlanesClient) BeginDelete(ctx context.Context, resou // Delete - Deletes the specified packet core data plane. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *PacketCoreDataPlanesClient) deleteOperation(ctx context.Context, resourceGroupName string, packetCoreControlPlaneName string, packetCoreDataPlaneName string, options *PacketCoreDataPlanesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, options) if err != nil { @@ -189,7 +190,7 @@ func (client *PacketCoreDataPlanesClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,7 +198,7 @@ func (client *PacketCoreDataPlanesClient) deleteCreateRequest(ctx context.Contex // Get - Gets information about the specified packet core data plane. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // packetCoreControlPlaneName - The name of the packet core control plane. // packetCoreDataPlaneName - The name of the packet core data plane. @@ -242,7 +243,7 @@ func (client *PacketCoreDataPlanesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,9 +258,9 @@ func (client *PacketCoreDataPlanesClient) getHandleResponse(resp *http.Response) return result, nil } -// NewListByPacketCoreControlPlanePager - Lists all the packetCoreDataPlanes associated with a packetCoreControlPlane. +// NewListByPacketCoreControlPlanePager - Lists all the packet core data planes associated with a packet core control plane. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // packetCoreControlPlaneName - The name of the packet core control plane. // options - PacketCoreDataPlanesClientListByPacketCoreControlPlaneOptions contains the optional parameters for the PacketCoreDataPlanesClient.ListByPacketCoreControlPlane @@ -312,7 +313,7 @@ func (client *PacketCoreDataPlanesClient) listByPacketCoreControlPlaneCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,13 +328,13 @@ func (client *PacketCoreDataPlanesClient) listByPacketCoreControlPlaneHandleResp return result, nil } -// UpdateTags - Updates a PacketCoreDataPlane update tags. +// UpdateTags - Updates packet core data planes tags. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // packetCoreControlPlaneName - The name of the packet core control plane. // packetCoreDataPlaneName - The name of the packet core data plane. -// parameters - Parameters supplied to update PacketCoreDataPlane tags. +// parameters - Parameters supplied to update packet core data plane tags. // options - PacketCoreDataPlanesClientUpdateTagsOptions contains the optional parameters for the PacketCoreDataPlanesClient.UpdateTags // method. func (client *PacketCoreDataPlanesClient) UpdateTags(ctx context.Context, resourceGroupName string, packetCoreControlPlaneName string, packetCoreDataPlaneName string, parameters TagsObject, options *PacketCoreDataPlanesClientUpdateTagsOptions) (PacketCoreDataPlanesClientUpdateTagsResponse, error) { @@ -375,7 +376,7 @@ func (client *PacketCoreDataPlanesClient) updateTagsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_packetcoredataplanes_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcoredataplanes_client_example_test.go similarity index 94% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_packetcoredataplanes_client_test.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcoredataplanes_client_example_test.go index c0e30162e244..a1657aa133f4 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_packetcoredataplanes_client_test.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/packetcoredataplanes_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreDataPlaneDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/PacketCoreDataPlaneDelete.json func ExamplePacketCoreDataPlanesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +42,7 @@ func ExamplePacketCoreDataPlanesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreDataPlaneGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/PacketCoreDataPlaneGet.json func ExamplePacketCoreDataPlanesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -65,7 +65,7 @@ func ExamplePacketCoreDataPlanesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreDataPlaneCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/PacketCoreDataPlaneCreate.json func ExamplePacketCoreDataPlanesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -100,7 +100,7 @@ func ExamplePacketCoreDataPlanesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreDataPlaneUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/PacketCoreDataPlaneUpdateTags.json func ExamplePacketCoreDataPlanesClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -129,7 +129,7 @@ func ExamplePacketCoreDataPlanesClient_UpdateTags() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreDataPlaneListByPacketCoreControlPlane.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/PacketCoreDataPlaneListByPacketCoreControlPlane.json func ExamplePacketCoreDataPlanesClient_NewListByPacketCoreControlPlanePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_response_types.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/response_types.go similarity index 85% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_response_types.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/response_types.go index 1be7cc9c093e..00de97cc52cc 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_response_types.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/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 armmobilenetwork @@ -98,6 +99,16 @@ type OperationsClientListResponse struct { OperationList } +// PacketCoreControlPlaneVersionsClientGetResponse contains the response from method PacketCoreControlPlaneVersionsClient.Get. +type PacketCoreControlPlaneVersionsClientGetResponse struct { + PacketCoreControlPlaneVersion +} + +// PacketCoreControlPlaneVersionsClientListByResourceGroupResponse contains the response from method PacketCoreControlPlaneVersionsClient.ListByResourceGroup. +type PacketCoreControlPlaneVersionsClientListByResourceGroupResponse struct { + PacketCoreControlPlaneVersionListResult +} + // PacketCoreControlPlanesClientCreateOrUpdateResponse contains the response from method PacketCoreControlPlanesClient.CreateOrUpdate. type PacketCoreControlPlanesClientCreateOrUpdateResponse struct { PacketCoreControlPlane @@ -178,6 +189,36 @@ type ServicesClientUpdateTagsResponse struct { Service } +// SimGroupsClientCreateOrUpdateResponse contains the response from method SimGroupsClient.CreateOrUpdate. +type SimGroupsClientCreateOrUpdateResponse struct { + SimGroup +} + +// SimGroupsClientDeleteResponse contains the response from method SimGroupsClient.Delete. +type SimGroupsClientDeleteResponse struct { + // placeholder for future response values +} + +// SimGroupsClientGetResponse contains the response from method SimGroupsClient.Get. +type SimGroupsClientGetResponse struct { + SimGroup +} + +// SimGroupsClientListByResourceGroupResponse contains the response from method SimGroupsClient.ListByResourceGroup. +type SimGroupsClientListByResourceGroupResponse struct { + SimGroupListResult +} + +// SimGroupsClientListBySubscriptionResponse contains the response from method SimGroupsClient.ListBySubscription. +type SimGroupsClientListBySubscriptionResponse struct { + SimGroupListResult +} + +// SimGroupsClientUpdateTagsResponse contains the response from method SimGroupsClient.UpdateTags. +type SimGroupsClientUpdateTagsResponse struct { + SimGroup +} + // SimPoliciesClientCreateOrUpdateResponse contains the response from method SimPoliciesClient.CreateOrUpdate. type SimPoliciesClientCreateOrUpdateResponse struct { SimPolicy @@ -218,21 +259,11 @@ type SimsClientGetResponse struct { Sim } -// SimsClientListByResourceGroupResponse contains the response from method SimsClient.ListByResourceGroup. -type SimsClientListByResourceGroupResponse struct { +// SimsClientListBySimGroupResponse contains the response from method SimsClient.ListBySimGroup. +type SimsClientListBySimGroupResponse struct { SimListResult } -// SimsClientListBySubscriptionResponse contains the response from method SimsClient.ListBySubscription. -type SimsClientListBySubscriptionResponse struct { - SimListResult -} - -// SimsClientUpdateTagsResponse contains the response from method SimsClient.UpdateTags. -type SimsClientUpdateTagsResponse struct { - Sim -} - // SitesClientCreateOrUpdateResponse contains the response from method SitesClient.CreateOrUpdate. type SitesClientCreateOrUpdateResponse struct { Site diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_services_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/services_client.go similarity index 96% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_services_client.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/services_client.go index 8d39347ddffc..0688a5a449b2 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_services_client.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/services_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 armmobilenetwork @@ -54,9 +55,9 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, return client, nil } -// BeginCreateOrUpdate - Creates or updates a Service. +// BeginCreateOrUpdate - Creates or updates a service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // serviceName - The name of the service. You must not use any of the following reserved strings - default, requested or service @@ -77,9 +78,9 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG } } -// CreateOrUpdate - Creates or updates a Service. +// CreateOrUpdate - Creates or updates a service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, mobileNetworkName string, serviceName string, parameters Service, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, mobileNetworkName, serviceName, parameters, options) if err != nil { @@ -119,7 +120,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -127,7 +128,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Deletes the specified service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // serviceName - The name of the service. You must not use any of the following reserved strings - default, requested or service @@ -148,7 +149,7 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *ServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, mobileNetworkName string, serviceName string, options *ServicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, mobileNetworkName, serviceName, options) if err != nil { @@ -188,7 +189,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -196,7 +197,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets information about the specified service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // serviceName - The name of the service. You must not use any of the following reserved strings - default, requested or service @@ -240,7 +241,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +258,7 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // NewListByMobileNetworkPager - Gets all the services in a mobile network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // options - ServicesClientListByMobileNetworkOptions contains the optional parameters for the ServicesClient.ListByMobileNetwork @@ -310,7 +311,7 @@ func (client *ServicesClient) listByMobileNetworkCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,9 +326,9 @@ func (client *ServicesClient) listByMobileNetworkHandleResponse(resp *http.Respo return result, nil } -// UpdateTags - Update service tags. +// UpdateTags - Updates service tags. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // serviceName - The name of the service. You must not use any of the following reserved strings - default, requested or service @@ -372,7 +373,7 @@ func (client *ServicesClient) updateTagsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_services_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/services_client_example_test.go similarity index 95% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_services_client_test.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/services_client_example_test.go index 7e80d0c9f2f8..c59e54d8f053 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_services_client_test.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/services_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/ServiceDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/ServiceDelete.json func ExampleServicesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +42,7 @@ func ExampleServicesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/ServiceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/ServiceGet.json func ExampleServicesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -65,7 +65,7 @@ func ExampleServicesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/ServiceCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/ServiceCreate.json func ExampleServicesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -134,7 +134,7 @@ func ExampleServicesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/ServiceUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/ServiceUpdateTags.json func ExampleServicesClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -163,7 +163,7 @@ func ExampleServicesClient_UpdateTags() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/ServiceListByMobileNetwork.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/ServiceListByMobileNetwork.json func ExampleServicesClient_NewListByMobileNetworkPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/simgroups_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/simgroups_client.go new file mode 100644 index 000000000000..2310a957502d --- /dev/null +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/simgroups_client.go @@ -0,0 +1,424 @@ +//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 armmobilenetwork + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// SimGroupsClient contains the methods for the SimGroups group. +// Don't use this type directly, use NewSimGroupsClient() instead. +type SimGroupsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewSimGroupsClient creates a new instance of SimGroupsClient with the specified values. +// subscriptionID - The ID of the target subscription. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewSimGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SimGroupsClient, 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 := &SimGroupsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a SIM group. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// simGroupName - The name of the SIM Group. +// parameters - Parameters supplied to the create or update SIM group operation. +// options - SimGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the SimGroupsClient.BeginCreateOrUpdate +// method. +func (client *SimGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, simGroupName string, parameters SimGroup, options *SimGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SimGroupsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, simGroupName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SimGroupsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SimGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Creates or updates a SIM group. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01-preview +func (client *SimGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, simGroupName string, parameters SimGroup, options *SimGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, simGroupName, parameters, 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 *SimGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, simGroupName string, parameters SimGroup, options *SimGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}" + 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 simGroupName == "" { + return nil, errors.New("parameter simGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{simGroupName}", url.PathEscape(simGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified SIM group. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// simGroupName - The name of the SIM Group. +// options - SimGroupsClientBeginDeleteOptions contains the optional parameters for the SimGroupsClient.BeginDelete method. +func (client *SimGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, simGroupName string, options *SimGroupsClientBeginDeleteOptions) (*runtime.Poller[SimGroupsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, simGroupName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SimGroupsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[SimGroupsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Deletes the specified SIM group. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01-preview +func (client *SimGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, simGroupName string, options *SimGroupsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, simGroupName, 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 *SimGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, simGroupName string, options *SimGroupsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}" + 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 simGroupName == "" { + return nil, errors.New("parameter simGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{simGroupName}", url.PathEscape(simGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about the specified SIM group. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// simGroupName - The name of the SIM Group. +// options - SimGroupsClientGetOptions contains the optional parameters for the SimGroupsClient.Get method. +func (client *SimGroupsClient) Get(ctx context.Context, resourceGroupName string, simGroupName string, options *SimGroupsClientGetOptions) (SimGroupsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, simGroupName, options) + if err != nil { + return SimGroupsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SimGroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SimGroupsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SimGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, simGroupName string, options *SimGroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}" + 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 simGroupName == "" { + return nil, errors.New("parameter simGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{simGroupName}", url.PathEscape(simGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SimGroupsClient) getHandleResponse(resp *http.Response) (SimGroupsClientGetResponse, error) { + result := SimGroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SimGroup); err != nil { + return SimGroupsClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Gets all the SIM groups in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// options - SimGroupsClientListByResourceGroupOptions contains the optional parameters for the SimGroupsClient.ListByResourceGroup +// method. +func (client *SimGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *SimGroupsClientListByResourceGroupOptions) *runtime.Pager[SimGroupsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[SimGroupsClientListByResourceGroupResponse]{ + More: func(page SimGroupsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SimGroupsClientListByResourceGroupResponse) (SimGroupsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SimGroupsClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SimGroupsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SimGroupsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *SimGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SimGroupsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *SimGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (SimGroupsClientListByResourceGroupResponse, error) { + result := SimGroupsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SimGroupListResult); err != nil { + return SimGroupsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Gets all the SIM groups in a subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01-preview +// options - SimGroupsClientListBySubscriptionOptions contains the optional parameters for the SimGroupsClient.ListBySubscription +// method. +func (client *SimGroupsClient) NewListBySubscriptionPager(options *SimGroupsClientListBySubscriptionOptions) *runtime.Pager[SimGroupsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[SimGroupsClientListBySubscriptionResponse]{ + More: func(page SimGroupsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SimGroupsClientListBySubscriptionResponse) (SimGroupsClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SimGroupsClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SimGroupsClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SimGroupsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *SimGroupsClient) listBySubscriptionCreateRequest(ctx context.Context, options *SimGroupsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.MobileNetwork/simGroups" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *SimGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (SimGroupsClientListBySubscriptionResponse, error) { + result := SimGroupsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SimGroupListResult); err != nil { + return SimGroupsClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates SIM group tags. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// simGroupName - The name of the SIM Group. +// parameters - Parameters supplied to update SIM group tags. +// options - SimGroupsClientUpdateTagsOptions contains the optional parameters for the SimGroupsClient.UpdateTags method. +func (client *SimGroupsClient) UpdateTags(ctx context.Context, resourceGroupName string, simGroupName string, parameters TagsObject, options *SimGroupsClientUpdateTagsOptions) (SimGroupsClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, simGroupName, parameters, options) + if err != nil { + return SimGroupsClientUpdateTagsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SimGroupsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SimGroupsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *SimGroupsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, simGroupName string, parameters TagsObject, options *SimGroupsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}" + 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 simGroupName == "" { + return nil, errors.New("parameter simGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{simGroupName}", url.PathEscape(simGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *SimGroupsClient) updateTagsHandleResponse(resp *http.Response) (SimGroupsClientUpdateTagsResponse, error) { + result := SimGroupsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SimGroup); err != nil { + return SimGroupsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/simgroups_client_example_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/simgroups_client_example_test.go new file mode 100644 index 000000000000..7e460b541330 --- /dev/null +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/simgroups_client_example_test.go @@ -0,0 +1,178 @@ +//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 armmobilenetwork_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/mobilenetwork/armmobilenetwork" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SimGroupDelete.json +func ExampleSimGroupsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armmobilenetwork.NewSimGroupsClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDelete(ctx, + "testResourceGroupName", + "testSimGroup", + 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/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SimGroupGet.json +func ExampleSimGroupsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armmobilenetwork.NewSimGroupsClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "testResourceGroupName", + "testSimGroupName", + 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/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SimGroupCreate.json +func ExampleSimGroupsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armmobilenetwork.NewSimGroupsClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginCreateOrUpdate(ctx, + "rg1", + "testSimGroup", + armmobilenetwork.SimGroup{ + Location: to.Ptr("eastus"), + Properties: &armmobilenetwork.SimGroupPropertiesFormat{ + EncryptionKey: &armmobilenetwork.KeyVaultKey{ + KeyURL: to.Ptr("https://contosovault.vault.azure.net/keys/azureKey"), + }, + MobileNetwork: &armmobilenetwork.ResourceID{ + ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork"), + }, + }, + }, + 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/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SimGroupUpdateTags.json +func ExampleSimGroupsClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armmobilenetwork.NewSimGroupsClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.UpdateTags(ctx, + "rg1", + "testSimGroup", + armmobilenetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SimGroupListBySubscription.json +func ExampleSimGroupsClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armmobilenetwork.NewSimGroupsClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListBySubscriptionPager(nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SimGroupListByResourceGroup.json +func ExampleSimGroupsClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armmobilenetwork.NewSimGroupsClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByResourceGroupPager("rg1", + 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/mobilenetwork/armmobilenetwork/zz_generated_simpolicies_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/simpolicies_client.go similarity index 94% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_simpolicies_client.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/simpolicies_client.go index b61d81952b2d..b98e73f8a994 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_simpolicies_client.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/simpolicies_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 armmobilenetwork @@ -54,13 +55,13 @@ func NewSimPoliciesClient(subscriptionID string, credential azcore.TokenCredenti return client, nil } -// BeginCreateOrUpdate - Creates or updates a SimPolicy. +// BeginCreateOrUpdate - Creates or updates a SIM policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // simPolicyName - The name of the SIM policy. -// parameters - Parameters supplied to the create or update sim policy operation. +// parameters - Parameters supplied to the create or update SIM policy operation. // options - SimPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the SimPoliciesClient.BeginCreateOrUpdate // method. func (client *SimPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, mobileNetworkName string, simPolicyName string, parameters SimPolicy, options *SimPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SimPoliciesClientCreateOrUpdateResponse], error) { @@ -77,9 +78,9 @@ func (client *SimPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resour } } -// CreateOrUpdate - Creates or updates a SimPolicy. +// CreateOrUpdate - Creates or updates a SIM policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *SimPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, mobileNetworkName string, simPolicyName string, parameters SimPolicy, options *SimPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, mobileNetworkName, simPolicyName, parameters, options) if err != nil { @@ -119,15 +120,15 @@ func (client *SimPoliciesClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } -// BeginDelete - Deletes the specified sim policy. +// BeginDelete - Deletes the specified SIM policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // simPolicyName - The name of the SIM policy. @@ -146,9 +147,9 @@ func (client *SimPoliciesClient) BeginDelete(ctx context.Context, resourceGroupN } } -// Delete - Deletes the specified sim policy. +// Delete - Deletes the specified SIM policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *SimPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, mobileNetworkName string, simPolicyName string, options *SimPoliciesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, mobileNetworkName, simPolicyName, options) if err != nil { @@ -188,15 +189,15 @@ func (client *SimPoliciesClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Gets information about the specified sim policy. +// Get - Gets information about the specified SIM policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // simPolicyName - The name of the SIM policy. @@ -240,7 +241,7 @@ func (client *SimPoliciesClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,9 +256,9 @@ func (client *SimPoliciesClient) getHandleResponse(resp *http.Response) (SimPoli return result, nil } -// NewListByMobileNetworkPager - Gets all the simPolicies in a mobile network. +// NewListByMobileNetworkPager - Gets all the SIM policies in a mobile network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // options - SimPoliciesClientListByMobileNetworkOptions contains the optional parameters for the SimPoliciesClient.ListByMobileNetwork @@ -310,7 +311,7 @@ func (client *SimPoliciesClient) listByMobileNetworkCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,13 +326,13 @@ func (client *SimPoliciesClient) listByMobileNetworkHandleResponse(resp *http.Re return result, nil } -// UpdateTags - Update sim policy tags. +// UpdateTags - Updates SIM policy tags. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // simPolicyName - The name of the SIM policy. -// parameters - Parameters supplied to update Sim Policy tags. +// parameters - Parameters supplied to update SIM policy tags. // options - SimPoliciesClientUpdateTagsOptions contains the optional parameters for the SimPoliciesClient.UpdateTags method. func (client *SimPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, mobileNetworkName string, simPolicyName string, parameters TagsObject, options *SimPoliciesClientUpdateTagsOptions) (SimPoliciesClientUpdateTagsResponse, error) { req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, mobileNetworkName, simPolicyName, parameters, options) @@ -372,7 +373,7 @@ func (client *SimPoliciesClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_simpolicies_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/simpolicies_client_example_test.go similarity index 95% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_simpolicies_client_test.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/simpolicies_client_example_test.go index 09ccc72a555f..4297b81f320a 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_simpolicies_client_test.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/simpolicies_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimPolicyDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SimPolicyDelete.json func ExampleSimPoliciesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +42,7 @@ func ExampleSimPoliciesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimPolicyGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SimPolicyGet.json func ExampleSimPoliciesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -65,7 +65,7 @@ func ExampleSimPoliciesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimPolicyCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SimPolicyCreate.json func ExampleSimPoliciesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -134,7 +134,7 @@ func ExampleSimPoliciesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimPolicyUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SimPolicyUpdateTags.json func ExampleSimPoliciesClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -163,7 +163,7 @@ func ExampleSimPoliciesClient_UpdateTags() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimPolicyListByMobileNetwork.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SimPolicyListByMobileNetwork.json func ExampleSimPoliciesClient_NewListByMobileNetworkPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_sims_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/sims_client.go similarity index 52% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_sims_client.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/sims_client.go index 46d29805c037..f052a1350d4d 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_sims_client.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/sims_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 armmobilenetwork @@ -54,17 +55,18 @@ func NewSimsClient(subscriptionID string, credential azcore.TokenCredential, opt return client, nil } -// BeginCreateOrUpdate - Creates or updates a Sim. +// BeginCreateOrUpdate - Creates or updates a SIM. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. +// simGroupName - The name of the SIM Group. // simName - The name of the SIM. -// parameters - Parameters supplied to the create or update sim operation. +// parameters - Parameters supplied to the create or update SIM operation. // options - SimsClientBeginCreateOrUpdateOptions contains the optional parameters for the SimsClient.BeginCreateOrUpdate // method. -func (client *SimsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, simName string, parameters Sim, options *SimsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SimsClientCreateOrUpdateResponse], error) { +func (client *SimsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, simGroupName string, simName string, parameters Sim, options *SimsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SimsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, simName, parameters, options) + resp, err := client.createOrUpdate(ctx, resourceGroupName, simGroupName, simName, parameters, options) if err != nil { return nil, err } @@ -76,11 +78,11 @@ func (client *SimsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroup } } -// CreateOrUpdate - Creates or updates a Sim. +// CreateOrUpdate - Creates or updates a SIM. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview -func (client *SimsClient) createOrUpdate(ctx context.Context, resourceGroupName string, simName string, parameters Sim, options *SimsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, simName, parameters, options) +// Generated from API version 2022-04-01-preview +func (client *SimsClient) createOrUpdate(ctx context.Context, resourceGroupName string, simGroupName string, simName string, parameters Sim, options *SimsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, simGroupName, simName, parameters, options) if err != nil { return nil, err } @@ -95,8 +97,8 @@ func (client *SimsClient) createOrUpdate(ctx context.Context, resourceGroupName } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SimsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, simName string, parameters Sim, options *SimsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/sims/{simName}" +func (client *SimsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, simGroupName string, simName string, parameters Sim, options *SimsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}/sims/{simName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -105,6 +107,10 @@ func (client *SimsClient) createOrUpdateCreateRequest(ctx context.Context, resou return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if simGroupName == "" { + return nil, errors.New("parameter simGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{simGroupName}", url.PathEscape(simGroupName)) if simName == "" { return nil, errors.New("parameter simName cannot be empty") } @@ -114,21 +120,22 @@ func (client *SimsClient) createOrUpdateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } -// BeginDelete - Deletes the specified sim. +// BeginDelete - Deletes the specified SIM. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. +// simGroupName - The name of the SIM Group. // simName - The name of the SIM. // options - SimsClientBeginDeleteOptions contains the optional parameters for the SimsClient.BeginDelete method. -func (client *SimsClient) BeginDelete(ctx context.Context, resourceGroupName string, simName string, options *SimsClientBeginDeleteOptions) (*runtime.Poller[SimsClientDeleteResponse], error) { +func (client *SimsClient) BeginDelete(ctx context.Context, resourceGroupName string, simGroupName string, simName string, options *SimsClientBeginDeleteOptions) (*runtime.Poller[SimsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, simName, options) + resp, err := client.deleteOperation(ctx, resourceGroupName, simGroupName, simName, options) if err != nil { return nil, err } @@ -140,11 +147,11 @@ func (client *SimsClient) BeginDelete(ctx context.Context, resourceGroupName str } } -// Delete - Deletes the specified sim. +// Delete - Deletes the specified SIM. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview -func (client *SimsClient) deleteOperation(ctx context.Context, resourceGroupName string, simName string, options *SimsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, simName, options) +// Generated from API version 2022-04-01-preview +func (client *SimsClient) deleteOperation(ctx context.Context, resourceGroupName string, simGroupName string, simName string, options *SimsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, simGroupName, simName, options) if err != nil { return nil, err } @@ -159,8 +166,8 @@ func (client *SimsClient) deleteOperation(ctx context.Context, resourceGroupName } // deleteCreateRequest creates the Delete request. -func (client *SimsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, simName string, options *SimsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/sims/{simName}" +func (client *SimsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, simGroupName string, simName string, options *SimsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}/sims/{simName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -169,6 +176,10 @@ func (client *SimsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if simGroupName == "" { + return nil, errors.New("parameter simGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{simGroupName}", url.PathEscape(simGroupName)) if simName == "" { return nil, errors.New("parameter simName cannot be empty") } @@ -178,20 +189,21 @@ func (client *SimsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Gets information about the specified sim. +// Get - Gets information about the specified SIM. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. +// simGroupName - The name of the SIM Group. // simName - The name of the SIM. // options - SimsClientGetOptions contains the optional parameters for the SimsClient.Get method. -func (client *SimsClient) Get(ctx context.Context, resourceGroupName string, simName string, options *SimsClientGetOptions) (SimsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, simName, options) +func (client *SimsClient) Get(ctx context.Context, resourceGroupName string, simGroupName string, simName string, options *SimsClientGetOptions) (SimsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, simGroupName, simName, options) if err != nil { return SimsClientGetResponse{}, err } @@ -206,8 +218,8 @@ func (client *SimsClient) Get(ctx context.Context, resourceGroupName string, sim } // getCreateRequest creates the Get request. -func (client *SimsClient) getCreateRequest(ctx context.Context, resourceGroupName string, simName string, options *SimsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/sims/{simName}" +func (client *SimsClient) getCreateRequest(ctx context.Context, resourceGroupName string, simGroupName string, simName string, options *SimsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}/sims/{simName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -216,6 +228,10 @@ func (client *SimsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if simGroupName == "" { + return nil, errors.New("parameter simGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{simGroupName}", url.PathEscape(simGroupName)) if simName == "" { return nil, errors.New("parameter simName cannot be empty") } @@ -225,7 +241,7 @@ func (client *SimsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,43 +256,43 @@ func (client *SimsClient) getHandleResponse(resp *http.Response) (SimsClientGetR return result, nil } -// NewListByResourceGroupPager - Gets all the Sims in a subscription. +// NewListBySimGroupPager - Gets all the SIMs in a SIM group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// options - SimsClientListByResourceGroupOptions contains the optional parameters for the SimsClient.ListByResourceGroup -// method. -func (client *SimsClient) NewListByResourceGroupPager(resourceGroupName string, options *SimsClientListByResourceGroupOptions) *runtime.Pager[SimsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[SimsClientListByResourceGroupResponse]{ - More: func(page SimsClientListByResourceGroupResponse) bool { +// simGroupName - The name of the SIM Group. +// options - SimsClientListBySimGroupOptions contains the optional parameters for the SimsClient.ListBySimGroup method. +func (client *SimsClient) NewListBySimGroupPager(resourceGroupName string, simGroupName string, options *SimsClientListBySimGroupOptions) *runtime.Pager[SimsClientListBySimGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[SimsClientListBySimGroupResponse]{ + More: func(page SimsClientListBySimGroupResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *SimsClientListByResourceGroupResponse) (SimsClientListByResourceGroupResponse, error) { + Fetcher: func(ctx context.Context, page *SimsClientListBySimGroupResponse) (SimsClientListBySimGroupResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + req, err = client.listBySimGroupCreateRequest(ctx, resourceGroupName, simGroupName, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return SimsClientListByResourceGroupResponse{}, err + return SimsClientListBySimGroupResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return SimsClientListByResourceGroupResponse{}, err + return SimsClientListBySimGroupResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return SimsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + return SimsClientListBySimGroupResponse{}, runtime.NewResponseError(resp) } - return client.listByResourceGroupHandleResponse(resp) + return client.listBySimGroupHandleResponse(resp) }, }) } -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *SimsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SimsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/sims" +// listBySimGroupCreateRequest creates the ListBySimGroup request. +func (client *SimsClient) listBySimGroupCreateRequest(ctx context.Context, resourceGroupName string, simGroupName string, options *SimsClientListBySimGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}/sims" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -285,138 +301,26 @@ func (client *SimsClient) listByResourceGroupCreateRequest(ctx context.Context, return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *SimsClient) listByResourceGroupHandleResponse(resp *http.Response) (SimsClientListByResourceGroupResponse, error) { - result := SimsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SimListResult); err != nil { - return SimsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Gets all the sims in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview -// options - SimsClientListBySubscriptionOptions contains the optional parameters for the SimsClient.ListBySubscription method. -func (client *SimsClient) NewListBySubscriptionPager(options *SimsClientListBySubscriptionOptions) *runtime.Pager[SimsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[SimsClientListBySubscriptionResponse]{ - More: func(page SimsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SimsClientListBySubscriptionResponse) (SimsClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SimsClientListBySubscriptionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SimsClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SimsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *SimsClient) listBySubscriptionCreateRequest(ctx context.Context, options *SimsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.MobileNetwork/sims" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") + if simGroupName == "" { + return nil, errors.New("parameter simGroupName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{simGroupName}", url.PathEscape(simGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *SimsClient) listBySubscriptionHandleResponse(resp *http.Response) (SimsClientListBySubscriptionResponse, error) { - result := SimsClientListBySubscriptionResponse{} +// listBySimGroupHandleResponse handles the ListBySimGroup response. +func (client *SimsClient) listBySimGroupHandleResponse(resp *http.Response) (SimsClientListBySimGroupResponse, error) { + result := SimsClientListBySimGroupResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SimListResult); err != nil { - return SimsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates a sim update tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// simName - The name of the SIM. -// parameters - Parameters supplied to update sim tags. -// options - SimsClientUpdateTagsOptions contains the optional parameters for the SimsClient.UpdateTags method. -func (client *SimsClient) UpdateTags(ctx context.Context, resourceGroupName string, simName string, parameters TagsObject, options *SimsClientUpdateTagsOptions) (SimsClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, simName, parameters, options) - if err != nil { - return SimsClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SimsClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SimsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *SimsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, simName string, parameters TagsObject, options *SimsClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/sims/{simName}" - 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 simName == "" { - return nil, errors.New("parameter simName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{simName}", url.PathEscape(simName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *SimsClient) updateTagsHandleResponse(resp *http.Response) (SimsClientUpdateTagsResponse, error) { - result := SimsClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Sim); err != nil { - return SimsClientUpdateTagsResponse{}, err + return SimsClientListBySimGroupResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_sims_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/sims_client_example_test.go similarity index 66% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_sims_client_test.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/sims_client_example_test.go index 1ebf1cbbe884..ad74364832bd 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_sims_client_test.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/sims_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SimDelete.json func ExampleSimsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -30,6 +30,7 @@ func ExampleSimsClient_BeginDelete() { } poller, err := client.BeginDelete(ctx, "testResourceGroupName", + "testSimGroup", "testSim", nil) if err != nil { @@ -41,7 +42,7 @@ func ExampleSimsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SimGet.json func ExampleSimsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -54,6 +55,7 @@ func ExampleSimsClient_Get() { } res, err := client.Get(ctx, "testResourceGroupName", + "testSimGroup", "testSimName", nil) if err != nil { @@ -63,7 +65,7 @@ func ExampleSimsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SimCreate.json func ExampleSimsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -76,18 +78,15 @@ func ExampleSimsClient_BeginCreateOrUpdate() { } poller, err := client.BeginCreateOrUpdate(ctx, "rg1", + "testSimGroup", "testSim", armmobilenetwork.Sim{ - Location: to.Ptr("testLocation"), Properties: &armmobilenetwork.SimPropertiesFormat{ AuthenticationKey: to.Ptr("00000000000000000000000000000000"), DeviceType: to.Ptr("Video camera"), IntegratedCircuitCardIdentifier: to.Ptr("8900000000000000000"), InternationalMobileSubscriberIdentity: to.Ptr("00000"), - MobileNetwork: &armmobilenetwork.ResourceID{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork"), - }, - OperatorKeyCode: to.Ptr("00000000000000000000000000000000"), + OperatorKeyCode: to.Ptr("00000000000000000000000000000000"), SimPolicy: &armmobilenetwork.SimPolicyResourceID{ ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork/simPolicies/MySimPolicy"), }, @@ -117,60 +116,8 @@ func ExampleSimsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimUpdateTags.json -func ExampleSimsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmobilenetwork.NewSimsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.UpdateTags(ctx, - "rg1", - "testSim", - armmobilenetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimListBySubscription.json -func ExampleSimsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmobilenetwork.NewSimsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimListByResourceGroup.json -func ExampleSimsClient_NewListByResourceGroupPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SimListBySimGroup.json +func ExampleSimsClient_NewListBySimGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -180,7 +127,8 @@ func ExampleSimsClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourceGroupPager("rg1", + pager := client.NewListBySimGroupPager("rg1", + "testSimGroup", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_sites_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/sites_client.go similarity index 96% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_sites_client.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/sites_client.go index 902f289d9628..64bca62c9c08 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_sites_client.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/sites_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 armmobilenetwork @@ -56,7 +57,7 @@ func NewSitesClient(subscriptionID string, credential azcore.TokenCredential, op // BeginCreateOrUpdate - Creates or updates a mobile network site. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // siteName - The name of the mobile network site. @@ -79,7 +80,7 @@ func (client *SitesClient) BeginCreateOrUpdate(ctx context.Context, resourceGrou // CreateOrUpdate - Creates or updates a mobile network site. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *SitesClient) createOrUpdate(ctx context.Context, resourceGroupName string, mobileNetworkName string, siteName string, parameters Site, options *SitesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, mobileNetworkName, siteName, parameters, options) if err != nil { @@ -119,7 +120,7 @@ func (client *SitesClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -127,7 +128,7 @@ func (client *SitesClient) createOrUpdateCreateRequest(ctx context.Context, reso // BeginDelete - Deletes the specified mobile network site. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // siteName - The name of the mobile network site. @@ -148,7 +149,7 @@ func (client *SitesClient) BeginDelete(ctx context.Context, resourceGroupName st // Delete - Deletes the specified mobile network site. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *SitesClient) deleteOperation(ctx context.Context, resourceGroupName string, mobileNetworkName string, siteName string, options *SitesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, mobileNetworkName, siteName, options) if err != nil { @@ -188,7 +189,7 @@ func (client *SitesClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -196,7 +197,7 @@ func (client *SitesClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Gets information about the specified mobile network site. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // siteName - The name of the mobile network site. @@ -240,7 +241,7 @@ func (client *SitesClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +258,7 @@ func (client *SitesClient) getHandleResponse(resp *http.Response) (SitesClientGe // NewListByMobileNetworkPager - Lists all sites in the mobile network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // options - SitesClientListByMobileNetworkOptions contains the optional parameters for the SitesClient.ListByMobileNetwork @@ -310,7 +311,7 @@ func (client *SitesClient) listByMobileNetworkCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,9 +326,9 @@ func (client *SitesClient) listByMobileNetworkHandleResponse(resp *http.Response return result, nil } -// UpdateTags - Updates a site update tags. +// UpdateTags - Updates site tags. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // siteName - The name of the mobile network site. @@ -372,7 +373,7 @@ func (client *SitesClient) updateTagsCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_sites_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/sites_client_example_test.go similarity index 93% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_sites_client_test.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/sites_client_example_test.go index f27f7df9c6d2..909b8e968b43 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_sites_client_test.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/sites_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SiteDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SiteDelete.json func ExampleSitesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +42,7 @@ func ExampleSitesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SiteGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SiteGet.json func ExampleSitesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -65,7 +65,7 @@ func ExampleSitesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SiteCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SiteCreate.json func ExampleSitesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -101,7 +101,7 @@ func ExampleSitesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SiteUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SiteUpdateTags.json func ExampleSitesClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -130,7 +130,7 @@ func ExampleSitesClient_UpdateTags() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SiteListByMobileNetwork.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SiteListByMobileNetwork.json func ExampleSitesClient_NewListByMobileNetworkPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_slices_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/slices_client.go similarity index 93% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_slices_client.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/slices_client.go index 2aa5740f311a..474a29d4bd08 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_slices_client.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/slices_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 armmobilenetwork @@ -54,13 +55,13 @@ func NewSlicesClient(subscriptionID string, credential azcore.TokenCredential, o return client, nil } -// BeginCreateOrUpdate - Creates or updates a mobile network slice. +// BeginCreateOrUpdate - Creates or updates a network slice. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. -// sliceName - The name of the mobile network slice. -// parameters - Parameters supplied to the create or update mobile network slice operation. +// sliceName - The name of the network slice. +// parameters - Parameters supplied to the create or update network slice operation. // options - SlicesClientBeginCreateOrUpdateOptions contains the optional parameters for the SlicesClient.BeginCreateOrUpdate // method. func (client *SlicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, mobileNetworkName string, sliceName string, parameters Slice, options *SlicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SlicesClientCreateOrUpdateResponse], error) { @@ -77,9 +78,9 @@ func (client *SlicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGro } } -// CreateOrUpdate - Creates or updates a mobile network slice. +// CreateOrUpdate - Creates or updates a network slice. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *SlicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, mobileNetworkName string, sliceName string, parameters Slice, options *SlicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, mobileNetworkName, sliceName, parameters, options) if err != nil { @@ -119,18 +120,18 @@ func (client *SlicesClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } -// BeginDelete - Deletes the specified mobile network slice. +// BeginDelete - Deletes the specified network slice. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. -// sliceName - The name of the mobile network slice. +// sliceName - The name of the network slice. // options - SlicesClientBeginDeleteOptions contains the optional parameters for the SlicesClient.BeginDelete method. func (client *SlicesClient) BeginDelete(ctx context.Context, resourceGroupName string, mobileNetworkName string, sliceName string, options *SlicesClientBeginDeleteOptions) (*runtime.Poller[SlicesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -146,9 +147,9 @@ func (client *SlicesClient) BeginDelete(ctx context.Context, resourceGroupName s } } -// Delete - Deletes the specified mobile network slice. +// Delete - Deletes the specified network slice. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview func (client *SlicesClient) deleteOperation(ctx context.Context, resourceGroupName string, mobileNetworkName string, sliceName string, options *SlicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, mobileNetworkName, sliceName, options) if err != nil { @@ -188,18 +189,18 @@ func (client *SlicesClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Gets information about the specified mobile network slice. +// Get - Gets information about the specified network slice. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. -// sliceName - The name of the mobile network slice. +// sliceName - The name of the network slice. // options - SlicesClientGetOptions contains the optional parameters for the SlicesClient.Get method. func (client *SlicesClient) Get(ctx context.Context, resourceGroupName string, mobileNetworkName string, sliceName string, options *SlicesClientGetOptions) (SlicesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, mobileNetworkName, sliceName, options) @@ -240,7 +241,7 @@ func (client *SlicesClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +258,7 @@ func (client *SlicesClient) getHandleResponse(resp *http.Response) (SlicesClient // NewListByMobileNetworkPager - Lists all slices in the mobile network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. // options - SlicesClientListByMobileNetworkOptions contains the optional parameters for the SlicesClient.ListByMobileNetwork @@ -310,7 +311,7 @@ func (client *SlicesClient) listByMobileNetworkCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,13 +326,13 @@ func (client *SlicesClient) listByMobileNetworkHandleResponse(resp *http.Respons return result, nil } -// UpdateTags - Update slice tags. +// UpdateTags - Updates slice tags. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01-preview +// Generated from API version 2022-04-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // mobileNetworkName - The name of the mobile network. -// sliceName - The name of the mobile network slice. -// parameters - Parameters supplied to update mobile network slice tags. +// sliceName - The name of the network slice. +// parameters - Parameters supplied to update network slice tags. // options - SlicesClientUpdateTagsOptions contains the optional parameters for the SlicesClient.UpdateTags method. func (client *SlicesClient) UpdateTags(ctx context.Context, resourceGroupName string, mobileNetworkName string, sliceName string, parameters TagsObject, options *SlicesClientUpdateTagsOptions) (SlicesClientUpdateTagsResponse, error) { req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, mobileNetworkName, sliceName, parameters, options) @@ -372,7 +373,7 @@ func (client *SlicesClient) updateTagsCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_slices_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/slices_client_example_test.go similarity index 93% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_slices_client_test.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/slices_client_example_test.go index 6b87d33ce08f..b72bf7d7ca9c 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_slices_client_test.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/slices_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SliceDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SliceDelete.json func ExampleSlicesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +42,7 @@ func ExampleSlicesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SliceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SliceGet.json func ExampleSlicesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -65,7 +65,7 @@ func ExampleSlicesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SliceCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SliceCreate.json func ExampleSlicesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -102,7 +102,7 @@ func ExampleSlicesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SliceUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SliceUpdateTags.json func ExampleSlicesClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -131,7 +131,7 @@ func ExampleSlicesClient_UpdateTags() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SliceListByMobileNetwork.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/SliceListByMobileNetwork.json func ExampleSlicesClient_NewListByMobileNetworkPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_time_rfc3339.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/mobilenetwork/armmobilenetwork/time_rfc3339.go index cad4f37efef1..30077a7e0625 100644 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/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 armmobilenetwork diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_models_serde.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_models_serde.go deleted file mode 100644 index a6ae66f259be..000000000000 --- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_models_serde.go +++ /dev/null @@ -1,335 +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 armmobilenetwork - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type AttachedDataNetwork. -func (a AttachedDataNetwork) 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) -} - -// MarshalJSON implements the json.Marshaller interface for type AttachedDataNetworkPropertiesFormat. -func (a AttachedDataNetworkPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "naptConfiguration", a.NaptConfiguration) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "userEquipmentAddressPoolPrefix", a.UserEquipmentAddressPoolPrefix) - populate(objectMap, "userEquipmentStaticAddressPoolPrefix", a.UserEquipmentStaticAddressPoolPrefix) - populate(objectMap, "userPlaneDataInterface", a.UserPlaneDataInterface) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DataNetwork. -func (d DataNetwork) 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) -} - -// MarshalJSON implements the json.Marshaller interface for type DataNetworkConfiguration. -func (d DataNetworkConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalAllowedSessionTypes", d.AdditionalAllowedSessionTypes) - populate(objectMap, "allocationAndRetentionPriorityLevel", d.AllocationAndRetentionPriorityLevel) - populate(objectMap, "allowedServices", d.AllowedServices) - populate(objectMap, "dataNetwork", d.DataNetwork) - populate(objectMap, "defaultSessionType", d.DefaultSessionType) - populate(objectMap, "5qi", d.FiveQi) - populate(objectMap, "preemptionCapability", d.PreemptionCapability) - populate(objectMap, "preemptionVulnerability", d.PreemptionVulnerability) - populate(objectMap, "sessionAmbr", d.SessionAmbr) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MobileNetwork. -func (m MobileNetwork) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PacketCoreControlPlane. -func (p PacketCoreControlPlane) 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) -} - -// MarshalJSON implements the json.Marshaller interface for type PacketCoreDataPlane. -func (p PacketCoreDataPlane) 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) -} - -// MarshalJSON implements the json.Marshaller interface for type PccRuleConfiguration. -func (p PccRuleConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ruleName", p.RuleName) - populate(objectMap, "rulePrecedence", p.RulePrecedence) - populate(objectMap, "ruleQosPolicy", p.RuleQosPolicy) - populate(objectMap, "serviceDataFlowTemplates", p.ServiceDataFlowTemplates) - populate(objectMap, "trafficControl", p.TrafficControl) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Service. -func (s Service) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceDataFlowTemplate. -func (s ServiceDataFlowTemplate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "direction", s.Direction) - populate(objectMap, "ports", s.Ports) - populate(objectMap, "protocol", s.Protocol) - populate(objectMap, "remoteIpList", s.RemoteIPList) - populate(objectMap, "templateName", s.TemplateName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServicePropertiesFormat. -func (s ServicePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "pccRules", s.PccRules) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "servicePrecedence", s.ServicePrecedence) - populate(objectMap, "serviceQosPolicy", s.ServiceQosPolicy) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Sim. -func (s Sim) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SimPolicy. -func (s SimPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SimPolicyPropertiesFormat. -func (s SimPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultSlice", s.DefaultSlice) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "registrationTimer", s.RegistrationTimer) - populate(objectMap, "rfspIndex", s.RfspIndex) - populate(objectMap, "sliceConfigurations", s.SliceConfigurations) - populate(objectMap, "ueAmbr", s.UeAmbr) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SimPropertiesFormat. -func (s SimPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authenticationKey", s.AuthenticationKey) - populate(objectMap, "deviceType", s.DeviceType) - populate(objectMap, "integratedCircuitCardIdentifier", s.IntegratedCircuitCardIdentifier) - populate(objectMap, "internationalMobileSubscriberIdentity", s.InternationalMobileSubscriberIdentity) - populate(objectMap, "mobileNetwork", s.MobileNetwork) - populate(objectMap, "operatorKeyCode", s.OperatorKeyCode) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "simPolicy", s.SimPolicy) - populate(objectMap, "simState", s.SimState) - populate(objectMap, "staticIpConfiguration", s.StaticIPConfiguration) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Site. -func (s Site) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SitePropertiesFormat. -func (s SitePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "networkFunctions", s.NetworkFunctions) - populate(objectMap, "provisioningState", s.ProvisioningState) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Slice. -func (s Slice) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SliceConfiguration. -func (s SliceConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataNetworkConfigurations", s.DataNetworkConfigurations) - populate(objectMap, "defaultDataNetwork", s.DefaultDataNetwork) - populate(objectMap, "slice", s.Slice) - return json.Marshal(objectMap) -} - -// 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 TagsObject. -func (t TagsObject) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", t.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -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 -}