From db19b4ab4653ea5d253d12f1ce6b9bff1637c614 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 23 Mar 2023 04:15:52 +0000 Subject: [PATCH] CodeGen from PR 23239 in Azure/azure-rest-api-specs Merge 785cf32815bc1fd1a3f4d01495c41d568628bd82 into 5f869da70574588b5af7c46a20de802cb8edc093 --- ...e.ResourceManager.IotHub.netstandard2.0.cs | 61 ++++++ .../Generated/IotHubDescriptionCollection.cs | 4 +- ...tionPropertiesDescription.Serialization.cs | 71 +++++++ .../Models/EncryptionPropertiesDescription.cs | 36 ++++ .../src/Generated/Models/IPVersion.cs | 54 ++++++ .../Models/IotHubProperties.Serialization.cs | 66 ++++++- .../src/Generated/Models/IotHubProperties.cs | 29 ++- ...ubPropertiesDeviceStreams.Serialization.cs | 60 ++++++ .../Models/IotHubPropertiesDeviceStreams.cs | 32 ++++ .../Generated/Models/IotHubRoutingSource.cs | 6 + .../KeyVaultKeyProperties.Serialization.cs | 60 ++++++ .../Generated/Models/KeyVaultKeyProperties.cs | 45 +++++ ...RootCertificateProperties.Serialization.cs | 61 ++++++ .../Models/RootCertificateProperties.cs | 34 ++++ ...gCosmosDBSqlApiProperties.Serialization.cs | 175 ++++++++++++++++++ .../Models/RoutingCosmosDBSqlApiProperties.cs | 105 +++++++++++ .../Models/RoutingEndpoints.Serialization.cs | 28 ++- .../src/Generated/Models/RoutingEndpoints.cs | 7 +- .../CertificatesRestOperations.cs | 2 +- .../IotHubResourceRestOperations.cs | 6 +- .../RestOperations/IotHubRestOperations.cs | 2 +- ...rivateEndpointConnectionsRestOperations.cs | 2 +- .../PrivateLinkResourcesRestOperations.cs | 2 +- .../ResourceProviderCommonRestOperations.cs | 2 +- .../src/autorest.md | 2 +- 25 files changed, 937 insertions(+), 15 deletions(-) create mode 100644 sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/EncryptionPropertiesDescription.Serialization.cs create mode 100644 sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/EncryptionPropertiesDescription.cs create mode 100644 sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IPVersion.cs create mode 100644 sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubPropertiesDeviceStreams.Serialization.cs create mode 100644 sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubPropertiesDeviceStreams.cs create mode 100644 sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/KeyVaultKeyProperties.Serialization.cs create mode 100644 sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/KeyVaultKeyProperties.cs create mode 100644 sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RootCertificateProperties.Serialization.cs create mode 100644 sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RootCertificateProperties.cs create mode 100644 sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingCosmosDBSqlApiProperties.Serialization.cs create mode 100644 sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingCosmosDBSqlApiProperties.cs diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/api/Azure.ResourceManager.IotHub.netstandard2.0.cs b/sdk/iothub/Azure.ResourceManager.IotHub/api/Azure.ResourceManager.IotHub.netstandard2.0.cs index fd870b5b016b..915a5aa50351 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/api/Azure.ResourceManager.IotHub.netstandard2.0.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/api/Azure.ResourceManager.IotHub.netstandard2.0.cs @@ -251,6 +251,12 @@ public CloudToDeviceProperties() { } public Azure.ResourceManager.IotHub.Models.CloudToDeviceFeedbackQueueProperties Feedback { get { throw null; } set { } } public int? MaxDeliveryCount { get { throw null; } set { } } } + public partial class EncryptionPropertiesDescription + { + public EncryptionPropertiesDescription() { } + public string KeySource { get { throw null; } set { } } + public System.Collections.Generic.IList KeyVaultProperties { get { throw null; } } + } public partial class EventHubCompatibleEndpointProperties { public EventHubCompatibleEndpointProperties() { } @@ -606,15 +612,18 @@ public IotHubProperties() { } public System.Collections.Generic.IList AuthorizationPolicies { get { throw null; } } public Azure.ResourceManager.IotHub.Models.CloudToDeviceProperties CloudToDevice { get { throw null; } set { } } public string Comments { get { throw null; } set { } } + public System.Collections.Generic.IList DeviceStreamsStreamingEndpoints { get { throw null; } } public bool? DisableDeviceSas { get { throw null; } set { } } public bool? DisableLocalAuth { get { throw null; } set { } } public bool? DisableModuleSas { get { throw null; } set { } } public bool? EnableDataResidency { get { throw null; } set { } } public bool? EnableFileUploadNotifications { get { throw null; } set { } } + public Azure.ResourceManager.IotHub.Models.EncryptionPropertiesDescription Encryption { get { throw null; } set { } } public System.Collections.Generic.IDictionary EventHubEndpoints { get { throw null; } } public Azure.ResourceManager.IotHub.Models.IotHubCapability? Features { get { throw null; } set { } } public string HostName { get { throw null; } } public System.Collections.Generic.IList IPFilterRules { get { throw null; } } + public Azure.ResourceManager.IotHub.Models.IPVersion? IPVersion { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList Locations { get { throw null; } } public System.Collections.Generic.IDictionary MessagingEndpoints { get { throw null; } } public string MinTlsVersion { get { throw null; } set { } } @@ -623,6 +632,7 @@ public IotHubProperties() { } public string ProvisioningState { get { throw null; } } public Azure.ResourceManager.IotHub.Models.IotHubPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public bool? RestrictOutboundNetworkAccess { get { throw null; } set { } } + public Azure.ResourceManager.IotHub.Models.RootCertificateProperties RootCertificate { get { throw null; } set { } } public Azure.ResourceManager.IotHub.Models.IotHubRoutingProperties Routing { get { throw null; } set { } } public string State { get { throw null; } } public System.Collections.Generic.IDictionary StorageEndpoints { get { throw null; } } @@ -695,7 +705,9 @@ public IotHubRoutingProperties() { } public static Azure.ResourceManager.IotHub.Models.IotHubRoutingSource DeviceJobLifecycleEvents { get { throw null; } } public static Azure.ResourceManager.IotHub.Models.IotHubRoutingSource DeviceLifecycleEvents { get { throw null; } } public static Azure.ResourceManager.IotHub.Models.IotHubRoutingSource DeviceMessages { get { throw null; } } + public static Azure.ResourceManager.IotHub.Models.IotHubRoutingSource DigitalTwinChangeEvents { get { throw null; } } public static Azure.ResourceManager.IotHub.Models.IotHubRoutingSource Invalid { get { throw null; } } + public static Azure.ResourceManager.IotHub.Models.IotHubRoutingSource MqttBrokerMessages { get { throw null; } } public static Azure.ResourceManager.IotHub.Models.IotHubRoutingSource TwinChangeEvents { get { throw null; } } public bool Equals(Azure.ResourceManager.IotHub.Models.IotHubRoutingSource other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -843,6 +855,31 @@ internal IotHubUserSubscriptionQuota() { } public string Unit { get { throw null; } } public string UserSubscriptionQuotaType { get { throw null; } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IPVersion : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IPVersion(string value) { throw null; } + public static Azure.ResourceManager.IotHub.Models.IPVersion IPv4 { get { throw null; } } + public static Azure.ResourceManager.IotHub.Models.IPVersion IPv4IPv6 { get { throw null; } } + public static Azure.ResourceManager.IotHub.Models.IPVersion IPv6 { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotHub.Models.IPVersion other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotHub.Models.IPVersion left, Azure.ResourceManager.IotHub.Models.IPVersion right) { throw null; } + public static implicit operator Azure.ResourceManager.IotHub.Models.IPVersion (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotHub.Models.IPVersion left, Azure.ResourceManager.IotHub.Models.IPVersion right) { throw null; } + public override string ToString() { throw null; } + } + public partial class KeyVaultKeyProperties + { + public KeyVaultKeyProperties() { } + public string KeyIdentifier { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier UserAssignedIdentity { get { throw null; } set { } } + } public partial class MessagingEndpointProperties { public MessagingEndpointProperties() { } @@ -850,6 +887,12 @@ public MessagingEndpointProperties() { } public int? MaxDeliveryCount { get { throw null; } set { } } public System.TimeSpan? TtlAsIso8601 { get { throw null; } set { } } } + public partial class RootCertificateProperties + { + public RootCertificateProperties() { } + public bool? EnableRootCertificateV2 { get { throw null; } set { } } + public System.DateTimeOffset? LastUpdatedTimeUtc { get { throw null; } } + } public partial class RouteCompilationError { internal RouteCompilationError() { } @@ -887,9 +930,27 @@ internal RouteErrorRange() { } public static bool operator !=(Azure.ResourceManager.IotHub.Models.RouteErrorSeverity left, Azure.ResourceManager.IotHub.Models.RouteErrorSeverity right) { throw null; } public override string ToString() { throw null; } } + public partial class RoutingCosmosDBSqlApiProperties + { + public RoutingCosmosDBSqlApiProperties(string name, System.Uri endpointUri, string databaseName, string collectionName) { } + public Azure.ResourceManager.IotHub.Models.IotHubAuthenticationType? AuthenticationType { get { throw null; } set { } } + public string CollectionName { get { throw null; } set { } } + public string DatabaseName { get { throw null; } set { } } + public System.Uri EndpointUri { get { throw null; } set { } } + public string Id { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string PartitionKeyName { get { throw null; } set { } } + public string PartitionKeyTemplate { get { throw null; } set { } } + public string PrimaryKey { get { throw null; } set { } } + public string ResourceGroup { get { throw null; } set { } } + public string SecondaryKey { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier UserAssignedIdentity { get { throw null; } set { } } + } public partial class RoutingEndpoints { public RoutingEndpoints() { } + public System.Collections.Generic.IList CosmosDBSqlCollections { get { throw null; } } public System.Collections.Generic.IList EventHubs { get { throw null; } } public System.Collections.Generic.IList ServiceBusQueues { get { throw null; } } public System.Collections.Generic.IList ServiceBusTopics { get { throw null; } } diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/IotHubDescriptionCollection.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/IotHubDescriptionCollection.cs index 280fc3c8b80f..cb3bf09595e9 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/IotHubDescriptionCollection.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/IotHubDescriptionCollection.cs @@ -54,7 +54,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to default, which may lead to unexpected behavior. + /// Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. /// /// /// Request Path @@ -96,7 +96,7 @@ public virtual async Task> CreateOrUpdat } /// - /// Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to default, which may lead to unexpected behavior. + /// Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. /// /// /// Request Path diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/EncryptionPropertiesDescription.Serialization.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/EncryptionPropertiesDescription.Serialization.cs new file mode 100644 index 000000000000..41a7c06786b3 --- /dev/null +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/EncryptionPropertiesDescription.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotHub.Models +{ + public partial class EncryptionPropertiesDescription : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(KeySource)) + { + writer.WritePropertyName("keySource"u8); + writer.WriteStringValue(KeySource); + } + if (Optional.IsCollectionDefined(KeyVaultProperties)) + { + writer.WritePropertyName("keyVaultProperties"u8); + writer.WriteStartArray(); + foreach (var item in KeyVaultProperties) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static EncryptionPropertiesDescription DeserializeEncryptionPropertiesDescription(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional keySource = default; + Optional> keyVaultProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keySource"u8)) + { + keySource = property.Value.GetString(); + continue; + } + if (property.NameEquals("keyVaultProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(KeyVaultKeyProperties.DeserializeKeyVaultKeyProperties(item)); + } + keyVaultProperties = array; + continue; + } + } + return new EncryptionPropertiesDescription(keySource.Value, Optional.ToList(keyVaultProperties)); + } + } +} diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/EncryptionPropertiesDescription.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/EncryptionPropertiesDescription.cs new file mode 100644 index 000000000000..8217faf66ae1 --- /dev/null +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/EncryptionPropertiesDescription.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.IotHub.Models +{ + /// The encryption properties for the IoT hub. + public partial class EncryptionPropertiesDescription + { + /// Initializes a new instance of EncryptionPropertiesDescription. + public EncryptionPropertiesDescription() + { + KeyVaultProperties = new ChangeTrackingList(); + } + + /// Initializes a new instance of EncryptionPropertiesDescription. + /// The source of the key. + /// The properties of the KeyVault key. + internal EncryptionPropertiesDescription(string keySource, IList keyVaultProperties) + { + KeySource = keySource; + KeyVaultProperties = keyVaultProperties; + } + + /// The source of the key. + public string KeySource { get; set; } + /// The properties of the KeyVault key. + public IList KeyVaultProperties { get; } + } +} diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IPVersion.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IPVersion.cs new file mode 100644 index 000000000000..07d953342467 --- /dev/null +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IPVersion.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.IotHub.Models +{ + /// This property specifies the IP Version the hub is currently utilizing. + public readonly partial struct IPVersion : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IPVersion(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string IPv4Value = "ipv4"; + private const string IPv6Value = "ipv6"; + private const string IPv4IPv6Value = "ipv4ipv6"; + + /// ipv4. + public static IPVersion IPv4 { get; } = new IPVersion(IPv4Value); + /// ipv6. + public static IPVersion IPv6 { get; } = new IPVersion(IPv6Value); + /// ipv4ipv6. + public static IPVersion IPv4IPv6 { get; } = new IPVersion(IPv4IPv6Value); + /// Determines if two values are the same. + public static bool operator ==(IPVersion left, IPVersion right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IPVersion left, IPVersion right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator IPVersion(string value) => new IPVersion(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IPVersion other && Equals(other); + /// + public bool Equals(IPVersion other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubProperties.Serialization.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubProperties.Serialization.cs index fb12fa85b977..a159ecff595d 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubProperties.Serialization.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubProperties.Serialization.cs @@ -145,16 +145,36 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("comments"u8); writer.WriteStringValue(Comments); } + if (Optional.IsDefined(DeviceStreams)) + { + writer.WritePropertyName("deviceStreams"u8); + writer.WriteObjectValue(DeviceStreams); + } if (Optional.IsDefined(Features)) { writer.WritePropertyName("features"u8); writer.WriteStringValue(Features.Value.ToString()); } + if (Optional.IsDefined(Encryption)) + { + writer.WritePropertyName("encryption"u8); + writer.WriteObjectValue(Encryption); + } if (Optional.IsDefined(EnableDataResidency)) { writer.WritePropertyName("enableDataResidency"u8); writer.WriteBooleanValue(EnableDataResidency.Value); } + if (Optional.IsDefined(RootCertificate)) + { + writer.WritePropertyName("rootCertificate"u8); + writer.WriteObjectValue(RootCertificate); + } + if (Optional.IsDefined(IPVersion)) + { + writer.WritePropertyName("ipVersion"u8); + writer.WriteStringValue(IPVersion.Value.ToString()); + } writer.WriteEndObject(); } @@ -185,9 +205,13 @@ internal static IotHubProperties DeserializeIotHubProperties(JsonElement element Optional enableFileUploadNotifications = default; Optional cloudToDevice = default; Optional comments = default; + Optional deviceStreams = default; Optional features = default; + Optional encryption = default; Optional> locations = default; Optional enableDataResidency = default; + Optional rootCertificate = default; + Optional ipVersion = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("authorizationPolicies"u8)) @@ -410,6 +434,16 @@ internal static IotHubProperties DeserializeIotHubProperties(JsonElement element comments = property.Value.GetString(); continue; } + if (property.NameEquals("deviceStreams"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + deviceStreams = IotHubPropertiesDeviceStreams.DeserializeIotHubPropertiesDeviceStreams(property.Value); + continue; + } if (property.NameEquals("features"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -420,6 +454,16 @@ internal static IotHubProperties DeserializeIotHubProperties(JsonElement element features = new IotHubCapability(property.Value.GetString()); continue; } + if (property.NameEquals("encryption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + encryption = EncryptionPropertiesDescription.DeserializeEncryptionPropertiesDescription(property.Value); + continue; + } if (property.NameEquals("locations"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -445,8 +489,28 @@ internal static IotHubProperties DeserializeIotHubProperties(JsonElement element enableDataResidency = property.Value.GetBoolean(); continue; } + if (property.NameEquals("rootCertificate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + rootCertificate = RootCertificateProperties.DeserializeRootCertificateProperties(property.Value); + continue; + } + if (property.NameEquals("ipVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + ipVersion = new IPVersion(property.Value.GetString()); + continue; + } } - return new IotHubProperties(Optional.ToList(authorizationPolicies), Optional.ToNullable(disableLocalAuth), Optional.ToNullable(disableDeviceSas), Optional.ToNullable(disableModuleSas), Optional.ToNullable(restrictOutboundNetworkAccess), Optional.ToList(allowedFqdnList), Optional.ToNullable(publicNetworkAccess), Optional.ToList(ipFilterRules), networkRuleSets.Value, minTlsVersion.Value, Optional.ToList(privateEndpointConnections), provisioningState.Value, state.Value, hostName.Value, Optional.ToDictionary(eventHubEndpoints), routing.Value, Optional.ToDictionary(storageEndpoints), Optional.ToDictionary(messagingEndpoints), Optional.ToNullable(enableFileUploadNotifications), cloudToDevice.Value, comments.Value, Optional.ToNullable(features), Optional.ToList(locations), Optional.ToNullable(enableDataResidency)); + return new IotHubProperties(Optional.ToList(authorizationPolicies), Optional.ToNullable(disableLocalAuth), Optional.ToNullable(disableDeviceSas), Optional.ToNullable(disableModuleSas), Optional.ToNullable(restrictOutboundNetworkAccess), Optional.ToList(allowedFqdnList), Optional.ToNullable(publicNetworkAccess), Optional.ToList(ipFilterRules), networkRuleSets.Value, minTlsVersion.Value, Optional.ToList(privateEndpointConnections), provisioningState.Value, state.Value, hostName.Value, Optional.ToDictionary(eventHubEndpoints), routing.Value, Optional.ToDictionary(storageEndpoints), Optional.ToDictionary(messagingEndpoints), Optional.ToNullable(enableFileUploadNotifications), cloudToDevice.Value, comments.Value, deviceStreams.Value, Optional.ToNullable(features), encryption.Value, Optional.ToList(locations), Optional.ToNullable(enableDataResidency), rootCertificate.Value, Optional.ToNullable(ipVersion)); } } } diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubProperties.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubProperties.cs index b7a8809fad12..f1f13be9b837 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubProperties.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubProperties.cs @@ -49,10 +49,14 @@ public IotHubProperties() /// If True, file upload notifications are enabled. /// The IoT hub cloud-to-device messaging properties. /// IoT hub comments. + /// The device streams properties of iothub. /// The capabilities and features enabled for the IoT hub. + /// The encryption properties for the IoT hub. /// Primary and secondary location for iot hub. /// This property when set to true, will enable data residency, thus, disabling disaster recovery. - internal IotHubProperties(IList authorizationPolicies, bool? disableLocalAuth, bool? disableDeviceSas, bool? disableModuleSas, bool? restrictOutboundNetworkAccess, IList allowedFqdns, IotHubPublicNetworkAccess? publicNetworkAccess, IList ipFilterRules, IotHubNetworkRuleSetProperties networkRuleSets, string minTlsVersion, IList privateEndpointConnections, string provisioningState, string state, string hostName, IDictionary eventHubEndpoints, IotHubRoutingProperties routing, IDictionary storageEndpoints, IDictionary messagingEndpoints, bool? enableFileUploadNotifications, CloudToDeviceProperties cloudToDevice, string comments, IotHubCapability? features, IReadOnlyList locations, bool? enableDataResidency) + /// This property store root certificate related information. + /// This property specifies the IP Version the hub is currently utilizing. + internal IotHubProperties(IList authorizationPolicies, bool? disableLocalAuth, bool? disableDeviceSas, bool? disableModuleSas, bool? restrictOutboundNetworkAccess, IList allowedFqdns, IotHubPublicNetworkAccess? publicNetworkAccess, IList ipFilterRules, IotHubNetworkRuleSetProperties networkRuleSets, string minTlsVersion, IList privateEndpointConnections, string provisioningState, string state, string hostName, IDictionary eventHubEndpoints, IotHubRoutingProperties routing, IDictionary storageEndpoints, IDictionary messagingEndpoints, bool? enableFileUploadNotifications, CloudToDeviceProperties cloudToDevice, string comments, IotHubPropertiesDeviceStreams deviceStreams, IotHubCapability? features, EncryptionPropertiesDescription encryption, IReadOnlyList locations, bool? enableDataResidency, RootCertificateProperties rootCertificate, IPVersion? ipVersion) { AuthorizationPolicies = authorizationPolicies; DisableLocalAuth = disableLocalAuth; @@ -75,9 +79,13 @@ internal IotHubProperties(IList authoriz EnableFileUploadNotifications = enableFileUploadNotifications; CloudToDevice = cloudToDevice; Comments = comments; + DeviceStreams = deviceStreams; Features = features; + Encryption = encryption; Locations = locations; EnableDataResidency = enableDataResidency; + RootCertificate = rootCertificate; + IPVersion = ipVersion; } /// The shared access policies you can use to secure a connection to the IoT hub. @@ -122,11 +130,30 @@ internal IotHubProperties(IList authoriz public CloudToDeviceProperties CloudToDevice { get; set; } /// IoT hub comments. public string Comments { get; set; } + /// The device streams properties of iothub. + internal IotHubPropertiesDeviceStreams DeviceStreams { get; set; } + /// List of Device Streams Endpoints. + public IList DeviceStreamsStreamingEndpoints + { + get + { + if (DeviceStreams is null) + DeviceStreams = new IotHubPropertiesDeviceStreams(); + return DeviceStreams.StreamingEndpoints; + } + } + /// The capabilities and features enabled for the IoT hub. public IotHubCapability? Features { get; set; } + /// The encryption properties for the IoT hub. + public EncryptionPropertiesDescription Encryption { get; set; } /// Primary and secondary location for iot hub. public IReadOnlyList Locations { get; } /// This property when set to true, will enable data residency, thus, disabling disaster recovery. public bool? EnableDataResidency { get; set; } + /// This property store root certificate related information. + public RootCertificateProperties RootCertificate { get; set; } + /// This property specifies the IP Version the hub is currently utilizing. + public IPVersion? IPVersion { get; set; } } } diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubPropertiesDeviceStreams.Serialization.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubPropertiesDeviceStreams.Serialization.cs new file mode 100644 index 000000000000..7b0b02ec945f --- /dev/null +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubPropertiesDeviceStreams.Serialization.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotHub.Models +{ + internal partial class IotHubPropertiesDeviceStreams : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(StreamingEndpoints)) + { + writer.WritePropertyName("streamingEndpoints"u8); + writer.WriteStartArray(); + foreach (var item in StreamingEndpoints) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static IotHubPropertiesDeviceStreams DeserializeIotHubPropertiesDeviceStreams(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> streamingEndpoints = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("streamingEndpoints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + streamingEndpoints = array; + continue; + } + } + return new IotHubPropertiesDeviceStreams(Optional.ToList(streamingEndpoints)); + } + } +} diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubPropertiesDeviceStreams.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubPropertiesDeviceStreams.cs new file mode 100644 index 000000000000..679560b21972 --- /dev/null +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubPropertiesDeviceStreams.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.IotHub.Models +{ + /// The device streams properties of iothub. + internal partial class IotHubPropertiesDeviceStreams + { + /// Initializes a new instance of IotHubPropertiesDeviceStreams. + public IotHubPropertiesDeviceStreams() + { + StreamingEndpoints = new ChangeTrackingList(); + } + + /// Initializes a new instance of IotHubPropertiesDeviceStreams. + /// List of Device Streams Endpoints. + internal IotHubPropertiesDeviceStreams(IList streamingEndpoints) + { + StreamingEndpoints = streamingEndpoints; + } + + /// List of Device Streams Endpoints. + public IList StreamingEndpoints { get; } + } +} diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubRoutingSource.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubRoutingSource.cs index e00e8a8f4a7d..4bfb2ecc1827 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubRoutingSource.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/IotHubRoutingSource.cs @@ -27,7 +27,9 @@ public IotHubRoutingSource(string value) private const string TwinChangeEventsValue = "TwinChangeEvents"; private const string DeviceLifecycleEventsValue = "DeviceLifecycleEvents"; private const string DeviceJobLifecycleEventsValue = "DeviceJobLifecycleEvents"; + private const string DigitalTwinChangeEventsValue = "DigitalTwinChangeEvents"; private const string DeviceConnectionStateEventsValue = "DeviceConnectionStateEvents"; + private const string MqttBrokerMessagesValue = "MqttBrokerMessages"; /// Invalid. public static IotHubRoutingSource Invalid { get; } = new IotHubRoutingSource(InvalidValue); @@ -39,8 +41,12 @@ public IotHubRoutingSource(string value) public static IotHubRoutingSource DeviceLifecycleEvents { get; } = new IotHubRoutingSource(DeviceLifecycleEventsValue); /// DeviceJobLifecycleEvents. public static IotHubRoutingSource DeviceJobLifecycleEvents { get; } = new IotHubRoutingSource(DeviceJobLifecycleEventsValue); + /// DigitalTwinChangeEvents. + public static IotHubRoutingSource DigitalTwinChangeEvents { get; } = new IotHubRoutingSource(DigitalTwinChangeEventsValue); /// DeviceConnectionStateEvents. public static IotHubRoutingSource DeviceConnectionStateEvents { get; } = new IotHubRoutingSource(DeviceConnectionStateEventsValue); + /// MqttBrokerMessages. + public static IotHubRoutingSource MqttBrokerMessages { get; } = new IotHubRoutingSource(MqttBrokerMessagesValue); /// Determines if two values are the same. public static bool operator ==(IotHubRoutingSource left, IotHubRoutingSource right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/KeyVaultKeyProperties.Serialization.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/KeyVaultKeyProperties.Serialization.cs new file mode 100644 index 000000000000..d58fe5b759bc --- /dev/null +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/KeyVaultKeyProperties.Serialization.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotHub.Models +{ + public partial class KeyVaultKeyProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(KeyIdentifier)) + { + writer.WritePropertyName("keyIdentifier"u8); + writer.WriteStringValue(KeyIdentifier); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity); + } + writer.WriteEndObject(); + } + + internal static KeyVaultKeyProperties DeserializeKeyVaultKeyProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional keyIdentifier = default; + Optional identity = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyIdentifier"u8)) + { + keyIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + identity = ManagedIdentity.DeserializeManagedIdentity(property.Value); + continue; + } + } + return new KeyVaultKeyProperties(keyIdentifier.Value, identity.Value); + } + } +} diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/KeyVaultKeyProperties.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/KeyVaultKeyProperties.cs new file mode 100644 index 000000000000..8f811ddc32be --- /dev/null +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/KeyVaultKeyProperties.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.IotHub.Models +{ + /// The properties of the KeyVault key. + public partial class KeyVaultKeyProperties + { + /// Initializes a new instance of KeyVaultKeyProperties. + public KeyVaultKeyProperties() + { + } + + /// Initializes a new instance of KeyVaultKeyProperties. + /// The identifier of the key. + /// Managed identity properties of KeyVault Key. + internal KeyVaultKeyProperties(string keyIdentifier, ManagedIdentity identity) + { + KeyIdentifier = keyIdentifier; + Identity = identity; + } + + /// The identifier of the key. + public string KeyIdentifier { get; set; } + /// Managed identity properties of KeyVault Key. + internal ManagedIdentity Identity { get; set; } + /// The user assigned identity. + public ResourceIdentifier UserAssignedIdentity + { + get => Identity is null ? default : Identity.UserAssignedIdentity; + set + { + if (Identity is null) + Identity = new ManagedIdentity(); + Identity.UserAssignedIdentity = value; + } + } + } +} diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RootCertificateProperties.Serialization.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RootCertificateProperties.Serialization.cs new file mode 100644 index 000000000000..ecc568a6bd82 --- /dev/null +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RootCertificateProperties.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotHub.Models +{ + public partial class RootCertificateProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(EnableRootCertificateV2)) + { + writer.WritePropertyName("enableRootCertificateV2"u8); + writer.WriteBooleanValue(EnableRootCertificateV2.Value); + } + writer.WriteEndObject(); + } + + internal static RootCertificateProperties DeserializeRootCertificateProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional enableRootCertificateV2 = default; + Optional lastUpdatedTimeUtc = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enableRootCertificateV2"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + enableRootCertificateV2 = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("lastUpdatedTimeUtc"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + lastUpdatedTimeUtc = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new RootCertificateProperties(Optional.ToNullable(enableRootCertificateV2), Optional.ToNullable(lastUpdatedTimeUtc)); + } + } +} diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RootCertificateProperties.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RootCertificateProperties.cs new file mode 100644 index 000000000000..bb1e885befff --- /dev/null +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RootCertificateProperties.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.IotHub.Models +{ + /// This property store root certificate related information. + public partial class RootCertificateProperties + { + /// Initializes a new instance of RootCertificateProperties. + public RootCertificateProperties() + { + } + + /// Initializes a new instance of RootCertificateProperties. + /// This property when set to true, hub will use G2 cert; while it's set to false, hub uses Baltimore Cert. + /// the last update time to root certificate flag. + internal RootCertificateProperties(bool? enableRootCertificateV2, DateTimeOffset? lastUpdatedTimeUtc) + { + EnableRootCertificateV2 = enableRootCertificateV2; + LastUpdatedTimeUtc = lastUpdatedTimeUtc; + } + + /// This property when set to true, hub will use G2 cert; while it's set to false, hub uses Baltimore Cert. + public bool? EnableRootCertificateV2 { get; set; } + /// the last update time to root certificate flag. + public DateTimeOffset? LastUpdatedTimeUtc { get; } + } +} diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingCosmosDBSqlApiProperties.Serialization.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingCosmosDBSqlApiProperties.Serialization.cs new file mode 100644 index 000000000000..10b5303cd2a2 --- /dev/null +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingCosmosDBSqlApiProperties.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotHub.Models +{ + public partial class RoutingCosmosDBSqlApiProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(SubscriptionId)) + { + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + } + if (Optional.IsDefined(ResourceGroup)) + { + writer.WritePropertyName("resourceGroup"u8); + writer.WriteStringValue(ResourceGroup); + } + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + if (Optional.IsDefined(AuthenticationType)) + { + writer.WritePropertyName("authenticationType"u8); + writer.WriteStringValue(AuthenticationType.Value.ToString()); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity); + } + if (Optional.IsDefined(PrimaryKey)) + { + writer.WritePropertyName("primaryKey"u8); + writer.WriteStringValue(PrimaryKey); + } + if (Optional.IsDefined(SecondaryKey)) + { + writer.WritePropertyName("secondaryKey"u8); + writer.WriteStringValue(SecondaryKey); + } + writer.WritePropertyName("databaseName"u8); + writer.WriteStringValue(DatabaseName); + writer.WritePropertyName("collectionName"u8); + writer.WriteStringValue(CollectionName); + if (Optional.IsDefined(PartitionKeyName)) + { + writer.WritePropertyName("partitionKeyName"u8); + writer.WriteStringValue(PartitionKeyName); + } + if (Optional.IsDefined(PartitionKeyTemplate)) + { + writer.WritePropertyName("partitionKeyTemplate"u8); + writer.WriteStringValue(PartitionKeyTemplate); + } + writer.WriteEndObject(); + } + + internal static RoutingCosmosDBSqlApiProperties DeserializeRoutingCosmosDBSqlApiProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + Optional id = default; + Optional subscriptionId = default; + Optional resourceGroup = default; + Uri endpointUri = default; + Optional authenticationType = default; + Optional identity = default; + Optional primaryKey = default; + Optional secondaryKey = default; + string databaseName = default; + string collectionName = default; + Optional partitionKeyName = default; + Optional partitionKeyTemplate = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("subscriptionId"u8)) + { + subscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceGroup"u8)) + { + resourceGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("authenticationType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + authenticationType = new IotHubAuthenticationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + identity = ManagedIdentity.DeserializeManagedIdentity(property.Value); + continue; + } + if (property.NameEquals("primaryKey"u8)) + { + primaryKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondaryKey"u8)) + { + secondaryKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("databaseName"u8)) + { + databaseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("collectionName"u8)) + { + collectionName = property.Value.GetString(); + continue; + } + if (property.NameEquals("partitionKeyName"u8)) + { + partitionKeyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("partitionKeyTemplate"u8)) + { + partitionKeyTemplate = property.Value.GetString(); + continue; + } + } + return new RoutingCosmosDBSqlApiProperties(name, id.Value, subscriptionId.Value, resourceGroup.Value, endpointUri, Optional.ToNullable(authenticationType), identity.Value, primaryKey.Value, secondaryKey.Value, databaseName, collectionName, partitionKeyName.Value, partitionKeyTemplate.Value); + } + } +} diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingCosmosDBSqlApiProperties.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingCosmosDBSqlApiProperties.cs new file mode 100644 index 000000000000..85f64439925c --- /dev/null +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingCosmosDBSqlApiProperties.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.IotHub.Models +{ + /// The properties related to a cosmos DB sql collection endpoint. + public partial class RoutingCosmosDBSqlApiProperties + { + /// Initializes a new instance of RoutingCosmosDBSqlApiProperties. + /// The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. + /// The url of the cosmos DB account. It must include the protocol https://. + /// The name of the cosmos DB database in the cosmos DB account. + /// The name of the cosmos DB sql collection in the cosmos DB database. + /// , , or is null. + public RoutingCosmosDBSqlApiProperties(string name, Uri endpointUri, string databaseName, string collectionName) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(endpointUri, nameof(endpointUri)); + Argument.AssertNotNull(databaseName, nameof(databaseName)); + Argument.AssertNotNull(collectionName, nameof(collectionName)); + + Name = name; + EndpointUri = endpointUri; + DatabaseName = databaseName; + CollectionName = collectionName; + } + + /// Initializes a new instance of RoutingCosmosDBSqlApiProperties. + /// The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. + /// Id of the cosmos DB sql collection endpoint. + /// The subscription identifier of the cosmos DB account. + /// The name of the resource group of the cosmos DB account. + /// The url of the cosmos DB account. It must include the protocol https://. + /// Method used to authenticate against the cosmos DB sql collection endpoint. + /// Managed identity properties of routing cosmos DB collection endpoint. + /// The primary key of the cosmos DB account. + /// The secondary key of the cosmos DB account. + /// The name of the cosmos DB database in the cosmos DB account. + /// The name of the cosmos DB sql collection in the cosmos DB database. + /// The name of the partition key associated with this cosmos DB sql collection if one exists. This is an optional parameter. + /// The template for generating a synthetic partition key value for use with this cosmos DB sql collection. The template must include at least one of the following placeholders: {iothub}, {deviceid}, {DD}, {MM}, and {YYYY}. Any one placeholder may be specified at most once, but order and non-placeholder components are arbitrary. This parameter is only required if PartitionKeyName is specified. + internal RoutingCosmosDBSqlApiProperties(string name, string id, string subscriptionId, string resourceGroup, Uri endpointUri, IotHubAuthenticationType? authenticationType, ManagedIdentity identity, string primaryKey, string secondaryKey, string databaseName, string collectionName, string partitionKeyName, string partitionKeyTemplate) + { + Name = name; + Id = id; + SubscriptionId = subscriptionId; + ResourceGroup = resourceGroup; + EndpointUri = endpointUri; + AuthenticationType = authenticationType; + Identity = identity; + PrimaryKey = primaryKey; + SecondaryKey = secondaryKey; + DatabaseName = databaseName; + CollectionName = collectionName; + PartitionKeyName = partitionKeyName; + PartitionKeyTemplate = partitionKeyTemplate; + } + + /// The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. + public string Name { get; set; } + /// Id of the cosmos DB sql collection endpoint. + public string Id { get; set; } + /// The subscription identifier of the cosmos DB account. + public string SubscriptionId { get; set; } + /// The name of the resource group of the cosmos DB account. + public string ResourceGroup { get; set; } + /// The url of the cosmos DB account. It must include the protocol https://. + public Uri EndpointUri { get; set; } + /// Method used to authenticate against the cosmos DB sql collection endpoint. + public IotHubAuthenticationType? AuthenticationType { get; set; } + /// Managed identity properties of routing cosmos DB collection endpoint. + internal ManagedIdentity Identity { get; set; } + /// The user assigned identity. + public ResourceIdentifier UserAssignedIdentity + { + get => Identity is null ? default : Identity.UserAssignedIdentity; + set + { + if (Identity is null) + Identity = new ManagedIdentity(); + Identity.UserAssignedIdentity = value; + } + } + + /// The primary key of the cosmos DB account. + public string PrimaryKey { get; set; } + /// The secondary key of the cosmos DB account. + public string SecondaryKey { get; set; } + /// The name of the cosmos DB database in the cosmos DB account. + public string DatabaseName { get; set; } + /// The name of the cosmos DB sql collection in the cosmos DB database. + public string CollectionName { get; set; } + /// The name of the partition key associated with this cosmos DB sql collection if one exists. This is an optional parameter. + public string PartitionKeyName { get; set; } + /// The template for generating a synthetic partition key value for use with this cosmos DB sql collection. The template must include at least one of the following placeholders: {iothub}, {deviceid}, {DD}, {MM}, and {YYYY}. Any one placeholder may be specified at most once, but order and non-placeholder components are arbitrary. This parameter is only required if PartitionKeyName is specified. + public string PartitionKeyTemplate { get; set; } + } +} diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingEndpoints.Serialization.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingEndpoints.Serialization.cs index 647fdc015bcf..bb721343565a 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingEndpoints.Serialization.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingEndpoints.Serialization.cs @@ -56,6 +56,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsCollectionDefined(CosmosDBSqlCollections)) + { + writer.WritePropertyName("cosmosDBSqlCollections"u8); + writer.WriteStartArray(); + foreach (var item in CosmosDBSqlCollections) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } writer.WriteEndObject(); } @@ -69,6 +79,7 @@ internal static RoutingEndpoints DeserializeRoutingEndpoints(JsonElement element Optional> serviceBusTopics = default; Optional> eventHubs = default; Optional> storageContainers = default; + Optional> cosmosDBSqlCollections = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("serviceBusQueues"u8)) @@ -131,8 +142,23 @@ internal static RoutingEndpoints DeserializeRoutingEndpoints(JsonElement element storageContainers = array; continue; } + if (property.NameEquals("cosmosDBSqlCollections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RoutingCosmosDBSqlApiProperties.DeserializeRoutingCosmosDBSqlApiProperties(item)); + } + cosmosDBSqlCollections = array; + continue; + } } - return new RoutingEndpoints(Optional.ToList(serviceBusQueues), Optional.ToList(serviceBusTopics), Optional.ToList(eventHubs), Optional.ToList(storageContainers)); + return new RoutingEndpoints(Optional.ToList(serviceBusQueues), Optional.ToList(serviceBusTopics), Optional.ToList(eventHubs), Optional.ToList(storageContainers), Optional.ToList(cosmosDBSqlCollections)); } } } diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingEndpoints.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingEndpoints.cs index a50316d3396a..14bd0df854e3 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingEndpoints.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Models/RoutingEndpoints.cs @@ -20,6 +20,7 @@ public RoutingEndpoints() ServiceBusTopics = new ChangeTrackingList(); EventHubs = new ChangeTrackingList(); StorageContainers = new ChangeTrackingList(); + CosmosDBSqlCollections = new ChangeTrackingList(); } /// Initializes a new instance of RoutingEndpoints. @@ -27,12 +28,14 @@ public RoutingEndpoints() /// The list of Service Bus topic endpoints that the IoT hub routes the messages to, based on the routing rules. /// The list of Event Hubs endpoints that IoT hub routes messages to, based on the routing rules. This list does not include the built-in Event Hubs endpoint. /// The list of storage container endpoints that IoT hub routes messages to, based on the routing rules. - internal RoutingEndpoints(IList serviceBusQueues, IList serviceBusTopics, IList eventHubs, IList storageContainers) + /// The list of Cosmos DB collection endpoints that IoT hub routes messages to, based on the routing rules. + internal RoutingEndpoints(IList serviceBusQueues, IList serviceBusTopics, IList eventHubs, IList storageContainers, IList cosmosDBSqlCollections) { ServiceBusQueues = serviceBusQueues; ServiceBusTopics = serviceBusTopics; EventHubs = eventHubs; StorageContainers = storageContainers; + CosmosDBSqlCollections = cosmosDBSqlCollections; } /// The list of Service Bus queue endpoints that IoT hub routes the messages to, based on the routing rules. @@ -43,5 +46,7 @@ internal RoutingEndpoints(IList servic public IList EventHubs { get; } /// The list of storage container endpoints that IoT hub routes messages to, based on the routing rules. public IList StorageContainers { get; } + /// The list of Cosmos DB collection endpoints that IoT hub routes messages to, based on the routing rules. + public IList CosmosDBSqlCollections { get; } } } diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/CertificatesRestOperations.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/CertificatesRestOperations.cs index cc59b3487a2c..433ca1e45361 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/CertificatesRestOperations.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/CertificatesRestOperations.cs @@ -33,7 +33,7 @@ public CertificatesRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-07-02"; + _apiVersion = apiVersion ?? "2022-11-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/IotHubResourceRestOperations.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/IotHubResourceRestOperations.cs index d35ca6ecb77c..026dad382ffe 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/IotHubResourceRestOperations.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/IotHubResourceRestOperations.cs @@ -33,7 +33,7 @@ public IotHubResourceRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-07-02"; + _apiVersion = apiVersion ?? "2022-11-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -147,7 +147,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r return message; } - /// Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to default, which may lead to unexpected behavior. + /// Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. /// The subscription identifier. /// The name of the resource group that contains the IoT hub. /// The name of the IoT hub. @@ -175,7 +175,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } } - /// Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to default, which may lead to unexpected behavior. + /// Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. /// The subscription identifier. /// The name of the resource group that contains the IoT hub. /// The name of the IoT hub. diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/IotHubRestOperations.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/IotHubRestOperations.cs index 65921e4e7563..b71c7758cde2 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/IotHubRestOperations.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/IotHubRestOperations.cs @@ -32,7 +32,7 @@ public IotHubRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-07-02"; + _apiVersion = apiVersion ?? "2022-11-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 05c3ce016c11..26ced591646d 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -33,7 +33,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-07-02"; + _apiVersion = apiVersion ?? "2022-11-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 099e36c1cceb..f24f61b41cd6 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -33,7 +33,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-07-02"; + _apiVersion = apiVersion ?? "2022-11-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/ResourceProviderCommonRestOperations.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/ResourceProviderCommonRestOperations.cs index 3db444a1868d..938a22ce71fc 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/ResourceProviderCommonRestOperations.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/RestOperations/ResourceProviderCommonRestOperations.cs @@ -33,7 +33,7 @@ public ResourceProviderCommonRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-07-02"; + _apiVersion = apiVersion ?? "2022-11-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/autorest.md b/sdk/iothub/Azure.ResourceManager.IotHub/src/autorest.md index 95af672fd5a1..888b906772b5 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/autorest.md +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/autorest.md @@ -9,7 +9,7 @@ generate-model-factory: false csharp: true library-name: IotHub namespace: Azure.ResourceManager.IotHub -require: https://github.com/Azure/azure-rest-api-specs/blob/0f9df940977c680c39938c8b8bd5baf893737ed0/specification/iothub/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/iothub/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true