From 6475b4f14d7fb2fd49be4264ca831b36dd9b5399 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 13 May 2025 06:21:32 +0000 Subject: [PATCH] CodeGen from PR 34318 in Azure/azure-rest-api-specs Merge 82b856cc12f4455d68fad7e02d87377a9e6a112c into c269b7b78cac2808d7acc55124a9653b2e904e4b --- ...mDeviceProvisioningServicesModelFactory.cs | 183 ++- .../DeviceProvisioningServiceCollection.cs | 24 +- ...ceProvisioningServiceData.Serialization.cs | 18 + .../DeviceProvisioningServiceData.cs | 6 +- .../DeviceProvisioningServiceResource.cs | 276 ++-- ...ovisioningServicesCertificateCollection.cs | 24 +- ...ProvisioningServicesCertificateResource.cs | 32 +- ...icesPrivateEndpointConnectionCollection.cs | 40 +- ...rvicesPrivateEndpointConnectionResource.cs | 30 +- ...ProvisioningServicesPrivateLinkResource.cs | 14 +- ...ngServicesPrivateLinkResourceCollection.cs | 32 +- ...isioningServicesPrivateLinkResourceData.cs | 4 +- .../DeviceProvisioningServicesExtensions.cs | 112 +- ...ableDeviceProvisioningServicesArmClient.cs | 36 +- ...ovisioningServicesResourceGroupResource.cs | 4 +- ...rovisioningServicesSubscriptionResource.cs | 120 +- ...erificationCodeProperties.Serialization.cs | 30 +- .../CertificateVerificationCodeProperties.cs | 8 +- ...isioningServiceProperties.Serialization.cs | 12 + .../DeviceProvisioningServiceProperties.cs | 6 +- ...ervicesCertificateResourceDeleteOptions.cs | 20 +- ...ResourceGenerateVerificationCodeOptions.cs | 20 +- ...ateLinkResourceProperties.Serialization.cs | 4 +- ...ngServicesPrivateLinkResourceProperties.cs | 10 +- ...psSkuDefinitionListResult.Serialization.cs | 31 +- .../Models/IotDpsSkuDefinitionListResult.cs | 26 +- .../Models/IotHubAuthenticationType.cs | 54 + ...tHubDefinitionDescription.Serialization.cs | 39 +- .../Models/IotHubDefinitionDescription.cs | 17 +- ...viceDescriptionListResult.Serialization.cs | 31 +- ...rovisioningServiceDescriptionListResult.cs | 28 +- ...thorizationRuleListResult.Serialization.cs | 31 +- ...essSignatureAuthorizationRuleListResult.cs | 26 +- .../DpsCertificateRestOperations.cs | 418 +++--- .../IotDpsResourceRestOperations.cs | 1154 ++++++++--------- .../src/autorest.md | 2 +- ...ple_DeviceProvisioningServiceCollection.cs | 63 +- ...ample_DeviceProvisioningServiceResource.cs | 40 +- ...ovisioningServicesCertificateCollection.cs | 12 +- ...ProvisioningServicesCertificateResource.cs | 20 +- ...icesPrivateEndpointConnectionCollection.cs | 30 +- ...rvicesPrivateEndpointConnectionResource.cs | 18 +- ...ProvisioningServicesPrivateLinkResource.cs | 6 +- ...ngServicesPrivateLinkResourceCollection.cs | 24 +- .../Sample_SubscriptionResourceExtensions.cs | 40 +- sdk/storage/ci.yml | 2 + 46 files changed, 1710 insertions(+), 1467 deletions(-) create mode 100644 sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotHubAuthenticationType.cs diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/ArmDeviceProvisioningServicesModelFactory.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/ArmDeviceProvisioningServicesModelFactory.cs index 36822d575317..3e3fdf8abe26 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/ArmDeviceProvisioningServicesModelFactory.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/ArmDeviceProvisioningServicesModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -16,46 +17,14 @@ namespace Azure.ResourceManager.DeviceProvisioningServices.Models /// Model factory for models. public static partial class ArmDeviceProvisioningServicesModelFactory { - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// properties of a certificate. - /// The entity tag. - /// A new instance for mocking. - public static DeviceProvisioningServicesCertificateData DeviceProvisioningServicesCertificateData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DeviceProvisioningServicesCertificateProperties properties = null, ETag? etag = null) - { - return new DeviceProvisioningServicesCertificateData( - id, - name, - resourceType, - systemData, - properties, - etag, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The certificate's subject name. - /// The certificate's expiration date and time. - /// The certificate's thumbprint. - /// Determines whether certificate has been verified. - /// base-64 representation of X509 certificate .cer file or just .pem file content. - /// The certificate's creation date and time. - /// The certificate's last update date and time. - /// A new instance for mocking. - public static DeviceProvisioningServicesCertificateProperties DeviceProvisioningServicesCertificateProperties(string subject = null, DateTimeOffset? expireOn = null, BinaryData thumbprint = null, bool? isVerified = null, BinaryData certificate = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null) + /// Initializes a new instance of . + /// specifies if a name is available or not. + /// specifies the reason a name is unavailable. + /// message containing a detailed reason name is unavailable. + /// A new instance for mocking. + public static DeviceProvisioningServicesNameAvailabilityResult DeviceProvisioningServicesNameAvailabilityResult(bool? isNameAvailable = null, DeviceProvisioningServicesNameUnavailableReason? reason = null, string message = null) { - return new DeviceProvisioningServicesCertificateProperties( - subject, - expireOn, - thumbprint, - isVerified, - certificate, - createdOn, - updatedOn, - serializedAdditionalRawData: null); + return new DeviceProvisioningServicesNameAvailabilityResult(isNameAvailable, reason, message, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -68,8 +37,9 @@ public static DeviceProvisioningServicesCertificateProperties DeviceProvisioning /// The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention. /// Service specific properties for a provisioning service. /// Sku info for a provisioning Service. + /// The managed service identities assigned to this resource. /// A new instance for mocking. - public static DeviceProvisioningServiceData DeviceProvisioningServiceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, DeviceProvisioningServiceProperties properties = null, DeviceProvisioningServicesSkuInfo sku = null) + public static DeviceProvisioningServiceData DeviceProvisioningServiceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, DeviceProvisioningServiceProperties properties = null, DeviceProvisioningServicesSkuInfo sku = null, ManagedServiceIdentity identity = null) { tags ??= new Dictionary(); @@ -83,6 +53,7 @@ public static DeviceProvisioningServiceData DeviceProvisioningServiceData(Resour etag, properties, sku, + identity, serializedAdditionalRawData: null); } @@ -102,8 +73,9 @@ public static DeviceProvisioningServiceData DeviceProvisioningServiceData(Resour /// Optional. /// Indicates if the DPS instance has Data Residency enabled, removing the cross geo-pair disaster recovery. /// + /// Portal endpoint to enable CORS for this provisioning service. /// A new instance for mocking. - public static DeviceProvisioningServiceProperties DeviceProvisioningServiceProperties(DeviceProvisioningServicesState? state = null, DeviceProvisioningServicesPublicNetworkAccess? publicNetworkAccess = null, IEnumerable ipFilterRules = null, IEnumerable privateEndpointConnections = null, string provisioningState = null, IEnumerable iotHubs = null, DeviceProvisioningServicesAllocationPolicy? allocationPolicy = null, string serviceOperationsHostName = null, string deviceProvisioningHostName = null, string idScope = null, IEnumerable authorizationPolicies = null, bool? isDataResidencyEnabled = null) + public static DeviceProvisioningServiceProperties DeviceProvisioningServiceProperties(DeviceProvisioningServicesState? state = null, DeviceProvisioningServicesPublicNetworkAccess? publicNetworkAccess = null, IEnumerable ipFilterRules = null, IEnumerable privateEndpointConnections = null, string provisioningState = null, IEnumerable iotHubs = null, DeviceProvisioningServicesAllocationPolicy? allocationPolicy = null, string serviceOperationsHostName = null, string deviceProvisioningHostName = null, string idScope = null, IEnumerable authorizationPolicies = null, bool? isDataResidencyEnabled = null, string portalOperationsHostName = null) { ipFilterRules ??= new List(); privateEndpointConnections ??= new List(); @@ -123,6 +95,7 @@ public static DeviceProvisioningServiceProperties DeviceProvisioningServicePrope idScope, authorizationPolicies?.ToList(), isDataResidencyEnabled, + portalOperationsHostName, serializedAdditionalRawData: null); } @@ -150,8 +123,10 @@ public static DeviceProvisioningServicesPrivateEndpointConnectionData DeviceProv /// Host name of the IoT hub. /// Connection string of the IoT hub. /// ARM region of the IoT hub. + /// IotHub MI authentication type: KeyBased, UserAssigned, SystemAssigned. + /// The selected user-assigned identity resource Id associated with IoT Hub. This is required when authenticationType is UserAssigned. /// A new instance for mocking. - public static IotHubDefinitionDescription IotHubDefinitionDescription(bool? applyAllocationPolicy = null, int? allocationWeight = null, string name = null, string connectionString = null, AzureLocation location = default) + public static IotHubDefinitionDescription IotHubDefinitionDescription(bool? applyAllocationPolicy = null, int? allocationWeight = null, string name = null, string connectionString = null, AzureLocation location = default, IotHubAuthenticationType? authenticationType = null, ResourceIdentifier selectedUserAssignedIdentityResourceId = null) { return new IotHubDefinitionDescription( applyAllocationPolicy, @@ -159,6 +134,8 @@ public static IotHubDefinitionDescription IotHubDefinitionDescription(bool? appl name, connectionString, location, + authenticationType, + selectedUserAssignedIdentityResourceId, serializedAdditionalRawData: null); } @@ -172,12 +149,46 @@ public static DeviceProvisioningServicesSkuInfo DeviceProvisioningServicesSkuInf return new DeviceProvisioningServicesSkuInfo(name, tier, capacity, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Sku name. - /// A new instance for mocking. - public static DeviceProvisioningServicesSkuDefinition DeviceProvisioningServicesSkuDefinition(DeviceProvisioningServicesSku? name = null) + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// properties of a certificate. + /// The entity tag. + /// A new instance for mocking. + public static DeviceProvisioningServicesCertificateData DeviceProvisioningServicesCertificateData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DeviceProvisioningServicesCertificateProperties properties = null, ETag? etag = null) { - return new DeviceProvisioningServicesSkuDefinition(name, serializedAdditionalRawData: null); + return new DeviceProvisioningServicesCertificateData( + id, + name, + resourceType, + systemData, + properties, + etag, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The certificate's subject name. + /// The certificate's expiration date and time. + /// The certificate's thumbprint. + /// Determines whether certificate has been verified. + /// base-64 representation of X509 certificate .cer file or just .pem file content. + /// The certificate's creation date and time. + /// The certificate's last update date and time. + /// A new instance for mocking. + public static DeviceProvisioningServicesCertificateProperties DeviceProvisioningServicesCertificateProperties(string subject = null, DateTimeOffset? expireOn = null, BinaryData thumbprint = null, bool? isVerified = null, BinaryData certificate = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null) + { + return new DeviceProvisioningServicesCertificateProperties( + subject, + expireOn, + thumbprint, + isVerified, + certificate, + createdOn, + updatedOn, + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -210,7 +221,7 @@ public static CertificateVerificationCodeResult CertificateVerificationCodeResul /// Certificate created time. /// Certificate updated time. /// A new instance for mocking. - public static CertificateVerificationCodeProperties CertificateVerificationCodeProperties(string verificationCode = null, string subject = null, DateTimeOffset? expireOn = null, BinaryData thumbprint = null, bool? isVerified = null, BinaryData certificate = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null) + public static CertificateVerificationCodeProperties CertificateVerificationCodeProperties(string verificationCode = null, string subject = null, string expireOn = null, BinaryData thumbprint = null, bool? isVerified = null, BinaryData certificate = null, string createdOn = null, string updatedOn = null) { return new CertificateVerificationCodeProperties( verificationCode, @@ -224,16 +235,6 @@ public static CertificateVerificationCodeProperties CertificateVerificationCodeP serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// specifies if a name is available or not. - /// specifies the reason a name is unavailable. - /// message containing a detailed reason name is unavailable. - /// A new instance for mocking. - public static DeviceProvisioningServicesNameAvailabilityResult DeviceProvisioningServicesNameAvailabilityResult(bool? isNameAvailable = null, DeviceProvisioningServicesNameUnavailableReason? reason = null, string message = null) - { - return new DeviceProvisioningServicesNameAvailabilityResult(isNameAvailable, reason, message, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -252,17 +253,65 @@ public static DeviceProvisioningServicesPrivateLinkResourceData DeviceProvisioni serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The group id. - /// The required members for a specific group id. - /// The required DNS zones for a specific group id. - /// A new instance for mocking. - public static DeviceProvisioningServicesPrivateLinkResourceProperties DeviceProvisioningServicesPrivateLinkResourceProperties(string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null) + /// Initializes a new instance of . + /// Sku name. + /// A new instance for mocking. + public static DeviceProvisioningServicesSkuDefinition DeviceProvisioningServicesSkuDefinition(DeviceProvisioningServicesSku? name = null) { - requiredMembers ??= new List(); - requiredZoneNames ??= new List(); + return new DeviceProvisioningServicesSkuDefinition(name, serializedAdditionalRawData: null); + } - return new DeviceProvisioningServicesPrivateLinkResourceProperties(groupId, requiredMembers?.ToList(), requiredZoneNames?.ToList(), serializedAdditionalRawData: null); + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention. + /// Service specific properties for a provisioning service. + /// Sku info for a provisioning Service. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static DeviceProvisioningServiceData DeviceProvisioningServiceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, DeviceProvisioningServiceProperties properties, DeviceProvisioningServicesSkuInfo sku) + { + return DeviceProvisioningServiceData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, etag: etag, properties: properties, sku: sku, identity: default); + } + + /// Initializes a new instance of . + /// Current state of the provisioning service. + /// Whether requests from Public Network are allowed. + /// The IP filter rules. + /// Private endpoint connections created on this IotHub. + /// The ARM provisioning state of the provisioning service. + /// List of IoT hubs associated with this provisioning service. + /// Allocation policy to be used by this provisioning service. + /// Service endpoint for provisioning service. + /// Device endpoint for this provisioning service. + /// Unique identifier of this provisioning service. + /// List of authorization keys for a provisioning service. + /// + /// Optional. + /// Indicates if the DPS instance has Data Residency enabled, removing the cross geo-pair disaster recovery. + /// + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static DeviceProvisioningServiceProperties DeviceProvisioningServiceProperties(DeviceProvisioningServicesState? state, DeviceProvisioningServicesPublicNetworkAccess? publicNetworkAccess, IEnumerable ipFilterRules, IEnumerable privateEndpointConnections, string provisioningState, IEnumerable iotHubs, DeviceProvisioningServicesAllocationPolicy? allocationPolicy, string serviceOperationsHostName, string deviceProvisioningHostName, string idScope, IEnumerable authorizationPolicies, bool? isDataResidencyEnabled) + { + return DeviceProvisioningServiceProperties(state: state, publicNetworkAccess: publicNetworkAccess, ipFilterRules: ipFilterRules, privateEndpointConnections: privateEndpointConnections, provisioningState: provisioningState, iotHubs: iotHubs, allocationPolicy: allocationPolicy, serviceOperationsHostName: serviceOperationsHostName, deviceProvisioningHostName: deviceProvisioningHostName, idScope: idScope, authorizationPolicies: authorizationPolicies, isDataResidencyEnabled: isDataResidencyEnabled, portalOperationsHostName: default); + } + + /// Initializes a new instance of . + /// flag for applying allocationPolicy or not for a given iot hub. + /// weight to apply for a given iot h. + /// Host name of the IoT hub. + /// Connection string of the IoT hub. + /// ARM region of the IoT hub. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static IotHubDefinitionDescription IotHubDefinitionDescription(bool? applyAllocationPolicy, int? allocationWeight, string name, string connectionString, AzureLocation location) + { + return IotHubDefinitionDescription(applyAllocationPolicy: applyAllocationPolicy, allocationWeight: allocationWeight, name: name, connectionString: connectionString, location: location, authenticationType: default, selectedUserAssignedIdentityResourceId: default); } } } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceCollection.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceCollection.cs index 0eb13b794418..82651cb495b8 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceCollection.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -74,7 +74,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of provisioning service to create or update. + /// Name of the provisioning service to retrieve. /// Description of the provisioning service to create or update. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -114,7 +114,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -123,7 +123,7 @@ public virtual async Task> Creat /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of provisioning service to create or update. + /// Name of the provisioning service to retrieve. /// Description of the provisioning service to create or update. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string provisioni /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string provisioningService /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string provisioningServiceName, Cancellatio /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceData.Serialization.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceData.Serialization.cs index 4c26af310a50..f1e016b11d02 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceData.Serialization.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceData.Serialization.cs @@ -46,6 +46,12 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(Properties, options); writer.WritePropertyName("sku"u8); writer.WriteObjectValue(Sku, options); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } } DeviceProvisioningServiceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -71,6 +77,7 @@ internal static DeviceProvisioningServiceData DeserializeDeviceProvisioningServi ETag? etag = default; DeviceProvisioningServiceProperties properties = default; DeviceProvisioningServicesSkuInfo sku = default; + ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -100,6 +107,16 @@ internal static DeviceProvisioningServiceData DeserializeDeviceProvisioningServi sku = DeviceProvisioningServicesSkuInfo.DeserializeDeviceProvisioningServicesSkuInfo(property.Value, options); continue; } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -159,6 +176,7 @@ internal static DeviceProvisioningServiceData DeserializeDeviceProvisioningServi etag, properties, sku, + identity, serializedAdditionalRawData); } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceData.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceData.cs index 42d79a0132dc..523c5868f2c7 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceData.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceData.cs @@ -75,12 +75,14 @@ public DeviceProvisioningServiceData(AzureLocation location, DeviceProvisioningS /// The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention. /// Service specific properties for a provisioning service. /// Sku info for a provisioning Service. + /// The managed service identities assigned to this resource. /// Keeps track of any properties unknown to the library. - internal DeviceProvisioningServiceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, DeviceProvisioningServiceProperties properties, DeviceProvisioningServicesSkuInfo sku, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal DeviceProvisioningServiceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, DeviceProvisioningServiceProperties properties, DeviceProvisioningServicesSkuInfo sku, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { ETag = etag; Properties = properties; Sku = sku; + Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -95,5 +97,7 @@ internal DeviceProvisioningServiceData() public DeviceProvisioningServiceProperties Properties { get; set; } /// Sku info for a provisioning Service. public DeviceProvisioningServicesSkuInfo Sku { get; set; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceResource.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceResource.cs index 1832d0bd775e..1ba7ef1968b9 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceResource.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceResource.cs @@ -91,75 +91,73 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } - /// Gets a collection of DeviceProvisioningServicesCertificateResources in the DeviceProvisioningService. - /// An object representing collection of DeviceProvisioningServicesCertificateResources and their operations over a DeviceProvisioningServicesCertificateResource. - public virtual DeviceProvisioningServicesCertificateCollection GetDeviceProvisioningServicesCertificates() + /// Gets a collection of DeviceProvisioningServicesPrivateEndpointConnectionResources in the DeviceProvisioningService. + /// An object representing collection of DeviceProvisioningServicesPrivateEndpointConnectionResources and their operations over a DeviceProvisioningServicesPrivateEndpointConnectionResource. + public virtual DeviceProvisioningServicesPrivateEndpointConnectionCollection GetDeviceProvisioningServicesPrivateEndpointConnections() { - return GetCachedClient(client => new DeviceProvisioningServicesCertificateCollection(client, Id)); + return GetCachedClient(client => new DeviceProvisioningServicesPrivateEndpointConnectionCollection(client, Id)); } /// - /// Get the certificate from the provisioning service. + /// Get private endpoint connection properties /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id - /// DpsCertificate_Get + /// IotDpsResource_GetPrivateEndpointConnection /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the certificate to retrieve. - /// ETag of the certificate. + /// The name of the private endpoint connection. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetDeviceProvisioningServicesCertificateAsync(string certificateName, string ifMatch = null, CancellationToken cancellationToken = default) + public virtual async Task> GetDeviceProvisioningServicesPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { - return await GetDeviceProvisioningServicesCertificates().GetAsync(certificateName, ifMatch, cancellationToken).ConfigureAwait(false); + return await GetDeviceProvisioningServicesPrivateEndpointConnections().GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); } /// - /// Get the certificate from the provisioning service. + /// Get private endpoint connection properties /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id - /// DpsCertificate_Get + /// IotDpsResource_GetPrivateEndpointConnection /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the certificate to retrieve. - /// ETag of the certificate. + /// The name of the private endpoint connection. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetDeviceProvisioningServicesCertificate(string certificateName, string ifMatch = null, CancellationToken cancellationToken = default) + public virtual Response GetDeviceProvisioningServicesPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { - return GetDeviceProvisioningServicesCertificates().Get(certificateName, ifMatch, cancellationToken); + return GetDeviceProvisioningServicesPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); } /// Gets a collection of DeviceProvisioningServicesPrivateLinkResources in the DeviceProvisioningService. @@ -174,7 +172,7 @@ public virtual DeviceProvisioningServicesPrivateLinkResourceCollection GetDevice /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateLinkResources/{groupId} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateLinkResources/{groupId} /// /// /// Operation Id @@ -182,7 +180,7 @@ public virtual DeviceProvisioningServicesPrivateLinkResourceCollection GetDevice /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -205,7 +203,7 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateLinkResources/{groupId} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateLinkResources/{groupId} /// /// /// Operation Id @@ -213,7 +211,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -231,73 +229,75 @@ public virtual Response GetDevice return GetDeviceProvisioningServicesPrivateLinkResources().Get(groupId, cancellationToken); } - /// Gets a collection of DeviceProvisioningServicesPrivateEndpointConnectionResources in the DeviceProvisioningService. - /// An object representing collection of DeviceProvisioningServicesPrivateEndpointConnectionResources and their operations over a DeviceProvisioningServicesPrivateEndpointConnectionResource. - public virtual DeviceProvisioningServicesPrivateEndpointConnectionCollection GetDeviceProvisioningServicesPrivateEndpointConnections() + /// Gets a collection of DeviceProvisioningServicesCertificateResources in the DeviceProvisioningService. + /// An object representing collection of DeviceProvisioningServicesCertificateResources and their operations over a DeviceProvisioningServicesCertificateResource. + public virtual DeviceProvisioningServicesCertificateCollection GetDeviceProvisioningServicesCertificates() { - return GetCachedClient(client => new DeviceProvisioningServicesPrivateEndpointConnectionCollection(client, Id)); + return GetCachedClient(client => new DeviceProvisioningServicesCertificateCollection(client, Id)); } /// - /// Get private endpoint connection properties + /// Get the certificate from the provisioning service. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName} /// /// /// Operation Id - /// IotDpsResource_GetPrivateEndpointConnection + /// DpsCertificate_Get /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the private endpoint connection. + /// Name of the certificate to retrieve. + /// ETag of the certificate. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetDeviceProvisioningServicesPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + public virtual async Task> GetDeviceProvisioningServicesCertificateAsync(string certificateName, string ifMatch = null, CancellationToken cancellationToken = default) { - return await GetDeviceProvisioningServicesPrivateEndpointConnections().GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + return await GetDeviceProvisioningServicesCertificates().GetAsync(certificateName, ifMatch, cancellationToken).ConfigureAwait(false); } /// - /// Get private endpoint connection properties + /// Get the certificate from the provisioning service. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName} /// /// /// Operation Id - /// IotDpsResource_GetPrivateEndpointConnection + /// DpsCertificate_Get /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the private endpoint connection. + /// Name of the certificate to retrieve. + /// ETag of the certificate. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetDeviceProvisioningServicesPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + public virtual Response GetDeviceProvisioningServicesCertificate(string certificateName, string ifMatch = null, CancellationToken cancellationToken = default) { - return GetDeviceProvisioningServicesPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); + return GetDeviceProvisioningServicesCertificates().Get(certificateName, ifMatch, cancellationToken); } /// @@ -313,7 +313,7 @@ public virtual Response /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -393,7 +393,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -435,7 +435,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -477,7 +477,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -523,7 +523,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -557,63 +557,81 @@ public virtual ArmOperation Update(WaitUntil } /// - /// Gets the list of valid SKUs and tiers for a provisioning service. + /// List primary and secondary keys for a specific key name /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/skus + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/keys/{keyName}/listkeys /// /// /// Operation Id - /// IotDpsResource_ListValidSkus + /// IotDpsResource_ListKeysForKeyName /// /// /// Default Api Version - /// 2022-02-05 - /// - /// - /// Resource - /// + /// 2025-02-01-preview /// /// /// + /// Logical key name to get key-values for. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetValidSkusAsync(CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetKeyAsync(string keyName, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceProvisioningServiceIotDpsResourceRestClient.CreateListValidSkusRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceProvisioningServiceIotDpsResourceRestClient.CreateListValidSkusNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DeviceProvisioningServicesSkuDefinition.DeserializeDeviceProvisioningServicesSkuDefinition(e), _deviceProvisioningServiceIotDpsResourceClientDiagnostics, Pipeline, "DeviceProvisioningServiceResource.GetValidSkus", "value", "nextLink", cancellationToken); + Argument.AssertNotNullOrEmpty(keyName, nameof(keyName)); + + using var scope = _deviceProvisioningServiceIotDpsResourceClientDiagnostics.CreateScope("DeviceProvisioningServiceResource.GetKey"); + scope.Start(); + try + { + var response = await _deviceProvisioningServiceIotDpsResourceRestClient.ListKeysForKeyNameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, keyName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// - /// Gets the list of valid SKUs and tiers for a provisioning service. + /// List primary and secondary keys for a specific key name /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/skus + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/keys/{keyName}/listkeys /// /// /// Operation Id - /// IotDpsResource_ListValidSkus + /// IotDpsResource_ListKeysForKeyName /// /// /// Default Api Version - /// 2022-02-05 - /// - /// - /// Resource - /// + /// 2025-02-01-preview /// /// /// + /// Logical key name to get key-values for. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetValidSkus(CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetKey(string keyName, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceProvisioningServiceIotDpsResourceRestClient.CreateListValidSkusRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceProvisioningServiceIotDpsResourceRestClient.CreateListValidSkusNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DeviceProvisioningServicesSkuDefinition.DeserializeDeviceProvisioningServicesSkuDefinition(e), _deviceProvisioningServiceIotDpsResourceClientDiagnostics, Pipeline, "DeviceProvisioningServiceResource.GetValidSkus", "value", "nextLink", cancellationToken); + Argument.AssertNotNullOrEmpty(keyName, nameof(keyName)); + + using var scope = _deviceProvisioningServiceIotDpsResourceClientDiagnostics.CreateScope("DeviceProvisioningServiceResource.GetKey"); + scope.Start(); + try + { + var response = _deviceProvisioningServiceIotDpsResourceRestClient.ListKeysForKeyName(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, keyName, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// @@ -629,7 +647,7 @@ public virtual Pageable GetValidSkus(Ca /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -659,7 +677,7 @@ public virtual AsyncPageable GetKeysA /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -677,81 +695,63 @@ public virtual Pageable GetKeys(Cance } /// - /// List primary and secondary keys for a specific key name + /// Gets the list of valid SKUs and tiers for a provisioning service. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/keys/{keyName}/listkeys + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/skus /// /// /// Operation Id - /// IotDpsResource_ListKeysForKeyName + /// IotDpsResource_ListValidSkus /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview + /// + /// + /// Resource + /// /// /// /// - /// Logical key name to get key-values for. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetKeyAsync(string keyName, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetValidSkusAsync(CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(keyName, nameof(keyName)); - - using var scope = _deviceProvisioningServiceIotDpsResourceClientDiagnostics.CreateScope("DeviceProvisioningServiceResource.GetKey"); - scope.Start(); - try - { - var response = await _deviceProvisioningServiceIotDpsResourceRestClient.ListKeysForKeyNameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, keyName, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceProvisioningServiceIotDpsResourceRestClient.CreateListValidSkusRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceProvisioningServiceIotDpsResourceRestClient.CreateListValidSkusNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DeviceProvisioningServicesSkuDefinition.DeserializeDeviceProvisioningServicesSkuDefinition(e), _deviceProvisioningServiceIotDpsResourceClientDiagnostics, Pipeline, "DeviceProvisioningServiceResource.GetValidSkus", "value", "nextLink", cancellationToken); } /// - /// List primary and secondary keys for a specific key name + /// Gets the list of valid SKUs and tiers for a provisioning service. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/keys/{keyName}/listkeys + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/skus /// /// /// Operation Id - /// IotDpsResource_ListKeysForKeyName + /// IotDpsResource_ListValidSkus /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview + /// + /// + /// Resource + /// /// /// /// - /// Logical key name to get key-values for. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response GetKey(string keyName, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetValidSkus(CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(keyName, nameof(keyName)); - - using var scope = _deviceProvisioningServiceIotDpsResourceClientDiagnostics.CreateScope("DeviceProvisioningServiceResource.GetKey"); - scope.Start(); - try - { - var response = _deviceProvisioningServiceIotDpsResourceRestClient.ListKeysForKeyName(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, keyName, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceProvisioningServiceIotDpsResourceRestClient.CreateListValidSkusRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceProvisioningServiceIotDpsResourceRestClient.CreateListValidSkusNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DeviceProvisioningServicesSkuDefinition.DeserializeDeviceProvisioningServicesSkuDefinition(e), _deviceProvisioningServiceIotDpsResourceClientDiagnostics, Pipeline, "DeviceProvisioningServiceResource.GetValidSkus", "value", "nextLink", cancellationToken); } /// @@ -767,7 +767,7 @@ public virtual Response GetKey(string /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -829,7 +829,7 @@ public virtual async Task> AddTagAsy /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -891,7 +891,7 @@ public virtual Response AddTag(string key, st /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -948,7 +948,7 @@ public virtual async Task> SetTagsAs /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -1005,7 +1005,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -1065,7 +1065,7 @@ public virtual async Task> RemoveTag /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesCertificateCollection.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesCertificateCollection.cs index cafe7437e8de..b787d9cce0d4 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesCertificateCollection.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesCertificateCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -73,7 +73,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the certificate create or update. + /// Name of the certificate to retrieve. /// The certificate body. /// ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand new certificate. /// The cancellation token to use. @@ -116,7 +116,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -125,7 +125,7 @@ public virtual async Task /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the certificate create or update. + /// Name of the certificate to retrieve. /// The certificate body. /// ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand new certificate. /// The cancellation token to use. @@ -168,7 +168,7 @@ public virtual ArmOperation Creat /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -260,7 +260,7 @@ public virtual Response Get(strin /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetA /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual Pageable GetAll(Ca /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string certificateName, st /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -406,7 +406,7 @@ public virtual Response Exists(string certificateName, string ifMatch = nu /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -452,7 +452,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesCertificateResource.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesCertificateResource.cs index 694bc0269619..151930a26ffb 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesCertificateResource.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesCertificateResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(strin /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -204,8 +204,8 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, DeviceP scope.Start(); try { - var response = await _deviceProvisioningServicesCertificateDpsCertificateRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.IfMatch, options.CertificateCommonName, options.CertificateRawBytes, options.CertificateIsVerified, options.CertificatePurpose, options.CertificateCreatedOn, options.CertificateLastUpdatedOn, options.CertificateHasPrivateKey, options.CertificateNonce, cancellationToken).ConfigureAwait(false); - var uri = _deviceProvisioningServicesCertificateDpsCertificateRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.IfMatch, options.CertificateCommonName, options.CertificateRawBytes, options.CertificateIsVerified, options.CertificatePurpose, options.CertificateCreatedOn, options.CertificateLastUpdatedOn, options.CertificateHasPrivateKey, options.CertificateNonce); + var response = await _deviceProvisioningServicesCertificateDpsCertificateRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.CertificateCommonName, options.CertificateName1, options.CertificateRawBytes, options.CertificateIsVerified, options.CertificateCreatedOn, options.CertificateLastUpdatedOn, options.CertificateLastUpdated, options.CertificateHasPrivateKey, options.CertificateNonce, cancellationToken).ConfigureAwait(false); + var uri = _deviceProvisioningServicesCertificateDpsCertificateRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.CertificateCommonName, options.CertificateName1, options.CertificateRawBytes, options.CertificateIsVerified, options.CertificateCreatedOn, options.CertificateLastUpdatedOn, options.CertificateLastUpdated, options.CertificateHasPrivateKey, options.CertificateNonce); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new DeviceProvisioningServicesArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -232,7 +232,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, DeviceP /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -252,8 +252,8 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, DeviceProvisioningServic scope.Start(); try { - var response = _deviceProvisioningServicesCertificateDpsCertificateRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.IfMatch, options.CertificateCommonName, options.CertificateRawBytes, options.CertificateIsVerified, options.CertificatePurpose, options.CertificateCreatedOn, options.CertificateLastUpdatedOn, options.CertificateHasPrivateKey, options.CertificateNonce, cancellationToken); - var uri = _deviceProvisioningServicesCertificateDpsCertificateRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.IfMatch, options.CertificateCommonName, options.CertificateRawBytes, options.CertificateIsVerified, options.CertificatePurpose, options.CertificateCreatedOn, options.CertificateLastUpdatedOn, options.CertificateHasPrivateKey, options.CertificateNonce); + var response = _deviceProvisioningServicesCertificateDpsCertificateRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.CertificateCommonName, options.CertificateName1, options.CertificateRawBytes, options.CertificateIsVerified, options.CertificateCreatedOn, options.CertificateLastUpdatedOn, options.CertificateLastUpdated, options.CertificateHasPrivateKey, options.CertificateNonce, cancellationToken); + var uri = _deviceProvisioningServicesCertificateDpsCertificateRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.CertificateCommonName, options.CertificateName1, options.CertificateRawBytes, options.CertificateIsVerified, options.CertificateCreatedOn, options.CertificateLastUpdatedOn, options.CertificateLastUpdated, options.CertificateHasPrivateKey, options.CertificateNonce); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new DeviceProvisioningServicesArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -280,7 +280,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, DeviceProvisioningServic /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -329,7 +329,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -378,7 +378,7 @@ public virtual ArmOperation Updat /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual async Task> GenerateV scope.Start(); try { - var response = await _deviceProvisioningServicesCertificateDpsCertificateRestClient.GenerateVerificationCodeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.IfMatch, options.CertificateCommonName, options.CertificateRawBytes, options.CertificateIsVerified, options.CertificatePurpose, options.CertificateCreatedOn, options.CertificateLastUpdatedOn, options.CertificateHasPrivateKey, options.CertificateNonce, cancellationToken).ConfigureAwait(false); + var response = await _deviceProvisioningServicesCertificateDpsCertificateRestClient.GenerateVerificationCodeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.CertificateCommonName, options.CertificateName1, options.CertificateRawBytes, options.CertificateIsVerified, options.CertificateCreatedOn, options.CertificateLastUpdatedOn, options.CertificateLastUpdated, options.CertificateHasPrivateKey, options.CertificateNonce, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -420,7 +420,7 @@ public virtual async Task> GenerateV /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -439,7 +439,7 @@ public virtual Response GenerateVerificationC scope.Start(); try { - var response = _deviceProvisioningServicesCertificateDpsCertificateRestClient.GenerateVerificationCode(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.IfMatch, options.CertificateCommonName, options.CertificateRawBytes, options.CertificateIsVerified, options.CertificatePurpose, options.CertificateCreatedOn, options.CertificateLastUpdatedOn, options.CertificateHasPrivateKey, options.CertificateNonce, cancellationToken); + var response = _deviceProvisioningServicesCertificateDpsCertificateRestClient.GenerateVerificationCode(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.CertificateCommonName, options.CertificateName1, options.CertificateRawBytes, options.CertificateIsVerified, options.CertificateCreatedOn, options.CertificateLastUpdatedOn, options.CertificateLastUpdated, options.CertificateHasPrivateKey, options.CertificateNonce, cancellationToken); return response; } catch (Exception e) @@ -462,7 +462,7 @@ public virtual Response GenerateVerificationC /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -504,7 +504,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateEndpointConnectionCollection.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateEndpointConnectionCollection.cs index 635bf219a485..a809de2716ec 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateEndpointConnectionCollection.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateEndpointConnectionCollection.cs @@ -56,7 +56,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -105,7 +105,7 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual ArmOperation /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id @@ -162,7 +162,7 @@ public virtual ArmOperation /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -199,7 +199,7 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -244,7 +244,7 @@ public virtual Response /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections /// /// /// Operation Id @@ -252,7 +252,7 @@ public virtual Response /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -273,7 +273,7 @@ public virtual AsyncPageable /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections /// /// /// Operation Id @@ -281,7 +281,7 @@ public virtual AsyncPageable /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -302,7 +302,7 @@ public virtual Pageable /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id @@ -310,7 +310,7 @@ public virtual Pageable /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -388,7 +388,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id @@ -396,7 +396,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -433,7 +433,7 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id @@ -441,7 +441,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateEndpointConnectionResource.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateEndpointConnectionResource.cs index 04ed988e6913..bdf897648e31 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateEndpointConnectionResource.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateEndpointConnectionResource.cs @@ -25,11 +25,11 @@ public partial class DeviceProvisioningServicesPrivateEndpointConnectionResource /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. - /// The resourceName. + /// The provisioningServiceName. /// The privateEndpointConnectionName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string provisioningServiceName, string privateEndpointConnectionName) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName}"; return new ResourceIdentifier(resourceId); } @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -133,7 +133,7 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -173,7 +173,7 @@ public virtual Response /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id @@ -181,7 +181,7 @@ public virtual Response /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -215,7 +215,7 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id @@ -223,7 +223,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual ArmOperation /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id @@ -265,7 +265,7 @@ public virtual ArmOperation /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -303,7 +303,7 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateLinkResource.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateLinkResource.cs index bbbdace5fe6b..e28739a4b8f3 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateLinkResource.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateLinkResource.cs @@ -25,11 +25,11 @@ public partial class DeviceProvisioningServicesPrivateLinkResource : ArmResource /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. - /// The resourceName. + /// The provisioningServiceName. /// The groupId. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string groupId) + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string provisioningServiceName, string groupId) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateLinkResources/{groupId}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateLinkResources/{groupId}"; return new ResourceIdentifier(resourceId); } @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateLinkResources/{groupId} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateLinkResources/{groupId} /// /// /// Operation Id @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -133,7 +133,7 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateLinkResources/{groupId} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateLinkResources/{groupId} /// /// /// Operation Id @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateLinkResourceCollection.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateLinkResourceCollection.cs index 50f1d93bdfb3..98abb85cb350 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateLinkResourceCollection.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateLinkResourceCollection.cs @@ -56,7 +56,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateLinkResources/{groupId} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateLinkResources/{groupId} /// /// /// Operation Id @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -101,7 +101,7 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateLinkResources/{groupId} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateLinkResources/{groupId} /// /// /// Operation Id @@ -109,7 +109,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -146,7 +146,7 @@ public virtual Response Get(strin /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateLinkResources + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateLinkResources /// /// /// Operation Id @@ -154,7 +154,7 @@ public virtual Response Get(strin /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -175,7 +175,7 @@ public virtual AsyncPageable GetA /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateLinkResources + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateLinkResources /// /// /// Operation Id @@ -183,7 +183,7 @@ public virtual AsyncPageable GetA /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -204,7 +204,7 @@ public virtual Pageable GetAll(Ca /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateLinkResources/{groupId} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateLinkResources/{groupId} /// /// /// Operation Id @@ -212,7 +212,7 @@ public virtual Pageable GetAll(Ca /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -247,7 +247,7 @@ public virtual async Task> ExistsAsync(string groupId, Cancellati /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateLinkResources/{groupId} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateLinkResources/{groupId} /// /// /// Operation Id @@ -255,7 +255,7 @@ public virtual async Task> ExistsAsync(string groupId, Cancellati /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -290,7 +290,7 @@ public virtual Response Exists(string groupId, CancellationToken cancellat /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateLinkResources/{groupId} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateLinkResources/{groupId} /// /// /// Operation Id @@ -298,7 +298,7 @@ public virtual Response Exists(string groupId, CancellationToken cancellat /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -335,7 +335,7 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateLinkResources/{groupId} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/privateLinkResources/{groupId} /// /// /// Operation Id @@ -343,7 +343,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateLinkResourceData.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateLinkResourceData.cs index aca0f24560c0..0046bfb99b87 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateLinkResourceData.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServicesPrivateLinkResourceData.cs @@ -54,7 +54,7 @@ public partial class DeviceProvisioningServicesPrivateLinkResourceData : Resourc /// Initializes a new instance of . /// The properties for a group information object. /// is null. - internal DeviceProvisioningServicesPrivateLinkResourceData(DeviceProvisioningServicesPrivateLinkResourceProperties properties) + public DeviceProvisioningServicesPrivateLinkResourceData(DeviceProvisioningServicesPrivateLinkResourceProperties properties) { Argument.AssertNotNull(properties, nameof(properties)); @@ -80,6 +80,6 @@ internal DeviceProvisioningServicesPrivateLinkResourceData() } /// The properties for a group information object. - public DeviceProvisioningServicesPrivateLinkResourceProperties Properties { get; } + public DeviceProvisioningServicesPrivateLinkResourceProperties Properties { get; set; } } } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesExtensions.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesExtensions.cs index 07c9df2459ee..24fb1c524d67 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesExtensions.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesExtensions.cs @@ -34,41 +34,41 @@ private static MockableDeviceProvisioningServicesSubscriptionResource GetMockabl } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static DeviceProvisioningServicesCertificateResource GetDeviceProvisioningServicesCertificateResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static DeviceProvisioningServiceResource GetDeviceProvisioningServiceResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableDeviceProvisioningServicesArmClient(client).GetDeviceProvisioningServicesCertificateResource(id); + return GetMockableDeviceProvisioningServicesArmClient(client).GetDeviceProvisioningServiceResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static DeviceProvisioningServiceResource GetDeviceProvisioningServiceResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static DeviceProvisioningServicesPrivateEndpointConnectionResource GetDeviceProvisioningServicesPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableDeviceProvisioningServicesArmClient(client).GetDeviceProvisioningServiceResource(id); + return GetMockableDeviceProvisioningServicesArmClient(client).GetDeviceProvisioningServicesPrivateEndpointConnectionResource(id); } /// @@ -91,22 +91,22 @@ public static DeviceProvisioningServicesPrivateLinkResource GetDeviceProvisionin } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static DeviceProvisioningServicesPrivateEndpointConnectionResource GetDeviceProvisioningServicesPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static DeviceProvisioningServicesCertificateResource GetDeviceProvisioningServicesCertificateResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableDeviceProvisioningServicesArmClient(client).GetDeviceProvisioningServicesPrivateEndpointConnectionResource(id); + return GetMockableDeviceProvisioningServicesArmClient(client).GetDeviceProvisioningServicesCertificateResource(id); } /// @@ -139,7 +139,7 @@ public static DeviceProvisioningServiceCollection GetDeviceProvisioningServices( /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -177,7 +177,7 @@ public static async Task> GetDeviceP /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -203,19 +203,19 @@ public static Response GetDeviceProvisioningS } /// - /// List all the provisioning services for a given subscription id. + /// Check if a provisioning service name is available. This will validate if the name is syntactically valid and if the name is usable /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/provisioningServices + /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability /// /// /// Operation Id - /// IotDpsResource_ListBySubscription + /// IotDpsResource_CheckProvisioningServiceNameAvailability /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -224,34 +224,34 @@ public static Response GetDeviceProvisioningS /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. + /// The request body. /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetDeviceProvisioningServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// or is null. + public static async Task> CheckDeviceProvisioningServicesNameAvailabilityAsync(this SubscriptionResource subscriptionResource, DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableDeviceProvisioningServicesSubscriptionResource(subscriptionResource).GetDeviceProvisioningServicesAsync(cancellationToken); + return await GetMockableDeviceProvisioningServicesSubscriptionResource(subscriptionResource).CheckDeviceProvisioningServicesNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// - /// List all the provisioning services for a given subscription id. + /// Check if a provisioning service name is available. This will validate if the name is syntactically valid and if the name is usable /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/provisioningServices + /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability /// /// /// Operation Id - /// IotDpsResource_ListBySubscription + /// IotDpsResource_CheckProvisioningServiceNameAvailability /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -260,34 +260,34 @@ public static AsyncPageable GetDeviceProvisio /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. + /// The request body. /// The cancellation token to use. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetDeviceProvisioningServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// or is null. + public static Response CheckDeviceProvisioningServicesNameAvailability(this SubscriptionResource subscriptionResource, DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableDeviceProvisioningServicesSubscriptionResource(subscriptionResource).GetDeviceProvisioningServices(cancellationToken); + return GetMockableDeviceProvisioningServicesSubscriptionResource(subscriptionResource).CheckDeviceProvisioningServicesNameAvailability(content, cancellationToken); } /// - /// Check if a provisioning service name is available. This will validate if the name is syntactically valid and if the name is usable + /// List all the provisioning services for a given subscription id. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability + /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/provisioningServices /// /// /// Operation Id - /// IotDpsResource_CheckProvisioningServiceNameAvailability + /// IotDpsResource_ListBySubscription /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -296,34 +296,34 @@ public static Pageable GetDeviceProvisioningS /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Set the name parameter in the OperationInputs structure to the name of the provisioning service to check. /// The cancellation token to use. - /// or is null. - public static async Task> CheckDeviceProvisioningServicesNameAvailabilityAsync(this SubscriptionResource subscriptionResource, DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDeviceProvisioningServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return await GetMockableDeviceProvisioningServicesSubscriptionResource(subscriptionResource).CheckDeviceProvisioningServicesNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return GetMockableDeviceProvisioningServicesSubscriptionResource(subscriptionResource).GetDeviceProvisioningServicesAsync(cancellationToken); } /// - /// Check if a provisioning service name is available. This will validate if the name is syntactically valid and if the name is usable + /// List all the provisioning services for a given subscription id. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability + /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/provisioningServices /// /// /// Operation Id - /// IotDpsResource_CheckProvisioningServiceNameAvailability + /// IotDpsResource_ListBySubscription /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -332,18 +332,18 @@ public static async Task /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Set the name parameter in the OperationInputs structure to the name of the provisioning service to check. /// The cancellation token to use. - /// or is null. - public static Response CheckDeviceProvisioningServicesNameAvailability(this SubscriptionResource subscriptionResource, DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetDeviceProvisioningServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableDeviceProvisioningServicesSubscriptionResource(subscriptionResource).CheckDeviceProvisioningServicesNameAvailability(content, cancellationToken); + return GetMockableDeviceProvisioningServicesSubscriptionResource(subscriptionResource).GetDeviceProvisioningServices(cancellationToken); } } } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/MockableDeviceProvisioningServicesArmClient.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/MockableDeviceProvisioningServicesArmClient.cs index e426fadd3633..226f994c3608 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/MockableDeviceProvisioningServicesArmClient.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/MockableDeviceProvisioningServicesArmClient.cs @@ -34,18 +34,6 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual DeviceProvisioningServicesCertificateResource GetDeviceProvisioningServicesCertificateResource(ResourceIdentifier id) - { - DeviceProvisioningServicesCertificateResource.ValidateResourceId(id); - return new DeviceProvisioningServicesCertificateResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -58,6 +46,18 @@ public virtual DeviceProvisioningServiceResource GetDeviceProvisioningServiceRes return new DeviceProvisioningServiceResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DeviceProvisioningServicesPrivateEndpointConnectionResource GetDeviceProvisioningServicesPrivateEndpointConnectionResource(ResourceIdentifier id) + { + DeviceProvisioningServicesPrivateEndpointConnectionResource.ValidateResourceId(id); + return new DeviceProvisioningServicesPrivateEndpointConnectionResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -71,15 +71,15 @@ public virtual DeviceProvisioningServicesPrivateLinkResource GetDeviceProvisioni } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual DeviceProvisioningServicesPrivateEndpointConnectionResource GetDeviceProvisioningServicesPrivateEndpointConnectionResource(ResourceIdentifier id) + /// Returns a object. + public virtual DeviceProvisioningServicesCertificateResource GetDeviceProvisioningServicesCertificateResource(ResourceIdentifier id) { - DeviceProvisioningServicesPrivateEndpointConnectionResource.ValidateResourceId(id); - return new DeviceProvisioningServicesPrivateEndpointConnectionResource(Client, id); + DeviceProvisioningServicesCertificateResource.ValidateResourceId(id); + return new DeviceProvisioningServicesCertificateResource(Client, id); } } } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/MockableDeviceProvisioningServicesResourceGroupResource.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/MockableDeviceProvisioningServicesResourceGroupResource.cs index 7044386ed3ca..0e23e9a81052 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/MockableDeviceProvisioningServicesResourceGroupResource.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/MockableDeviceProvisioningServicesResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual DeviceProvisioningServiceCollection GetDeviceProvisioningServices /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetDevice /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/MockableDeviceProvisioningServicesSubscriptionResource.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/MockableDeviceProvisioningServicesSubscriptionResource.cs index 8bf8a33ff135..2117cac2c798 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/MockableDeviceProvisioningServicesSubscriptionResource.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/MockableDeviceProvisioningServicesSubscriptionResource.cs @@ -43,19 +43,19 @@ private string GetApiVersionOrNull(ResourceType resourceType) } /// - /// List all the provisioning services for a given subscription id. + /// Check if a provisioning service name is available. This will validate if the name is syntactically valid and if the name is usable /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/provisioningServices + /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability /// /// /// Operation Id - /// IotDpsResource_ListBySubscription + /// IotDpsResource_CheckProvisioningServiceNameAvailability /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -63,29 +63,41 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// + /// The request body. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetDeviceProvisioningServicesAsync(CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> CheckDeviceProvisioningServicesNameAvailabilityAsync(DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceProvisioningServiceIotDpsResourceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceProvisioningServiceIotDpsResourceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceProvisioningServiceResource(Client, DeviceProvisioningServiceData.DeserializeDeviceProvisioningServiceData(e)), DeviceProvisioningServiceIotDpsResourceClientDiagnostics, Pipeline, "MockableDeviceProvisioningServicesSubscriptionResource.GetDeviceProvisioningServices", "value", "nextLink", cancellationToken); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DeviceProvisioningServiceIotDpsResourceClientDiagnostics.CreateScope("MockableDeviceProvisioningServicesSubscriptionResource.CheckDeviceProvisioningServicesNameAvailability"); + scope.Start(); + try + { + var response = await DeviceProvisioningServiceIotDpsResourceRestClient.CheckProvisioningServiceNameAvailabilityAsync(Id.SubscriptionId, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// - /// List all the provisioning services for a given subscription id. + /// Check if a provisioning service name is available. This will validate if the name is syntactically valid and if the name is usable /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/provisioningServices + /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability /// /// /// Operation Id - /// IotDpsResource_ListBySubscription + /// IotDpsResource_CheckProvisioningServiceNameAvailability /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -93,29 +105,41 @@ public virtual AsyncPageable GetDeviceProvisi /// /// /// + /// The request body. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetDeviceProvisioningServices(CancellationToken cancellationToken = default) + /// is null. + public virtual Response CheckDeviceProvisioningServicesNameAvailability(DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceProvisioningServiceIotDpsResourceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceProvisioningServiceIotDpsResourceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceProvisioningServiceResource(Client, DeviceProvisioningServiceData.DeserializeDeviceProvisioningServiceData(e)), DeviceProvisioningServiceIotDpsResourceClientDiagnostics, Pipeline, "MockableDeviceProvisioningServicesSubscriptionResource.GetDeviceProvisioningServices", "value", "nextLink", cancellationToken); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DeviceProvisioningServiceIotDpsResourceClientDiagnostics.CreateScope("MockableDeviceProvisioningServicesSubscriptionResource.CheckDeviceProvisioningServicesNameAvailability"); + scope.Start(); + try + { + var response = DeviceProvisioningServiceIotDpsResourceRestClient.CheckProvisioningServiceNameAvailability(Id.SubscriptionId, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// - /// Check if a provisioning service name is available. This will validate if the name is syntactically valid and if the name is usable + /// List all the provisioning services for a given subscription id. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability + /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/provisioningServices /// /// /// Operation Id - /// IotDpsResource_CheckProvisioningServiceNameAvailability + /// IotDpsResource_ListBySubscription /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -123,41 +147,29 @@ public virtual Pageable GetDeviceProvisioning /// /// /// - /// Set the name parameter in the OperationInputs structure to the name of the provisioning service to check. /// The cancellation token to use. - /// is null. - public virtual async Task> CheckDeviceProvisioningServicesNameAvailabilityAsync(DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDeviceProvisioningServicesAsync(CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = DeviceProvisioningServiceIotDpsResourceClientDiagnostics.CreateScope("MockableDeviceProvisioningServicesSubscriptionResource.CheckDeviceProvisioningServicesNameAvailability"); - scope.Start(); - try - { - var response = await DeviceProvisioningServiceIotDpsResourceRestClient.CheckProvisioningServiceNameAvailabilityAsync(Id.SubscriptionId, content, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceProvisioningServiceIotDpsResourceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceProvisioningServiceIotDpsResourceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceProvisioningServiceResource(Client, DeviceProvisioningServiceData.DeserializeDeviceProvisioningServiceData(e)), DeviceProvisioningServiceIotDpsResourceClientDiagnostics, Pipeline, "MockableDeviceProvisioningServicesSubscriptionResource.GetDeviceProvisioningServices", "value", "nextLink", cancellationToken); } /// - /// Check if a provisioning service name is available. This will validate if the name is syntactically valid and if the name is usable + /// List all the provisioning services for a given subscription id. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability + /// /subscriptions/{subscriptionId}/providers/Microsoft.Devices/provisioningServices /// /// /// Operation Id - /// IotDpsResource_CheckProvisioningServiceNameAvailability + /// IotDpsResource_ListBySubscription /// /// /// Default Api Version - /// 2022-02-05 + /// 2025-02-01-preview /// /// /// Resource @@ -165,25 +177,13 @@ public virtual async Task /// /// - /// Set the name parameter in the OperationInputs structure to the name of the provisioning service to check. /// The cancellation token to use. - /// is null. - public virtual Response CheckDeviceProvisioningServicesNameAvailability(DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDeviceProvisioningServices(CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = DeviceProvisioningServiceIotDpsResourceClientDiagnostics.CreateScope("MockableDeviceProvisioningServicesSubscriptionResource.CheckDeviceProvisioningServicesNameAvailability"); - scope.Start(); - try - { - var response = DeviceProvisioningServiceIotDpsResourceRestClient.CheckProvisioningServiceNameAvailability(Id.SubscriptionId, content, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceProvisioningServiceIotDpsResourceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceProvisioningServiceIotDpsResourceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceProvisioningServiceResource(Client, DeviceProvisioningServiceData.DeserializeDeviceProvisioningServiceData(e)), DeviceProvisioningServiceIotDpsResourceClientDiagnostics, Pipeline, "MockableDeviceProvisioningServicesSubscriptionResource.GetDeviceProvisioningServices", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/CertificateVerificationCodeProperties.Serialization.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/CertificateVerificationCodeProperties.Serialization.cs index d0b7f9776182..c88c03add8c4 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/CertificateVerificationCodeProperties.Serialization.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/CertificateVerificationCodeProperties.Serialization.cs @@ -47,7 +47,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(ExpireOn)) { writer.WritePropertyName("expiry"u8); - writer.WriteStringValue(ExpireOn.Value, "R"); + writer.WriteStringValue(ExpireOn); } if (Optional.IsDefined(Thumbprint)) { @@ -81,12 +81,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(CreatedOn)) { writer.WritePropertyName("created"u8); - writer.WriteStringValue(CreatedOn.Value, "R"); + writer.WriteStringValue(CreatedOn); } if (Optional.IsDefined(UpdatedOn)) { writer.WritePropertyName("updated"u8); - writer.WriteStringValue(UpdatedOn.Value, "R"); + writer.WriteStringValue(UpdatedOn); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -127,12 +127,12 @@ internal static CertificateVerificationCodeProperties DeserializeCertificateVeri } string verificationCode = default; string subject = default; - DateTimeOffset? expiry = default; + string expiry = default; BinaryData thumbprint = default; bool? isVerified = default; BinaryData certificate = default; - DateTimeOffset? created = default; - DateTimeOffset? updated = default; + string created = default; + string updated = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -149,11 +149,7 @@ internal static CertificateVerificationCodeProperties DeserializeCertificateVeri } if (property.NameEquals("expiry"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - expiry = property.Value.GetDateTimeOffset("R"); + expiry = property.Value.GetString(); continue; } if (property.NameEquals("thumbprint"u8)) @@ -185,20 +181,12 @@ internal static CertificateVerificationCodeProperties DeserializeCertificateVeri } if (property.NameEquals("created"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - created = property.Value.GetDateTimeOffset("R"); + created = property.Value.GetString(); continue; } if (property.NameEquals("updated"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - updated = property.Value.GetDateTimeOffset("R"); + updated = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/CertificateVerificationCodeProperties.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/CertificateVerificationCodeProperties.cs index 38134270fc75..94d6a57a06cd 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/CertificateVerificationCodeProperties.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/CertificateVerificationCodeProperties.cs @@ -60,7 +60,7 @@ internal CertificateVerificationCodeProperties() /// Certificate created time. /// Certificate updated time. /// Keeps track of any properties unknown to the library. - internal CertificateVerificationCodeProperties(string verificationCode, string subject, DateTimeOffset? expireOn, BinaryData thumbprint, bool? isVerified, BinaryData certificate, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IDictionary serializedAdditionalRawData) + internal CertificateVerificationCodeProperties(string verificationCode, string subject, string expireOn, BinaryData thumbprint, bool? isVerified, BinaryData certificate, string createdOn, string updatedOn, IDictionary serializedAdditionalRawData) { VerificationCode = verificationCode; Subject = subject; @@ -78,7 +78,7 @@ internal CertificateVerificationCodeProperties(string verificationCode, string s /// Certificate subject. public string Subject { get; } /// Code expiry. - public DateTimeOffset? ExpireOn { get; } + public string ExpireOn { get; } /// /// Certificate thumbprint. /// @@ -144,8 +144,8 @@ internal CertificateVerificationCodeProperties(string verificationCode, string s /// public BinaryData Certificate { get; } /// Certificate created time. - public DateTimeOffset? CreatedOn { get; } + public string CreatedOn { get; } /// Certificate updated time. - public DateTimeOffset? UpdatedOn { get; } + public string UpdatedOn { get; } } } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServiceProperties.Serialization.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServiceProperties.Serialization.cs index 809fc7d4febe..c4eec240c9c3 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServiceProperties.Serialization.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServiceProperties.Serialization.cs @@ -114,6 +114,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("enableDataResidency"u8); writer.WriteBooleanValue(IsDataResidencyEnabled.Value); } + if (Optional.IsDefined(PortalOperationsHostName)) + { + writer.WritePropertyName("portalOperationsHostName"u8); + writer.WriteStringValue(PortalOperationsHostName); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -163,6 +168,7 @@ internal static DeviceProvisioningServiceProperties DeserializeDeviceProvisionin string idScope = default; IList authorizationPolicies = default; bool? enableDataResidency = default; + string portalOperationsHostName = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -279,6 +285,11 @@ internal static DeviceProvisioningServiceProperties DeserializeDeviceProvisionin enableDataResidency = property.Value.GetBoolean(); continue; } + if (property.NameEquals("portalOperationsHostName"u8)) + { + portalOperationsHostName = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -298,6 +309,7 @@ internal static DeviceProvisioningServiceProperties DeserializeDeviceProvisionin idScope, authorizationPolicies ?? new ChangeTrackingList(), enableDataResidency, + portalOperationsHostName, serializedAdditionalRawData); } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServiceProperties.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServiceProperties.cs index 09aeb078068a..e4b3be0d86fe 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServiceProperties.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServiceProperties.cs @@ -70,8 +70,9 @@ public DeviceProvisioningServiceProperties() /// Optional. /// Indicates if the DPS instance has Data Residency enabled, removing the cross geo-pair disaster recovery. /// + /// Portal endpoint to enable CORS for this provisioning service. /// Keeps track of any properties unknown to the library. - internal DeviceProvisioningServiceProperties(DeviceProvisioningServicesState? state, DeviceProvisioningServicesPublicNetworkAccess? publicNetworkAccess, IList ipFilterRules, IList privateEndpointConnections, string provisioningState, IList iotHubs, DeviceProvisioningServicesAllocationPolicy? allocationPolicy, string serviceOperationsHostName, string deviceProvisioningHostName, string idScope, IList authorizationPolicies, bool? isDataResidencyEnabled, IDictionary serializedAdditionalRawData) + internal DeviceProvisioningServiceProperties(DeviceProvisioningServicesState? state, DeviceProvisioningServicesPublicNetworkAccess? publicNetworkAccess, IList ipFilterRules, IList privateEndpointConnections, string provisioningState, IList iotHubs, DeviceProvisioningServicesAllocationPolicy? allocationPolicy, string serviceOperationsHostName, string deviceProvisioningHostName, string idScope, IList authorizationPolicies, bool? isDataResidencyEnabled, string portalOperationsHostName, IDictionary serializedAdditionalRawData) { State = state; PublicNetworkAccess = publicNetworkAccess; @@ -85,6 +86,7 @@ internal DeviceProvisioningServiceProperties(DeviceProvisioningServicesState? st IdScope = idScope; AuthorizationPolicies = authorizationPolicies; IsDataResidencyEnabled = isDataResidencyEnabled; + PortalOperationsHostName = portalOperationsHostName; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -115,5 +117,7 @@ internal DeviceProvisioningServiceProperties(DeviceProvisioningServicesState? st /// Indicates if the DPS instance has Data Residency enabled, removing the cross geo-pair disaster recovery. /// public bool? IsDataResidencyEnabled { get; set; } + /// Portal endpoint to enable CORS for this provisioning service. + public string PortalOperationsHostName { get; set; } } } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesCertificateResourceDeleteOptions.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesCertificateResourceDeleteOptions.cs index 99d7b4849384..3c260f5ae013 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesCertificateResourceDeleteOptions.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesCertificateResourceDeleteOptions.cs @@ -13,13 +13,13 @@ namespace Azure.ResourceManager.DeviceProvisioningServices.Models public partial class DeviceProvisioningServicesCertificateResourceDeleteOptions { /// Initializes a new instance of . - /// ETag of the certificate. - /// is null. - public DeviceProvisioningServicesCertificateResourceDeleteOptions(string ifMatch) + /// ETag of the certificate. + /// is null. + public DeviceProvisioningServicesCertificateResourceDeleteOptions(string certificateCommonName) { - Argument.AssertNotNull(ifMatch, nameof(ifMatch)); + Argument.AssertNotNull(certificateCommonName, nameof(certificateCommonName)); - IfMatch = ifMatch; + CertificateCommonName = certificateCommonName; } /// Initializes a new instance of for deserialization. @@ -28,19 +28,19 @@ internal DeviceProvisioningServicesCertificateResourceDeleteOptions() } /// ETag of the certificate. - public string IfMatch { get; } + public string CertificateCommonName { get; } /// This is optional, and it is the Common Name of the certificate. - public string CertificateCommonName { get; set; } + public string CertificateName1 { get; set; } /// Raw data within the certificate. public byte[] CertificateRawBytes { get; set; } /// Indicates if certificate has been verified by owner of the private key. public bool? CertificateIsVerified { get; set; } /// A description that mentions the purpose of the certificate. - public DeviceProvisioningServicesCertificatePurpose? CertificatePurpose { get; set; } + public DeviceProvisioningServicesCertificatePurpose? CertificateCreatedOn { get; set; } /// Time the certificate is created. - public DateTimeOffset? CertificateCreatedOn { get; set; } - /// Time the certificate is last updated. public DateTimeOffset? CertificateLastUpdatedOn { get; set; } + /// Time the certificate is last updated. + public DateTimeOffset? CertificateLastUpdated { get; set; } /// Indicates if the certificate contains a private key. public bool? CertificateHasPrivateKey { get; set; } /// Random number generated to indicate Proof of Possession. diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesCertificateResourceGenerateVerificationCodeOptions.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesCertificateResourceGenerateVerificationCodeOptions.cs index e7bcf4e5cb91..157063b34ec4 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesCertificateResourceGenerateVerificationCodeOptions.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesCertificateResourceGenerateVerificationCodeOptions.cs @@ -13,13 +13,13 @@ namespace Azure.ResourceManager.DeviceProvisioningServices.Models public partial class DeviceProvisioningServicesCertificateResourceGenerateVerificationCodeOptions { /// Initializes a new instance of . - /// ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand new certificate. - /// is null. - public DeviceProvisioningServicesCertificateResourceGenerateVerificationCodeOptions(string ifMatch) + /// ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand new certificate. + /// is null. + public DeviceProvisioningServicesCertificateResourceGenerateVerificationCodeOptions(string certificateCommonName) { - Argument.AssertNotNull(ifMatch, nameof(ifMatch)); + Argument.AssertNotNull(certificateCommonName, nameof(certificateCommonName)); - IfMatch = ifMatch; + CertificateCommonName = certificateCommonName; } /// Initializes a new instance of for deserialization. @@ -28,19 +28,19 @@ internal DeviceProvisioningServicesCertificateResourceGenerateVerificationCodeOp } /// ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand new certificate. - public string IfMatch { get; } + public string CertificateCommonName { get; } /// Common Name for the certificate. - public string CertificateCommonName { get; set; } + public string CertificateName1 { get; set; } /// Raw data of certificate. public byte[] CertificateRawBytes { get; set; } /// Indicates if the certificate has been verified by owner of the private key. public bool? CertificateIsVerified { get; set; } /// Description mentioning the purpose of the certificate. - public DeviceProvisioningServicesCertificatePurpose? CertificatePurpose { get; set; } + public DeviceProvisioningServicesCertificatePurpose? CertificateCreatedOn { get; set; } /// Certificate creation time. - public DateTimeOffset? CertificateCreatedOn { get; set; } - /// Certificate last updated time. public DateTimeOffset? CertificateLastUpdatedOn { get; set; } + /// Certificate last updated time. + public DateTimeOffset? CertificateLastUpdated { get; set; } /// Indicates if the certificate contains private key. public bool? CertificateHasPrivateKey { get; set; } /// Random number generated to indicate Proof of Possession. diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesPrivateLinkResourceProperties.Serialization.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesPrivateLinkResourceProperties.Serialization.cs index c712b48368d7..ed3b6df865ca 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesPrivateLinkResourceProperties.Serialization.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesPrivateLinkResourceProperties.Serialization.cs @@ -97,8 +97,8 @@ internal static DeviceProvisioningServicesPrivateLinkResourceProperties Deserial return null; } string groupId = default; - IReadOnlyList requiredMembers = default; - IReadOnlyList requiredZoneNames = default; + IList requiredMembers = default; + IList requiredZoneNames = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesPrivateLinkResourceProperties.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesPrivateLinkResourceProperties.cs index 4af2ba7d3fb0..5c3fb23a5a9b 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesPrivateLinkResourceProperties.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/DeviceProvisioningServicesPrivateLinkResourceProperties.cs @@ -46,7 +46,7 @@ public partial class DeviceProvisioningServicesPrivateLinkResourceProperties private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal DeviceProvisioningServicesPrivateLinkResourceProperties() + public DeviceProvisioningServicesPrivateLinkResourceProperties() { RequiredMembers = new ChangeTrackingList(); RequiredZoneNames = new ChangeTrackingList(); @@ -57,7 +57,7 @@ internal DeviceProvisioningServicesPrivateLinkResourceProperties() /// The required members for a specific group id. /// The required DNS zones for a specific group id. /// Keeps track of any properties unknown to the library. - internal DeviceProvisioningServicesPrivateLinkResourceProperties(string groupId, IReadOnlyList requiredMembers, IReadOnlyList requiredZoneNames, IDictionary serializedAdditionalRawData) + internal DeviceProvisioningServicesPrivateLinkResourceProperties(string groupId, IList requiredMembers, IList requiredZoneNames, IDictionary serializedAdditionalRawData) { GroupId = groupId; RequiredMembers = requiredMembers; @@ -66,10 +66,10 @@ internal DeviceProvisioningServicesPrivateLinkResourceProperties(string groupId, } /// The group id. - public string GroupId { get; } + public string GroupId { get; set; } /// The required members for a specific group id. - public IReadOnlyList RequiredMembers { get; } + public IList RequiredMembers { get; } /// The required DNS zones for a specific group id. - public IReadOnlyList RequiredZoneNames { get; } + public IList RequiredZoneNames { get; } } } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuDefinitionListResult.Serialization.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuDefinitionListResult.Serialization.cs index 7055fda6d986..1faa4f034b0b 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuDefinitionListResult.Serialization.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuDefinitionListResult.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(IotDpsSkuDefinitionListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static IotDpsSkuDefinitionListResult DeserializeIotDpsSkuDefinitionList return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static IotDpsSkuDefinitionListResult DeserializeIotDpsSkuDefinitionList } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static IotDpsSkuDefinitionListResult DeserializeIotDpsSkuDefinitionList } } serializedAdditionalRawData = rawDataDictionary; - return new IotDpsSkuDefinitionListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new IotDpsSkuDefinitionListResult(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuDefinitionListResult.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuDefinitionListResult.cs index d4e1c7398311..1be0c09ae0fc 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuDefinitionListResult.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuDefinitionListResult.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DeviceProvisioningServices.Models { @@ -46,25 +47,34 @@ internal partial class IotDpsSkuDefinitionListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal IotDpsSkuDefinitionListResult() + /// The IotDpsSkuDefinition items on this page. + /// is null. + internal IotDpsSkuDefinitionListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// The list of SKUs. - /// The next link. + /// The IotDpsSkuDefinition items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal IotDpsSkuDefinitionListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal IotDpsSkuDefinitionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of SKUs. + /// Initializes a new instance of for deserialization. + internal IotDpsSkuDefinitionListResult() + { + } + + /// The IotDpsSkuDefinition items on this page. public IReadOnlyList Value { get; } - /// The next link. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotHubAuthenticationType.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotHubAuthenticationType.cs new file mode 100644 index 000000000000..3ecfb63f1a2f --- /dev/null +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotHubAuthenticationType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DeviceProvisioningServices.Models +{ + /// IotHub MI authentication type: KeyBased, UserAssigned, SystemAssigned. + public readonly partial struct IotHubAuthenticationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IotHubAuthenticationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string KeyBasedValue = "KeyBased"; + private const string UserAssignedValue = "UserAssigned"; + private const string SystemAssignedValue = "SystemAssigned"; + + /// KeyBased. + public static IotHubAuthenticationType KeyBased { get; } = new IotHubAuthenticationType(KeyBasedValue); + /// UserAssigned. + public static IotHubAuthenticationType UserAssigned { get; } = new IotHubAuthenticationType(UserAssignedValue); + /// SystemAssigned. + public static IotHubAuthenticationType SystemAssigned { get; } = new IotHubAuthenticationType(SystemAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(IotHubAuthenticationType left, IotHubAuthenticationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IotHubAuthenticationType left, IotHubAuthenticationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IotHubAuthenticationType(string value) => new IotHubAuthenticationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IotHubAuthenticationType other && Equals(other); + /// + public bool Equals(IotHubAuthenticationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotHubDefinitionDescription.Serialization.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotHubDefinitionDescription.Serialization.cs index 5d1862586c89..921a8bbd0f20 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotHubDefinitionDescription.Serialization.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotHubDefinitionDescription.Serialization.cs @@ -49,10 +49,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } - writer.WritePropertyName("connectionString"u8); - writer.WriteStringValue(ConnectionString); + if (Optional.IsDefined(ConnectionString)) + { + writer.WritePropertyName("connectionString"u8); + writer.WriteStringValue(ConnectionString); + } writer.WritePropertyName("location"u8); writer.WriteStringValue(Location); + if (Optional.IsDefined(AuthenticationType)) + { + writer.WritePropertyName("authenticationType"u8); + writer.WriteStringValue(AuthenticationType.Value.ToString()); + } + if (Optional.IsDefined(SelectedUserAssignedIdentityResourceId)) + { + writer.WritePropertyName("selectedUserAssignedIdentityResourceId"u8); + writer.WriteStringValue(SelectedUserAssignedIdentityResourceId); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -95,6 +108,8 @@ internal static IotHubDefinitionDescription DeserializeIotHubDefinitionDescripti string name = default; string connectionString = default; AzureLocation location = default; + IotHubAuthenticationType? authenticationType = default; + ResourceIdentifier selectedUserAssignedIdentityResourceId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -132,6 +147,24 @@ internal static IotHubDefinitionDescription DeserializeIotHubDefinitionDescripti location = new AzureLocation(property.Value.GetString()); continue; } + if (property.NameEquals("authenticationType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authenticationType = new IotHubAuthenticationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("selectedUserAssignedIdentityResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selectedUserAssignedIdentityResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -144,6 +177,8 @@ internal static IotHubDefinitionDescription DeserializeIotHubDefinitionDescripti name, connectionString, location, + authenticationType, + selectedUserAssignedIdentityResourceId, serializedAdditionalRawData); } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotHubDefinitionDescription.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotHubDefinitionDescription.cs index a9bd359a4604..0e5ce1ad4246 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotHubDefinitionDescription.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/IotHubDefinitionDescription.cs @@ -47,14 +47,9 @@ public partial class IotHubDefinitionDescription private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Connection string of the IoT hub. /// ARM region of the IoT hub. - /// is null. - public IotHubDefinitionDescription(string connectionString, AzureLocation location) + public IotHubDefinitionDescription(AzureLocation location) { - Argument.AssertNotNull(connectionString, nameof(connectionString)); - - ConnectionString = connectionString; Location = location; } @@ -64,14 +59,18 @@ public IotHubDefinitionDescription(string connectionString, AzureLocation locati /// Host name of the IoT hub. /// Connection string of the IoT hub. /// ARM region of the IoT hub. + /// IotHub MI authentication type: KeyBased, UserAssigned, SystemAssigned. + /// The selected user-assigned identity resource Id associated with IoT Hub. This is required when authenticationType is UserAssigned. /// Keeps track of any properties unknown to the library. - internal IotHubDefinitionDescription(bool? applyAllocationPolicy, int? allocationWeight, string name, string connectionString, AzureLocation location, IDictionary serializedAdditionalRawData) + internal IotHubDefinitionDescription(bool? applyAllocationPolicy, int? allocationWeight, string name, string connectionString, AzureLocation location, IotHubAuthenticationType? authenticationType, ResourceIdentifier selectedUserAssignedIdentityResourceId, IDictionary serializedAdditionalRawData) { ApplyAllocationPolicy = applyAllocationPolicy; AllocationWeight = allocationWeight; Name = name; ConnectionString = connectionString; Location = location; + AuthenticationType = authenticationType; + SelectedUserAssignedIdentityResourceId = selectedUserAssignedIdentityResourceId; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -90,5 +89,9 @@ internal IotHubDefinitionDescription() public string ConnectionString { get; set; } /// ARM region of the IoT hub. public AzureLocation Location { get; set; } + /// IotHub MI authentication type: KeyBased, UserAssigned, SystemAssigned. + public IotHubAuthenticationType? AuthenticationType { get; set; } + /// The selected user-assigned identity resource Id associated with IoT Hub. This is required when authenticationType is UserAssigned. + public ResourceIdentifier SelectedUserAssignedIdentityResourceId { get; set; } } } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/ProvisioningServiceDescriptionListResult.Serialization.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/ProvisioningServiceDescriptionListResult.Serialization.cs index 2ab199d1ba41..800c8d048a31 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/ProvisioningServiceDescriptionListResult.Serialization.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/ProvisioningServiceDescriptionListResult.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ProvisioningServiceDescriptionListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static ProvisioningServiceDescriptionListResult DeserializeProvisioning return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static ProvisioningServiceDescriptionListResult DeserializeProvisioning } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static ProvisioningServiceDescriptionListResult DeserializeProvisioning } } serializedAdditionalRawData = rawDataDictionary; - return new ProvisioningServiceDescriptionListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ProvisioningServiceDescriptionListResult(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/ProvisioningServiceDescriptionListResult.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/ProvisioningServiceDescriptionListResult.cs index e44efd428932..352bf7e5e2d1 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/ProvisioningServiceDescriptionListResult.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/ProvisioningServiceDescriptionListResult.cs @@ -7,10 +7,11 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DeviceProvisioningServices.Models { - /// List of provisioning service descriptions. + /// The response of a ProvisioningServiceDescription list operation. internal partial class ProvisioningServiceDescriptionListResult { /// @@ -46,25 +47,34 @@ internal partial class ProvisioningServiceDescriptionListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ProvisioningServiceDescriptionListResult() + /// The ProvisioningServiceDescription items on this page. + /// is null. + internal ProvisioningServiceDescriptionListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// List of provisioning service descriptions. - /// the next link. + /// The ProvisioningServiceDescription items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ProvisioningServiceDescriptionListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ProvisioningServiceDescriptionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of provisioning service descriptions. + /// Initializes a new instance of for deserialization. + internal ProvisioningServiceDescriptionListResult() + { + } + + /// The ProvisioningServiceDescription items on this page. public IReadOnlyList Value { get; } - /// the next link. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/SharedAccessSignatureAuthorizationRuleListResult.Serialization.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/SharedAccessSignatureAuthorizationRuleListResult.Serialization.cs index 3d8f42a44d50..8b7301a78d97 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/SharedAccessSignatureAuthorizationRuleListResult.Serialization.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/SharedAccessSignatureAuthorizationRuleListResult.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(SharedAccessSignatureAuthorizationRuleListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static SharedAccessSignatureAuthorizationRuleListResult DeserializeShar return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static SharedAccessSignatureAuthorizationRuleListResult DeserializeShar } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static SharedAccessSignatureAuthorizationRuleListResult DeserializeShar } } serializedAdditionalRawData = rawDataDictionary; - return new SharedAccessSignatureAuthorizationRuleListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new SharedAccessSignatureAuthorizationRuleListResult(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/SharedAccessSignatureAuthorizationRuleListResult.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/SharedAccessSignatureAuthorizationRuleListResult.cs index 5cad2ff8e91e..4d6bd6a3b963 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/SharedAccessSignatureAuthorizationRuleListResult.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Models/SharedAccessSignatureAuthorizationRuleListResult.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DeviceProvisioningServices.Models { @@ -46,25 +47,34 @@ internal partial class SharedAccessSignatureAuthorizationRuleListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal SharedAccessSignatureAuthorizationRuleListResult() + /// The SharedAccessSignatureAuthorizationRuleAccessRightsDescription items on this page. + /// is null. + internal SharedAccessSignatureAuthorizationRuleListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// The list of shared access policies. - /// The next link. + /// The SharedAccessSignatureAuthorizationRuleAccessRightsDescription items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal SharedAccessSignatureAuthorizationRuleListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal SharedAccessSignatureAuthorizationRuleListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of shared access policies. + /// Initializes a new instance of for deserialization. + internal SharedAccessSignatureAuthorizationRuleListResult() + { + } + + /// The SharedAccessSignatureAuthorizationRuleAccessRightsDescription items on this page. public IReadOnlyList Value { get; } - /// The next link. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/RestOperations/DpsCertificateRestOperations.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/RestOperations/DpsCertificateRestOperations.cs index d995c05fc825..475a1f3ec048 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/RestOperations/DpsCertificateRestOperations.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/RestOperations/DpsCertificateRestOperations.cs @@ -32,10 +32,104 @@ public DpsCertificateRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-05"; + _apiVersion = apiVersion ?? "2025-02-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/certificates", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/certificates", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the certificates tied to the provisioning service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, provisioningServiceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CertificateListDescription value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CertificateListDescription.DeserializeCertificateListDescription(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the certificates tied to the provisioning service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, provisioningServiceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CertificateListDescription value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CertificateListDescription.DeserializeCertificateListDescription(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch) { var uri = new RawRequestUriBuilder(); @@ -79,9 +173,9 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the certificate from the provisioning service. - /// The subscription identifier. - /// Resource group identifier. - /// Name of the provisioning service the certificate is associated with. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// Name of the certificate to retrieve. /// ETag of the certificate. /// The cancellation token to use. @@ -113,9 +207,9 @@ public async Task> GetAsync( } /// Get the certificate from the provisioning service. - /// The subscription identifier. - /// Resource group identifier. - /// Name of the provisioning service the certificate is associated with. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// Name of the certificate to retrieve. /// ETag of the certificate. /// The cancellation token to use. @@ -193,10 +287,10 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Add new certificate or update an existing certificate. - /// The subscription identifier. - /// Resource group identifier. - /// The name of the provisioning service. - /// The name of the certificate create or update. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// Name of the certificate to retrieve. /// The certificate body. /// ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand new certificate. /// The cancellation token to use. @@ -227,10 +321,10 @@ public async Task> CreateOrU } /// Add new certificate or update an existing certificate. - /// The subscription identifier. - /// Resource group identifier. - /// The name of the provisioning service. - /// The name of the certificate create or update. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// Name of the certificate to retrieve. /// The certificate body. /// ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand new certificate. /// The cancellation token to use. @@ -260,7 +354,7 @@ public Response CreateOrUpdate(string } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch, string certificateCommonName, byte[] certificateRawBytes, bool? certificateIsVerified, DeviceProvisioningServicesCertificatePurpose? certificatePurpose, DateTimeOffset? certificateCreatedOn, DateTimeOffset? certificateLastUpdatedOn, bool? certificateHasPrivateKey, string certificateNonce) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string certificateCommonName, string certificateName1, byte[] certificateRawBytes, bool? certificateIsVerified, DeviceProvisioningServicesCertificatePurpose? certificateCreatedOn, DateTimeOffset? certificateLastUpdatedOn, DateTimeOffset? certificateLastUpdated, bool? certificateHasPrivateKey, string certificateNonce) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -272,9 +366,10 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(provisioningServiceName, true); uri.AppendPath("/certificates/", false); uri.AppendPath(certificateName, true); - if (certificateCommonName != null) + uri.AppendQuery("api-version", _apiVersion, true); + if (certificateName1 != null) { - uri.AppendQuery("certificateCommonName", certificateCommonName, true); + uri.AppendQuery("certificate.name", certificateName1, true); } if (certificateRawBytes != null) { @@ -284,18 +379,18 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string { uri.AppendQuery("certificate.isVerified", certificateIsVerified.Value, true); } - if (certificatePurpose != null) - { - uri.AppendQuery("certificate.purpose", certificatePurpose.Value.ToString(), true); - } if (certificateCreatedOn != null) { - uri.AppendQuery("certificateCreatedOn", certificateCreatedOn.Value, "O", true); + uri.AppendQuery("certificateCreatedOn", certificateCreatedOn.Value.ToString(), true); } if (certificateLastUpdatedOn != null) { uri.AppendQuery("certificateLastUpdatedOn", certificateLastUpdatedOn.Value, "O", true); } + if (certificateLastUpdated != null) + { + uri.AppendQuery("certificate.lastUpdated", certificateLastUpdated.Value, "O", true); + } if (certificateHasPrivateKey != null) { uri.AppendQuery("certificate.hasPrivateKey", certificateHasPrivateKey.Value, true); @@ -304,11 +399,10 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string { uri.AppendQuery("certificate.nonce", certificateNonce, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch, string certificateCommonName, byte[] certificateRawBytes, bool? certificateIsVerified, DeviceProvisioningServicesCertificatePurpose? certificatePurpose, DateTimeOffset? certificateCreatedOn, DateTimeOffset? certificateLastUpdatedOn, bool? certificateHasPrivateKey, string certificateNonce) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string certificateCommonName, string certificateName1, byte[] certificateRawBytes, bool? certificateIsVerified, DeviceProvisioningServicesCertificatePurpose? certificateCreatedOn, DateTimeOffset? certificateLastUpdatedOn, DateTimeOffset? certificateLastUpdated, bool? certificateHasPrivateKey, string certificateNonce) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -323,9 +417,10 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(provisioningServiceName, true); uri.AppendPath("/certificates/", false); uri.AppendPath(certificateName, true); - if (certificateCommonName != null) + uri.AppendQuery("api-version", _apiVersion, true); + if (certificateName1 != null) { - uri.AppendQuery("certificateCommonName", certificateCommonName, true); + uri.AppendQuery("certificate.name", certificateName1, true); } if (certificateRawBytes != null) { @@ -335,18 +430,18 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG { uri.AppendQuery("certificate.isVerified", certificateIsVerified.Value, true); } - if (certificatePurpose != null) - { - uri.AppendQuery("certificate.purpose", certificatePurpose.Value.ToString(), true); - } if (certificateCreatedOn != null) { - uri.AppendQuery("certificateCreatedOn", certificateCreatedOn.Value, "O", true); + uri.AppendQuery("certificateCreatedOn", certificateCreatedOn.Value.ToString(), true); } if (certificateLastUpdatedOn != null) { uri.AppendQuery("certificateLastUpdatedOn", certificateLastUpdatedOn.Value, "O", true); } + if (certificateLastUpdated != null) + { + uri.AppendQuery("certificate.lastUpdated", certificateLastUpdated.Value, "O", true); + } if (certificateHasPrivateKey != null) { uri.AppendQuery("certificate.hasPrivateKey", certificateHasPrivateKey.Value, true); @@ -355,40 +450,39 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG { uri.AppendQuery("certificate.nonce", certificateNonce, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - request.Headers.Add("If-Match", ifMatch); + request.Headers.Add("certificateCommonName", certificateCommonName); request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } /// Deletes the specified certificate associated with the Provisioning Service. - /// The subscription identifier. - /// Resource group identifier. - /// The name of the provisioning service. - /// This is a mandatory field, and is the logical name of the certificate that the provisioning service will access by. - /// ETag of the certificate. - /// This is optional, and it is the Common Name of the certificate. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// Name of the certificate to retrieve. + /// ETag of the certificate. + /// This is optional, and it is the Common Name of the certificate. /// Raw data within the certificate. /// Indicates if certificate has been verified by owner of the private key. - /// A description that mentions the purpose of the certificate. - /// Time the certificate is created. - /// Time the certificate is last updated. + /// A description that mentions the purpose of the certificate. + /// Time the certificate is created. + /// Time the certificate is last updated. /// Indicates if the certificate contains a private key. /// Random number generated to indicate Proof of Possession. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch, string certificateCommonName = null, byte[] certificateRawBytes = null, bool? certificateIsVerified = null, DeviceProvisioningServicesCertificatePurpose? certificatePurpose = null, DateTimeOffset? certificateCreatedOn = null, DateTimeOffset? certificateLastUpdatedOn = null, bool? certificateHasPrivateKey = null, string certificateNonce = null, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string certificateCommonName, string certificateName1 = null, byte[] certificateRawBytes = null, bool? certificateIsVerified = null, DeviceProvisioningServicesCertificatePurpose? certificateCreatedOn = null, DateTimeOffset? certificateLastUpdatedOn = null, DateTimeOffset? certificateLastUpdated = null, bool? certificateHasPrivateKey = null, string certificateNonce = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - Argument.AssertNotNull(ifMatch, nameof(ifMatch)); + Argument.AssertNotNull(certificateCommonName, nameof(certificateCommonName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, provisioningServiceName, certificateName, ifMatch, certificateCommonName, certificateRawBytes, certificateIsVerified, certificatePurpose, certificateCreatedOn, certificateLastUpdatedOn, certificateHasPrivateKey, certificateNonce); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, provisioningServiceName, certificateName, certificateCommonName, certificateName1, certificateRawBytes, certificateIsVerified, certificateCreatedOn, certificateLastUpdatedOn, certificateLastUpdated, certificateHasPrivateKey, certificateNonce); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -401,31 +495,31 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes the specified certificate associated with the Provisioning Service. - /// The subscription identifier. - /// Resource group identifier. - /// The name of the provisioning service. - /// This is a mandatory field, and is the logical name of the certificate that the provisioning service will access by. - /// ETag of the certificate. - /// This is optional, and it is the Common Name of the certificate. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// Name of the certificate to retrieve. + /// ETag of the certificate. + /// This is optional, and it is the Common Name of the certificate. /// Raw data within the certificate. /// Indicates if certificate has been verified by owner of the private key. - /// A description that mentions the purpose of the certificate. - /// Time the certificate is created. - /// Time the certificate is last updated. + /// A description that mentions the purpose of the certificate. + /// Time the certificate is created. + /// Time the certificate is last updated. /// Indicates if the certificate contains a private key. /// Random number generated to indicate Proof of Possession. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch, string certificateCommonName = null, byte[] certificateRawBytes = null, bool? certificateIsVerified = null, DeviceProvisioningServicesCertificatePurpose? certificatePurpose = null, DateTimeOffset? certificateCreatedOn = null, DateTimeOffset? certificateLastUpdatedOn = null, bool? certificateHasPrivateKey = null, string certificateNonce = null, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string certificateCommonName, string certificateName1 = null, byte[] certificateRawBytes = null, bool? certificateIsVerified = null, DeviceProvisioningServicesCertificatePurpose? certificateCreatedOn = null, DateTimeOffset? certificateLastUpdatedOn = null, DateTimeOffset? certificateLastUpdated = null, bool? certificateHasPrivateKey = null, string certificateNonce = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - Argument.AssertNotNull(ifMatch, nameof(ifMatch)); + Argument.AssertNotNull(certificateCommonName, nameof(certificateCommonName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, provisioningServiceName, certificateName, ifMatch, certificateCommonName, certificateRawBytes, certificateIsVerified, certificatePurpose, certificateCreatedOn, certificateLastUpdatedOn, certificateHasPrivateKey, certificateNonce); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, provisioningServiceName, certificateName, certificateCommonName, certificateName1, certificateRawBytes, certificateIsVerified, certificateCreatedOn, certificateLastUpdatedOn, certificateLastUpdated, certificateHasPrivateKey, certificateNonce); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -437,101 +531,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string p } } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(provisioningServiceName, true); - uri.AppendPath("/certificates", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(provisioningServiceName, true); - uri.AppendPath("/certificates", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get all the certificates tied to the provisioning service. - /// The subscription identifier. - /// Name of resource group. - /// Name of provisioning service to retrieve certificates for. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, provisioningServiceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CertificateListDescription value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CertificateListDescription.DeserializeCertificateListDescription(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get all the certificates tied to the provisioning service. - /// The subscription identifier. - /// Name of resource group. - /// Name of provisioning service to retrieve certificates for. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, provisioningServiceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CertificateListDescription value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CertificateListDescription.DeserializeCertificateListDescription(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGenerateVerificationCodeRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch, string certificateCommonName, byte[] certificateRawBytes, bool? certificateIsVerified, DeviceProvisioningServicesCertificatePurpose? certificatePurpose, DateTimeOffset? certificateCreatedOn, DateTimeOffset? certificateLastUpdatedOn, bool? certificateHasPrivateKey, string certificateNonce) + internal RequestUriBuilder CreateGenerateVerificationCodeRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string certificateCommonName, string certificateName1, byte[] certificateRawBytes, bool? certificateIsVerified, DeviceProvisioningServicesCertificatePurpose? certificateCreatedOn, DateTimeOffset? certificateLastUpdatedOn, DateTimeOffset? certificateLastUpdated, bool? certificateHasPrivateKey, string certificateNonce) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -544,9 +544,10 @@ internal RequestUriBuilder CreateGenerateVerificationCodeRequestUri(string subsc uri.AppendPath("/certificates/", false); uri.AppendPath(certificateName, true); uri.AppendPath("/generateVerificationCode", false); - if (certificateCommonName != null) + uri.AppendQuery("api-version", _apiVersion, true); + if (certificateName1 != null) { - uri.AppendQuery("certificateCommonName", certificateCommonName, true); + uri.AppendQuery("certificate.name", certificateName1, true); } if (certificateRawBytes != null) { @@ -556,18 +557,18 @@ internal RequestUriBuilder CreateGenerateVerificationCodeRequestUri(string subsc { uri.AppendQuery("certificate.isVerified", certificateIsVerified.Value, true); } - if (certificatePurpose != null) - { - uri.AppendQuery("certificate.purpose", certificatePurpose.Value.ToString(), true); - } if (certificateCreatedOn != null) { - uri.AppendQuery("certificateCreatedOn", certificateCreatedOn.Value, "O", true); + uri.AppendQuery("certificateCreatedOn", certificateCreatedOn.Value.ToString(), true); } if (certificateLastUpdatedOn != null) { uri.AppendQuery("certificateLastUpdatedOn", certificateLastUpdatedOn.Value, "O", true); } + if (certificateLastUpdated != null) + { + uri.AppendQuery("certificate.lastUpdated", certificateLastUpdated.Value, "O", true); + } if (certificateHasPrivateKey != null) { uri.AppendQuery("certificate.hasPrivateKey", certificateHasPrivateKey.Value, true); @@ -576,11 +577,10 @@ internal RequestUriBuilder CreateGenerateVerificationCodeRequestUri(string subsc { uri.AppendQuery("certificate.nonce", certificateNonce, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGenerateVerificationCodeRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch, string certificateCommonName, byte[] certificateRawBytes, bool? certificateIsVerified, DeviceProvisioningServicesCertificatePurpose? certificatePurpose, DateTimeOffset? certificateCreatedOn, DateTimeOffset? certificateLastUpdatedOn, bool? certificateHasPrivateKey, string certificateNonce) + internal HttpMessage CreateGenerateVerificationCodeRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string certificateCommonName, string certificateName1, byte[] certificateRawBytes, bool? certificateIsVerified, DeviceProvisioningServicesCertificatePurpose? certificateCreatedOn, DateTimeOffset? certificateLastUpdatedOn, DateTimeOffset? certificateLastUpdated, bool? certificateHasPrivateKey, string certificateNonce) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -596,9 +596,10 @@ internal HttpMessage CreateGenerateVerificationCodeRequest(string subscriptionId uri.AppendPath("/certificates/", false); uri.AppendPath(certificateName, true); uri.AppendPath("/generateVerificationCode", false); - if (certificateCommonName != null) + uri.AppendQuery("api-version", _apiVersion, true); + if (certificateName1 != null) { - uri.AppendQuery("certificateCommonName", certificateCommonName, true); + uri.AppendQuery("certificate.name", certificateName1, true); } if (certificateRawBytes != null) { @@ -608,18 +609,18 @@ internal HttpMessage CreateGenerateVerificationCodeRequest(string subscriptionId { uri.AppendQuery("certificate.isVerified", certificateIsVerified.Value, true); } - if (certificatePurpose != null) - { - uri.AppendQuery("certificate.purpose", certificatePurpose.Value.ToString(), true); - } if (certificateCreatedOn != null) { - uri.AppendQuery("certificateCreatedOn", certificateCreatedOn.Value, "O", true); + uri.AppendQuery("certificateCreatedOn", certificateCreatedOn.Value.ToString(), true); } if (certificateLastUpdatedOn != null) { uri.AppendQuery("certificateLastUpdatedOn", certificateLastUpdatedOn.Value, "O", true); } + if (certificateLastUpdated != null) + { + uri.AppendQuery("certificate.lastUpdated", certificateLastUpdated.Value, "O", true); + } if (certificateHasPrivateKey != null) { uri.AppendQuery("certificate.hasPrivateKey", certificateHasPrivateKey.Value, true); @@ -628,40 +629,39 @@ internal HttpMessage CreateGenerateVerificationCodeRequest(string subscriptionId { uri.AppendQuery("certificate.nonce", certificateNonce, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - request.Headers.Add("If-Match", ifMatch); + request.Headers.Add("certificateCommonName", certificateCommonName); request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } /// Generate verification code for Proof of Possession. - /// The subscription identifier. - /// name of resource group. - /// Name of provisioning service. - /// The mandatory logical name of the certificate, that the provisioning service uses to access. - /// ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand new certificate. - /// Common Name for the certificate. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// Name of the certificate to retrieve. + /// ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand new certificate. + /// Common Name for the certificate. /// Raw data of certificate. /// Indicates if the certificate has been verified by owner of the private key. - /// Description mentioning the purpose of the certificate. - /// Certificate creation time. - /// Certificate last updated time. + /// Description mentioning the purpose of the certificate. + /// Certificate creation time. + /// Certificate last updated time. /// Indicates if the certificate contains private key. /// Random number generated to indicate Proof of Possession. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> GenerateVerificationCodeAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch, string certificateCommonName = null, byte[] certificateRawBytes = null, bool? certificateIsVerified = null, DeviceProvisioningServicesCertificatePurpose? certificatePurpose = null, DateTimeOffset? certificateCreatedOn = null, DateTimeOffset? certificateLastUpdatedOn = null, bool? certificateHasPrivateKey = null, string certificateNonce = null, CancellationToken cancellationToken = default) + public async Task> GenerateVerificationCodeAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string certificateCommonName, string certificateName1 = null, byte[] certificateRawBytes = null, bool? certificateIsVerified = null, DeviceProvisioningServicesCertificatePurpose? certificateCreatedOn = null, DateTimeOffset? certificateLastUpdatedOn = null, DateTimeOffset? certificateLastUpdated = null, bool? certificateHasPrivateKey = null, string certificateNonce = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - Argument.AssertNotNull(ifMatch, nameof(ifMatch)); + Argument.AssertNotNull(certificateCommonName, nameof(certificateCommonName)); - using var message = CreateGenerateVerificationCodeRequest(subscriptionId, resourceGroupName, provisioningServiceName, certificateName, ifMatch, certificateCommonName, certificateRawBytes, certificateIsVerified, certificatePurpose, certificateCreatedOn, certificateLastUpdatedOn, certificateHasPrivateKey, certificateNonce); + using var message = CreateGenerateVerificationCodeRequest(subscriptionId, resourceGroupName, provisioningServiceName, certificateName, certificateCommonName, certificateName1, certificateRawBytes, certificateIsVerified, certificateCreatedOn, certificateLastUpdatedOn, certificateLastUpdated, certificateHasPrivateKey, certificateNonce); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -678,31 +678,31 @@ public async Task> GenerateVerificat } /// Generate verification code for Proof of Possession. - /// The subscription identifier. - /// name of resource group. - /// Name of provisioning service. - /// The mandatory logical name of the certificate, that the provisioning service uses to access. - /// ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand new certificate. - /// Common Name for the certificate. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// Name of the certificate to retrieve. + /// ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand new certificate. + /// Common Name for the certificate. /// Raw data of certificate. /// Indicates if the certificate has been verified by owner of the private key. - /// Description mentioning the purpose of the certificate. - /// Certificate creation time. - /// Certificate last updated time. + /// Description mentioning the purpose of the certificate. + /// Certificate creation time. + /// Certificate last updated time. /// Indicates if the certificate contains private key. /// Random number generated to indicate Proof of Possession. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response GenerateVerificationCode(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch, string certificateCommonName = null, byte[] certificateRawBytes = null, bool? certificateIsVerified = null, DeviceProvisioningServicesCertificatePurpose? certificatePurpose = null, DateTimeOffset? certificateCreatedOn = null, DateTimeOffset? certificateLastUpdatedOn = null, bool? certificateHasPrivateKey = null, string certificateNonce = null, CancellationToken cancellationToken = default) + public Response GenerateVerificationCode(string subscriptionId, string resourceGroupName, string provisioningServiceName, string certificateName, string certificateCommonName, string certificateName1 = null, byte[] certificateRawBytes = null, bool? certificateIsVerified = null, DeviceProvisioningServicesCertificatePurpose? certificateCreatedOn = null, DateTimeOffset? certificateLastUpdatedOn = null, DateTimeOffset? certificateLastUpdated = null, bool? certificateHasPrivateKey = null, string certificateNonce = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - Argument.AssertNotNull(ifMatch, nameof(ifMatch)); + Argument.AssertNotNull(certificateCommonName, nameof(certificateCommonName)); - using var message = CreateGenerateVerificationCodeRequest(subscriptionId, resourceGroupName, provisioningServiceName, certificateName, ifMatch, certificateCommonName, certificateRawBytes, certificateIsVerified, certificatePurpose, certificateCreatedOn, certificateLastUpdatedOn, certificateHasPrivateKey, certificateNonce); + using var message = CreateGenerateVerificationCodeRequest(subscriptionId, resourceGroupName, provisioningServiceName, certificateName, certificateCommonName, certificateName1, certificateRawBytes, certificateIsVerified, certificateCreatedOn, certificateLastUpdatedOn, certificateLastUpdated, certificateHasPrivateKey, certificateNonce); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -731,6 +731,7 @@ internal RequestUriBuilder CreateVerifyCertificateRequestUri(string subscription uri.AppendPath("/certificates/", false); uri.AppendPath(certificateName, true); uri.AppendPath("/verify", false); + uri.AppendQuery("api-version", _apiVersion, true); if (certificateCommonName != null) { uri.AppendQuery("certificateCommonName", certificateCommonName, true); @@ -763,7 +764,6 @@ internal RequestUriBuilder CreateVerifyCertificateRequestUri(string subscription { uri.AppendQuery("certificate.nonce", certificateNonce, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -783,6 +783,7 @@ internal HttpMessage CreateVerifyCertificateRequest(string subscriptionId, strin uri.AppendPath("/certificates/", false); uri.AppendPath(certificateName, true); uri.AppendPath("/verify", false); + uri.AppendQuery("api-version", _apiVersion, true); if (certificateCommonName != null) { uri.AppendQuery("certificateCommonName", certificateCommonName, true); @@ -815,7 +816,6 @@ internal HttpMessage CreateVerifyCertificateRequest(string subscriptionId, strin { uri.AppendQuery("certificate.nonce", certificateNonce, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("If-Match", ifMatch); request.Headers.Add("Accept", "application/json"); @@ -828,10 +828,10 @@ internal HttpMessage CreateVerifyCertificateRequest(string subscriptionId, strin } /// Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded certificate. - /// The subscription identifier. - /// Resource group name. - /// Provisioning service name. - /// The mandatory logical name of the certificate, that the provisioning service uses to access. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// Name of the certificate to retrieve. /// ETag of the certificate. /// The name of the certificate. /// Common Name for the certificate. @@ -871,10 +871,10 @@ public async Task> VerifyCer } /// Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded certificate. - /// The subscription identifier. - /// Resource group name. - /// Provisioning service name. - /// The mandatory logical name of the certificate, that the provisioning service uses to access. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// Name of the certificate to retrieve. /// ETag of the certificate. /// The name of the certificate. /// Common Name for the certificate. diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/RestOperations/IotDpsResourceRestOperations.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/RestOperations/IotDpsResourceRestOperations.cs index 488dbea18ac0..9ce0e9815794 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/RestOperations/IotDpsResourceRestOperations.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/RestOperations/IotDpsResourceRestOperations.cs @@ -33,199 +33,175 @@ public IotDpsResourceRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-05"; + _apiVersion = apiVersion ?? "2025-02-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName) + internal RequestUriBuilder CreateCheckProvisioningServiceNameAvailabilityRequestUri(string subscriptionId, DeviceProvisioningServicesNameAvailabilityContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName) + internal HttpMessage CreateCheckProvisioningServiceNameAvailabilityRequest(string subscriptionId, DeviceProvisioningServicesNameAvailabilityContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Get the metadata of the provisioning service without SAS keys. - /// The subscription identifier. - /// Resource group name. - /// Name of the provisioning service to retrieve. + /// Check if a provisioning service name is available. This will validate if the name is syntactically valid and if the name is usable. + /// The ID of the target subscription. + /// The request body. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> CheckProvisioningServiceNameAvailabilityAsync(string subscriptionId, DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, provisioningServiceName); + using var message = CreateCheckProvisioningServiceNameAvailabilityRequest(subscriptionId, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DeviceProvisioningServiceData value = default; + DeviceProvisioningServicesNameAvailabilityResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeviceProvisioningServiceData.DeserializeDeviceProvisioningServiceData(document.RootElement); + value = DeviceProvisioningServicesNameAvailabilityResult.DeserializeDeviceProvisioningServicesNameAvailabilityResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((DeviceProvisioningServiceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get the metadata of the provisioning service without SAS keys. - /// The subscription identifier. - /// Resource group name. - /// Name of the provisioning service to retrieve. + /// Check if a provisioning service name is available. This will validate if the name is syntactically valid and if the name is usable. + /// The ID of the target subscription. + /// The request body. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response CheckProvisioningServiceNameAvailability(string subscriptionId, DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, provisioningServiceName); + using var message = CreateCheckProvisioningServiceNameAvailabilityRequest(subscriptionId, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DeviceProvisioningServiceData value = default; + DeviceProvisioningServicesNameAvailabilityResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeviceProvisioningServiceData.DeserializeDeviceProvisioningServiceData(document.RootElement); + value = DeviceProvisioningServicesNameAvailabilityResult.DeserializeDeviceProvisioningServicesNameAvailabilityResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((DeviceProvisioningServiceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServiceData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/providers/Microsoft.Devices/provisioningServices", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServiceData data) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/providers/Microsoft.Devices/provisioningServices", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service. - /// The subscription identifier. - /// Resource group identifier. - /// Name of provisioning service to create or update. - /// Description of the provisioning service to create or update. + /// List all the provisioning services for a given subscription id. + /// The ID of the target subscription. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServiceData data, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, provisioningServiceName, data); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + ProvisioningServiceDescriptionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ProvisioningServiceDescriptionListResult.DeserializeProvisioningServiceDescriptionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service. - /// The subscription identifier. - /// Resource group identifier. - /// Name of provisioning service to create or update. - /// Description of the provisioning service to create or update. + /// List all the provisioning services for a given subscription id. + /// The ID of the target subscription. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServiceData data, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, provisioningServiceName, data); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + ProvisioningServiceDescriptionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ProvisioningServiceDescriptionListResult.DeserializeProvisioningServiceDescriptionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServicePatch patch) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -233,89 +209,85 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/providers/Microsoft.Devices/provisioningServices", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServicePatch patch) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/providers/Microsoft.Devices/provisioningServices", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Update an existing provisioning service's tags. to update other fields use the CreateOrUpdate method. - /// The subscription identifier. - /// Resource group identifier. - /// Name of provisioning service to create or update. - /// Updated tag information to set into the provisioning service instance. + /// Get a list of all provisioning services in the given resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServicePatch patch, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, provisioningServiceName, patch); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - return message.Response; + { + ProvisioningServiceDescriptionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ProvisioningServiceDescriptionListResult.DeserializeProvisioningServiceDescriptionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Update an existing provisioning service's tags. to update other fields use the CreateOrUpdate method. - /// The subscription identifier. - /// Resource group identifier. - /// Name of provisioning service to create or update. - /// Updated tag information to set into the provisioning service instance. + /// Get a list of all provisioning services in the given resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServicePatch patch, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, provisioningServiceName, patch); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - return message.Response; + { + ProvisioningServiceDescriptionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ProvisioningServiceDescriptionListResult.DeserializeProvisioningServiceDescriptionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -329,11 +301,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -349,139 +321,161 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Deletes the Provisioning Service. - /// The subscription identifier. - /// Resource group identifier. - /// Name of provisioning service to delete. + /// Get the metadata of the provisioning service without SAS keys. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, provisioningServiceName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, provisioningServiceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - case 204: + { + DeviceProvisioningServiceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DeviceProvisioningServiceData.DeserializeDeviceProvisioningServiceData(document.RootElement); + return Response.FromValue(value, message.Response); + } case 404: - return message.Response; + return Response.FromValue((DeviceProvisioningServiceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Deletes the Provisioning Service. - /// The subscription identifier. - /// Resource group identifier. - /// Name of provisioning service to delete. + /// Get the metadata of the provisioning service without SAS keys. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, provisioningServiceName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, provisioningServiceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - case 204: + { + DeviceProvisioningServiceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DeviceProvisioningServiceData.DeserializeDeviceProvisioningServiceData(document.RootElement); + return Response.FromValue(value, message.Response); + } case 404: - return message.Response; + return Response.FromValue((DeviceProvisioningServiceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServiceData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Devices/provisioningServices", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); + uri.AppendPath(provisioningServiceName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServiceData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Devices/provisioningServices", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); + uri.AppendPath(provisioningServiceName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// List all the provisioning services for a given subscription id. - /// The subscription identifier. + /// Create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// Description of the provisioning service to create or update. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServiceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, provisioningServiceName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - ProvisioningServiceDescriptionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ProvisioningServiceDescriptionListResult.DeserializeProvisioningServiceDescriptionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// List all the provisioning services for a given subscription id. - /// The subscription identifier. + /// Create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// Description of the provisioning service to create or update. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServiceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, provisioningServiceName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - ProvisioningServiceDescriptionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ProvisioningServiceDescriptionListResult.DeserializeProvisioningServiceDescriptionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServicePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -489,85 +483,89 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Devices/provisioningServices", false); + uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); + uri.AppendPath(provisioningServiceName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServicePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Devices/provisioningServices", false); + uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); + uri.AppendPath(provisioningServiceName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Get a list of all provisioning services in the given resource group. - /// The subscription identifier. - /// Resource group identifier. + /// Update an existing provisioning service's tags. to update other fields use the CreateOrUpdate method. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// Updated tag information to set into the provisioning service instance. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServicePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, provisioningServiceName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - ProvisioningServiceDescriptionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ProvisioningServiceDescriptionListResult.DeserializeProvisioningServiceDescriptionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Get a list of all provisioning services in the given resource group. - /// The subscription identifier. - /// Resource group identifier. + /// Update an existing provisioning service's tags. to update other fields use the CreateOrUpdate method. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// Updated tag information to set into the provisioning service instance. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string provisioningServiceName, DeviceProvisioningServicePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, provisioningServiceName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - ProvisioningServiceDescriptionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ProvisioningServiceDescriptionListResult.DeserializeProvisioningServiceDescriptionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListValidSkusRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -577,16 +575,15 @@ internal RequestUriBuilder CreateListValidSkusRequestUri(string subscriptionId, uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); uri.AppendPath(provisioningServiceName, true); - uri.AppendPath("/skus", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListValidSkusRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -595,7 +592,6 @@ internal HttpMessage CreateListValidSkusRequest(string subscriptionId, string re uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); uri.AppendPath(provisioningServiceName, true); - uri.AppendPath("/skus", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -603,76 +599,78 @@ internal HttpMessage CreateListValidSkusRequest(string subscriptionId, string re return message; } - /// Gets the list of valid SKUs and tiers for a provisioning service. - /// The subscription identifier. - /// Name of resource group. - /// Name of provisioning service. + /// Deletes the Provisioning Service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListValidSkusAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - using var message = CreateListValidSkusRequest(subscriptionId, resourceGroupName, provisioningServiceName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, provisioningServiceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - IotDpsSkuDefinitionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = IotDpsSkuDefinitionListResult.DeserializeIotDpsSkuDefinitionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + case 404: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Gets the list of valid SKUs and tiers for a provisioning service. - /// The subscription identifier. - /// Name of resource group. - /// Name of provisioning service. + /// Deletes the Provisioning Service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListValidSkus(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - using var message = CreateListValidSkusRequest(subscriptionId, resourceGroupName, provisioningServiceName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, provisioningServiceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - IotDpsSkuDefinitionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = IotDpsSkuDefinitionListResult.DeserializeIotDpsSkuDefinitionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + case 404: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCheckProvisioningServiceNameAvailabilityRequestUri(string subscriptionId, DeviceProvisioningServicesNameAvailabilityContent content) + internal RequestUriBuilder CreateListKeysForKeyNameRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName, string keyName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/keys/", false); + uri.AppendPath(keyName, true); + uri.AppendPath("/listkeys", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCheckProvisioningServiceNameAvailabilityRequest(string subscriptionId, DeviceProvisioningServicesNameAvailabilityContent content) + internal HttpMessage CreateListKeysForKeyNameRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName, string keyName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -681,38 +679,44 @@ internal HttpMessage CreateCheckProvisioningServiceNameAvailabilityRequest(strin uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/keys/", false); + uri.AppendPath(keyName, true); + uri.AppendPath("/listkeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; _userAgent.Apply(message); return message; } - /// Check if a provisioning service name is available. This will validate if the name is syntactically valid and if the name is usable. - /// The subscription identifier. - /// Set the name parameter in the OperationInputs structure to the name of the provisioning service to check. + /// List primary and secondary keys for a specific key name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// Logical key name to get key-values for. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> CheckProvisioningServiceNameAvailabilityAsync(string subscriptionId, DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListKeysForKeyNameAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, string keyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNullOrEmpty(keyName, nameof(keyName)); - using var message = CreateCheckProvisioningServiceNameAvailabilityRequest(subscriptionId, content); + using var message = CreateListKeysForKeyNameRequest(subscriptionId, resourceGroupName, provisioningServiceName, keyName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DeviceProvisioningServicesNameAvailabilityResult value = default; + DeviceProvisioningServicesSharedAccessKey value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeviceProvisioningServicesNameAvailabilityResult.DeserializeDeviceProvisioningServicesNameAvailabilityResult(document.RootElement); + value = DeviceProvisioningServicesSharedAccessKey.DeserializeDeviceProvisioningServicesSharedAccessKey(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -720,26 +724,30 @@ public async Task> Ch } } - /// Check if a provisioning service name is available. This will validate if the name is syntactically valid and if the name is usable. - /// The subscription identifier. - /// Set the name parameter in the OperationInputs structure to the name of the provisioning service to check. + /// List primary and secondary keys for a specific key name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// Logical key name to get key-values for. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response CheckProvisioningServiceNameAvailability(string subscriptionId, DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListKeysForKeyName(string subscriptionId, string resourceGroupName, string provisioningServiceName, string keyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNullOrEmpty(keyName, nameof(keyName)); - using var message = CreateCheckProvisioningServiceNameAvailabilityRequest(subscriptionId, content); + using var message = CreateListKeysForKeyNameRequest(subscriptionId, resourceGroupName, provisioningServiceName, keyName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DeviceProvisioningServicesNameAvailabilityResult value = default; + DeviceProvisioningServicesSharedAccessKey value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeviceProvisioningServicesNameAvailabilityResult.DeserializeDeviceProvisioningServicesNameAvailabilityResult(document.RootElement); + value = DeviceProvisioningServicesSharedAccessKey.DeserializeDeviceProvisioningServicesSharedAccessKey(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -784,9 +792,9 @@ internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourc } /// List the primary and secondary keys for a provisioning service. - /// The subscription identifier. - /// resource group name. - /// The provisioning service name to get the shared access keys for. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -813,9 +821,9 @@ public async Task> Li } /// List the primary and secondary keys for a provisioning service. - /// The subscription identifier. - /// resource group name. - /// The provisioning service name to get the shared access keys for. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -841,7 +849,7 @@ public Response ListKeys(strin } } - internal RequestUriBuilder CreateListKeysForKeyNameRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName, string keyName) + internal RequestUriBuilder CreateListPrivateEndpointConnectionsRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -851,18 +859,16 @@ internal RequestUriBuilder CreateListKeysForKeyNameRequestUri(string subscriptio uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); uri.AppendPath(provisioningServiceName, true); - uri.AppendPath("/keys/", false); - uri.AppendPath(keyName, true); - uri.AppendPath("/listkeys", false); + uri.AppendPath("/privateEndpointConnections", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListKeysForKeyNameRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName, string keyName) + internal HttpMessage CreateListPrivateEndpointConnectionsRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -871,9 +877,7 @@ internal HttpMessage CreateListKeysForKeyNameRequest(string subscriptionId, stri uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); uri.AppendPath(provisioningServiceName, true); - uri.AppendPath("/keys/", false); - uri.AppendPath(keyName, true); - uri.AppendPath("/listkeys", false); + uri.AppendPath("/privateEndpointConnections", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -881,30 +885,33 @@ internal HttpMessage CreateListKeysForKeyNameRequest(string subscriptionId, stri return message; } - /// List primary and secondary keys for a specific key name. - /// The subscription identifier. - /// The name of the resource group that contains the provisioning service. - /// Name of the provisioning service. - /// Logical key name to get key-values for. + /// List private endpoint connection properties. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListKeysForKeyNameAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, string keyName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task>> ListPrivateEndpointConnectionsAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - Argument.AssertNotNullOrEmpty(keyName, nameof(keyName)); - using var message = CreateListKeysForKeyNameRequest(subscriptionId, resourceGroupName, provisioningServiceName, keyName); + using var message = CreateListPrivateEndpointConnectionsRequest(subscriptionId, resourceGroupName, provisioningServiceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DeviceProvisioningServicesSharedAccessKey value = default; + IReadOnlyList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeviceProvisioningServicesSharedAccessKey.DeserializeDeviceProvisioningServicesSharedAccessKey(document.RootElement); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(DeviceProvisioningServicesPrivateEndpointConnectionData.DeserializeDeviceProvisioningServicesPrivateEndpointConnectionData(item)); + } + value = array; return Response.FromValue(value, message.Response); } default: @@ -912,30 +919,33 @@ public async Task> ListKeysF } } - /// List primary and secondary keys for a specific key name. - /// The subscription identifier. - /// The name of the resource group that contains the provisioning service. - /// Name of the provisioning service. - /// Logical key name to get key-values for. + /// List private endpoint connection properties. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListKeysForKeyName(string subscriptionId, string resourceGroupName, string provisioningServiceName, string keyName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response> ListPrivateEndpointConnections(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - Argument.AssertNotNullOrEmpty(keyName, nameof(keyName)); - using var message = CreateListKeysForKeyNameRequest(subscriptionId, resourceGroupName, provisioningServiceName, keyName); + using var message = CreateListPrivateEndpointConnectionsRequest(subscriptionId, resourceGroupName, provisioningServiceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DeviceProvisioningServicesSharedAccessKey value = default; + IReadOnlyList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeviceProvisioningServicesSharedAccessKey.DeserializeDeviceProvisioningServicesSharedAccessKey(document.RootElement); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(DeviceProvisioningServicesPrivateEndpointConnectionData.DeserializeDeviceProvisioningServicesPrivateEndpointConnectionData(item)); + } + value = array; return Response.FromValue(value, message.Response); } default: @@ -943,7 +953,7 @@ public Response ListKeysForKeyName(st } } - internal RequestUriBuilder CreateListPrivateLinkResourcesRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateGetPrivateEndpointConnectionRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName, string privateEndpointConnectionName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -952,13 +962,14 @@ internal RequestUriBuilder CreateListPrivateLinkResourcesRequestUri(string subsc uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateLinkResources", false); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListPrivateLinkResourcesRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateGetPrivateEndpointConnectionRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName, string privateEndpointConnectionName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -970,8 +981,9 @@ internal HttpMessage CreateListPrivateLinkResourcesRequest(string subscriptionId uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateLinkResources", false); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -979,65 +991,73 @@ internal HttpMessage CreateListPrivateLinkResourcesRequest(string subscriptionId return message; } - /// List private link resources for the given provisioning service. - /// The subscription identifier. - /// The name of the resource group that contains the provisioning service. - /// The name of the provisioning service. + /// Get private endpoint connection properties. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// The name of the private endpoint connection. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListPrivateLinkResourcesAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetPrivateEndpointConnectionAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - using var message = CreateListPrivateLinkResourcesRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateGetPrivateEndpointConnectionRequest(subscriptionId, resourceGroupName, provisioningServiceName, privateEndpointConnectionName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - PrivateLinkResources value = default; + DeviceProvisioningServicesPrivateEndpointConnectionData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = PrivateLinkResources.DeserializePrivateLinkResources(document.RootElement); + value = DeviceProvisioningServicesPrivateEndpointConnectionData.DeserializeDeviceProvisioningServicesPrivateEndpointConnectionData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((DeviceProvisioningServicesPrivateEndpointConnectionData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// List private link resources for the given provisioning service. - /// The subscription identifier. - /// The name of the resource group that contains the provisioning service. - /// The name of the provisioning service. + /// Get private endpoint connection properties. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// The name of the private endpoint connection. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListPrivateLinkResources(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetPrivateEndpointConnection(string subscriptionId, string resourceGroupName, string provisioningServiceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - using var message = CreateListPrivateLinkResourcesRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateGetPrivateEndpointConnectionRequest(subscriptionId, resourceGroupName, provisioningServiceName, privateEndpointConnectionName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - PrivateLinkResources value = default; + DeviceProvisioningServicesPrivateEndpointConnectionData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = PrivateLinkResources.DeserializePrivateLinkResources(document.RootElement); + value = DeviceProvisioningServicesPrivateEndpointConnectionData.DeserializeDeviceProvisioningServicesPrivateEndpointConnectionData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((DeviceProvisioningServicesPrivateEndpointConnectionData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetPrivateLinkResourcesRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string groupId) + internal RequestUriBuilder CreateCreateOrUpdatePrivateEndpointConnectionRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName, string privateEndpointConnectionName, DeviceProvisioningServicesPrivateEndpointConnectionData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1046,18 +1066,18 @@ internal RequestUriBuilder CreateGetPrivateLinkResourcesRequestUri(string subscr uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateLinkResources/", false); - uri.AppendPath(groupId, true); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetPrivateLinkResourcesRequest(string subscriptionId, string resourceGroupName, string resourceName, string groupId) + internal HttpMessage CreateCreateOrUpdatePrivateEndpointConnectionRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName, string privateEndpointConnectionName, DeviceProvisioningServicesPrivateEndpointConnectionData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -1065,83 +1085,79 @@ internal HttpMessage CreateGetPrivateLinkResourcesRequest(string subscriptionId, uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateLinkResources/", false); - uri.AppendPath(groupId, true); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Get the specified private link resource for the given provisioning service. - /// The subscription identifier. - /// The name of the resource group that contains the provisioning service. - /// The name of the provisioning service. - /// The name of the private link resource. + /// Create or update the status of a private endpoint connection with the specified name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// The name of the private endpoint connection. + /// The private endpoint connection with updated properties. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetPrivateLinkResourcesAsync(string subscriptionId, string resourceGroupName, string resourceName, string groupId, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdatePrivateEndpointConnectionAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, string privateEndpointConnectionName, DeviceProvisioningServicesPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(groupId, nameof(groupId)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetPrivateLinkResourcesRequest(subscriptionId, resourceGroupName, resourceName, groupId); + using var message = CreateCreateOrUpdatePrivateEndpointConnectionRequest(subscriptionId, resourceGroupName, provisioningServiceName, privateEndpointConnectionName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DeviceProvisioningServicesPrivateLinkResourceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeviceProvisioningServicesPrivateLinkResourceData.DeserializeDeviceProvisioningServicesPrivateLinkResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DeviceProvisioningServicesPrivateLinkResourceData)null, message.Response); + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Get the specified private link resource for the given provisioning service. - /// The subscription identifier. - /// The name of the resource group that contains the provisioning service. - /// The name of the provisioning service. - /// The name of the private link resource. + /// Create or update the status of a private endpoint connection with the specified name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// The name of the private endpoint connection. + /// The private endpoint connection with updated properties. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetPrivateLinkResources(string subscriptionId, string resourceGroupName, string resourceName, string groupId, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdatePrivateEndpointConnection(string subscriptionId, string resourceGroupName, string provisioningServiceName, string privateEndpointConnectionName, DeviceProvisioningServicesPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(groupId, nameof(groupId)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetPrivateLinkResourcesRequest(subscriptionId, resourceGroupName, resourceName, groupId); + using var message = CreateCreateOrUpdatePrivateEndpointConnectionRequest(subscriptionId, resourceGroupName, provisioningServiceName, privateEndpointConnectionName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DeviceProvisioningServicesPrivateLinkResourceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeviceProvisioningServicesPrivateLinkResourceData.DeserializeDeviceProvisioningServicesPrivateLinkResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DeviceProvisioningServicesPrivateLinkResourceData)null, message.Response); + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListPrivateEndpointConnectionsRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateDeletePrivateEndpointConnectionRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName, string privateEndpointConnectionName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1150,17 +1166,18 @@ internal RequestUriBuilder CreateListPrivateEndpointConnectionsRequestUri(string uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections", false); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListPrivateEndpointConnectionsRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateDeletePrivateEndpointConnectionRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName, string privateEndpointConnectionName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -1168,8 +1185,9 @@ internal HttpMessage CreateListPrivateEndpointConnectionsRequest(string subscrip uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections", false); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -1177,75 +1195,63 @@ internal HttpMessage CreateListPrivateEndpointConnectionsRequest(string subscrip return message; } - /// List private endpoint connection properties. - /// The subscription identifier. - /// The name of the resource group that contains the provisioning service. - /// The name of the provisioning service. + /// Delete private endpoint connection with the specified name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// The name of the private endpoint connection. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task>> ListPrivateEndpointConnectionsAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeletePrivateEndpointConnectionAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - using var message = CreateListPrivateEndpointConnectionsRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateDeletePrivateEndpointConnectionRequest(subscriptionId, resourceGroupName, provisioningServiceName, privateEndpointConnectionName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(DeviceProvisioningServicesPrivateEndpointConnectionData.DeserializeDeviceProvisioningServicesPrivateEndpointConnectionData(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// List private endpoint connection properties. - /// The subscription identifier. - /// The name of the resource group that contains the provisioning service. - /// The name of the provisioning service. + /// Delete private endpoint connection with the specified name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// The name of the private endpoint connection. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response> ListPrivateEndpointConnections(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DeletePrivateEndpointConnection(string subscriptionId, string resourceGroupName, string provisioningServiceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - using var message = CreateListPrivateEndpointConnectionsRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateDeletePrivateEndpointConnectionRequest(subscriptionId, resourceGroupName, provisioningServiceName, privateEndpointConnectionName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(DeviceProvisioningServicesPrivateEndpointConnectionData.DeserializeDeviceProvisioningServicesPrivateEndpointConnectionData(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetPrivateEndpointConnectionRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + internal RequestUriBuilder CreateListPrivateLinkResourcesRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1254,14 +1260,13 @@ internal RequestUriBuilder CreateGetPrivateEndpointConnectionRequestUri(string s uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/privateLinkResources", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetPrivateEndpointConnectionRequest(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + internal HttpMessage CreateListPrivateLinkResourcesRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1273,9 +1278,8 @@ internal HttpMessage CreateGetPrivateEndpointConnectionRequest(string subscripti uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/privateLinkResources", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -1283,73 +1287,65 @@ internal HttpMessage CreateGetPrivateEndpointConnectionRequest(string subscripti return message; } - /// Get private endpoint connection properties. - /// The subscription identifier. - /// The name of the resource group that contains the provisioning service. - /// The name of the provisioning service. - /// The name of the private endpoint connection. + /// List private link resources for the given provisioning service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetPrivateEndpointConnectionAsync(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListPrivateLinkResourcesAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - using var message = CreateGetPrivateEndpointConnectionRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); + using var message = CreateListPrivateLinkResourcesRequest(subscriptionId, resourceGroupName, provisioningServiceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DeviceProvisioningServicesPrivateEndpointConnectionData value = default; + PrivateLinkResources value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeviceProvisioningServicesPrivateEndpointConnectionData.DeserializeDeviceProvisioningServicesPrivateEndpointConnectionData(document.RootElement); + value = PrivateLinkResources.DeserializePrivateLinkResources(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((DeviceProvisioningServicesPrivateEndpointConnectionData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get private endpoint connection properties. - /// The subscription identifier. - /// The name of the resource group that contains the provisioning service. - /// The name of the provisioning service. - /// The name of the private endpoint connection. + /// List private link resources for the given provisioning service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetPrivateEndpointConnection(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListPrivateLinkResources(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - using var message = CreateGetPrivateEndpointConnectionRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); + using var message = CreateListPrivateLinkResourcesRequest(subscriptionId, resourceGroupName, provisioningServiceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DeviceProvisioningServicesPrivateEndpointConnectionData value = default; + PrivateLinkResources value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeviceProvisioningServicesPrivateEndpointConnectionData.DeserializeDeviceProvisioningServicesPrivateEndpointConnectionData(document.RootElement); + value = PrivateLinkResources.DeserializePrivateLinkResources(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((DeviceProvisioningServicesPrivateEndpointConnectionData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdatePrivateEndpointConnectionRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, DeviceProvisioningServicesPrivateEndpointConnectionData data) + internal RequestUriBuilder CreateGetPrivateLinkResourcesRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName, string groupId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1358,18 +1354,18 @@ internal RequestUriBuilder CreateCreateOrUpdatePrivateEndpointConnectionRequestU uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/privateLinkResources/", false); + uri.AppendPath(groupId, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateOrUpdatePrivateEndpointConnectionRequest(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, DeviceProvisioningServicesPrivateEndpointConnectionData data) + internal HttpMessage CreateGetPrivateLinkResourcesRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName, string groupId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -1377,79 +1373,83 @@ internal HttpMessage CreateCreateOrUpdatePrivateEndpointConnectionRequest(string uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/privateLinkResources/", false); + uri.AppendPath(groupId, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Create or update the status of a private endpoint connection with the specified name. - /// The subscription identifier. - /// The name of the resource group that contains the provisioning service. - /// The name of the provisioning service. - /// The name of the private endpoint connection. - /// The private endpoint connection with updated properties. + /// Get the specified private link resource for the given provisioning service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// The name of the private link resource. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdatePrivateEndpointConnectionAsync(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, DeviceProvisioningServicesPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetPrivateLinkResourcesAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, string groupId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNullOrEmpty(groupId, nameof(groupId)); - using var message = CreateCreateOrUpdatePrivateEndpointConnectionRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName, data); + using var message = CreateGetPrivateLinkResourcesRequest(subscriptionId, resourceGroupName, provisioningServiceName, groupId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + DeviceProvisioningServicesPrivateLinkResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DeviceProvisioningServicesPrivateLinkResourceData.DeserializeDeviceProvisioningServicesPrivateLinkResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeviceProvisioningServicesPrivateLinkResourceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Create or update the status of a private endpoint connection with the specified name. - /// The subscription identifier. - /// The name of the resource group that contains the provisioning service. - /// The name of the provisioning service. - /// The name of the private endpoint connection. - /// The private endpoint connection with updated properties. + /// Get the specified private link resource for the given provisioning service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. + /// The name of the private link resource. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdatePrivateEndpointConnection(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, DeviceProvisioningServicesPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetPrivateLinkResources(string subscriptionId, string resourceGroupName, string provisioningServiceName, string groupId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); + Argument.AssertNotNullOrEmpty(groupId, nameof(groupId)); - using var message = CreateCreateOrUpdatePrivateEndpointConnectionRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName, data); + using var message = CreateGetPrivateLinkResourcesRequest(subscriptionId, resourceGroupName, provisioningServiceName, groupId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + DeviceProvisioningServicesPrivateLinkResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DeviceProvisioningServicesPrivateLinkResourceData.DeserializeDeviceProvisioningServicesPrivateLinkResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeviceProvisioningServicesPrivateLinkResourceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeletePrivateEndpointConnectionRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + internal RequestUriBuilder CreateListValidSkusRequestUri(string subscriptionId, string resourceGroupName, string provisioningServiceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1458,18 +1458,17 @@ internal RequestUriBuilder CreateDeletePrivateEndpointConnectionRequestUri(strin uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/skus", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeletePrivateEndpointConnectionRequest(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + internal HttpMessage CreateListValidSkusRequest(string subscriptionId, string resourceGroupName, string provisioningServiceName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -1477,9 +1476,8 @@ internal HttpMessage CreateDeletePrivateEndpointConnectionRequest(string subscri uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Devices/provisioningServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendPath(provisioningServiceName, true); + uri.AppendPath("/skus", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -1487,57 +1485,59 @@ internal HttpMessage CreateDeletePrivateEndpointConnectionRequest(string subscri return message; } - /// Delete private endpoint connection with the specified name. - /// The subscription identifier. - /// The name of the resource group that contains the provisioning service. - /// The name of the provisioning service. - /// The name of the private endpoint connection. + /// Gets the list of valid SKUs and tiers for a provisioning service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeletePrivateEndpointConnectionAsync(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListValidSkusAsync(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - using var message = CreateDeletePrivateEndpointConnectionRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); + using var message = CreateListValidSkusRequest(subscriptionId, resourceGroupName, provisioningServiceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + IotDpsSkuDefinitionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IotDpsSkuDefinitionListResult.DeserializeIotDpsSkuDefinitionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete private endpoint connection with the specified name. - /// The subscription identifier. - /// The name of the resource group that contains the provisioning service. - /// The name of the provisioning service. - /// The name of the private endpoint connection. + /// Gets the list of valid SKUs and tiers for a provisioning service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response DeletePrivateEndpointConnection(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListValidSkus(string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - using var message = CreateDeletePrivateEndpointConnectionRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); + using var message = CreateListValidSkusRequest(subscriptionId, resourceGroupName, provisioningServiceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + IotDpsSkuDefinitionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IotDpsSkuDefinitionListResult.DeserializeIotDpsSkuDefinitionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -1567,7 +1567,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// List all the provisioning services for a given subscription id. /// The URL to the next page of results. - /// The subscription identifier. + /// The ID of the target subscription. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -1594,7 +1594,7 @@ public async Task> ListBySubs /// List all the provisioning services for a given subscription id. /// The URL to the next page of results. - /// The subscription identifier. + /// The ID of the target subscription. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -1643,8 +1643,8 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// Get a list of all provisioning services in the given resource group. /// The URL to the next page of results. - /// The subscription identifier. - /// Resource group identifier. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. @@ -1672,8 +1672,8 @@ public async Task> ListByReso /// Get a list of all provisioning services in the given resource group. /// The URL to the next page of results. - /// The subscription identifier. - /// Resource group identifier. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. @@ -1699,7 +1699,7 @@ public Response ListByResourceGroupNex } } - internal RequestUriBuilder CreateListValidSkusNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName) + internal RequestUriBuilder CreateListKeysNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1707,7 +1707,7 @@ internal RequestUriBuilder CreateListValidSkusNextPageRequestUri(string nextLink return uri; } - internal HttpMessage CreateListValidSkusNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName) + internal HttpMessage CreateListKeysNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1721,30 +1721,30 @@ internal HttpMessage CreateListValidSkusNextPageRequest(string nextLink, string return message; } - /// Gets the list of valid SKUs and tiers for a provisioning service. + /// List the primary and secondary keys for a provisioning service. /// The URL to the next page of results. - /// The subscription identifier. - /// Name of resource group. - /// Name of provisioning service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListValidSkusNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) + public async Task> ListKeysNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - using var message = CreateListValidSkusNextPageRequest(nextLink, subscriptionId, resourceGroupName, provisioningServiceName); + using var message = CreateListKeysNextPageRequest(nextLink, subscriptionId, resourceGroupName, provisioningServiceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - IotDpsSkuDefinitionListResult value = default; + SharedAccessSignatureAuthorizationRuleListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = IotDpsSkuDefinitionListResult.DeserializeIotDpsSkuDefinitionListResult(document.RootElement); + value = SharedAccessSignatureAuthorizationRuleListResult.DeserializeSharedAccessSignatureAuthorizationRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1752,30 +1752,30 @@ public async Task> ListValidSkusNextPage } } - /// Gets the list of valid SKUs and tiers for a provisioning service. + /// List the primary and secondary keys for a provisioning service. /// The URL to the next page of results. - /// The subscription identifier. - /// Name of resource group. - /// Name of provisioning service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListValidSkusNextPage(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) + public Response ListKeysNextPage(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - using var message = CreateListValidSkusNextPageRequest(nextLink, subscriptionId, resourceGroupName, provisioningServiceName); + using var message = CreateListKeysNextPageRequest(nextLink, subscriptionId, resourceGroupName, provisioningServiceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - IotDpsSkuDefinitionListResult value = default; + SharedAccessSignatureAuthorizationRuleListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = IotDpsSkuDefinitionListResult.DeserializeIotDpsSkuDefinitionListResult(document.RootElement); + value = SharedAccessSignatureAuthorizationRuleListResult.DeserializeSharedAccessSignatureAuthorizationRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1783,7 +1783,7 @@ public Response ListValidSkusNextPage(string next } } - internal RequestUriBuilder CreateListKeysNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName) + internal RequestUriBuilder CreateListValidSkusNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1791,7 +1791,7 @@ internal RequestUriBuilder CreateListKeysNextPageRequestUri(string nextLink, str return uri; } - internal HttpMessage CreateListKeysNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName) + internal HttpMessage CreateListValidSkusNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1805,30 +1805,30 @@ internal HttpMessage CreateListKeysNextPageRequest(string nextLink, string subsc return message; } - /// List the primary and secondary keys for a provisioning service. + /// Gets the list of valid SKUs and tiers for a provisioning service. /// The URL to the next page of results. - /// The subscription identifier. - /// resource group name. - /// The provisioning service name to get the shared access keys for. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListKeysNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) + public async Task> ListValidSkusNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - using var message = CreateListKeysNextPageRequest(nextLink, subscriptionId, resourceGroupName, provisioningServiceName); + using var message = CreateListValidSkusNextPageRequest(nextLink, subscriptionId, resourceGroupName, provisioningServiceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - SharedAccessSignatureAuthorizationRuleListResult value = default; + IotDpsSkuDefinitionListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = SharedAccessSignatureAuthorizationRuleListResult.DeserializeSharedAccessSignatureAuthorizationRuleListResult(document.RootElement); + value = IotDpsSkuDefinitionListResult.DeserializeIotDpsSkuDefinitionListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1836,30 +1836,30 @@ public async Task> Li } } - /// List the primary and secondary keys for a provisioning service. + /// Gets the list of valid SKUs and tiers for a provisioning service. /// The URL to the next page of results. - /// The subscription identifier. - /// resource group name. - /// The provisioning service name to get the shared access keys for. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the provisioning service to retrieve. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListKeysNextPage(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) + public Response ListValidSkusNextPage(string nextLink, string subscriptionId, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(provisioningServiceName, nameof(provisioningServiceName)); - using var message = CreateListKeysNextPageRequest(nextLink, subscriptionId, resourceGroupName, provisioningServiceName); + using var message = CreateListValidSkusNextPageRequest(nextLink, subscriptionId, resourceGroupName, provisioningServiceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - SharedAccessSignatureAuthorizationRuleListResult value = default; + IotDpsSkuDefinitionListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = SharedAccessSignatureAuthorizationRuleListResult.DeserializeSharedAccessSignatureAuthorizationRuleListResult(document.RootElement); + value = IotDpsSkuDefinitionListResult.DeserializeIotDpsSkuDefinitionListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/autorest.md b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/autorest.md index a4c99bebe699..39606d1009c6 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/autorest.md +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: DeviceProvisioningServices namespace: Azure.ResourceManager.DeviceProvisioningServices -require: https://github.com/Azure/azure-rest-api-specs/blob/df70965d3a207eb2a628c96aa6ed935edc6b7911/specification/deviceprovisioningservices/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/deviceprovisioningservices/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServiceCollection.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServiceCollection.cs index 794120879069..35fe18b0a65d 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServiceCollection.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServiceCollection.cs @@ -10,6 +10,7 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.DeviceProvisioningServices.Models; +using Azure.ResourceManager.Models; using Azure.ResourceManager.Resources; using NUnit.Framework; @@ -21,7 +22,7 @@ public partial class Sample_DeviceProvisioningServiceCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DPSCreate() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSCreate.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSCreate.json // this example is just showing the usage of "IotDpsResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,11 +63,63 @@ public async Task CreateOrUpdate_DPSCreate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DPSUpdate() + { + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSUpdate.json + // this example is just showing the usage of "IotDpsResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceProvisioningServiceResource + DeviceProvisioningServiceCollection collection = resourceGroupResource.GetDeviceProvisioningServices(); + + // invoke the operation + string provisioningServiceName = "myFirstProvisioningService"; + DeviceProvisioningServiceData data = new DeviceProvisioningServiceData(new AzureLocation("East US"), new DeviceProvisioningServiceProperties + { + IsDataResidencyEnabled = false, + }, new DeviceProvisioningServicesSkuInfo + { + Name = DeviceProvisioningServicesSku.S1, + Capacity = 1L, + }) + { + Identity = new ManagedServiceIdentity("SystemAssigned,UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourcegroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity")] = new UserAssignedIdentity() +}, + }, + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, provisioningServiceName, data); + DeviceProvisioningServiceResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceProvisioningServiceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task Get_DPSGet() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGet.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGet.json // this example is just showing the usage of "IotDpsResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +152,7 @@ public async Task Get_DPSGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_DPSListByResourceGroup() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSListByResourceGroup.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSListByResourceGroup.json // this example is just showing the usage of "IotDpsResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +187,7 @@ public async Task GetAll_DPSListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_DPSGet() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGet.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGet.json // this example is just showing the usage of "IotDpsResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +216,7 @@ public async Task Exists_DPSGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_DPSGet() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGet.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGet.json // this example is just showing the usage of "IotDpsResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServiceResource.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServiceResource.cs index de9df70f8487..c56ad484fba5 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServiceResource.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServiceResource.cs @@ -20,7 +20,7 @@ public partial class Sample_DeviceProvisioningServiceResource [Ignore("Only validating compilation of examples")] public async Task Get_DPSGet() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGet.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGet.json // this example is just showing the usage of "IotDpsResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_DPSGet() [Ignore("Only validating compilation of examples")] public async Task Delete_DPSDelete() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSDelete.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSDelete.json // this example is just showing the usage of "IotDpsResource_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_DPSDelete() [Ignore("Only validating compilation of examples")] public async Task Update_DPSPatch() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSPatch.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSPatch.json // this example is just showing the usage of "IotDpsResource_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -112,10 +112,10 @@ public async Task Update_DPSPatch() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetValidSkus_DPSGetValidSku() + public async Task GetKey_DPSGetKey() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetValidSku.json - // this example is just showing the usage of "IotDpsResource_ListValidSkus" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGetKey.json + // this example is just showing the usage of "IotDpsResource_ListKeysForKeyName" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -130,20 +130,18 @@ public async Task GetValidSkus_DPSGetValidSku() ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, provisioningServiceName); DeviceProvisioningServiceResource deviceProvisioningService = client.GetDeviceProvisioningServiceResource(deviceProvisioningServiceResourceId); - // invoke the operation and iterate over the result - await foreach (DeviceProvisioningServicesSkuDefinition item in deviceProvisioningService.GetValidSkusAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } + // invoke the operation + string keyName = "testKey"; + DeviceProvisioningServicesSharedAccessKey result = await deviceProvisioningService.GetKeyAsync(keyName); - Console.WriteLine("Succeeded"); + Console.WriteLine($"Succeeded: {result}"); } [Test] [Ignore("Only validating compilation of examples")] public async Task GetKeys_DPSListKeys() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSListKeys.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSListKeys.json // this example is just showing the usage of "IotDpsResource_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,10 +168,10 @@ public async Task GetKeys_DPSListKeys() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetKey_DPSGetKey() + public async Task GetValidSkus_DPSGetValidSku() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetKey.json - // this example is just showing the usage of "IotDpsResource_ListKeysForKeyName" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGetValidSku.json + // this example is just showing the usage of "IotDpsResource_ListValidSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -188,11 +186,13 @@ public async Task GetKey_DPSGetKey() ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, provisioningServiceName); DeviceProvisioningServiceResource deviceProvisioningService = client.GetDeviceProvisioningServiceResource(deviceProvisioningServiceResourceId); - // invoke the operation - string keyName = "testKey"; - DeviceProvisioningServicesSharedAccessKey result = await deviceProvisioningService.GetKeyAsync(keyName); + // invoke the operation and iterate over the result + await foreach (DeviceProvisioningServicesSkuDefinition item in deviceProvisioningService.GetValidSkusAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } - Console.WriteLine($"Succeeded: {result}"); + Console.WriteLine("Succeeded"); } } } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesCertificateCollection.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesCertificateCollection.cs index 08c9225f6d35..2ae0afd63561 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesCertificateCollection.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesCertificateCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_DeviceProvisioningServicesCertificateCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DPSCreateOrUpdateCertificate() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSCertificateCreateOrUpdate.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSCertificateCreateOrUpdate.json // this example is just showing the usage of "DpsCertificate_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -45,7 +45,7 @@ public async Task CreateOrUpdate_DPSCreateOrUpdateCertificate() { Properties = new DeviceProvisioningServicesCertificateProperties { - Certificate = BinaryData.FromObjectAsJson("############################################"), + Certificate = BinaryData.FromObjectAsJson("MA=="), }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, certificateName, data); @@ -62,7 +62,7 @@ public async Task CreateOrUpdate_DPSCreateOrUpdateCertificate() [Ignore("Only validating compilation of examples")] public async Task Get_DPSGetCertificate() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetCertificate.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGetCertificate.json // this example is just showing the usage of "DpsCertificate_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_DPSGetCertificate() [Ignore("Only validating compilation of examples")] public async Task GetAll_DPSGetCertificates() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetCertificates.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGetCertificates.json // this example is just showing the usage of "DpsCertificate_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,7 +132,7 @@ public async Task GetAll_DPSGetCertificates() [Ignore("Only validating compilation of examples")] public async Task Exists_DPSGetCertificate() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetCertificate.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGetCertificate.json // this example is just showing the usage of "DpsCertificate_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -162,7 +162,7 @@ public async Task Exists_DPSGetCertificate() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_DPSGetCertificate() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetCertificate.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGetCertificate.json // this example is just showing the usage of "DpsCertificate_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesCertificateResource.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesCertificateResource.cs index f213c5d84a7b..5e7b8d554841 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesCertificateResource.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesCertificateResource.cs @@ -20,7 +20,7 @@ public partial class Sample_DeviceProvisioningServicesCertificateResource [Ignore("Only validating compilation of examples")] public async Task Get_DPSGetCertificate() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetCertificate.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGetCertificate.json // this example is just showing the usage of "DpsCertificate_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_DPSGetCertificate() [Ignore("Only validating compilation of examples")] public async Task Delete_DPSDeleteCertificate() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSDeleteCertificate.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSDeleteCertificate.json // this example is just showing the usage of "DpsCertificate_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -69,8 +69,8 @@ public async Task Delete_DPSDeleteCertificate() DeviceProvisioningServicesCertificateResource deviceProvisioningServicesCertificate = client.GetDeviceProvisioningServicesCertificateResource(deviceProvisioningServicesCertificateResourceId); // invoke the operation - string ifMatch = "AAAAAAAADGk="; - DeviceProvisioningServicesCertificateResourceDeleteOptions options = new DeviceProvisioningServicesCertificateResourceDeleteOptions(ifMatch); + string certificateCommonName = null; + DeviceProvisioningServicesCertificateResourceDeleteOptions options = new DeviceProvisioningServicesCertificateResourceDeleteOptions(certificateCommonName); await deviceProvisioningServicesCertificate.DeleteAsync(WaitUntil.Completed, options); Console.WriteLine("Succeeded"); @@ -80,7 +80,7 @@ public async Task Delete_DPSDeleteCertificate() [Ignore("Only validating compilation of examples")] public async Task Update_DPSCreateOrUpdateCertificate() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSCertificateCreateOrUpdate.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSCertificateCreateOrUpdate.json // this example is just showing the usage of "DpsCertificate_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +102,7 @@ public async Task Update_DPSCreateOrUpdateCertificate() { Properties = new DeviceProvisioningServicesCertificateProperties { - Certificate = BinaryData.FromObjectAsJson("############################################"), + Certificate = BinaryData.FromObjectAsJson("MA=="), }, }; ArmOperation lro = await deviceProvisioningServicesCertificate.UpdateAsync(WaitUntil.Completed, data); @@ -119,7 +119,7 @@ public async Task Update_DPSCreateOrUpdateCertificate() [Ignore("Only validating compilation of examples")] public async Task GenerateVerificationCode_DPSGenerateVerificationCode() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGenerateVerificationCode.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGenerateVerificationCode.json // this example is just showing the usage of "DpsCertificate_GenerateVerificationCode" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -137,8 +137,8 @@ public async Task GenerateVerificationCode_DPSGenerateVerificationCode() DeviceProvisioningServicesCertificateResource deviceProvisioningServicesCertificate = client.GetDeviceProvisioningServicesCertificateResource(deviceProvisioningServicesCertificateResourceId); // invoke the operation - string ifMatch = "AAAAAAAADGk="; - DeviceProvisioningServicesCertificateResourceGenerateVerificationCodeOptions options = new DeviceProvisioningServicesCertificateResourceGenerateVerificationCodeOptions(ifMatch); + string certificateCommonName = null; + DeviceProvisioningServicesCertificateResourceGenerateVerificationCodeOptions options = new DeviceProvisioningServicesCertificateResourceGenerateVerificationCodeOptions(certificateCommonName); CertificateVerificationCodeResult result = await deviceProvisioningServicesCertificate.GenerateVerificationCodeAsync(options); Console.WriteLine($"Succeeded: {result}"); @@ -148,7 +148,7 @@ public async Task GenerateVerificationCode_DPSGenerateVerificationCode() [Ignore("Only validating compilation of examples")] public async Task VerifyCertificate_DPSVerifyCertificate() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSVerifyCertificate.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSVerifyCertificate.json // this example is just showing the usage of "DpsCertificate_VerifyCertificate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateEndpointConnectionCollection.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateEndpointConnectionCollection.cs index 1a26016af9df..088fa4bf2f93 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateEndpointConnectionCollection.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_DeviceProvisioningServicesPrivateEndpointConnectionC [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PrivateEndpointConnectionCreateOrUpdate() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSCreateOrUpdatePrivateEndpointConnection.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSCreateOrUpdatePrivateEndpointConnection.json // this example is just showing the usage of "IotDpsResource_CreateOrUpdatePrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -32,8 +32,8 @@ public async Task CreateOrUpdate_PrivateEndpointConnectionCreateOrUpdate() // for more information of creating DeviceProvisioningServiceResource, please refer to the document of DeviceProvisioningServiceResource string subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0"; string resourceGroupName = "myResourceGroup"; - string resourceName = "myFirstProvisioningService"; - ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + string provisioningServiceName = null; + ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, provisioningServiceName); DeviceProvisioningServiceResource deviceProvisioningService = client.GetDeviceProvisioningServiceResource(deviceProvisioningServiceResourceId); // get the collection of this DeviceProvisioningServicesPrivateEndpointConnectionResource @@ -56,7 +56,7 @@ public async Task CreateOrUpdate_PrivateEndpointConnectionCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetPrivateEndpointConnection.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGetPrivateEndpointConnection.json // this example is just showing the usage of "IotDpsResource_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,8 +68,8 @@ public async Task Get_PrivateEndpointConnectionGet() // for more information of creating DeviceProvisioningServiceResource, please refer to the document of DeviceProvisioningServiceResource string subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0"; string resourceGroupName = "myResourceGroup"; - string resourceName = "myFirstProvisioningService"; - ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + string provisioningServiceName = null; + ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, provisioningServiceName); DeviceProvisioningServiceResource deviceProvisioningService = client.GetDeviceProvisioningServiceResource(deviceProvisioningServiceResourceId); // get the collection of this DeviceProvisioningServicesPrivateEndpointConnectionResource @@ -90,7 +90,7 @@ public async Task Get_PrivateEndpointConnectionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_PrivateEndpointConnectionsList() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSListPrivateEndpointConnections.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSListPrivateEndpointConnections.json // this example is just showing the usage of "IotDpsResource_ListPrivateEndpointConnections" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,8 +102,8 @@ public async Task GetAll_PrivateEndpointConnectionsList() // for more information of creating DeviceProvisioningServiceResource, please refer to the document of DeviceProvisioningServiceResource string subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0"; string resourceGroupName = "myResourceGroup"; - string resourceName = "myFirstProvisioningService"; - ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + string provisioningServiceName = null; + ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, provisioningServiceName); DeviceProvisioningServiceResource deviceProvisioningService = client.GetDeviceProvisioningServiceResource(deviceProvisioningServiceResourceId); // get the collection of this DeviceProvisioningServicesPrivateEndpointConnectionResource @@ -126,7 +126,7 @@ public async Task GetAll_PrivateEndpointConnectionsList() [Ignore("Only validating compilation of examples")] public async Task Exists_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetPrivateEndpointConnection.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGetPrivateEndpointConnection.json // this example is just showing the usage of "IotDpsResource_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,8 +138,8 @@ public async Task Exists_PrivateEndpointConnectionGet() // for more information of creating DeviceProvisioningServiceResource, please refer to the document of DeviceProvisioningServiceResource string subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0"; string resourceGroupName = "myResourceGroup"; - string resourceName = "myFirstProvisioningService"; - ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + string provisioningServiceName = null; + ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, provisioningServiceName); DeviceProvisioningServiceResource deviceProvisioningService = client.GetDeviceProvisioningServiceResource(deviceProvisioningServiceResourceId); // get the collection of this DeviceProvisioningServicesPrivateEndpointConnectionResource @@ -156,7 +156,7 @@ public async Task Exists_PrivateEndpointConnectionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetPrivateEndpointConnection.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGetPrivateEndpointConnection.json // this example is just showing the usage of "IotDpsResource_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,8 +168,8 @@ public async Task GetIfExists_PrivateEndpointConnectionGet() // for more information of creating DeviceProvisioningServiceResource, please refer to the document of DeviceProvisioningServiceResource string subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0"; string resourceGroupName = "myResourceGroup"; - string resourceName = "myFirstProvisioningService"; - ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + string provisioningServiceName = null; + ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, provisioningServiceName); DeviceProvisioningServiceResource deviceProvisioningService = client.GetDeviceProvisioningServiceResource(deviceProvisioningServiceResourceId); // get the collection of this DeviceProvisioningServicesPrivateEndpointConnectionResource diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateEndpointConnectionResource.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateEndpointConnectionResource.cs index 6aa044db5a8c..7f1de7d12c3d 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateEndpointConnectionResource.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_DeviceProvisioningServicesPrivateEndpointConnectionR [Ignore("Only validating compilation of examples")] public async Task Get_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetPrivateEndpointConnection.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGetPrivateEndpointConnection.json // this example is just showing the usage of "IotDpsResource_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -32,9 +32,9 @@ public async Task Get_PrivateEndpointConnectionGet() // for more information of creating DeviceProvisioningServicesPrivateEndpointConnectionResource, please refer to the document of DeviceProvisioningServicesPrivateEndpointConnectionResource string subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0"; string resourceGroupName = "myResourceGroup"; - string resourceName = "myFirstProvisioningService"; + string provisioningServiceName = null; string privateEndpointConnectionName = "myPrivateEndpointConnection"; - ResourceIdentifier deviceProvisioningServicesPrivateEndpointConnectionResourceId = DeviceProvisioningServicesPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); + ResourceIdentifier deviceProvisioningServicesPrivateEndpointConnectionResourceId = DeviceProvisioningServicesPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, provisioningServiceName, privateEndpointConnectionName); DeviceProvisioningServicesPrivateEndpointConnectionResource deviceProvisioningServicesPrivateEndpointConnection = client.GetDeviceProvisioningServicesPrivateEndpointConnectionResource(deviceProvisioningServicesPrivateEndpointConnectionResourceId); // invoke the operation @@ -51,7 +51,7 @@ public async Task Get_PrivateEndpointConnectionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_PrivateEndpointConnectionDelete() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSDeletePrivateEndpointConnection.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSDeletePrivateEndpointConnection.json // this example is just showing the usage of "IotDpsResource_DeletePrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,9 +63,9 @@ public async Task Delete_PrivateEndpointConnectionDelete() // for more information of creating DeviceProvisioningServicesPrivateEndpointConnectionResource, please refer to the document of DeviceProvisioningServicesPrivateEndpointConnectionResource string subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0"; string resourceGroupName = "myResourceGroup"; - string resourceName = "myFirstProvisioningService"; + string provisioningServiceName = null; string privateEndpointConnectionName = "myPrivateEndpointConnection"; - ResourceIdentifier deviceProvisioningServicesPrivateEndpointConnectionResourceId = DeviceProvisioningServicesPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); + ResourceIdentifier deviceProvisioningServicesPrivateEndpointConnectionResourceId = DeviceProvisioningServicesPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, provisioningServiceName, privateEndpointConnectionName); DeviceProvisioningServicesPrivateEndpointConnectionResource deviceProvisioningServicesPrivateEndpointConnection = client.GetDeviceProvisioningServicesPrivateEndpointConnectionResource(deviceProvisioningServicesPrivateEndpointConnectionResourceId); // invoke the operation @@ -83,7 +83,7 @@ public async Task Delete_PrivateEndpointConnectionDelete() [Ignore("Only validating compilation of examples")] public async Task Update_PrivateEndpointConnectionCreateOrUpdate() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSCreateOrUpdatePrivateEndpointConnection.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSCreateOrUpdatePrivateEndpointConnection.json // this example is just showing the usage of "IotDpsResource_CreateOrUpdatePrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,9 +95,9 @@ public async Task Update_PrivateEndpointConnectionCreateOrUpdate() // for more information of creating DeviceProvisioningServicesPrivateEndpointConnectionResource, please refer to the document of DeviceProvisioningServicesPrivateEndpointConnectionResource string subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0"; string resourceGroupName = "myResourceGroup"; - string resourceName = "myFirstProvisioningService"; + string provisioningServiceName = null; string privateEndpointConnectionName = "myPrivateEndpointConnection"; - ResourceIdentifier deviceProvisioningServicesPrivateEndpointConnectionResourceId = DeviceProvisioningServicesPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); + ResourceIdentifier deviceProvisioningServicesPrivateEndpointConnectionResourceId = DeviceProvisioningServicesPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, provisioningServiceName, privateEndpointConnectionName); DeviceProvisioningServicesPrivateEndpointConnectionResource deviceProvisioningServicesPrivateEndpointConnection = client.GetDeviceProvisioningServicesPrivateEndpointConnectionResource(deviceProvisioningServicesPrivateEndpointConnectionResourceId); // invoke the operation diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateLinkResource.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateLinkResource.cs index 00c5df5dde48..bc55cd14df29 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateLinkResource.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateLinkResource.cs @@ -19,7 +19,7 @@ public partial class Sample_DeviceProvisioningServicesPrivateLinkResource [Ignore("Only validating compilation of examples")] public async Task Get_PrivateLinkResourcesList() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetPrivateLinkResources.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGetPrivateLinkResources.json // this example is just showing the usage of "IotDpsResource_GetPrivateLinkResources" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,9 +31,9 @@ public async Task Get_PrivateLinkResourcesList() // for more information of creating DeviceProvisioningServicesPrivateLinkResource, please refer to the document of DeviceProvisioningServicesPrivateLinkResource string subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0"; string resourceGroupName = "myResourceGroup"; - string resourceName = "myFirstProvisioningService"; + string provisioningServiceName = null; string groupId = "iotDps"; - ResourceIdentifier deviceProvisioningServicesPrivateLinkResourceId = DeviceProvisioningServicesPrivateLinkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, groupId); + ResourceIdentifier deviceProvisioningServicesPrivateLinkResourceId = DeviceProvisioningServicesPrivateLinkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, provisioningServiceName, groupId); DeviceProvisioningServicesPrivateLinkResource deviceProvisioningServicesPrivateLinkResource = client.GetDeviceProvisioningServicesPrivateLinkResource(deviceProvisioningServicesPrivateLinkResourceId); // invoke the operation diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateLinkResourceCollection.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateLinkResourceCollection.cs index 94ba9d0375f3..aad67c4747f8 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateLinkResourceCollection.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_DeviceProvisioningServicesPrivateLinkResourceCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_DeviceProvisioningServicesPrivateLinkResourceCollect [Ignore("Only validating compilation of examples")] public async Task Get_PrivateLinkResourcesList() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetPrivateLinkResources.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGetPrivateLinkResources.json // this example is just showing the usage of "IotDpsResource_GetPrivateLinkResources" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,8 +31,8 @@ public async Task Get_PrivateLinkResourcesList() // for more information of creating DeviceProvisioningServiceResource, please refer to the document of DeviceProvisioningServiceResource string subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0"; string resourceGroupName = "myResourceGroup"; - string resourceName = "myFirstProvisioningService"; - ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + string provisioningServiceName = null; + ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, provisioningServiceName); DeviceProvisioningServiceResource deviceProvisioningService = client.GetDeviceProvisioningServiceResource(deviceProvisioningServiceResourceId); // get the collection of this DeviceProvisioningServicesPrivateLinkResource @@ -53,7 +53,7 @@ public async Task Get_PrivateLinkResourcesList() [Ignore("Only validating compilation of examples")] public async Task GetAll_PrivateLinkResourcesList() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSListPrivateLinkResources.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSListPrivateLinkResources.json // this example is just showing the usage of "IotDpsResource_ListPrivateLinkResources" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -65,8 +65,8 @@ public async Task GetAll_PrivateLinkResourcesList() // for more information of creating DeviceProvisioningServiceResource, please refer to the document of DeviceProvisioningServiceResource string subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0"; string resourceGroupName = "myResourceGroup"; - string resourceName = "myFirstProvisioningService"; - ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + string provisioningServiceName = null; + ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, provisioningServiceName); DeviceProvisioningServiceResource deviceProvisioningService = client.GetDeviceProvisioningServiceResource(deviceProvisioningServiceResourceId); // get the collection of this DeviceProvisioningServicesPrivateLinkResource @@ -89,7 +89,7 @@ public async Task GetAll_PrivateLinkResourcesList() [Ignore("Only validating compilation of examples")] public async Task Exists_PrivateLinkResourcesList() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetPrivateLinkResources.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGetPrivateLinkResources.json // this example is just showing the usage of "IotDpsResource_GetPrivateLinkResources" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -101,8 +101,8 @@ public async Task Exists_PrivateLinkResourcesList() // for more information of creating DeviceProvisioningServiceResource, please refer to the document of DeviceProvisioningServiceResource string subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0"; string resourceGroupName = "myResourceGroup"; - string resourceName = "myFirstProvisioningService"; - ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + string provisioningServiceName = null; + ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, provisioningServiceName); DeviceProvisioningServiceResource deviceProvisioningService = client.GetDeviceProvisioningServiceResource(deviceProvisioningServiceResourceId); // get the collection of this DeviceProvisioningServicesPrivateLinkResource @@ -119,7 +119,7 @@ public async Task Exists_PrivateLinkResourcesList() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_PrivateLinkResourcesList() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetPrivateLinkResources.json + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSGetPrivateLinkResources.json // this example is just showing the usage of "IotDpsResource_GetPrivateLinkResources" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,8 +131,8 @@ public async Task GetIfExists_PrivateLinkResourcesList() // for more information of creating DeviceProvisioningServiceResource, please refer to the document of DeviceProvisioningServiceResource string subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0"; string resourceGroupName = "myResourceGroup"; - string resourceName = "myFirstProvisioningService"; - ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + string provisioningServiceName = null; + ResourceIdentifier deviceProvisioningServiceResourceId = DeviceProvisioningServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, provisioningServiceName); DeviceProvisioningServiceResource deviceProvisioningService = client.GetDeviceProvisioningServiceResource(deviceProvisioningServiceResourceId); // get the collection of this DeviceProvisioningServicesPrivateLinkResource diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 81b122567b44..39372eff79f7 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -19,10 +19,10 @@ public partial class Sample_SubscriptionResourceExtensions { [Test] [Ignore("Only validating compilation of examples")] - public async Task GetDeviceProvisioningServices_DPSListBySubscription() + public async Task CheckDeviceProvisioningServicesNameAvailability_DPSCheckName() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSListBySubscription.json - // this example is just showing the usage of "IotDpsResource_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSCheckNameAvailability.json + // this example is just showing the usage of "IotDpsResource_CheckProvisioningServiceNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -35,25 +35,19 @@ public async Task GetDeviceProvisioningServices_DPSListBySubscription() ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - // invoke the operation and iterate over the result - await foreach (DeviceProvisioningServiceResource item in subscriptionResource.GetDeviceProvisioningServicesAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DeviceProvisioningServiceData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } + // invoke the operation + DeviceProvisioningServicesNameAvailabilityContent content = new DeviceProvisioningServicesNameAvailabilityContent("test213123"); + DeviceProvisioningServicesNameAvailabilityResult result = await subscriptionResource.CheckDeviceProvisioningServicesNameAvailabilityAsync(content); - Console.WriteLine("Succeeded"); + Console.WriteLine($"Succeeded: {result}"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task CheckDeviceProvisioningServicesNameAvailability_DPSCheckName() + public async Task GetDeviceProvisioningServices_DPSListBySubscription() { - // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSCheckNameAvailability.json - // this example is just showing the usage of "IotDpsResource_CheckProvisioningServiceNameAvailability" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/preview/2025-02-01-preview/examples/DPSListBySubscription.json + // this example is just showing the usage of "IotDpsResource_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -66,11 +60,17 @@ public async Task CheckDeviceProvisioningServicesNameAvailability_DPSCheckName() ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - // invoke the operation - DeviceProvisioningServicesNameAvailabilityContent content = new DeviceProvisioningServicesNameAvailabilityContent("test213123"); - DeviceProvisioningServicesNameAvailabilityResult result = await subscriptionResource.CheckDeviceProvisioningServicesNameAvailabilityAsync(content); + // invoke the operation and iterate over the result + await foreach (DeviceProvisioningServiceResource item in subscriptionResource.GetDeviceProvisioningServicesAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceProvisioningServiceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } - Console.WriteLine($"Succeeded: {result}"); + Console.WriteLine("Succeeded"); } } } diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/