From 9cb06cc3c0d71086098fb7c2c2f694c0f88d078a Mon Sep 17 00:00:00 2001 From: Chengming <61542202+dvbb@users.noreply.github.com> Date: Mon, 29 May 2023 17:46:59 +0800 Subject: [PATCH] enable model factory (#36585) --- .../Azure.ResourceManager.Redis/CHANGELOG.md | 9 +- ...re.ResourceManager.Redis.netstandard2.0.cs | 15 + .../src/Generated/ArmRedisModelFactory.cs | 229 ++++++ .../src/autorest.md | 1 - .../CHANGELOG.md | 5 +- ...eManager.RedisEnterprise.netstandard2.0.cs | 14 + .../ArmRedisEnterpriseModelFactory.cs | 173 +++++ .../src/autorest.md | 1 - .../Azure.ResourceManager.Relay/CHANGELOG.md | 9 +- ...re.ResourceManager.Relay.netstandard2.0.cs | 13 + .../src/Generated/ArmRelayModelFactory.cs | 191 +++++ .../src/autorest.md | 1 - .../CHANGELOG.md | 9 +- ...urceManager.Reservations.netstandard2.0.cs | 56 ++ .../Generated/ArmReservationsModelFactory.cs | 687 ++++++++++++++++++ .../src/autorest.md | 1 - .../CHANGELOG.md | 9 +- ...rceManager.ResourceGraph.netstandard2.0.cs | 8 + .../Generated/ArmResourceGraphModelFactory.cs | 79 ++ .../src/autorest.md | 1 - .../CHANGELOG.md | 9 +- ...ceManager.ResourceHealth.netstandard2.0.cs | 28 + .../ArmResourceHealthModelFactory.cs | 374 ++++++++++ .../src/autorest.md | 3 +- 24 files changed, 1897 insertions(+), 28 deletions(-) create mode 100644 sdk/redis/Azure.ResourceManager.Redis/src/Generated/ArmRedisModelFactory.cs create mode 100644 sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/ArmRedisEnterpriseModelFactory.cs create mode 100644 sdk/relay/Azure.ResourceManager.Relay/src/Generated/ArmRelayModelFactory.cs create mode 100644 sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/ArmReservationsModelFactory.cs create mode 100644 sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/Generated/ArmResourceGraphModelFactory.cs create mode 100644 sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/ArmResourceHealthModelFactory.cs diff --git a/sdk/redis/Azure.ResourceManager.Redis/CHANGELOG.md b/sdk/redis/Azure.ResourceManager.Redis/CHANGELOG.md index 9fb2525225bb2..5a3c67fb3e2d1 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/CHANGELOG.md +++ b/sdk/redis/Azure.ResourceManager.Redis/CHANGELOG.md @@ -1,15 +1,16 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.2.0-beta.1 (2023-05-31) ### Features Added -### Breaking Changes - -### Bugs Fixed +- Enable the model factory feature for model mocking, more information can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-mocking-factory-builder). ### Other Changes +- Upgraded dependent Azure.Core to 1.32.0. +- Upgraded dependent Azure.ResourceManager to 1.6.0. + ## 1.1.1 (2023-02-20) ### Other Changes diff --git a/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs b/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs index eb23aaca29608..25b33af46dd95 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs @@ -258,6 +258,21 @@ protected RedisResource() { } } namespace Azure.ResourceManager.Redis.Models { + public static partial class ArmRedisModelFactory + { + public static Azure.ResourceManager.Redis.Models.RedisAccessKeys RedisAccessKeys(string primaryKey = null, string secondaryKey = null) { throw null; } + public static Azure.ResourceManager.Redis.Models.RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBackupEnabled = default(bool?), string rdbBackupFrequency = null, int? rdbBackupMaxSnapshotCount = default(int?), string rdbStorageConnectionString = null, bool? isAofBackupEnabled = default(bool?), string aofStorageConnectionString0 = null, string aofStorageConnectionString1 = null, string maxFragmentationMemoryReserved = null, string maxMemoryPolicy = null, string maxMemoryReserved = null, string maxMemoryDelta = null, string maxClients = null, string preferredDataArchiveAuthMethod = null, string preferredDataPersistenceAuthMethod = null, string zonalConfiguration = null, string authNotRequired = null, System.Collections.Generic.IDictionary additionalProperties = null) { throw null; } + public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary tenantSettings = null, int? shardCount = default(int?), Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.Redis.Models.RedisTlsVersion?), Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess?), Azure.ResourceManager.Redis.Models.RedisSku sku = null, Azure.Core.ResourceIdentifier subnetId = null, System.Net.IPAddress staticIP = null, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState = default(Azure.ResourceManager.Redis.Models.RedisProvisioningState?), string hostName = null, int? port = default(int?), int? sslPort = default(int?), Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys = null, System.Collections.Generic.IEnumerable linkedServers = null, System.Collections.Generic.IEnumerable instances = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } + public static Azure.ResourceManager.Redis.RedisFirewallRuleData RedisFirewallRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Net.IPAddress startIP = null, System.Net.IPAddress endIP = null) { throw null; } + public static Azure.ResourceManager.Redis.Models.RedisForceRebootResult RedisForceRebootResult(string message = null) { throw null; } + public static Azure.ResourceManager.Redis.Models.RedisInstanceDetails RedisInstanceDetails(int? sslPort = default(int?), int? nonSslPort = default(int?), string zone = null, int? shardId = default(int?), bool? isMaster = default(bool?), bool? isPrimary = default(bool?)) { throw null; } + public static Azure.ResourceManager.Redis.RedisLinkedServerWithPropertyData RedisLinkedServerWithPropertyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier linkedRedisCacheId = null, Azure.Core.AzureLocation? linkedRedisCacheLocation = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Redis.Models.RedisLinkedServerRole? serverRole = default(Azure.ResourceManager.Redis.Models.RedisLinkedServerRole?), string geoReplicatedPrimaryHostName = null, string primaryHostName = null, string provisioningState = null) { throw null; } + public static Azure.ResourceManager.Redis.Models.RedisOperationStatus RedisOperationStatus(Azure.Core.ResourceIdentifier id = null, string name = null, string status = null, float? percentComplete = default(float?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable operations = null, Azure.ResponseError error = null, System.Collections.Generic.IReadOnlyDictionary properties = null) { throw null; } + public static Azure.ResourceManager.Redis.RedisPatchScheduleData RedisPatchScheduleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IEnumerable scheduleEntries = null) { throw null; } + public static Azure.ResourceManager.Redis.RedisPrivateEndpointConnectionData RedisPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.Redis.Models.RedisPrivateLinkServiceConnectionState redisPrivateLinkServiceConnectionState = null, Azure.ResourceManager.Redis.Models.RedisPrivateEndpointConnectionProvisioningState? redisProvisioningState = default(Azure.ResourceManager.Redis.Models.RedisPrivateEndpointConnectionProvisioningState?)) { throw null; } + public static Azure.ResourceManager.Redis.Models.RedisPrivateLinkResource RedisPrivateLinkResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } + public static Azure.ResourceManager.Redis.Models.RedisUpgradeNotification RedisUpgradeNotification(string name = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary upsellNotification = null) { throw null; } + } public partial class ExportRdbContent { public ExportRdbContent(string prefix, string container) { } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/ArmRedisModelFactory.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/ArmRedisModelFactory.cs new file mode 100644 index 0000000000000..82216a3778938 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/ArmRedisModelFactory.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Redis; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Redis.Models +{ + /// Model factory for models. + public static partial class ArmRedisModelFactory + { + + /// Initializes a new instance of RedisUpgradeNotification. + /// Name of upgrade notification. + /// Timestamp when upgrade notification occurred. + /// Details about this upgrade notification. + /// A new instance for mocking. + public static RedisUpgradeNotification RedisUpgradeNotification(string name = null, DateTimeOffset? timestamp = null, IReadOnlyDictionary upsellNotification = null) + { + upsellNotification ??= new Dictionary(); + + return new RedisUpgradeNotification(name, timestamp, upsellNotification); + } + + /// Initializes a new instance of RedisCommonConfiguration. + /// Specifies whether the rdb backup is enabled. + /// Specifies the frequency for creating rdb backup in minutes. Valid values: (15, 30, 60, 360, 720, 1440). + /// Specifies the maximum number of snapshots for rdb backup. + /// The storage account connection string for storing rdb file. + /// Specifies whether the aof backup is enabled. + /// First storage account connection string. + /// Second storage account connection string. + /// Value in megabytes reserved for fragmentation per shard. + /// The eviction strategy used when your data won't fit within its memory limit. + /// Value in megabytes reserved for non-cache usage per shard e.g. failover. + /// Value in megabytes reserved for non-cache usage per shard e.g. failover. + /// The max clients config. + /// Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS. + /// Preferred auth method to communicate to storage account used for data persistence, specify SAS or ManagedIdentity, default value is SAS. + /// Zonal Configuration. + /// Specifies whether the authentication is disabled. Setting this property is highly discouraged from security point of view. + /// Additional Properties. + /// A new instance for mocking. + public static RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBackupEnabled = null, string rdbBackupFrequency = null, int? rdbBackupMaxSnapshotCount = null, string rdbStorageConnectionString = null, bool? isAofBackupEnabled = null, string aofStorageConnectionString0 = null, string aofStorageConnectionString1 = null, string maxFragmentationMemoryReserved = null, string maxMemoryPolicy = null, string maxMemoryReserved = null, string maxMemoryDelta = null, string maxClients = null, string preferredDataArchiveAuthMethod = null, string preferredDataPersistenceAuthMethod = null, string zonalConfiguration = null, string authNotRequired = null, IDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new RedisCommonConfiguration(isRdbBackupEnabled, rdbBackupFrequency, rdbBackupMaxSnapshotCount, rdbStorageConnectionString, isAofBackupEnabled, aofStorageConnectionString0, aofStorageConnectionString1, maxFragmentationMemoryReserved, maxMemoryPolicy, maxMemoryReserved, maxMemoryDelta, maxClients, preferredDataArchiveAuthMethod, preferredDataPersistenceAuthMethod, zonalConfiguration, authNotRequired, additionalProperties); + } + + /// Initializes a new instance of RedisData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// A list of availability zones denoting where the resource needs to come from. + /// The identity of the resource. + /// All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. + /// Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. + /// Specifies whether the non-ssl Redis server port (6379) is enabled. + /// The number of replicas to be created per primary. + /// The number of replicas to be created per primary. + /// A dictionary of tenant settings. + /// The number of shards to be created on a Premium Cluster Cache. + /// Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). + /// Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. + /// The SKU of the Redis cache to deploy. + /// The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + /// Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. + /// Redis instance provisioning status. + /// Redis host name. + /// Redis non-SSL port. + /// Redis SSL port. + /// The keys of the Redis cache - not set if this object is not the response to Create or Update redis cache. + /// List of the linked servers associated with the cache. + /// List of the Redis instances associated with the cache. + /// List of private endpoint connection associated with the specified redis cache. + /// A new instance for mocking. + public static RedisData RedisData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable zones = null, ManagedServiceIdentity identity = null, RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = null, int? replicasPerMaster = null, int? replicasPerPrimary = null, IDictionary tenantSettings = null, int? shardCount = null, RedisTlsVersion? minimumTlsVersion = null, RedisPublicNetworkAccess? publicNetworkAccess = null, RedisSku sku = null, ResourceIdentifier subnetId = null, IPAddress staticIP = null, RedisProvisioningState? provisioningState = null, string hostName = null, int? port = null, int? sslPort = null, RedisAccessKeys accessKeys = null, IEnumerable linkedServers = null, IEnumerable instances = null, IEnumerable privateEndpointConnections = null) + { + tags ??= new Dictionary(); + zones ??= new List(); + tenantSettings ??= new Dictionary(); + linkedServers ??= new List(); + instances ??= new List(); + privateEndpointConnections ??= new List(); + + return new RedisData(id, name, resourceType, systemData, tags, location, zones?.ToList(), identity, redisConfiguration, redisVersion, enableNonSslPort, replicasPerMaster, replicasPerPrimary, tenantSettings, shardCount, minimumTlsVersion, publicNetworkAccess, sku, subnetId, staticIP, provisioningState, hostName, port, sslPort, accessKeys, linkedServers?.ToList(), instances?.ToList(), privateEndpointConnections?.ToList()); + } + + /// Initializes a new instance of RedisAccessKeys. + /// The current primary key that clients can use to authenticate with Redis cache. + /// The current secondary key that clients can use to authenticate with Redis cache. + /// A new instance for mocking. + public static RedisAccessKeys RedisAccessKeys(string primaryKey = null, string secondaryKey = null) + { + return new RedisAccessKeys(primaryKey, secondaryKey); + } + + /// Initializes a new instance of RedisInstanceDetails. + /// Redis instance SSL port. + /// If enableNonSslPort is true, provides Redis instance Non-SSL port. + /// If the Cache uses availability zones, specifies availability zone where this instance is located. + /// If clustering is enabled, the Shard ID of Redis Instance. + /// Specifies whether the instance is a primary node. + /// Specifies whether the instance is a primary node. + /// A new instance for mocking. + public static RedisInstanceDetails RedisInstanceDetails(int? sslPort = null, int? nonSslPort = null, string zone = null, int? shardId = null, bool? isMaster = null, bool? isPrimary = null) + { + return new RedisInstanceDetails(sslPort, nonSslPort, zone, shardId, isMaster, isPrimary); + } + + /// Initializes a new instance of RedisPrivateEndpointConnectionData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource of private end point. + /// A collection of information about the state of the connection between service consumer and provider. + /// The provisioning state of the private endpoint connection resource. + /// A new instance for mocking. + public static RedisPrivateEndpointConnectionData RedisPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier privateEndpointId = null, RedisPrivateLinkServiceConnectionState redisPrivateLinkServiceConnectionState = null, RedisPrivateEndpointConnectionProvisioningState? redisProvisioningState = null) + { + return new RedisPrivateEndpointConnectionData(id, name, resourceType, systemData, privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, redisPrivateLinkServiceConnectionState, redisProvisioningState); + } + + /// Initializes a new instance of RedisForceRebootResult. + /// Status message. + /// A new instance for mocking. + public static RedisForceRebootResult RedisForceRebootResult(string message = null) + { + return new RedisForceRebootResult(message); + } + + /// Initializes a new instance of RedisFirewallRuleData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// lowest IP address included in the range. + /// highest IP address included in the range. + /// A new instance for mocking. + public static RedisFirewallRuleData RedisFirewallRuleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IPAddress startIP = null, IPAddress endIP = null) + { + return new RedisFirewallRuleData(id, name, resourceType, systemData, startIP, endIP); + } + + /// Initializes a new instance of RedisPatchScheduleData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The geo-location where the resource lives. + /// List of patch schedules for a Redis cache. + /// A new instance for mocking. + public static RedisPatchScheduleData RedisPatchScheduleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IEnumerable scheduleEntries = null) + { + scheduleEntries ??= new List(); + + return new RedisPatchScheduleData(id, name, resourceType, systemData, location, scheduleEntries?.ToList()); + } + + /// Initializes a new instance of RedisLinkedServerWithPropertyData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Fully qualified resourceId of the linked redis cache. + /// Location of the linked redis cache. + /// Role of the linked server. + /// The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience. + /// The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover. + /// Terminal state of the link between primary and secondary redis cache. + /// A new instance for mocking. + public static RedisLinkedServerWithPropertyData RedisLinkedServerWithPropertyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier linkedRedisCacheId = null, AzureLocation? linkedRedisCacheLocation = null, RedisLinkedServerRole? serverRole = null, string geoReplicatedPrimaryHostName = null, string primaryHostName = null, string provisioningState = null) + { + return new RedisLinkedServerWithPropertyData(id, name, resourceType, systemData, linkedRedisCacheId, linkedRedisCacheLocation, serverRole, geoReplicatedPrimaryHostName, primaryHostName, provisioningState); + } + + /// Initializes a new instance of RedisPrivateLinkResource. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The private link resource group id. + /// The private link resource required member names. + /// The private link resource Private link DNS zone name. + /// A new instance for mocking. + public static RedisPrivateLinkResource RedisPrivateLinkResource(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null) + { + requiredMembers ??= new List(); + requiredZoneNames ??= new List(); + + return new RedisPrivateLinkResource(id, name, resourceType, systemData, groupId, requiredMembers?.ToList(), requiredZoneNames?.ToList()); + } + + /// Initializes a new instance of RedisOperationStatus. + /// Fully qualified ID for the async operation. + /// Name of the async operation. + /// Operation status. + /// Percent of the operation that is complete. + /// The start time of the operation. + /// The end time of the operation. + /// The operations list. + /// If present, details of the operation error. + /// Additional properties from RP, only when operation is successful. + /// A new instance for mocking. + public static RedisOperationStatus RedisOperationStatus(ResourceIdentifier id = null, string name = null, string status = null, float? percentComplete = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, IEnumerable operations = null, ResponseError error = null, IReadOnlyDictionary properties = null) + { + operations ??= new List(); + properties ??= new Dictionary(); + + return new RedisOperationStatus(id, name, status, percentComplete, startOn, endOn, operations?.ToList(), error, properties); + } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md b/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md index 4b14772a10860..e87488727ceba 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md +++ b/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md @@ -5,7 +5,6 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml azure-arm: true -generate-model-factory: false csharp: true library-name: Redis namespace: Azure.ResourceManager.Redis diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/CHANGELOG.md b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/CHANGELOG.md index d88502b727f80..f59a0318b43c1 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/CHANGELOG.md +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/CHANGELOG.md @@ -1,9 +1,10 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2023-05-31) ### Features Added +- Enable the model factory feature for model mocking, more information can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-mocking-factory-builder). - Updated api-version to `2023-03-01-preview` - Added operation Flush - Added operation group SkusOperations @@ -14,6 +15,8 @@ ### Other Changes +- Upgraded dependent Azure.Core to 1.32.0. +- Upgraded dependent Azure.ResourceManager to 1.6.0. - Model Database has a new parameter system_data - Model PrivateEndpointConnection has a new parameter system_data - Model PrivateLinkResource has a new parameter system_data diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/api/Azure.ResourceManager.RedisEnterprise.netstandard2.0.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/api/Azure.ResourceManager.RedisEnterprise.netstandard2.0.cs index 546068d8b4554..1028b055beae6 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/api/Azure.ResourceManager.RedisEnterprise.netstandard2.0.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/api/Azure.ResourceManager.RedisEnterprise.netstandard2.0.cs @@ -165,6 +165,20 @@ protected RedisEnterprisePrivateEndpointConnectionResource() { } } namespace Azure.ResourceManager.RedisEnterprise.Models { + public static partial class ArmRedisEnterpriseModelFactory + { + public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCapability RedisEnterpriseCapability(string name = null, bool? value = default(bool?)) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseClusterData RedisEnterpriseClusterData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku sku = null, System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption = null, string hostName = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), string redisVersion = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDataAccessKeys RedisEnterpriseDataAccessKeys(string primaryKey = null, string secondaryKey = null) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseDatabaseData RedisEnterpriseDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? clientProtocol = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol?), int? port = default(int?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? clusteringPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? evictionPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings persistence = null, System.Collections.Generic.IEnumerable modules = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication geoReplication = null) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseLinkedDatabase RedisEnterpriseLinkedDatabase(Azure.Core.ResourceIdentifier id = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseLinkState? state = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseLinkState?)) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseLocationInfo RedisEnterpriseLocationInfo(Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IEnumerable capabilities = null) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseModule RedisEnterpriseModule(string name = null, string args = null, string version = null) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseOperationStatus RedisEnterpriseOperationStatus(Azure.Core.ResourceIdentifier id = null, string name = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string status = null, Azure.ResponseError error = null) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.RedisEnterprisePrivateEndpointConnectionData RedisEnterprisePrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterprisePrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterprisePrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterprisePrivateEndpointConnectionProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterprisePrivateLinkResource RedisEnterprisePrivateLinkResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRegionSkuDetail RedisEnterpriseRegionSkuDetail(Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseLocationInfo locationInfo = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName? skuDetailsName = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName?)) { throw null; } + } public partial class ExportRedisEnterpriseDatabaseContent { public ExportRedisEnterpriseDatabaseContent(System.Uri sasUri) { } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/ArmRedisEnterpriseModelFactory.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/ArmRedisEnterpriseModelFactory.cs new file mode 100644 index 0000000000000..995790ea01227 --- /dev/null +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/ArmRedisEnterpriseModelFactory.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RedisEnterprise; + +namespace Azure.ResourceManager.RedisEnterprise.Models +{ + /// Model factory for models. + public static partial class ArmRedisEnterpriseModelFactory + { + + /// Initializes a new instance of RedisEnterpriseOperationStatus. + /// The operation's unique id. + /// The operation's name. + /// The start time of the operation. + /// The end time of the operation. + /// The current status of the operation. + /// Error response describing why the operation failed. + /// A new instance for mocking. + public static RedisEnterpriseOperationStatus RedisEnterpriseOperationStatus(ResourceIdentifier id = null, string name = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, string status = null, ResponseError error = null) + { + return new RedisEnterpriseOperationStatus(id, name, startOn, endOn, status, error != null ? new ErrorResponse(error) : null); + } + + /// Initializes a new instance of RedisEnterpriseClusterData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The SKU to create, which affects price, performance, and features. + /// The Availability Zones where this cluster will be deployed. + /// The identity of the resource. + /// The minimum TLS version for the cluster to support, e.g. '1.2'. + /// Encryption-at-rest configuration for the cluster. + /// DNS name of the cluster endpoint. + /// Current provisioning status of the cluster. + /// Current resource status of the cluster. + /// Version of redis the cluster supports, e.g. '6'. + /// List of private endpoint connections associated with the specified RedisEnterprise cluster. + /// A new instance for mocking. + public static RedisEnterpriseClusterData RedisEnterpriseClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, RedisEnterpriseSku sku = null, IEnumerable zones = null, ManagedServiceIdentity identity = null, RedisEnterpriseTlsVersion? minimumTlsVersion = null, RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption = null, string hostName = null, RedisEnterpriseProvisioningStatus? provisioningState = null, RedisEnterpriseClusterResourceState? resourceState = null, string redisVersion = null, IEnumerable privateEndpointConnections = null) + { + tags ??= new Dictionary(); + zones ??= new List(); + privateEndpointConnections ??= new List(); + + return new RedisEnterpriseClusterData(id, name, resourceType, systemData, tags, location, sku, zones?.ToList(), identity, minimumTlsVersion, customerManagedKeyEncryption != null ? new ClusterPropertiesEncryption(customerManagedKeyEncryption) : null, hostName, provisioningState, resourceState, redisVersion, privateEndpointConnections?.ToList()); + } + + /// Initializes a new instance of RedisEnterprisePrivateEndpointConnectionData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource of private end point. + /// A collection of information about the state of the connection between service consumer and provider. + /// The provisioning state of the private endpoint connection resource. + /// A new instance for mocking. + public static RedisEnterprisePrivateEndpointConnectionData RedisEnterprisePrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier privateEndpointId = null, RedisEnterprisePrivateLinkServiceConnectionState connectionState = null, RedisEnterprisePrivateEndpointConnectionProvisioningState? provisioningState = null) + { + return new RedisEnterprisePrivateEndpointConnectionData(id, name, resourceType, systemData, privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, connectionState, provisioningState); + } + + /// Initializes a new instance of RedisEnterpriseDatabaseData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted. + /// TCP port of the database endpoint. Specified at create time. Defaults to an available port. + /// Current provisioning status of the database. + /// Current resource status of the database. + /// Clustering policy - default is OSSCluster. Specified at create time. + /// Redis eviction policy - default is VolatileLRU. + /// Persistence settings. + /// Optional set of redis modules to enable in this database - modules can only be added at creation time. + /// Optional set of properties to configure geo replication for this database. + /// A new instance for mocking. + public static RedisEnterpriseDatabaseData RedisEnterpriseDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RedisEnterpriseClientProtocol? clientProtocol = null, int? port = null, RedisEnterpriseProvisioningStatus? provisioningState = null, RedisEnterpriseClusterResourceState? resourceState = null, RedisEnterpriseClusteringPolicy? clusteringPolicy = null, RedisEnterpriseEvictionPolicy? evictionPolicy = null, RedisPersistenceSettings persistence = null, IEnumerable modules = null, RedisEnterpriseDatabaseGeoReplication geoReplication = null) + { + modules ??= new List(); + + return new RedisEnterpriseDatabaseData(id, name, resourceType, systemData, clientProtocol, port, provisioningState, resourceState, clusteringPolicy, evictionPolicy, persistence, modules?.ToList(), geoReplication); + } + + /// Initializes a new instance of RedisEnterpriseModule. + /// The name of the module, e.g. 'RedisBloom', 'RediSearch', 'RedisTimeSeries'. + /// Configuration options for the module, e.g. 'ERROR_RATE 0.01 INITIAL_SIZE 400'. + /// The version of the module, e.g. '1.0'. + /// A new instance for mocking. + public static RedisEnterpriseModule RedisEnterpriseModule(string name = null, string args = null, string version = null) + { + return new RedisEnterpriseModule(name, args, version); + } + + /// Initializes a new instance of RedisEnterpriseLinkedDatabase. + /// Resource ID of a database resource to link with this database. + /// State of the link between the database resources. + /// A new instance for mocking. + public static RedisEnterpriseLinkedDatabase RedisEnterpriseLinkedDatabase(ResourceIdentifier id = null, RedisEnterpriseDatabaseLinkState? state = null) + { + return new RedisEnterpriseLinkedDatabase(id, state); + } + + /// Initializes a new instance of RedisEnterpriseDataAccessKeys. + /// The current primary key that clients can use to authenticate. + /// The current secondary key that clients can use to authenticate. + /// A new instance for mocking. + public static RedisEnterpriseDataAccessKeys RedisEnterpriseDataAccessKeys(string primaryKey = null, string secondaryKey = null) + { + return new RedisEnterpriseDataAccessKeys(primaryKey, secondaryKey); + } + + /// Initializes a new instance of RedisEnterprisePrivateLinkResource. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The private link resource group id. + /// The private link resource required member names. + /// The private link resource Private link DNS zone name. + /// A new instance for mocking. + public static RedisEnterprisePrivateLinkResource RedisEnterprisePrivateLinkResource(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null) + { + requiredMembers ??= new List(); + requiredZoneNames ??= new List(); + + return new RedisEnterprisePrivateLinkResource(id, name, resourceType, systemData, groupId, requiredMembers?.ToList(), requiredZoneNames?.ToList()); + } + + /// Initializes a new instance of RedisEnterpriseRegionSkuDetail. + /// Resource type which has the SKU, such as Microsoft.Cache/redisEnterprise. + /// Details about location and its capabilities. + /// Details about available skus. + /// A new instance for mocking. + public static RedisEnterpriseRegionSkuDetail RedisEnterpriseRegionSkuDetail(ResourceType? resourceType = null, RedisEnterpriseLocationInfo locationInfo = null, RedisEnterpriseSkuName? skuDetailsName = null) + { + return new RedisEnterpriseRegionSkuDetail(resourceType, locationInfo, skuDetailsName != null ? new SkuDetail(skuDetailsName) : null); + } + + /// Initializes a new instance of RedisEnterpriseLocationInfo. + /// Location name. + /// List of capabilities. + /// A new instance for mocking. + public static RedisEnterpriseLocationInfo RedisEnterpriseLocationInfo(AzureLocation? location = null, IEnumerable capabilities = null) + { + capabilities ??= new List(); + + return new RedisEnterpriseLocationInfo(location, capabilities?.ToList()); + } + + /// Initializes a new instance of RedisEnterpriseCapability. + /// Feature name. + /// Indicates whether feature is supported or not. + /// A new instance for mocking. + public static RedisEnterpriseCapability RedisEnterpriseCapability(string name = null, bool? value = null) + { + return new RedisEnterpriseCapability(name, value); + } + } +} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/autorest.md b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/autorest.md index 9a4e27b355476..372785adf341d 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/autorest.md +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/autorest.md @@ -5,7 +5,6 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml azure-arm: true -generate-model-factory: false csharp: true library-name: RedisEnterprise namespace: Azure.ResourceManager.RedisEnterprise diff --git a/sdk/relay/Azure.ResourceManager.Relay/CHANGELOG.md b/sdk/relay/Azure.ResourceManager.Relay/CHANGELOG.md index 06b084348673a..9ce221a5d10ab 100644 --- a/sdk/relay/Azure.ResourceManager.Relay/CHANGELOG.md +++ b/sdk/relay/Azure.ResourceManager.Relay/CHANGELOG.md @@ -1,15 +1,16 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.2.0-beta.1 (2023-05-31) ### Features Added -### Breaking Changes - -### Bugs Fixed +- Enable the model factory feature for model mocking, more information can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-mocking-factory-builder). ### Other Changes +- Upgraded dependent Azure.Core to 1.32.0. +- Upgraded dependent Azure.ResourceManager to 1.6.0. + ## 1.1.1 (2023-02-16) ### Other Changes diff --git a/sdk/relay/Azure.ResourceManager.Relay/api/Azure.ResourceManager.Relay.netstandard2.0.cs b/sdk/relay/Azure.ResourceManager.Relay/api/Azure.ResourceManager.Relay.netstandard2.0.cs index 6cd7e2d3977ec..3159cdf3d6aea 100644 --- a/sdk/relay/Azure.ResourceManager.Relay/api/Azure.ResourceManager.Relay.netstandard2.0.cs +++ b/sdk/relay/Azure.ResourceManager.Relay/api/Azure.ResourceManager.Relay.netstandard2.0.cs @@ -365,6 +365,19 @@ protected WcfRelayResource() { } } namespace Azure.ResourceManager.Relay.Models { + public static partial class ArmRelayModelFactory + { + public static Azure.ResourceManager.Relay.Models.RelayAccessKeys RelayAccessKeys(string primaryConnectionString = null, string secondaryConnectionString = null, string primaryKey = null, string secondaryKey = null, string keyName = null) { throw null; } + public static Azure.ResourceManager.Relay.RelayAuthorizationRuleData RelayAuthorizationRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable rights = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } + public static Azure.ResourceManager.Relay.RelayHybridConnectionData RelayHybridConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), int? listenerCount = default(int?), bool? isClientAuthorizationRequired = default(bool?), string userMetadata = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } + public static Azure.ResourceManager.Relay.Models.RelayNameAvailabilityResult RelayNameAvailabilityResult(string message = null, bool? isNameAvailable = default(bool?), Azure.ResourceManager.Relay.Models.RelayNameUnavailableReason? reason = default(Azure.ResourceManager.Relay.Models.RelayNameUnavailableReason?)) { throw null; } + public static Azure.ResourceManager.Relay.RelayNamespaceData RelayNamespaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Relay.Models.RelaySku sku = null, string provisioningState = null, string status = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), string serviceBusEndpoint = null, string metricId = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.Relay.Models.RelayPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Relay.Models.RelayPublicNetworkAccess?)) { throw null; } + public static Azure.ResourceManager.Relay.Models.RelayNamespacePatch RelayNamespacePatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Relay.Models.RelaySku sku = null, string provisioningState = null, string status = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), string serviceBusEndpoint = null, string metricId = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.Relay.Models.RelayPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Relay.Models.RelayPublicNetworkAccess?), System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.ResourceManager.Relay.RelayNetworkRuleSetData RelayNetworkRuleSetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Relay.Models.RelayNetworkRuleSetDefaultAction? defaultAction = default(Azure.ResourceManager.Relay.Models.RelayNetworkRuleSetDefaultAction?), Azure.ResourceManager.Relay.Models.RelayPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Relay.Models.RelayPublicNetworkAccess?), System.Collections.Generic.IEnumerable ipRules = null) { throw null; } + public static Azure.ResourceManager.Relay.RelayPrivateEndpointConnectionData RelayPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.Relay.Models.RelayPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.Relay.Models.RelayPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.Relay.Models.RelayPrivateEndpointConnectionProvisioningState?), Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } + public static Azure.ResourceManager.Relay.RelayPrivateLinkResourceData RelayPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } + public static Azure.ResourceManager.Relay.WcfRelayData WcfRelayData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, bool? isDynamic = default(bool?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), int? listenerCount = default(int?), Azure.ResourceManager.Relay.Models.RelayType? relayType = default(Azure.ResourceManager.Relay.Models.RelayType?), bool? isClientAuthorizationRequired = default(bool?), bool? isTransportSecurityRequired = default(bool?), string userMetadata = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } + } public partial class RelayAccessKeys { internal RelayAccessKeys() { } diff --git a/sdk/relay/Azure.ResourceManager.Relay/src/Generated/ArmRelayModelFactory.cs b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/ArmRelayModelFactory.cs new file mode 100644 index 0000000000000..b3bf4312795cc --- /dev/null +++ b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/ArmRelayModelFactory.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Relay; + +namespace Azure.ResourceManager.Relay.Models +{ + /// Model factory for models. + public static partial class ArmRelayModelFactory + { + /// Initializes a new instance of RelayAuthorizationRuleData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The rights associated with the rule. + /// The geo-location where the resource lives. + /// A new instance for mocking. + public static RelayAuthorizationRuleData RelayAuthorizationRuleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable rights = null, AzureLocation? location = null) + { + rights ??= new List(); + + return new RelayAuthorizationRuleData(id, name, resourceType, systemData, rights?.ToList(), location); + } + + /// Initializes a new instance of RelayAccessKeys. + /// Primary connection string of the created namespace authorization rule. + /// Secondary connection string of the created namespace authorization rule. + /// A base64-encoded 256-bit primary key for signing and validating the SAS token. + /// A base64-encoded 256-bit secondary key for signing and validating the SAS token. + /// A string that describes the authorization rule. + /// A new instance for mocking. + public static RelayAccessKeys RelayAccessKeys(string primaryConnectionString = null, string secondaryConnectionString = null, string primaryKey = null, string secondaryKey = null, string keyName = null) + { + return new RelayAccessKeys(primaryConnectionString, secondaryConnectionString, primaryKey, secondaryKey, keyName); + } + + /// Initializes a new instance of RelayHybridConnectionData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The time the hybrid connection was created. + /// The time the namespace was updated. + /// The number of listeners for this hybrid connection. Note that min : 1 and max:25 are supported. + /// Returns true if client authorization is needed for this hybrid connection; otherwise, false. + /// The usermetadata is a placeholder to store user-defined string data for the hybrid connection endpoint. For example, it can be used to store descriptive data, such as a list of teams and their contact information. Also, user-defined configuration settings can be stored. + /// The geo-location where the resource lives. + /// A new instance for mocking. + public static RelayHybridConnectionData RelayHybridConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, int? listenerCount = null, bool? isClientAuthorizationRequired = null, string userMetadata = null, AzureLocation? location = null) + { + return new RelayHybridConnectionData(id, name, resourceType, systemData, createdOn, updatedOn, listenerCount, isClientAuthorizationRequired, userMetadata, location); + } + + /// Initializes a new instance of RelayNameAvailabilityResult. + /// The detailed info regarding the reason associated with the namespace. + /// Value indicating namespace is available. Returns true if the namespace is available; otherwise, false. + /// The reason for unavailability of a namespace. + /// A new instance for mocking. + public static RelayNameAvailabilityResult RelayNameAvailabilityResult(string message = null, bool? isNameAvailable = null, RelayNameUnavailableReason? reason = null) + { + return new RelayNameAvailabilityResult(message, isNameAvailable, reason); + } + + /// Initializes a new instance of RelayNamespaceData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// SKU of the namespace. + /// Provisioning state of the Namespace. + /// Status of the Namespace. + /// The time the namespace was created. + /// The time the namespace was updated. + /// Endpoint you can use to perform Service Bus operations. + /// Identifier for Azure Insights metrics. + /// List of private endpoint connections. + /// This determines if traffic is allowed over public network. By default it is enabled. DO NOT USE PublicNetworkAccess on Namespace API. Please use the NetworkRuleSet API to enable or disable PublicNetworkAccess. + /// A new instance for mocking. + public static RelayNamespaceData RelayNamespaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, RelaySku sku = null, string provisioningState = null, string status = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, string serviceBusEndpoint = null, string metricId = null, IEnumerable privateEndpointConnections = null, RelayPublicNetworkAccess? publicNetworkAccess = null) + { + tags ??= new Dictionary(); + privateEndpointConnections ??= new List(); + + return new RelayNamespaceData(id, name, resourceType, systemData, tags, location, sku, provisioningState, status, createdOn, updatedOn, serviceBusEndpoint, metricId, privateEndpointConnections?.ToList(), publicNetworkAccess); + } + + /// Initializes a new instance of RelayPrivateEndpointConnectionData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The Private Endpoint resource for this Connection. + /// Details about the state of the connection. + /// Provisioning state of the Private Endpoint Connection. + /// The geo-location where the resource lives. + /// A new instance for mocking. + public static RelayPrivateEndpointConnectionData RelayPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier privateEndpointId = null, RelayPrivateLinkServiceConnectionState connectionState = null, RelayPrivateEndpointConnectionProvisioningState? provisioningState = null, AzureLocation? location = null) + { + return new RelayPrivateEndpointConnectionData(id, name, resourceType, systemData, privateEndpointId != null ? ResourceManagerModelFactory.WritableSubResource(privateEndpointId) : null, connectionState, provisioningState, location); + } + + /// Initializes a new instance of RelayNamespacePatch. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// SKU of the namespace. + /// Provisioning state of the Namespace. + /// Status of the Namespace. + /// The time the namespace was created. + /// The time the namespace was updated. + /// Endpoint you can use to perform Service Bus operations. + /// Identifier for Azure Insights metrics. + /// List of private endpoint connections. + /// This determines if traffic is allowed over public network. By default it is enabled. DO NOT USE PublicNetworkAccess on Namespace API. Please use the NetworkRuleSet API to enable or disable PublicNetworkAccess. + /// Resource tags. + /// A new instance for mocking. + public static RelayNamespacePatch RelayNamespacePatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RelaySku sku = null, string provisioningState = null, string status = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, string serviceBusEndpoint = null, string metricId = null, IEnumerable privateEndpointConnections = null, RelayPublicNetworkAccess? publicNetworkAccess = null, IDictionary tags = null) + { + privateEndpointConnections ??= new List(); + tags ??= new Dictionary(); + + return new RelayNamespacePatch(id, name, resourceType, systemData, sku, provisioningState, status, createdOn, updatedOn, serviceBusEndpoint, metricId, privateEndpointConnections?.ToList(), publicNetworkAccess, tags); + } + + /// Initializes a new instance of RelayPrivateLinkResourceData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The private link resource group id. + /// The private link resource required member names. + /// The private link resource Private link DNS zone name. + /// A new instance for mocking. + public static RelayPrivateLinkResourceData RelayPrivateLinkResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null) + { + requiredMembers ??= new List(); + requiredZoneNames ??= new List(); + + return new RelayPrivateLinkResourceData(id, name, resourceType, systemData, groupId, requiredMembers?.ToList(), requiredZoneNames?.ToList()); + } + + /// Initializes a new instance of RelayNetworkRuleSetData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Default Action for Network Rule Set. + /// This determines if traffic is allowed over public network. By default it is enabled. + /// List of IpRules. + /// A new instance for mocking. + public static RelayNetworkRuleSetData RelayNetworkRuleSetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RelayNetworkRuleSetDefaultAction? defaultAction = null, RelayPublicNetworkAccess? publicNetworkAccess = null, IEnumerable ipRules = null) + { + ipRules ??= new List(); + + return new RelayNetworkRuleSetData(id, name, resourceType, systemData, defaultAction, publicNetworkAccess, ipRules?.ToList()); + } + + /// Initializes a new instance of WcfRelayData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Returns true if the relay is dynamic; otherwise, false. + /// The time the WCF relay was created. + /// The time the namespace was updated. + /// The number of listeners for this relay. Note that min :1 and max:25 are supported. + /// WCF relay type. + /// Returns true if client authorization is needed for this relay; otherwise, false. + /// Returns true if transport security is needed for this relay; otherwise, false. + /// The usermetadata is a placeholder to store user-defined string data for the WCF Relay endpoint. For example, it can be used to store descriptive data, such as list of teams and their contact information. Also, user-defined configuration settings can be stored. + /// The geo-location where the resource lives. + /// A new instance for mocking. + public static WcfRelayData WcfRelayData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, bool? isDynamic = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, int? listenerCount = null, RelayType? relayType = null, bool? isClientAuthorizationRequired = null, bool? isTransportSecurityRequired = null, string userMetadata = null, AzureLocation? location = null) + { + return new WcfRelayData(id, name, resourceType, systemData, isDynamic, createdOn, updatedOn, listenerCount, relayType, isClientAuthorizationRequired, isTransportSecurityRequired, userMetadata, location); + } + } +} diff --git a/sdk/relay/Azure.ResourceManager.Relay/src/autorest.md b/sdk/relay/Azure.ResourceManager.Relay/src/autorest.md index 86d970eec9100..dbee54ccc28c0 100644 --- a/sdk/relay/Azure.ResourceManager.Relay/src/autorest.md +++ b/sdk/relay/Azure.ResourceManager.Relay/src/autorest.md @@ -5,7 +5,6 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml azure-arm: true -generate-model-factory: false csharp: true library-name: Relay namespace: Azure.ResourceManager.Relay diff --git a/sdk/reservations/Azure.ResourceManager.Reservations/CHANGELOG.md b/sdk/reservations/Azure.ResourceManager.Reservations/CHANGELOG.md index 307cba1449451..ee070608637a0 100644 --- a/sdk/reservations/Azure.ResourceManager.Reservations/CHANGELOG.md +++ b/sdk/reservations/Azure.ResourceManager.Reservations/CHANGELOG.md @@ -1,15 +1,16 @@ # Release History -## 1.4.0-beta.1 (Unreleased) +## 1.4.0-beta.1 (2023-05-31) ### Features Added -### Breaking Changes - -### Bugs Fixed +- Enable the model factory feature for model mocking, more information can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-mocking-factory-builder). ### Other Changes +- Upgraded dependent Azure.Core to 1.32.0. +- Upgraded dependent Azure.ResourceManager to 1.6.0. + ## 1.3.0 (2023-03-21) ### Features Added diff --git a/sdk/reservations/Azure.ResourceManager.Reservations/api/Azure.ResourceManager.Reservations.netstandard2.0.cs b/sdk/reservations/Azure.ResourceManager.Reservations/api/Azure.ResourceManager.Reservations.netstandard2.0.cs index 0d55c4e90b8f0..0e82ecc1edb67 100644 --- a/sdk/reservations/Azure.ResourceManager.Reservations/api/Azure.ResourceManager.Reservations.netstandard2.0.cs +++ b/sdk/reservations/Azure.ResourceManager.Reservations/api/Azure.ResourceManager.Reservations.netstandard2.0.cs @@ -241,6 +241,62 @@ public AppliedScopeProperties() { } public static bool operator !=(Azure.ResourceManager.Reservations.Models.AppliedScopeType left, Azure.ResourceManager.Reservations.Models.AppliedScopeType right) { throw null; } public override string ToString() { throw null; } } + public static partial class ArmReservationsModelFactory + { + public static Azure.ResourceManager.Reservations.Models.AppliedReservationData AppliedReservationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Reservations.Models.AppliedReservationList reservationOrderIds = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.AppliedReservationList AppliedReservationList(System.Collections.Generic.IEnumerable value = null, string nextLink = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.AvailableScopesProperties AvailableScopesProperties(System.Collections.Generic.IEnumerable scopes = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.BillingInformation BillingInformation(Azure.ResourceManager.Reservations.Models.PurchasePrice billingCurrencyTotalPaidAmount = null, Azure.ResourceManager.Reservations.Models.PurchasePrice billingCurrencyProratedAmount = null, Azure.ResourceManager.Reservations.Models.PurchasePrice billingCurrencyRemainingCommitmentAmount = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.CalculateExchangeResult CalculateExchangeResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.ResourceManager.Reservations.Models.CalculateExchangeOperationResultStatus? status = default(Azure.ResourceManager.Reservations.Models.CalculateExchangeOperationResultStatus?), Azure.ResourceManager.Reservations.Models.CalculateExchangeResultProperties properties = null, Azure.ResourceManager.Reservations.Models.OperationResultError error = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.CalculateExchangeResultProperties CalculateExchangeResultProperties(System.Guid? sessionId = default(System.Guid?), Azure.ResourceManager.Reservations.Models.PurchasePrice netPayable = null, Azure.ResourceManager.Reservations.Models.PurchasePrice refundsTotal = null, Azure.ResourceManager.Reservations.Models.PurchasePrice purchasesTotal = null, System.Collections.Generic.IEnumerable reservationsToPurchase = null, System.Collections.Generic.IEnumerable savingsPlansToPurchase = null, System.Collections.Generic.IEnumerable reservationsToExchange = null, System.Collections.Generic.IEnumerable policyErrors = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.CalculatePriceResult CalculatePriceResult(Azure.ResourceManager.Reservations.Models.CalculatePriceResultProperties properties = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.CalculatePriceResultProperties CalculatePriceResultProperties(Azure.ResourceManager.Reservations.Models.CalculatePriceResultPropertiesBillingCurrencyTotal billingCurrencyTotal = null, double? netTotal = default(double?), double? taxTotal = default(double?), double? grandTotal = default(double?), bool? isTaxIncluded = default(bool?), bool? isBillingPartnerManaged = default(bool?), System.Guid? reservationOrderId = default(System.Guid?), string skuTitle = null, string skuDescription = null, Azure.ResourceManager.Reservations.Models.CalculatePriceResultPropertiesPricingCurrencyTotal pricingCurrencyTotal = null, System.Collections.Generic.IEnumerable paymentSchedule = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.CalculatePriceResultPropertiesBillingCurrencyTotal CalculatePriceResultPropertiesBillingCurrencyTotal(string currencyCode = null, double? amount = default(double?)) { throw null; } + public static Azure.ResourceManager.Reservations.Models.CalculatePriceResultPropertiesPricingCurrencyTotal CalculatePriceResultPropertiesPricingCurrencyTotal(string currencyCode = null, float? amount = default(float?)) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ChangeDirectoryDetail ChangeDirectoryDetail(Azure.ResourceManager.Reservations.Models.ChangeDirectoryResult reservationOrder = null, System.Collections.Generic.IEnumerable reservations = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ChangeDirectoryResult ChangeDirectoryResult(System.Guid? id = default(System.Guid?), string name = null, bool? isSucceeded = default(bool?), string error = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ExchangePolicyError ExchangePolicyError(string code = null, string message = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ExchangeResult ExchangeResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.ResourceManager.Reservations.Models.ExchangeOperationResultStatus? status = default(Azure.ResourceManager.Reservations.Models.ExchangeOperationResultStatus?), Azure.ResourceManager.Reservations.Models.ExchangeResultProperties properties = null, Azure.ResourceManager.Reservations.Models.OperationResultError error = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ExchangeResultProperties ExchangeResultProperties(System.Guid? sessionId = default(System.Guid?), Azure.ResourceManager.Reservations.Models.PurchasePrice netPayable = null, Azure.ResourceManager.Reservations.Models.PurchasePrice refundsTotal = null, Azure.ResourceManager.Reservations.Models.PurchasePrice purchasesTotal = null, System.Collections.Generic.IEnumerable reservationsToPurchase = null, System.Collections.Generic.IEnumerable savingsPlansToPurchase = null, System.Collections.Generic.IEnumerable reservationsToExchange = null, System.Collections.Generic.IEnumerable policyErrors = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ExtendedStatusInfo ExtendedStatusInfo(Azure.ResourceManager.Reservations.Models.ReservationStatusCode? statusCode = default(Azure.ResourceManager.Reservations.Models.ReservationStatusCode?), string message = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.OperationResultError OperationResultError(string code = null, string message = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.PaymentDetail PaymentDetail(System.DateTimeOffset? dueOn = default(System.DateTimeOffset?), System.DateTimeOffset? payOn = default(System.DateTimeOffset?), Azure.ResourceManager.Reservations.Models.PurchasePrice pricingCurrencyTotal = null, Azure.ResourceManager.Reservations.Models.PurchasePrice billingCurrencyTotal = null, string billingAccount = null, Azure.ResourceManager.Reservations.Models.PaymentStatus? status = default(Azure.ResourceManager.Reservations.Models.PaymentStatus?), Azure.ResourceManager.Reservations.Models.ExtendedStatusInfo extendedStatusInfo = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.QuotaProperties QuotaProperties(int? limit = default(int?), int? currentValue = default(int?), string unit = null, Azure.ResourceManager.Reservations.Models.ReservationResourceName resourceName = null, Azure.ResourceManager.Reservations.Models.ResourceTypeName? resourceTypeName = default(Azure.ResourceManager.Reservations.Models.ResourceTypeName?), string quotaPeriod = null, System.BinaryData properties = null) { throw null; } + public static Azure.ResourceManager.Reservations.QuotaRequestDetailData QuotaRequestDetailData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Reservations.Models.QuotaRequestState? provisioningState = default(Azure.ResourceManager.Reservations.Models.QuotaRequestState?), string message = null, System.DateTimeOffset? requestSubmitOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable quotaRequestValue = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.RenewProperties RenewProperties(Azure.ResourceManager.Reservations.Models.ReservationPurchaseContent purchaseProperties = null, Azure.ResourceManager.Reservations.Models.RenewPropertiesPricingCurrencyTotal pricingCurrencyTotal = null, Azure.ResourceManager.Reservations.Models.RenewPropertiesBillingCurrencyTotal billingCurrencyTotal = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.RenewPropertiesBillingCurrencyTotal RenewPropertiesBillingCurrencyTotal(string currencyCode = null, float? amount = default(float?)) { throw null; } + public static Azure.ResourceManager.Reservations.Models.RenewPropertiesPricingCurrencyTotal RenewPropertiesPricingCurrencyTotal(string currencyCode = null, float? amount = default(float?)) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationCalculateRefundResult ReservationCalculateRefundResult(string id = null, Azure.ResourceManager.Reservations.Models.ReservationRefundResponseProperties properties = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationCatalog ReservationCatalog(string appliedResourceType = null, string skuName = null, System.Collections.Generic.IReadOnlyDictionary> billingPlans = null, System.Collections.Generic.IEnumerable terms = null, System.Collections.Generic.IEnumerable locations = null, System.Collections.Generic.IEnumerable skuProperties = null, Azure.ResourceManager.Reservations.Models.ReservationCatalogMsrp msrp = null, System.Collections.Generic.IEnumerable restrictions = null, string tier = null, string size = null, System.Collections.Generic.IEnumerable capabilities = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationCatalogMsrp ReservationCatalogMsrp(Azure.ResourceManager.Reservations.Models.PurchasePrice p1Y = null, Azure.ResourceManager.Reservations.Models.PurchasePrice p3Y = null, Azure.ResourceManager.Reservations.Models.PurchasePrice p5Y = null) { throw null; } + public static Azure.ResourceManager.Reservations.ReservationDetailData ReservationDetailData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), int? version = default(int?), string skuName = null, Azure.ResourceManager.Reservations.Models.ReservationProperties properties = null, Azure.ResourceManager.Reservations.Models.ReservationKind? kind = default(Azure.ResourceManager.Reservations.Models.ReservationKind?)) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationMergeProperties ReservationMergeProperties(string mergeDestination = null, System.Collections.Generic.IEnumerable mergeSources = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationOrderBillingPlanInformation ReservationOrderBillingPlanInformation(Azure.ResourceManager.Reservations.Models.PurchasePrice pricingCurrencyTotal = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? nextPaymentDueOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable transactions = null) { throw null; } + public static Azure.ResourceManager.Reservations.ReservationOrderData ReservationOrderData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, int? version = default(int?), string displayName = null, System.DateTimeOffset? requestOn = default(System.DateTimeOffset?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), System.DateTimeOffset? reservationExpireOn = default(System.DateTimeOffset?), System.DateTimeOffset? benefitStartOn = default(System.DateTimeOffset?), int? originalQuantity = default(int?), Azure.ResourceManager.Reservations.Models.ReservationTerm? term = default(Azure.ResourceManager.Reservations.Models.ReservationTerm?), Azure.ResourceManager.Reservations.Models.ReservationProvisioningState? provisioningState = default(Azure.ResourceManager.Reservations.Models.ReservationProvisioningState?), Azure.ResourceManager.Reservations.Models.ReservationBillingPlan? billingPlan = default(Azure.ResourceManager.Reservations.Models.ReservationBillingPlan?), Azure.ResourceManager.Reservations.Models.ReservationOrderBillingPlanInformation planInformation = null, System.Collections.Generic.IEnumerable reservations = null, System.DateTimeOffset? reviewOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationProperties ReservationProperties(Azure.ResourceManager.Reservations.Models.ReservedResourceType? reservedResourceType = default(Azure.ResourceManager.Reservations.Models.ReservedResourceType?), Azure.ResourceManager.Reservations.Models.InstanceFlexibility? instanceFlexibility = default(Azure.ResourceManager.Reservations.Models.InstanceFlexibility?), string displayName = null, System.Collections.Generic.IEnumerable appliedScopes = null, Azure.ResourceManager.Reservations.Models.AppliedScopeType? appliedScopeType = default(Azure.ResourceManager.Reservations.Models.AppliedScopeType?), bool? isArchived = default(bool?), string capabilities = null, int? quantity = default(int?), Azure.ResourceManager.Reservations.Models.ReservationProvisioningState? provisioningState = default(Azure.ResourceManager.Reservations.Models.ReservationProvisioningState?), System.DateTimeOffset? effectOn = default(System.DateTimeOffset?), System.DateTimeOffset? benefitStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), System.DateTimeOffset? reservationExpireOn = default(System.DateTimeOffset?), System.DateTimeOffset? reviewOn = default(System.DateTimeOffset?), string skuDescription = null, Azure.ResourceManager.Reservations.Models.ExtendedStatusInfo extendedStatusInfo = null, Azure.ResourceManager.Reservations.Models.ReservationBillingPlan? billingPlan = default(Azure.ResourceManager.Reservations.Models.ReservationBillingPlan?), string displayProvisioningState = null, string provisioningSubState = null, System.DateTimeOffset? purchaseOn = default(System.DateTimeOffset?), System.DateTimeOffset? reservationPurchaseOn = default(System.DateTimeOffset?), Azure.ResourceManager.Reservations.Models.ReservationSplitProperties splitProperties = null, Azure.ResourceManager.Reservations.Models.ReservationMergeProperties mergeProperties = null, Azure.ResourceManager.Reservations.Models.ReservationSwapProperties swapProperties = null, Azure.ResourceManager.Reservations.Models.AppliedScopeProperties appliedScopeProperties = null, Azure.Core.ResourceIdentifier billingScopeId = null, bool? isRenewEnabled = default(bool?), string renewSource = null, string renewDestination = null, Azure.ResourceManager.Reservations.Models.RenewProperties renewProperties = null, Azure.ResourceManager.Reservations.Models.ReservationTerm? term = default(Azure.ResourceManager.Reservations.Models.ReservationTerm?), string userFriendlyAppliedScopeType = null, string userFriendlyRenewState = null, Azure.ResourceManager.Reservations.Models.ReservationPropertiesUtilization utilization = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationPropertiesUtilization ReservationPropertiesUtilization(string trend = null, System.Collections.Generic.IEnumerable aggregates = null) { throw null; } + public static Azure.ResourceManager.Reservations.ReservationQuotaData ReservationQuotaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Reservations.Models.QuotaProperties properties = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationRefundBillingInformation ReservationRefundBillingInformation(Azure.ResourceManager.Reservations.Models.ReservationBillingPlan? billingPlan = default(Azure.ResourceManager.Reservations.Models.ReservationBillingPlan?), int? completedTransactions = default(int?), int? totalTransactions = default(int?), Azure.ResourceManager.Reservations.Models.PurchasePrice billingCurrencyTotalPaidAmount = null, Azure.ResourceManager.Reservations.Models.PurchasePrice billingCurrencyProratedAmount = null, Azure.ResourceManager.Reservations.Models.PurchasePrice billingCurrencyRemainingCommitmentAmount = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationRefundPolicyError ReservationRefundPolicyError(Azure.ResourceManager.Reservations.Models.ReservationErrorResponseCode? code = default(Azure.ResourceManager.Reservations.Models.ReservationErrorResponseCode?), string message = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationRefundPolicyResultProperty ReservationRefundPolicyResultProperty(Azure.ResourceManager.Reservations.Models.PurchasePrice consumedRefundsTotal = null, Azure.ResourceManager.Reservations.Models.PurchasePrice maxRefundLimit = null, System.Collections.Generic.IEnumerable policyErrors = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationRefundResponseProperties ReservationRefundResponseProperties(System.Guid? sessionId = default(System.Guid?), int? quantity = default(int?), Azure.ResourceManager.Reservations.Models.PurchasePrice billingRefundAmount = null, Azure.ResourceManager.Reservations.Models.PurchasePrice pricingRefundAmount = null, Azure.ResourceManager.Reservations.Models.ReservationRefundPolicyResultProperty policyResultProperties = null, Azure.ResourceManager.Reservations.Models.ReservationRefundBillingInformation billingInformation = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationRefundResult ReservationRefundResult(string id = null, Azure.ResourceManager.Reservations.Models.ReservationRefundResponseProperties properties = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationResourceName ReservationResourceName(string value = null, string localizedValue = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationSplitProperties ReservationSplitProperties(System.Collections.Generic.IEnumerable splitDestinations = null, string splitSource = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationSwapProperties ReservationSwapProperties(string swapSource = null, string swapDestination = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationToExchange ReservationToExchange(Azure.Core.ResourceIdentifier reservationId = null, int? quantity = default(int?), Azure.ResourceManager.Reservations.Models.PurchasePrice billingRefundAmount = null, Azure.ResourceManager.Reservations.Models.BillingInformation billingInformation = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationToPurchaseCalculateExchange ReservationToPurchaseCalculateExchange(Azure.ResourceManager.Reservations.Models.ReservationPurchaseContent properties = null, Azure.ResourceManager.Reservations.Models.PurchasePrice billingCurrencyTotal = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationToPurchaseExchange ReservationToPurchaseExchange(Azure.Core.ResourceIdentifier reservationOrderId = null, Azure.Core.ResourceIdentifier reservationId = null, Azure.ResourceManager.Reservations.Models.ReservationPurchaseContent properties = null, Azure.ResourceManager.Reservations.Models.PurchasePrice billingCurrencyTotal = null, Azure.ResourceManager.Reservations.Models.ReservationOperationStatus? status = default(Azure.ResourceManager.Reservations.Models.ReservationOperationStatus?)) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationToReturnForExchange ReservationToReturnForExchange(Azure.Core.ResourceIdentifier reservationId = null, int? quantity = default(int?), Azure.ResourceManager.Reservations.Models.PurchasePrice billingRefundAmount = null, Azure.ResourceManager.Reservations.Models.BillingInformation billingInformation = null, Azure.ResourceManager.Reservations.Models.ReservationOperationStatus? status = default(Azure.ResourceManager.Reservations.Models.ReservationOperationStatus?)) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ReservationUtilizationAggregates ReservationUtilizationAggregates(float? grain = default(float?), string grainUnit = null, float? value = default(float?), string valueUnit = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.SavingsPlanToPurchaseCalculateExchange SavingsPlanToPurchaseCalculateExchange(Azure.ResourceManager.Reservations.Models.SavingsPlanPurchase properties = null, Azure.ResourceManager.Reservations.Models.PurchasePrice billingCurrencyTotal = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.SavingsPlanToPurchaseExchange SavingsPlanToPurchaseExchange(string savingsPlanOrderId = null, string savingsPlanId = null, Azure.ResourceManager.Reservations.Models.SavingsPlanPurchase properties = null, Azure.ResourceManager.Reservations.Models.PurchasePrice billingCurrencyTotal = null, Azure.ResourceManager.Reservations.Models.ReservationOperationStatus? status = default(Azure.ResourceManager.Reservations.Models.ReservationOperationStatus?)) { throw null; } + public static Azure.ResourceManager.Reservations.Models.ScopeProperties ScopeProperties(string scope = null, bool? isValid = default(bool?)) { throw null; } + public static Azure.ResourceManager.Reservations.Models.SkuCapability SkuCapability(string name = null, string value = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.SkuProperty SkuProperty(string name = null, string value = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.SkuRestriction SkuRestriction(string skuRestrictionType = null, System.Collections.Generic.IEnumerable values = null, string reasonCode = null) { throw null; } + public static Azure.ResourceManager.Reservations.Models.SubContent SubContent(int? limit = default(int?), Azure.ResourceManager.Reservations.Models.ReservationResourceName name = null, string resourceType = null, string unit = null, Azure.ResourceManager.Reservations.Models.QuotaRequestState? provisioningState = default(Azure.ResourceManager.Reservations.Models.QuotaRequestState?), string message = null, System.Guid? subRequestId = default(System.Guid?)) { throw null; } + } public partial class AvailableScopesContent { public AvailableScopesContent() { } diff --git a/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/ArmReservationsModelFactory.cs b/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/ArmReservationsModelFactory.cs new file mode 100644 index 0000000000000..aacf806f97278 --- /dev/null +++ b/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/ArmReservationsModelFactory.cs @@ -0,0 +1,687 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Reservations; + +namespace Azure.ResourceManager.Reservations.Models +{ + /// Model factory for models. + public static partial class ArmReservationsModelFactory + { + /// Initializes a new instance of AvailableScopesProperties. + /// The scopes checked by the available scope api. + /// A new instance for mocking. + public static AvailableScopesProperties AvailableScopesProperties(IEnumerable scopes = null) + { + scopes ??= new List(); + + return new AvailableScopesProperties(scopes != null ? new SubscriptionScopeProperties(scopes?.ToList()) : null); + } + + /// Initializes a new instance of ScopeProperties. + /// + /// + /// A new instance for mocking. + public static ScopeProperties ScopeProperties(string scope = null, bool? isValid = null) + { + return new ScopeProperties(scope, isValid); + } + + /// Initializes a new instance of ReservationCatalog. + /// The type of resource the sku applies to. + /// The name of sku. + /// The billing plan options available for this sku. + /// Available reservation terms for this resource. + /// + /// + /// Pricing information about the sku. + /// + /// The tier of this sku. + /// The size of this sku. + /// + /// A new instance for mocking. + public static ReservationCatalog ReservationCatalog(string appliedResourceType = null, string skuName = null, IReadOnlyDictionary> billingPlans = null, IEnumerable terms = null, IEnumerable locations = null, IEnumerable skuProperties = null, ReservationCatalogMsrp msrp = null, IEnumerable restrictions = null, string tier = null, string size = null, IEnumerable capabilities = null) + { + billingPlans ??= new Dictionary>(); + terms ??= new List(); + locations ??= new List(); + skuProperties ??= new List(); + restrictions ??= new List(); + capabilities ??= new List(); + + return new ReservationCatalog(appliedResourceType, skuName, billingPlans, terms?.ToList(), locations?.ToList(), skuProperties?.ToList(), msrp, restrictions?.ToList(), tier, size, capabilities?.ToList()); + } + + /// Initializes a new instance of SkuProperty. + /// An invariant to describe the feature. + /// An invariant if the feature is measured by quantity. + /// A new instance for mocking. + public static SkuProperty SkuProperty(string name = null, string value = null) + { + return new SkuProperty(name, value); + } + + /// Initializes a new instance of ReservationCatalogMsrp. + /// Amount in pricing currency. Tax not included. + /// Amount in pricing currency. Tax not included. + /// Amount in pricing currency. Tax not included. + /// A new instance for mocking. + public static ReservationCatalogMsrp ReservationCatalogMsrp(PurchasePrice p1Y = null, PurchasePrice p3Y = null, PurchasePrice p5Y = null) + { + return new ReservationCatalogMsrp(p1Y, p3Y, p5Y); + } + + /// Initializes a new instance of SkuRestriction. + /// The type of restrictions. + /// The value of restrictions. If the restriction type is set to location. This would be different locations where the sku is restricted. + /// The reason for restriction. + /// A new instance for mocking. + public static SkuRestriction SkuRestriction(string skuRestrictionType = null, IEnumerable values = null, string reasonCode = null) + { + values ??= new List(); + + return new SkuRestriction(skuRestrictionType, values?.ToList(), reasonCode); + } + + /// Initializes a new instance of SkuCapability. + /// An invariant to describe the feature. + /// An invariant if the feature is measured by quantity. + /// A new instance for mocking. + public static SkuCapability SkuCapability(string name = null, string value = null) + { + return new SkuCapability(name, value); + } + + /// Initializes a new instance of AppliedReservationData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Paginated list of applied reservations. + /// A new instance for mocking. + public static AppliedReservationData AppliedReservationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AppliedReservationList reservationOrderIds = null) + { + return new AppliedReservationData(id, name, resourceType, systemData, reservationOrderIds); + } + + /// Initializes a new instance of AppliedReservationList. + /// + /// Url to get the next page of reservations. + /// A new instance for mocking. + public static AppliedReservationList AppliedReservationList(IEnumerable value = null, string nextLink = null) + { + value ??= new List(); + + return new AppliedReservationList(value?.ToList(), nextLink); + } + + /// Initializes a new instance of CalculatePriceResult. + /// Properties for calculate price response. + /// A new instance for mocking. + public static CalculatePriceResult CalculatePriceResult(CalculatePriceResultProperties properties = null) + { + return new CalculatePriceResult(properties); + } + + /// Initializes a new instance of CalculatePriceResultProperties. + /// Currency and amount that customer will be charged in customer's local currency. Tax is not included. + /// Net total amount in pricing currency. + /// Tax amount in pricing currency. + /// Total amount in pricing currency. + /// Whether or not tax is included in grand total. + /// True if billing is managed by Microsoft Partner. Used only for CSP accounts. + /// GUID that represents reservation order that can be placed after calculating price. + /// Title of sku that is being purchased. + /// Description of sku that is being purchased. + /// Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. + /// + /// A new instance for mocking. + public static CalculatePriceResultProperties CalculatePriceResultProperties(CalculatePriceResultPropertiesBillingCurrencyTotal billingCurrencyTotal = null, double? netTotal = null, double? taxTotal = null, double? grandTotal = null, bool? isTaxIncluded = null, bool? isBillingPartnerManaged = null, Guid? reservationOrderId = null, string skuTitle = null, string skuDescription = null, CalculatePriceResultPropertiesPricingCurrencyTotal pricingCurrencyTotal = null, IEnumerable paymentSchedule = null) + { + paymentSchedule ??= new List(); + + return new CalculatePriceResultProperties(billingCurrencyTotal, netTotal, taxTotal, grandTotal, isTaxIncluded, isBillingPartnerManaged, reservationOrderId, skuTitle, skuDescription, pricingCurrencyTotal, paymentSchedule?.ToList()); + } + + /// Initializes a new instance of CalculatePriceResultPropertiesBillingCurrencyTotal. + /// The ISO 4217 3-letter currency code for the currency used by this purchase record. + /// Amount in pricing currency. Tax is not included. + /// A new instance for mocking. + public static CalculatePriceResultPropertiesBillingCurrencyTotal CalculatePriceResultPropertiesBillingCurrencyTotal(string currencyCode = null, double? amount = null) + { + return new CalculatePriceResultPropertiesBillingCurrencyTotal(currencyCode, amount); + } + + /// Initializes a new instance of CalculatePriceResultPropertiesPricingCurrencyTotal. + /// The ISO 4217 3-letter currency code for the currency used by this purchase record. + /// + /// A new instance for mocking. + public static CalculatePriceResultPropertiesPricingCurrencyTotal CalculatePriceResultPropertiesPricingCurrencyTotal(string currencyCode = null, float? amount = null) + { + return new CalculatePriceResultPropertiesPricingCurrencyTotal(currencyCode, amount); + } + + /// Initializes a new instance of PaymentDetail. + /// Date when the payment needs to be done. + /// Date when the transaction is completed. Is null when it is scheduled. + /// Amount in pricing currency. Tax not included. + /// Amount charged in Billing currency. Tax not included. Is null for future payments. + /// Shows the Account that is charged for this payment. + /// Describes whether the payment is completed, failed, cancelled or scheduled in the future. + /// + /// A new instance for mocking. + public static PaymentDetail PaymentDetail(DateTimeOffset? dueOn = null, DateTimeOffset? payOn = null, PurchasePrice pricingCurrencyTotal = null, PurchasePrice billingCurrencyTotal = null, string billingAccount = null, PaymentStatus? status = null, ExtendedStatusInfo extendedStatusInfo = null) + { + return new PaymentDetail(dueOn, payOn, pricingCurrencyTotal, billingCurrencyTotal, billingAccount, status, extendedStatusInfo); + } + + /// Initializes a new instance of ExtendedStatusInfo. + /// + /// The message giving detailed information about the status code. + /// A new instance for mocking. + public static ExtendedStatusInfo ExtendedStatusInfo(ReservationStatusCode? statusCode = null, string message = null) + { + return new ExtendedStatusInfo(statusCode, message); + } + + /// Initializes a new instance of ReservationOrderData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Friendly name for user to easily identified the reservation. + /// This is the DateTime when the reservation was initially requested for purchase. + /// This is the DateTime when the reservation was created. + /// This is the date when the reservation will expire. + /// This is the date-time when the reservation will expire. + /// This is the DateTime when the reservation benefit started. + /// Total Quantity of the skus purchased in the reservation. + /// Represent the term of reservation. + /// Current state of the reservation. + /// Represent the billing plans. + /// Information describing the type of billing plan for this reservation. + /// + /// This is the date-time when the Azure Hybrid Benefit needs to be reviewed. + /// A new instance for mocking. + public static ReservationOrderData ReservationOrderData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? version = null, string displayName = null, DateTimeOffset? requestOn = null, DateTimeOffset? createdOn = null, DateTimeOffset? expireOn = null, DateTimeOffset? reservationExpireOn = null, DateTimeOffset? benefitStartOn = null, int? originalQuantity = null, ReservationTerm? term = null, ReservationProvisioningState? provisioningState = null, ReservationBillingPlan? billingPlan = null, ReservationOrderBillingPlanInformation planInformation = null, IEnumerable reservations = null, DateTimeOffset? reviewOn = null) + { + reservations ??= new List(); + + return new ReservationOrderData(id, name, resourceType, systemData, version, displayName, requestOn, createdOn, expireOn, reservationExpireOn, benefitStartOn, originalQuantity, term, provisioningState, billingPlan, planInformation, reservations?.ToList(), reviewOn); + } + + /// Initializes a new instance of ReservationOrderBillingPlanInformation. + /// Amount of money to be paid for the Order. Tax is not included. + /// Date when the billing plan has started. + /// For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off. + /// + /// A new instance for mocking. + public static ReservationOrderBillingPlanInformation ReservationOrderBillingPlanInformation(PurchasePrice pricingCurrencyTotal = null, DateTimeOffset? startOn = null, DateTimeOffset? nextPaymentDueOn = null, IEnumerable transactions = null) + { + transactions ??= new List(); + + return new ReservationOrderBillingPlanInformation(pricingCurrencyTotal, startOn, nextPaymentDueOn, transactions?.ToList()); + } + + /// Initializes a new instance of ReservationDetailData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The Azure region where the reserved resource lives. + /// + /// The sku information associated to this reservation. + /// The properties associated to this reservation. + /// Resource Provider type to be reserved. + /// A new instance for mocking. + public static ReservationDetailData ReservationDetailData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, int? version = null, string skuName = null, ReservationProperties properties = null, ReservationKind? kind = null) + { + return new ReservationDetailData(id, name, resourceType, systemData, location, version, skuName != null ? new ReservationsSkuName(skuName) : null, properties, kind); + } + + /// Initializes a new instance of ReservationProperties. + /// The type of the resource that is being reserved. + /// Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size flexibility. + /// Friendly name for user to easily identify the reservation. + /// The list of applied scopes. + /// The applied scope type. + /// Indicates if the reservation is archived. + /// Capabilities of the reservation. + /// Quantity of the skus that are part of the reservation. + /// Current state of the reservation. + /// DateTime of the reservation starting when this version is effective from. + /// This is the DateTime when the reservation benefit started. + /// DateTime of the last time the reservation was updated. + /// This is the date when the reservation will expire. + /// This is the date-time when the reservation will expire. + /// This is the date-time when the Azure Hybrid Benefit needs to be reviewed. + /// Description of the sku in english. + /// The message giving detailed information about the status code. + /// The billing plan options available for this sku. + /// The provisioning state of the reservation for display, e.g. Succeeded. + /// The provisioning sub-state of the reservation, e.g. Succeeded. + /// This is the date when the reservation was purchased. + /// This is the date-time when the reservation was purchased. + /// Properties of reservation split. + /// Properties of reservation merge. + /// Properties of reservation swap. + /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup. + /// Subscription that will be charged for purchasing reservation or savings plan. + /// Setting this to true will automatically purchase a new reservation on the expiration date time. + /// Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. + /// Reservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. + /// The renew properties for a reservation. + /// Represent the term of reservation. + /// The applied scope type of the reservation for display, e.g. Shared. + /// The renew state of the reservation for display, e.g. On. + /// Reservation utilization. + /// A new instance for mocking. + public static ReservationProperties ReservationProperties(ReservedResourceType? reservedResourceType = null, InstanceFlexibility? instanceFlexibility = null, string displayName = null, IEnumerable appliedScopes = null, AppliedScopeType? appliedScopeType = null, bool? isArchived = null, string capabilities = null, int? quantity = null, ReservationProvisioningState? provisioningState = null, DateTimeOffset? effectOn = null, DateTimeOffset? benefitStartOn = null, DateTimeOffset? lastUpdatedOn = null, DateTimeOffset? expireOn = null, DateTimeOffset? reservationExpireOn = null, DateTimeOffset? reviewOn = null, string skuDescription = null, ExtendedStatusInfo extendedStatusInfo = null, ReservationBillingPlan? billingPlan = null, string displayProvisioningState = null, string provisioningSubState = null, DateTimeOffset? purchaseOn = null, DateTimeOffset? reservationPurchaseOn = null, ReservationSplitProperties splitProperties = null, ReservationMergeProperties mergeProperties = null, ReservationSwapProperties swapProperties = null, AppliedScopeProperties appliedScopeProperties = null, ResourceIdentifier billingScopeId = null, bool? isRenewEnabled = null, string renewSource = null, string renewDestination = null, RenewProperties renewProperties = null, ReservationTerm? term = null, string userFriendlyAppliedScopeType = null, string userFriendlyRenewState = null, ReservationPropertiesUtilization utilization = null) + { + appliedScopes ??= new List(); + + return new ReservationProperties(reservedResourceType, instanceFlexibility, displayName, appliedScopes?.ToList(), appliedScopeType, isArchived, capabilities, quantity, provisioningState, effectOn, benefitStartOn, lastUpdatedOn, expireOn, reservationExpireOn, reviewOn, skuDescription, extendedStatusInfo, billingPlan, displayProvisioningState, provisioningSubState, purchaseOn, reservationPurchaseOn, splitProperties, mergeProperties, swapProperties, appliedScopeProperties, billingScopeId, isRenewEnabled, renewSource, renewDestination, renewProperties, term, userFriendlyAppliedScopeType, userFriendlyRenewState, utilization); + } + + /// Initializes a new instance of ReservationSplitProperties. + /// List of destination resource id that are created due to split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. + /// Resource id of the reservation from which this is split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. + /// A new instance for mocking. + public static ReservationSplitProperties ReservationSplitProperties(IEnumerable splitDestinations = null, string splitSource = null) + { + splitDestinations ??= new List(); + + return new ReservationSplitProperties(splitDestinations?.ToList(), splitSource); + } + + /// Initializes a new instance of ReservationMergeProperties. + /// Reservation resource id Created due to the merge. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. + /// Resource ids of the source reservation's merged to form this reservation. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. + /// A new instance for mocking. + public static ReservationMergeProperties ReservationMergeProperties(string mergeDestination = null, IEnumerable mergeSources = null) + { + mergeSources ??= new List(); + + return new ReservationMergeProperties(mergeDestination, mergeSources?.ToList()); + } + + /// Initializes a new instance of ReservationSwapProperties. + /// Resource id of the source reservation that gets swapped. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. + /// Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. + /// A new instance for mocking. + public static ReservationSwapProperties ReservationSwapProperties(string swapSource = null, string swapDestination = null) + { + return new ReservationSwapProperties(swapSource, swapDestination); + } + + /// Initializes a new instance of RenewProperties. + /// The request for reservation purchase. + /// Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. This is locked price 30 days before expiry. + /// Currency and amount that customer will be charged in customer's local currency for renewal purchase. Tax is not included. + /// A new instance for mocking. + public static RenewProperties RenewProperties(ReservationPurchaseContent purchaseProperties = null, RenewPropertiesPricingCurrencyTotal pricingCurrencyTotal = null, RenewPropertiesBillingCurrencyTotal billingCurrencyTotal = null) + { + return new RenewProperties(purchaseProperties, pricingCurrencyTotal, billingCurrencyTotal); + } + + /// Initializes a new instance of RenewPropertiesPricingCurrencyTotal. + /// The ISO 4217 3-letter currency code for the currency used by this purchase record. + /// + /// A new instance for mocking. + public static RenewPropertiesPricingCurrencyTotal RenewPropertiesPricingCurrencyTotal(string currencyCode = null, float? amount = null) + { + return new RenewPropertiesPricingCurrencyTotal(currencyCode, amount); + } + + /// Initializes a new instance of RenewPropertiesBillingCurrencyTotal. + /// The ISO 4217 3-letter currency code for the currency used by this purchase record. + /// + /// A new instance for mocking. + public static RenewPropertiesBillingCurrencyTotal RenewPropertiesBillingCurrencyTotal(string currencyCode = null, float? amount = null) + { + return new RenewPropertiesBillingCurrencyTotal(currencyCode, amount); + } + + /// Initializes a new instance of ReservationPropertiesUtilization. + /// last 7 day utilization trend for a reservation. + /// The array of aggregates of a reservation's utilization. + /// A new instance for mocking. + public static ReservationPropertiesUtilization ReservationPropertiesUtilization(string trend = null, IEnumerable aggregates = null) + { + aggregates ??= new List(); + + return new ReservationPropertiesUtilization(trend, aggregates?.ToList()); + } + + /// Initializes a new instance of ReservationUtilizationAggregates. + /// The grain of the aggregate. + /// The grain unit of the aggregate. + /// The aggregate value. + /// The aggregate value unit. + /// A new instance for mocking. + public static ReservationUtilizationAggregates ReservationUtilizationAggregates(float? grain = null, string grainUnit = null, float? value = null, string valueUnit = null) + { + return new ReservationUtilizationAggregates(grain, grainUnit, value, valueUnit); + } + + /// Initializes a new instance of ReservationCalculateRefundResult. + /// Fully qualified identifier of the reservation being returned. + /// The refund properties of reservation. + /// A new instance for mocking. + public static ReservationCalculateRefundResult ReservationCalculateRefundResult(string id = null, ReservationRefundResponseProperties properties = null) + { + return new ReservationCalculateRefundResult(id, properties); + } + + /// Initializes a new instance of ReservationRefundResponseProperties. + /// Refund session identifier. + /// Quantity to be returned. + /// Pricing information containing the amount and the currency code. + /// Pricing information containing the amount and the currency code. + /// Refund policy result. + /// billing information. + /// A new instance for mocking. + public static ReservationRefundResponseProperties ReservationRefundResponseProperties(Guid? sessionId = null, int? quantity = null, PurchasePrice billingRefundAmount = null, PurchasePrice pricingRefundAmount = null, ReservationRefundPolicyResultProperty policyResultProperties = null, ReservationRefundBillingInformation billingInformation = null) + { + return new ReservationRefundResponseProperties(sessionId, quantity, billingRefundAmount, pricingRefundAmount, policyResultProperties != null ? new RefundPolicyResult(policyResultProperties) : null, billingInformation); + } + + /// Initializes a new instance of ReservationRefundPolicyResultProperty. + /// Pricing information containing the amount and the currency code. + /// Pricing information containing the amount and the currency code. + /// Refund Policy errors. + /// A new instance for mocking. + public static ReservationRefundPolicyResultProperty ReservationRefundPolicyResultProperty(PurchasePrice consumedRefundsTotal = null, PurchasePrice maxRefundLimit = null, IEnumerable policyErrors = null) + { + policyErrors ??= new List(); + + return new ReservationRefundPolicyResultProperty(consumedRefundsTotal, maxRefundLimit, policyErrors?.ToList()); + } + + /// Initializes a new instance of ReservationRefundPolicyError. + /// Error code describing the reason that service is not able to process the incoming request. + /// + /// A new instance for mocking. + public static ReservationRefundPolicyError ReservationRefundPolicyError(ReservationErrorResponseCode? code = null, string message = null) + { + return new ReservationRefundPolicyError(code, message); + } + + /// Initializes a new instance of ReservationRefundBillingInformation. + /// Represent the billing plans. + /// The number of completed transactions in this reservation's payment. + /// The number of total transactions in this reservation's payment. + /// Pricing information containing the amount and the currency code. + /// Pricing information containing the amount and the currency code. + /// Pricing information containing the amount and the currency code. + /// A new instance for mocking. + public static ReservationRefundBillingInformation ReservationRefundBillingInformation(ReservationBillingPlan? billingPlan = null, int? completedTransactions = null, int? totalTransactions = null, PurchasePrice billingCurrencyTotalPaidAmount = null, PurchasePrice billingCurrencyProratedAmount = null, PurchasePrice billingCurrencyRemainingCommitmentAmount = null) + { + return new ReservationRefundBillingInformation(billingPlan, completedTransactions, totalTransactions, billingCurrencyTotalPaidAmount, billingCurrencyProratedAmount, billingCurrencyRemainingCommitmentAmount); + } + + /// Initializes a new instance of ReservationRefundResult. + /// Fully qualified identifier of the reservation being returned. + /// The refund properties of reservation. + /// A new instance for mocking. + public static ReservationRefundResult ReservationRefundResult(string id = null, ReservationRefundResponseProperties properties = null) + { + return new ReservationRefundResult(id, properties); + } + + /// Initializes a new instance of CalculateExchangeResult. + /// It should match what is used to GET the operation result. + /// It must match the last segment of the id field, and will typically be a GUID / system generated value. + /// Status of the operation. + /// CalculateExchange response properties. + /// Required if status == failed or status == canceled. + /// A new instance for mocking. + public static CalculateExchangeResult CalculateExchangeResult(ResourceIdentifier id = null, string name = null, CalculateExchangeOperationResultStatus? status = null, CalculateExchangeResultProperties properties = null, OperationResultError error = null) + { + return new CalculateExchangeResult(id, name, status, properties, error); + } + + /// Initializes a new instance of CalculateExchangeResultProperties. + /// Exchange session identifier. + /// Pricing information containing the amount and the currency code. + /// Pricing information containing the amount and the currency code. + /// Pricing information containing the amount and the currency code. + /// Details of the reservations being purchased. + /// Details of the savings plans being purchased. + /// Details of the reservations being returned. + /// Exchange policy errors. + /// A new instance for mocking. + public static CalculateExchangeResultProperties CalculateExchangeResultProperties(Guid? sessionId = null, PurchasePrice netPayable = null, PurchasePrice refundsTotal = null, PurchasePrice purchasesTotal = null, IEnumerable reservationsToPurchase = null, IEnumerable savingsPlansToPurchase = null, IEnumerable reservationsToExchange = null, IEnumerable policyErrors = null) + { + reservationsToPurchase ??= new List(); + savingsPlansToPurchase ??= new List(); + reservationsToExchange ??= new List(); + policyErrors ??= new List(); + + return new CalculateExchangeResultProperties(sessionId, netPayable, refundsTotal, purchasesTotal, reservationsToPurchase?.ToList(), savingsPlansToPurchase?.ToList(), reservationsToExchange?.ToList(), policyErrors != null ? new ExchangePolicyErrors(policyErrors?.ToList()) : null); + } + + /// Initializes a new instance of ReservationToPurchaseCalculateExchange. + /// The request for reservation purchase. + /// Pricing information containing the amount and the currency code. + /// A new instance for mocking. + public static ReservationToPurchaseCalculateExchange ReservationToPurchaseCalculateExchange(ReservationPurchaseContent properties = null, PurchasePrice billingCurrencyTotal = null) + { + return new ReservationToPurchaseCalculateExchange(properties, billingCurrencyTotal); + } + + /// Initializes a new instance of SavingsPlanToPurchaseCalculateExchange. + /// Request body for savings plan purchase. + /// Pricing information containing the amount and the currency code. + /// A new instance for mocking. + public static SavingsPlanToPurchaseCalculateExchange SavingsPlanToPurchaseCalculateExchange(SavingsPlanPurchase properties = null, PurchasePrice billingCurrencyTotal = null) + { + return new SavingsPlanToPurchaseCalculateExchange(properties, billingCurrencyTotal); + } + + /// Initializes a new instance of ReservationToExchange. + /// Fully qualified id of the reservation being returned. + /// Quantity to be returned. + /// Pricing information containing the amount and the currency code. + /// billing information. + /// A new instance for mocking. + public static ReservationToExchange ReservationToExchange(ResourceIdentifier reservationId = null, int? quantity = null, PurchasePrice billingRefundAmount = null, BillingInformation billingInformation = null) + { + return new ReservationToExchange(reservationId, quantity, billingRefundAmount, billingInformation); + } + + /// Initializes a new instance of BillingInformation. + /// Pricing information containing the amount and the currency code. + /// Pricing information containing the amount and the currency code. + /// Pricing information containing the amount and the currency code. + /// A new instance for mocking. + public static BillingInformation BillingInformation(PurchasePrice billingCurrencyTotalPaidAmount = null, PurchasePrice billingCurrencyProratedAmount = null, PurchasePrice billingCurrencyRemainingCommitmentAmount = null) + { + return new BillingInformation(billingCurrencyTotalPaidAmount, billingCurrencyProratedAmount, billingCurrencyRemainingCommitmentAmount); + } + + /// Initializes a new instance of ExchangePolicyError. + /// + /// + /// A new instance for mocking. + public static ExchangePolicyError ExchangePolicyError(string code = null, string message = null) + { + return new ExchangePolicyError(code, message); + } + + /// Initializes a new instance of OperationResultError. + /// Required if status == failed or status == cancelled. If status == failed, provide an invariant error code used for error troubleshooting, aggregation, and analysis. + /// Required if status == failed. Localized. If status == failed, provide an actionable error message indicating what error occurred, and what the user can do to address the issue. + /// A new instance for mocking. + public static OperationResultError OperationResultError(string code = null, string message = null) + { + return new OperationResultError(code, message); + } + + /// Initializes a new instance of ExchangeResult. + /// It should match what is used to GET the operation result. + /// It must match the last segment of the id field, and will typically be a GUID / system generated value. + /// Status of the operation. + /// Exchange response properties. + /// Required if status == failed or status == canceled. + /// A new instance for mocking. + public static ExchangeResult ExchangeResult(ResourceIdentifier id = null, string name = null, ExchangeOperationResultStatus? status = null, ExchangeResultProperties properties = null, OperationResultError error = null) + { + return new ExchangeResult(id, name, status, properties, error); + } + + /// Initializes a new instance of ExchangeResultProperties. + /// Exchange session identifier. + /// Pricing information containing the amount and the currency code. + /// Pricing information containing the amount and the currency code. + /// Pricing information containing the amount and the currency code. + /// Details of the reservations being purchased. + /// Details of the savings plans being purchased. + /// Details of the reservations being returned. + /// Exchange policy errors. + /// A new instance for mocking. + public static ExchangeResultProperties ExchangeResultProperties(Guid? sessionId = null, PurchasePrice netPayable = null, PurchasePrice refundsTotal = null, PurchasePrice purchasesTotal = null, IEnumerable reservationsToPurchase = null, IEnumerable savingsPlansToPurchase = null, IEnumerable reservationsToExchange = null, IEnumerable policyErrors = null) + { + reservationsToPurchase ??= new List(); + savingsPlansToPurchase ??= new List(); + reservationsToExchange ??= new List(); + policyErrors ??= new List(); + + return new ExchangeResultProperties(sessionId, netPayable, refundsTotal, purchasesTotal, reservationsToPurchase?.ToList(), savingsPlansToPurchase?.ToList(), reservationsToExchange?.ToList(), policyErrors != null ? new ExchangePolicyErrors(policyErrors?.ToList()) : null); + } + + /// Initializes a new instance of ReservationToPurchaseExchange. + /// Fully qualified id of the reservationOrder being purchased. + /// Fully qualified id of the reservation being purchased. This value is only guaranteed to be non-null if the purchase is successful. + /// The request for reservation purchase. + /// Pricing information containing the amount and the currency code. + /// Status of the individual operation. + /// A new instance for mocking. + public static ReservationToPurchaseExchange ReservationToPurchaseExchange(ResourceIdentifier reservationOrderId = null, ResourceIdentifier reservationId = null, ReservationPurchaseContent properties = null, PurchasePrice billingCurrencyTotal = null, ReservationOperationStatus? status = null) + { + return new ReservationToPurchaseExchange(reservationOrderId, reservationId, properties, billingCurrencyTotal, status); + } + + /// Initializes a new instance of SavingsPlanToPurchaseExchange. + /// Fully qualified id of the savings plan order being purchased. + /// Fully qualified id of the savings plan being purchased. This value is only guaranteed to be non-null if the purchase is successful. + /// Request body for savings plan purchase. + /// Pricing information containing the amount and the currency code. + /// Status of the individual operation. + /// A new instance for mocking. + public static SavingsPlanToPurchaseExchange SavingsPlanToPurchaseExchange(string savingsPlanOrderId = null, string savingsPlanId = null, SavingsPlanPurchase properties = null, PurchasePrice billingCurrencyTotal = null, ReservationOperationStatus? status = null) + { + return new SavingsPlanToPurchaseExchange(savingsPlanOrderId, savingsPlanId, properties, billingCurrencyTotal, status); + } + + /// Initializes a new instance of ReservationToReturnForExchange. + /// Fully qualified id of the reservation being returned. + /// Quantity to be returned. + /// Pricing information containing the amount and the currency code. + /// billing information. + /// Status of the individual operation. + /// A new instance for mocking. + public static ReservationToReturnForExchange ReservationToReturnForExchange(ResourceIdentifier reservationId = null, int? quantity = null, PurchasePrice billingRefundAmount = null, BillingInformation billingInformation = null, ReservationOperationStatus? status = null) + { + return new ReservationToReturnForExchange(reservationId, quantity, billingRefundAmount, billingInformation, status); + } + + /// Initializes a new instance of ChangeDirectoryDetail. + /// Change directory result for reservation order or reservation. + /// + /// A new instance for mocking. + public static ChangeDirectoryDetail ChangeDirectoryDetail(ChangeDirectoryResult reservationOrder = null, IEnumerable reservations = null) + { + reservations ??= new List(); + + return new ChangeDirectoryDetail(reservationOrder, reservations?.ToList()); + } + + /// Initializes a new instance of ChangeDirectoryResult. + /// Identifier of the reservation order or reservation. + /// Name of the reservation order or reservation. + /// True if change directory operation succeeded on this reservation order or reservation. + /// Error reason if operation failed. Null otherwise. + /// A new instance for mocking. + public static ChangeDirectoryResult ChangeDirectoryResult(Guid? id = null, string name = null, bool? isSucceeded = null, string error = null) + { + return new ChangeDirectoryResult(id, name, isSucceeded, error); + } + + /// Initializes a new instance of ReservationQuotaData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Quota properties for the resource. + /// A new instance for mocking. + public static ReservationQuotaData ReservationQuotaData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, QuotaProperties properties = null) + { + return new ReservationQuotaData(id, name, resourceType, systemData, properties); + } + + /// Initializes a new instance of QuotaProperties. + /// Quota properties. + /// Current usage value for the resource. + /// The limit units, such as **count** and **bytes**. Use the unit field provided in the response of the GET quota operation. + /// Name of the resource provide by the resource provider. Use this property for quotaRequests resource operations. + /// The name of the resource type. + /// The time period over which the quota usage values are summarized. For example, P1D (per one day), PT1M (per one minute), and PT1S (per one second). This parameter is optional because, for some resources such as compute, the time period is irrelevant. + /// Additional properties for the specified resource provider. + /// A new instance for mocking. + public static QuotaProperties QuotaProperties(int? limit = null, int? currentValue = null, string unit = null, ReservationResourceName resourceName = null, ResourceTypeName? resourceTypeName = null, string quotaPeriod = null, BinaryData properties = null) + { + return new QuotaProperties(limit, currentValue, unit, resourceName, resourceTypeName, quotaPeriod, properties); + } + + /// Initializes a new instance of ReservationResourceName. + /// Resource name. + /// Resource display localized name. + /// A new instance for mocking. + public static ReservationResourceName ReservationResourceName(string value = null, string localizedValue = null) + { + return new ReservationResourceName(value, localizedValue); + } + + /// Initializes a new instance of QuotaRequestDetailData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The quota request status. + /// User friendly status message. + /// The time when the quota request was submitted using format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + /// The quotaRequests. + /// A new instance for mocking. + public static QuotaRequestDetailData QuotaRequestDetailData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, QuotaRequestState? provisioningState = null, string message = null, DateTimeOffset? requestSubmitOn = null, IEnumerable quotaRequestValue = null) + { + quotaRequestValue ??= new List(); + + return new QuotaRequestDetailData(id, name, resourceType, systemData, provisioningState, message, requestSubmitOn, quotaRequestValue?.ToList()); + } + + /// Initializes a new instance of SubContent. + /// Quota (resource limit). + /// The resource name. + /// Resource type for which the quota check was made. + /// The limit units, such as **count** and **bytes**. Use the unit field provided in the response of the GET quota operation. + /// The quota request status. + /// User-friendly status message. + /// Sub request ID for individual request. + /// A new instance for mocking. + public static SubContent SubContent(int? limit = null, ReservationResourceName name = null, string resourceType = null, string unit = null, QuotaRequestState? provisioningState = null, string message = null, Guid? subRequestId = null) + { + return new SubContent(limit, name, resourceType, unit, provisioningState, message, subRequestId); + } + } +} diff --git a/sdk/reservations/Azure.ResourceManager.Reservations/src/autorest.md b/sdk/reservations/Azure.ResourceManager.Reservations/src/autorest.md index 993e3c3b14599..76784d82b4f05 100644 --- a/sdk/reservations/Azure.ResourceManager.Reservations/src/autorest.md +++ b/sdk/reservations/Azure.ResourceManager.Reservations/src/autorest.md @@ -4,7 +4,6 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml azure-arm: true -generate-model-factory: false csharp: true library-name: Reservations namespace: Azure.ResourceManager.Reservations diff --git a/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/CHANGELOG.md b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/CHANGELOG.md index 252aff5ac3b72..4b615f3ef4016 100644 --- a/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/CHANGELOG.md +++ b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/CHANGELOG.md @@ -1,15 +1,16 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2023-05-31) ### Features Added -### Breaking Changes - -### Bugs Fixed +- Enable the model factory feature for model mocking, more information can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-mocking-factory-builder). ### Other Changes +- Upgraded dependent Azure.Core to 1.32.0. +- Upgraded dependent Azure.ResourceManager to 1.6.0. + ## 1.0.1 (2023-02-16) ### Other Changes diff --git a/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/api/Azure.ResourceManager.ResourceGraph.netstandard2.0.cs b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/api/Azure.ResourceManager.ResourceGraph.netstandard2.0.cs index 4a4e175ce252f..d9ca724c99692 100644 --- a/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/api/Azure.ResourceManager.ResourceGraph.netstandard2.0.cs +++ b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/api/Azure.ResourceManager.ResourceGraph.netstandard2.0.cs @@ -10,6 +10,14 @@ public static partial class ResourceGraphExtensions } namespace Azure.ResourceManager.ResourceGraph.Models { + public static partial class ArmResourceGraphModelFactory + { + public static Azure.ResourceManager.ResourceGraph.Models.Facet Facet(string expression = null, string resultType = null) { throw null; } + public static Azure.ResourceManager.ResourceGraph.Models.FacetError FacetError(string expression = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.ResourceManager.ResourceGraph.Models.FacetErrorDetails FacetErrorDetails(string code = null, string message = null, System.Collections.Generic.IReadOnlyDictionary additionalProperties = null) { throw null; } + public static Azure.ResourceManager.ResourceGraph.Models.FacetResult FacetResult(string expression = null, long totalRecords = (long)0, int count = 0, System.BinaryData data = null) { throw null; } + public static Azure.ResourceManager.ResourceGraph.Models.ResourceQueryResult ResourceQueryResult(long totalRecords = (long)0, long count = (long)0, Azure.ResourceManager.ResourceGraph.Models.ResultTruncated resultTruncated = Azure.ResourceManager.ResourceGraph.Models.ResultTruncated.True, string skipToken = null, System.BinaryData data = null, System.Collections.Generic.IEnumerable facets = null) { throw null; } + } public enum AuthorizationScopeFilter { AtScopeAndBelow = 0, diff --git a/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/Generated/ArmResourceGraphModelFactory.cs b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/Generated/ArmResourceGraphModelFactory.cs new file mode 100644 index 0000000000000..123e0000a8d1b --- /dev/null +++ b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/Generated/ArmResourceGraphModelFactory.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ResourceGraph.Models +{ + /// Model factory for models. + public static partial class ArmResourceGraphModelFactory + { + /// Initializes a new instance of ResourceQueryResult. + /// Number of total records matching the query. + /// Number of records returned in the current response. In the case of paging, this is the number of records in the current page. + /// Indicates whether the query results are truncated. + /// When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. + /// Query output in JObject array or Table format. + /// + /// Query facets. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// A new instance for mocking. + public static ResourceQueryResult ResourceQueryResult(long totalRecords = default, long count = default, ResultTruncated resultTruncated = default, string skipToken = null, BinaryData data = null, IEnumerable facets = null) + { + facets ??= new List(); + + return new ResourceQueryResult(totalRecords, count, resultTruncated, skipToken, data, facets?.ToList()); + } + + /// Initializes a new instance of Facet. + /// Facet expression, same as in the corresponding facet request. + /// Result type. + /// A new instance for mocking. + public static Facet Facet(string expression = null, string resultType = null) + { + return new UnknownFacet(expression, resultType); + } + + /// Initializes a new instance of FacetErrorDetails. + /// Error code identifying the specific error. + /// A human readable error message. + /// Additional Properties. + /// A new instance for mocking. + public static FacetErrorDetails FacetErrorDetails(string code = null, string message = null, IReadOnlyDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new FacetErrorDetails(code, message, additionalProperties); + } + + /// Initializes a new instance of FacetResult. + /// Facet expression, same as in the corresponding facet request. + /// Number of total records in the facet results. + /// Number of records returned in the facet response. + /// A JObject array or Table containing the desired facets. Only present if the facet is valid. + /// A new instance for mocking. + public static FacetResult FacetResult(string expression = null, long totalRecords = default, int count = default, BinaryData data = null) + { + return new FacetResult(expression, "FacetResult", totalRecords, count, data); + } + + /// Initializes a new instance of FacetError. + /// Facet expression, same as in the corresponding facet request. + /// An array containing detected facet errors with details. + /// A new instance for mocking. + public static FacetError FacetError(string expression = null, IEnumerable errors = null) + { + errors ??= new List(); + + return new FacetError(expression, "FacetError", errors?.ToList()); + } + } +} diff --git a/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/autorest.md b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/autorest.md index 724424e868232..3068b891874b3 100644 --- a/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/autorest.md +++ b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/autorest.md @@ -5,7 +5,6 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml azure-arm: true -generate-model-factory: false csharp: true library-name: ResourceGraph namespace: Azure.ResourceManager.ResourceGraph diff --git a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/CHANGELOG.md b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/CHANGELOG.md index e5da1c30e2990..78b25fb818135 100644 --- a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/CHANGELOG.md +++ b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/CHANGELOG.md @@ -1,15 +1,16 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2023-05-31) ### Features Added -### Breaking Changes - -### Bugs Fixed +- Enable the model factory feature for model mocking, more information can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-mocking-factory-builder). ### Other Changes +- Upgraded dependent Azure.Core to 1.32.0. +- Upgraded dependent Azure.ResourceManager to 1.6.0. + ## 1.0.0 (2023-05-06) This package is the first stable release of the Azure Resource Health management library. diff --git a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/api/Azure.ResourceManager.ResourceHealth.netstandard2.0.cs b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/api/Azure.ResourceManager.ResourceHealth.netstandard2.0.cs index 36f017bdc4fb3..854f0f85ee4f5 100644 --- a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/api/Azure.ResourceManager.ResourceHealth.netstandard2.0.cs +++ b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/api/Azure.ResourceManager.ResourceHealth.netstandard2.0.cs @@ -247,6 +247,34 @@ protected TenantResourceHealthEventResource() { } } namespace Azure.ResourceManager.ResourceHealth.Models { + public static partial class ArmResourceHealthModelFactory + { + public static Azure.ResourceManager.ResourceHealth.Models.EmergingIssueActiveEventType EmergingIssueActiveEventType(string title = null, string description = null, string trackingId = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), string cloud = null, Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventSeverityLevel? severity = default(Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventSeverityLevel?), Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventStageValue? stage = default(Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventStageValue?), bool? isPublished = default(bool?), System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable impacts = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.EmergingIssueBannerType EmergingIssueBannerType(string title = null, string message = null, string cloud = null, System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.EmergingIssueImpact EmergingIssueImpact(string id = null, string name = null, System.Collections.Generic.IEnumerable regions = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.EmergingIssueImpactedRegion EmergingIssueImpactedRegion(string id = null, string name = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.MetadataSupportedValueDetail MetadataSupportedValueDetail(string id = null, string displayName = null, System.Collections.Generic.IEnumerable resourceTypes = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ResourceHealthAvailabilityStateRecentlyResolved ResourceHealthAvailabilityStateRecentlyResolved(System.DateTimeOffset? unavailableOccuredOn = default(System.DateTimeOffset?), System.DateTimeOffset? resolvedOn = default(System.DateTimeOffset?), string unavailableSummary = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ResourceHealthAvailabilityStatus ResourceHealthAvailabilityStatus(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.ResourceHealth.Models.ResourceHealthAvailabilityStatusProperties properties = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ResourceHealthAvailabilityStatusProperties ResourceHealthAvailabilityStatusProperties(Azure.ResourceManager.ResourceHealth.Models.ResourceHealthAvailabilityStateValue? availabilityState = default(Azure.ResourceManager.ResourceHealth.Models.ResourceHealthAvailabilityStateValue?), string title = null, string summary = null, string detailedStatus = null, string reasonType = null, string context = null, string category = null, string articleId = null, System.DateTimeOffset? rootCauseAttributionOn = default(System.DateTimeOffset?), string healthEventType = null, string healthEventCause = null, string healthEventCategory = null, string healthEventId = null, System.DateTimeOffset? resolutionEta = default(System.DateTimeOffset?), System.DateTimeOffset? occuredOn = default(System.DateTimeOffset?), Azure.ResourceManager.ResourceHealth.Models.ReasonChronicityType? reasonChronicity = default(Azure.ResourceManager.ResourceHealth.Models.ReasonChronicityType?), System.DateTimeOffset? reportedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ResourceHealth.Models.ResourceHealthAvailabilityStateRecentlyResolved recentlyResolved = null, System.Collections.Generic.IEnumerable recommendedActions = null, System.Collections.Generic.IEnumerable serviceImpactingEvents = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventArticle ResourceHealthEventArticle(string articleContent = null, string articleId = null, System.BinaryData parameters = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.ResourceHealthEventData ResourceHealthEventData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventTypeValue? eventType = default(Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventTypeValue?), Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventSourceValue? eventSource = default(Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventSourceValue?), Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventStatusValue? status = default(Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventStatusValue?), string title = null, string summary = null, string header = null, Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventInsightLevelValue? level = default(Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventInsightLevelValue?), Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventLevelValue? eventLevel = default(Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventLevelValue?), string externalIncidentId = null, string reason = null, Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventArticle article = null, System.Collections.Generic.IEnumerable links = null, System.DateTimeOffset? impactStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? impactMitigationOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable impact = null, Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventRecommendedActions recommendedActions = null, System.Collections.Generic.IEnumerable faqs = null, bool? isHirEvent = default(bool?), bool? isMicrosoftSupportEnabled = default(bool?), string description = null, bool? isPlatformInitiated = default(bool?), bool? isChatWithUsEnabled = default(bool?), int? priority = default(int?), System.DateTimeOffset? lastUpdateOn = default(System.DateTimeOffset?), string hirStage = null, string additionalInformationMessage = null, int? duration = default(int?), string impactType = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventFaq ResourceHealthEventFaq(string question = null, string answer = null, string localeCode = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventImpact ResourceHealthEventImpact(string impactedService = null, System.Collections.Generic.IEnumerable impactedRegions = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.ResourceHealthEventImpactedResourceData ResourceHealthEventImpactedResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceType? targetResourceType = default(Azure.Core.ResourceType?), Azure.Core.ResourceIdentifier targetResourceId = null, string targetRegion = null, System.Collections.Generic.IEnumerable info = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventImpactedServiceRegion ResourceHealthEventImpactedServiceRegion(string impactedRegion = null, Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventStatusValue? status = default(Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventStatusValue?), System.Collections.Generic.IEnumerable impactedSubscriptions = null, System.Collections.Generic.IEnumerable impactedTenants = null, System.DateTimeOffset? lastUpdateOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable updates = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventLink ResourceHealthEventLink(Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventLinkTypeValue? linkType = default(Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventLinkTypeValue?), Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventLinkDisplayText displayText = null, string extensionName = null, string bladeName = null, System.BinaryData parameters = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventLinkDisplayText ResourceHealthEventLinkDisplayText(string value = null, string localizedValue = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventRecommendedActions ResourceHealthEventRecommendedActions(string message = null, System.Collections.Generic.IEnumerable actions = null, string localeCode = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventRecommendedActionsItem ResourceHealthEventRecommendedActionsItem(int? groupId = default(int?), string actionText = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ResourceHealthEventUpdate ResourceHealthEventUpdate(string summary = null, System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ResourceHealthKeyValueItem ResourceHealthKeyValueItem(string key = null, string value = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.ResourceHealthMetadataEntityData ResourceHealthMetadataEntityData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string displayName = null, System.Collections.Generic.IEnumerable dependsOn = null, System.Collections.Generic.IEnumerable applicableScenarios = null, System.Collections.Generic.IEnumerable supportedValues = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ResourceHealthRecommendedAction ResourceHealthRecommendedAction(string action = null, System.Uri actionUri = null, string actionUriComment = null, string actionUriText = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.ServiceEmergingIssueData ServiceEmergingIssueData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? refreshedOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable statusBanners = null, System.Collections.Generic.IEnumerable statusActiveEvents = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ServiceImpactingEvent ServiceImpactingEvent(System.DateTimeOffset? eventStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? eventStatusLastModifiedOn = default(System.DateTimeOffset?), string correlationId = null, string statusValue = null, Azure.ResourceManager.ResourceHealth.Models.ServiceImpactingEventIncidentProperties incidentProperties = null) { throw null; } + public static Azure.ResourceManager.ResourceHealth.Models.ServiceImpactingEventIncidentProperties ServiceImpactingEventIncidentProperties(string title = null, string service = null, string region = null, string incidentType = null) { throw null; } + } public partial class EmergingIssueActiveEventType { internal EmergingIssueActiveEventType() { } diff --git a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/ArmResourceHealthModelFactory.cs b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/ArmResourceHealthModelFactory.cs new file mode 100644 index 0000000000000..f49418301e488 --- /dev/null +++ b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/ArmResourceHealthModelFactory.cs @@ -0,0 +1,374 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.ResourceHealth; + +namespace Azure.ResourceManager.ResourceHealth.Models +{ + /// Model factory for models. + public static partial class ArmResourceHealthModelFactory + { + /// Initializes a new instance of ResourceHealthAvailabilityStatus. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Azure Resource Manager geo location of the resource. + /// Properties of availability state. + /// A new instance for mocking. + public static ResourceHealthAvailabilityStatus ResourceHealthAvailabilityStatus(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, ResourceHealthAvailabilityStatusProperties properties = null) + { + return new ResourceHealthAvailabilityStatus(id, name, resourceType, systemData, location, properties); + } + + /// Initializes a new instance of ResourceHealthAvailabilityStatusProperties. + /// Availability status of the resource. When it is null, this availabilityStatus object represents an availability impacting event. + /// Title description of the availability status. + /// Summary description of the availability status. + /// Details of the availability status. + /// When the resource's availabilityState is Unavailable, it describes where the health impacting event was originated. Examples are planned, unplanned, user initiated or an outage etc. + /// When an event is created, it can either be triggered by a customer or the platform of the resource and this field will illustrate that. This field is connected to the category field in this object. + /// When a context field is set to Platform, this field will reflect if the event was planned or unplanned. If the context field does not have a value of Platform, then this field will be ignored. + /// The Article Id. + /// When the resource's availabilityState is Unavailable, it provides the Timestamp for when the health impacting event was received. + /// In case of an availability impacting event, it describes when the health impacting event was originated. Examples are Lifecycle, Downtime, Fault Analysis etc. + /// In case of an availability impacting event, it describes where the health impacting event was originated. Examples are PlatformInitiated, UserInitiated etc. + /// In case of an availability impacting event, it describes the category of a PlatformInitiated health impacting event. Examples are Planned, Unplanned etc. + /// It is a unique Id that identifies the event. + /// When the resource's availabilityState is Unavailable and the reasonType is not User Initiated, it provides the date and time for when the issue is expected to be resolved. + /// Timestamp for when last change in health status occurred. + /// Chronicity of the availability transition. + /// Timestamp for when the health was last checked. + /// An annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of type Unplanned. + /// Lists actions the user can take based on the current availabilityState of the resource. + /// Lists the service impacting events that may be affecting the health of the resource. + /// A new instance for mocking. + public static ResourceHealthAvailabilityStatusProperties ResourceHealthAvailabilityStatusProperties(ResourceHealthAvailabilityStateValue? availabilityState = null, string title = null, string summary = null, string detailedStatus = null, string reasonType = null, string context = null, string category = null, string articleId = null, DateTimeOffset? rootCauseAttributionOn = null, string healthEventType = null, string healthEventCause = null, string healthEventCategory = null, string healthEventId = null, DateTimeOffset? resolutionEta = null, DateTimeOffset? occuredOn = null, ReasonChronicityType? reasonChronicity = null, DateTimeOffset? reportedOn = null, ResourceHealthAvailabilityStateRecentlyResolved recentlyResolved = null, IEnumerable recommendedActions = null, IEnumerable serviceImpactingEvents = null) + { + recommendedActions ??= new List(); + serviceImpactingEvents ??= new List(); + + return new ResourceHealthAvailabilityStatusProperties(availabilityState, title, summary, detailedStatus, reasonType, context, category, articleId, rootCauseAttributionOn, healthEventType, healthEventCause, healthEventCategory, healthEventId, resolutionEta, occuredOn, reasonChronicity, reportedOn, recentlyResolved, recommendedActions?.ToList(), serviceImpactingEvents?.ToList()); + } + + /// Initializes a new instance of ResourceHealthAvailabilityStateRecentlyResolved. + /// Timestamp for when the availabilityState changed to Unavailable. + /// Timestamp when the availabilityState changes to Available. + /// Brief description of cause of the resource becoming unavailable. + /// A new instance for mocking. + public static ResourceHealthAvailabilityStateRecentlyResolved ResourceHealthAvailabilityStateRecentlyResolved(DateTimeOffset? unavailableOccuredOn = null, DateTimeOffset? resolvedOn = null, string unavailableSummary = null) + { + return new ResourceHealthAvailabilityStateRecentlyResolved(unavailableOccuredOn, resolvedOn, unavailableSummary); + } + + /// Initializes a new instance of ResourceHealthRecommendedAction. + /// Recommended action. + /// Link to the action. + /// the comment for the Action. + /// Substring of action, it describes which text should host the action URL. + /// A new instance for mocking. + public static ResourceHealthRecommendedAction ResourceHealthRecommendedAction(string action = null, Uri actionUri = null, string actionUriComment = null, string actionUriText = null) + { + return new ResourceHealthRecommendedAction(action, actionUri, actionUriComment, actionUriText); + } + + /// Initializes a new instance of ServiceImpactingEvent. + /// Timestamp for when the event started. + /// Timestamp for when event was submitted/detected. + /// Correlation id for the event. + /// Status of the service impacting event. + /// Properties of the service impacting event. + /// A new instance for mocking. + public static ServiceImpactingEvent ServiceImpactingEvent(DateTimeOffset? eventStartOn = null, DateTimeOffset? eventStatusLastModifiedOn = null, string correlationId = null, string statusValue = null, ServiceImpactingEventIncidentProperties incidentProperties = null) + { + return new ServiceImpactingEvent(eventStartOn, eventStatusLastModifiedOn, correlationId, statusValue != null ? new ServiceImpactingEventStatus(statusValue) : null, incidentProperties); + } + + /// Initializes a new instance of ServiceImpactingEventIncidentProperties. + /// Title of the incident. + /// Service impacted by the event. + /// Region impacted by the event. + /// Type of Event. + /// A new instance for mocking. + public static ServiceImpactingEventIncidentProperties ServiceImpactingEventIncidentProperties(string title = null, string service = null, string region = null, string incidentType = null) + { + return new ServiceImpactingEventIncidentProperties(title, service, region, incidentType); + } + + /// Initializes a new instance of ResourceHealthMetadataEntityData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The display name. + /// The list of keys on which this entity depends on. + /// The list of scenarios applicable to this metadata entity. + /// The list of supported values. + /// A new instance for mocking. + public static ResourceHealthMetadataEntityData ResourceHealthMetadataEntityData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string displayName = null, IEnumerable dependsOn = null, IEnumerable applicableScenarios = null, IEnumerable supportedValues = null) + { + dependsOn ??= new List(); + applicableScenarios ??= new List(); + supportedValues ??= new List(); + + return new ResourceHealthMetadataEntityData(id, name, resourceType, systemData, displayName, dependsOn?.ToList(), applicableScenarios?.ToList(), supportedValues?.ToList()); + } + + /// Initializes a new instance of MetadataSupportedValueDetail. + /// The id. + /// The display name. + /// The list of associated resource types. + /// A new instance for mocking. + public static MetadataSupportedValueDetail MetadataSupportedValueDetail(string id = null, string displayName = null, IEnumerable resourceTypes = null) + { + resourceTypes ??= new List(); + + return new MetadataSupportedValueDetail(id, displayName, resourceTypes?.ToList()); + } + + /// Initializes a new instance of ResourceHealthEventImpactedResourceData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Resource type within Microsoft cloud. + /// Identity for resource within Microsoft cloud. + /// Impacted resource region name. + /// Additional information. + /// A new instance for mocking. + public static ResourceHealthEventImpactedResourceData ResourceHealthEventImpactedResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceType? targetResourceType = null, ResourceIdentifier targetResourceId = null, string targetRegion = null, IEnumerable info = null) + { + info ??= new List(); + + return new ResourceHealthEventImpactedResourceData(id, name, resourceType, systemData, targetResourceType, targetResourceId, targetRegion, info?.ToList()); + } + + /// Initializes a new instance of ResourceHealthKeyValueItem. + /// Key of tuple. + /// Value of tuple. + /// A new instance for mocking. + public static ResourceHealthKeyValueItem ResourceHealthKeyValueItem(string key = null, string value = null) + { + return new ResourceHealthKeyValueItem(key, value); + } + + /// Initializes a new instance of ResourceHealthEventData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Type of event. + /// Source of event. + /// Current status of event. + /// Title text of event. + /// Summary text of event. + /// Header text of event. + /// Level of insight. + /// Level of event. + /// The id of the Incident. + /// The reason for the Incident. + /// Article of event. + /// Useful links of event. + /// It provides the Timestamp for when the health impacting event started. + /// It provides the Timestamp for when the health impacting event resolved. + /// List services impacted by the service health event. + /// Recommended actions of event. + /// Frequently asked questions for the service health event. + /// It provides information if the event is High incident rate event or not. + /// Tells if we want to enable or disable Microsoft Support for this event. + /// Contains the communication message for the event, that could include summary, root cause and other details. + /// Is true if the event is platform initiated. + /// Tells if we want to enable or disable Microsoft Support for this event. + /// Priority level of the event. Has value from 0 to 23. 0 is the highest priority. Service issue events have higher priority followed by planned maintenance and health advisory. Critical events have higher priority followed by error, warning and informational. Furthermore, active events have higher priority than resolved. + /// It provides the Timestamp for when the health impacting event was last updated. + /// Stage for HIR Document. + /// Additional information. + /// duration in seconds. + /// The type of the impact. + /// A new instance for mocking. + public static ResourceHealthEventData ResourceHealthEventData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceHealthEventTypeValue? eventType = null, ResourceHealthEventSourceValue? eventSource = null, ResourceHealthEventStatusValue? status = null, string title = null, string summary = null, string header = null, ResourceHealthEventInsightLevelValue? level = null, ResourceHealthEventLevelValue? eventLevel = null, string externalIncidentId = null, string reason = null, ResourceHealthEventArticle article = null, IEnumerable links = null, DateTimeOffset? impactStartOn = null, DateTimeOffset? impactMitigationOn = null, IEnumerable impact = null, ResourceHealthEventRecommendedActions recommendedActions = null, IEnumerable faqs = null, bool? isHirEvent = null, bool? isMicrosoftSupportEnabled = null, string description = null, bool? isPlatformInitiated = null, bool? isChatWithUsEnabled = null, int? priority = null, DateTimeOffset? lastUpdateOn = null, string hirStage = null, string additionalInformationMessage = null, int? duration = null, string impactType = null) + { + links ??= new List(); + impact ??= new List(); + faqs ??= new List(); + + return new ResourceHealthEventData(id, name, resourceType, systemData, eventType, eventSource, status, title, summary, header, level, eventLevel, externalIncidentId, reason, article, links?.ToList(), impactStartOn, impactMitigationOn, impact?.ToList(), recommendedActions, faqs?.ToList(), isHirEvent, isMicrosoftSupportEnabled, description, isPlatformInitiated, isChatWithUsEnabled, priority, lastUpdateOn, hirStage, additionalInformationMessage != null ? new ResourceHealthEventAdditionalInformation(additionalInformationMessage) : null, duration, impactType); + } + + /// Initializes a new instance of ResourceHealthEventArticle. + /// Article content of event. + /// Article Id. + /// It provides a map of parameter name and value. + /// A new instance for mocking. + public static ResourceHealthEventArticle ResourceHealthEventArticle(string articleContent = null, string articleId = null, BinaryData parameters = null) + { + return new ResourceHealthEventArticle(articleContent, articleId, parameters); + } + + /// Initializes a new instance of ResourceHealthEventLink. + /// Type of link. + /// Display text of link. + /// It provides the name of portal extension to produce link for given service health event. + /// It provides the name of portal extension blade to produce link for given service health event. + /// It provides a map of parameter name and value for portal extension blade to produce lik for given service health event. + /// A new instance for mocking. + public static ResourceHealthEventLink ResourceHealthEventLink(ResourceHealthEventLinkTypeValue? linkType = null, ResourceHealthEventLinkDisplayText displayText = null, string extensionName = null, string bladeName = null, BinaryData parameters = null) + { + return new ResourceHealthEventLink(linkType, displayText, extensionName, bladeName, parameters); + } + + /// Initializes a new instance of ResourceHealthEventLinkDisplayText. + /// Display text of link. + /// Localized display text of link. + /// A new instance for mocking. + public static ResourceHealthEventLinkDisplayText ResourceHealthEventLinkDisplayText(string value = null, string localizedValue = null) + { + return new ResourceHealthEventLinkDisplayText(value, localizedValue); + } + + /// Initializes a new instance of ResourceHealthEventImpact. + /// Impacted service name. + /// List regions impacted by the service health event. + /// A new instance for mocking. + public static ResourceHealthEventImpact ResourceHealthEventImpact(string impactedService = null, IEnumerable impactedRegions = null) + { + impactedRegions ??= new List(); + + return new ResourceHealthEventImpact(impactedService, impactedRegions?.ToList()); + } + + /// Initializes a new instance of ResourceHealthEventImpactedServiceRegion. + /// Impacted region name. + /// Current status of event in the region. + /// List subscription impacted by the service health event. + /// List tenant impacted by the service health event. + /// It provides the Timestamp for when the last update for the service health event. + /// List of updates for given service health event. + /// A new instance for mocking. + public static ResourceHealthEventImpactedServiceRegion ResourceHealthEventImpactedServiceRegion(string impactedRegion = null, ResourceHealthEventStatusValue? status = null, IEnumerable impactedSubscriptions = null, IEnumerable impactedTenants = null, DateTimeOffset? lastUpdateOn = null, IEnumerable updates = null) + { + impactedSubscriptions ??= new List(); + impactedTenants ??= new List(); + updates ??= new List(); + + return new ResourceHealthEventImpactedServiceRegion(impactedRegion, status, impactedSubscriptions?.ToList(), impactedTenants?.ToList(), lastUpdateOn, updates?.ToList()); + } + + /// Initializes a new instance of ResourceHealthEventUpdate. + /// Summary text for the given update for the service health event. + /// It provides the Timestamp for the given update for the service health event. + /// A new instance for mocking. + public static ResourceHealthEventUpdate ResourceHealthEventUpdate(string summary = null, DateTimeOffset? updatedOn = null) + { + return new ResourceHealthEventUpdate(summary, updatedOn); + } + + /// Initializes a new instance of ResourceHealthEventRecommendedActions. + /// Recommended action title for the service health event. + /// Recommended actions for the service health event. + /// Recommended action locale for the service health event. + /// A new instance for mocking. + public static ResourceHealthEventRecommendedActions ResourceHealthEventRecommendedActions(string message = null, IEnumerable actions = null, string localeCode = null) + { + actions ??= new List(); + + return new ResourceHealthEventRecommendedActions(message, actions?.ToList(), localeCode); + } + + /// Initializes a new instance of ResourceHealthEventRecommendedActionsItem. + /// Recommended action group Id for the service health event. + /// Recommended action text. + /// A new instance for mocking. + public static ResourceHealthEventRecommendedActionsItem ResourceHealthEventRecommendedActionsItem(int? groupId = null, string actionText = null) + { + return new ResourceHealthEventRecommendedActionsItem(groupId, actionText); + } + + /// Initializes a new instance of ResourceHealthEventFaq. + /// FAQ question for the service health event. + /// FAQ answer for the service health event. + /// FAQ locale for the service health event. + /// A new instance for mocking. + public static ResourceHealthEventFaq ResourceHealthEventFaq(string question = null, string answer = null, string localeCode = null) + { + return new ResourceHealthEventFaq(question, answer, localeCode); + } + + /// Initializes a new instance of ServiceEmergingIssueData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Timestamp for when last time refreshed for ongoing emerging issue. + /// The list of emerging issues of banner type. + /// The list of emerging issues of active event type. + /// A new instance for mocking. + public static ServiceEmergingIssueData ServiceEmergingIssueData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DateTimeOffset? refreshedOn = null, IEnumerable statusBanners = null, IEnumerable statusActiveEvents = null) + { + statusBanners ??= new List(); + statusActiveEvents ??= new List(); + + return new ServiceEmergingIssueData(id, name, resourceType, systemData, refreshedOn, statusBanners?.ToList(), statusActiveEvents?.ToList()); + } + + /// Initializes a new instance of EmergingIssueBannerType. + /// The banner title. + /// The details of banner. + /// The cloud type of this banner. + /// The last time modified on this banner. + /// A new instance for mocking. + public static EmergingIssueBannerType EmergingIssueBannerType(string title = null, string message = null, string cloud = null, DateTimeOffset? lastModifiedOn = null) + { + return new EmergingIssueBannerType(title, message, cloud, lastModifiedOn); + } + + /// Initializes a new instance of EmergingIssueActiveEventType. + /// The active event title. + /// The details of active event. + /// The tracking id of this active event. + /// The impact start time on this active event. + /// The cloud type of this active event. + /// The severity level of this active event. + /// The stage of this active event. + /// The boolean value of this active event if published or not. + /// The last time modified on this banner. + /// The list of emerging issues impacts. + /// A new instance for mocking. + public static EmergingIssueActiveEventType EmergingIssueActiveEventType(string title = null, string description = null, string trackingId = null, DateTimeOffset? startOn = null, string cloud = null, ResourceHealthEventSeverityLevel? severity = null, ResourceHealthEventStageValue? stage = null, bool? isPublished = null, DateTimeOffset? lastModifiedOn = null, IEnumerable impacts = null) + { + impacts ??= new List(); + + return new EmergingIssueActiveEventType(title, description, trackingId, startOn, cloud, severity, stage, isPublished, lastModifiedOn, impacts?.ToList()); + } + + /// Initializes a new instance of EmergingIssueImpact. + /// The impacted service id. + /// The impacted service name. + /// The list of impacted regions for corresponding emerging issues. + /// A new instance for mocking. + public static EmergingIssueImpact EmergingIssueImpact(string id = null, string name = null, IEnumerable regions = null) + { + regions ??= new List(); + + return new EmergingIssueImpact(id, name, regions?.ToList()); + } + + /// Initializes a new instance of EmergingIssueImpactedRegion. + /// The impacted region id. + /// The impacted region name. + /// A new instance for mocking. + public static EmergingIssueImpactedRegion EmergingIssueImpactedRegion(string id = null, string name = null) + { + return new EmergingIssueImpactedRegion(id, name); + } + } +} diff --git a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/autorest.md b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/autorest.md index 2037b107857d1..c7350cc2cba9c 100644 --- a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/autorest.md +++ b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/autorest.md @@ -4,7 +4,6 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml azure-arm: true -generate-model-factory: false csharp: true library-name: ResourceHealth namespace: Azure.ResourceManager.ResourceHealth @@ -120,4 +119,4 @@ request-path-is-non-resource: - /{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses/current - /{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses/current -``` \ No newline at end of file +```