diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/api/Azure.ResourceManager.Grafana.netstandard2.0.cs b/sdk/grafana/Azure.ResourceManager.Grafana/api/Azure.ResourceManager.Grafana.netstandard2.0.cs index cad659b2fbe9..d967340972b5 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/api/Azure.ResourceManager.Grafana.netstandard2.0.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/api/Azure.ResourceManager.Grafana.netstandard2.0.cs @@ -10,6 +10,7 @@ public static partial class GrafanaExtensions public static Azure.ResourceManager.Grafana.ManagedGrafanaCollection GetManagedGrafanas(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetManagedGrafanas(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetManagedGrafanasAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Grafana.ManagedPrivateEndpointModelResource GetManagedPrivateEndpointModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } } public partial class GrafanaPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -115,9 +116,13 @@ protected ManagedGrafanaResource() { } public virtual bool HasData { get { throw null; } } public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CheckEnterpriseDetails(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CheckEnterpriseDetailsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable FetchAvailablePlugins(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable FetchAvailablePluginsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetGrafanaPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -126,6 +131,11 @@ protected ManagedGrafanaResource() { } public virtual Azure.Response GetGrafanaPrivateLinkResource(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetGrafanaPrivateLinkResourceAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Grafana.GrafanaPrivateLinkResourceCollection GetGrafanaPrivateLinkResources() { throw null; } + public virtual Azure.Response GetManagedPrivateEndpointModel(string managedPrivateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetManagedPrivateEndpointModelAsync(string managedPrivateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Grafana.ManagedPrivateEndpointModelCollection GetManagedPrivateEndpointModels() { throw null; } + public virtual Azure.ResourceManager.ArmOperation RefreshManagedPrivateEndpoint(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RefreshManagedPrivateEndpointAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -133,15 +143,72 @@ protected ManagedGrafanaResource() { } public virtual Azure.Response Update(Azure.ResourceManager.Grafana.Models.ManagedGrafanaPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.Grafana.Models.ManagedGrafanaPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class ManagedPrivateEndpointModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ManagedPrivateEndpointModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string managedPrivateEndpointName, Azure.ResourceManager.Grafana.ManagedPrivateEndpointModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string managedPrivateEndpointName, Azure.ResourceManager.Grafana.ManagedPrivateEndpointModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string managedPrivateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string managedPrivateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string managedPrivateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string managedPrivateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string managedPrivateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string managedPrivateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ManagedPrivateEndpointModelData : Azure.ResourceManager.Models.TrackedResourceData + { + public ManagedPrivateEndpointModelData(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } + public Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionState ConnectionState { get { throw null; } } + public System.Collections.Generic.IList GroupIds { get { throw null; } } + public string PrivateLinkResourceId { get { throw null; } set { } } + public string PrivateLinkResourceRegion { get { throw null; } set { } } + public string PrivateLinkServicePrivateIP { get { throw null; } } + public System.Uri PrivateLinkServiceUri { get { throw null; } set { } } + public Azure.ResourceManager.Grafana.Models.GrafanaProvisioningState? ProvisioningState { get { throw null; } } + public string RequestMessage { get { throw null; } set { } } + } + public partial class ManagedPrivateEndpointModelResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ManagedPrivateEndpointModelResource() { } + public virtual Azure.ResourceManager.Grafana.ManagedPrivateEndpointModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string managedPrivateEndpointName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } } namespace Azure.ResourceManager.Grafana.Models { public static partial class ArmGrafanaModelFactory { + public static Azure.ResourceManager.Grafana.Models.EnterpriseDetails EnterpriseDetails(Azure.ResourceManager.Grafana.Models.SaasSubscriptionDetails saasSubscriptionDetails = null, Azure.ResourceManager.Grafana.Models.MarketplaceTrialQuota marketplaceTrialQuota = null) { throw null; } + public static Azure.ResourceManager.Grafana.Models.GrafanaAvailablePlugin GrafanaAvailablePlugin(string pluginId = null, string name = null) { throw null; } + public static Azure.ResourceManager.Grafana.Models.GrafanaPlugin GrafanaPlugin(string pluginId = null) { throw null; } public static Azure.ResourceManager.Grafana.GrafanaPrivateEndpointConnectionData GrafanaPrivateEndpointConnectionData(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.Grafana.Models.GrafanaPrivateLinkServiceConnectionState connectionState = null, System.Collections.Generic.IEnumerable groupIds = null, Azure.ResourceManager.Grafana.Models.GrafanaPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.Grafana.Models.GrafanaPrivateEndpointConnectionProvisioningState?)) { throw null; } public static Azure.ResourceManager.Grafana.GrafanaPrivateLinkResourceData GrafanaPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Grafana.Models.GrafanaProvisioningState? provisioningState = default(Azure.ResourceManager.Grafana.Models.GrafanaProvisioningState?), string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } public static Azure.ResourceManager.Grafana.ManagedGrafanaData ManagedGrafanaData(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), string skuName = null, Azure.ResourceManager.Grafana.Models.ManagedGrafanaProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } - public static Azure.ResourceManager.Grafana.Models.ManagedGrafanaProperties ManagedGrafanaProperties(Azure.ResourceManager.Grafana.Models.GrafanaProvisioningState? provisioningState = default(Azure.ResourceManager.Grafana.Models.GrafanaProvisioningState?), string grafanaVersion = null, string endpoint = null, Azure.ResourceManager.Grafana.Models.GrafanaPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Grafana.Models.GrafanaPublicNetworkAccess?), Azure.ResourceManager.Grafana.Models.GrafanaZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.Grafana.Models.GrafanaZoneRedundancy?), Azure.ResourceManager.Grafana.Models.GrafanaApiKey? apiKey = default(Azure.ResourceManager.Grafana.Models.GrafanaApiKey?), Azure.ResourceManager.Grafana.Models.DeterministicOutboundIP? deterministicOutboundIP = default(Azure.ResourceManager.Grafana.Models.DeterministicOutboundIP?), System.Collections.Generic.IEnumerable outboundIPs = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.Grafana.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.Grafana.Models.AutoGeneratedDomainNameLabelScope?), System.Collections.Generic.IEnumerable monitorWorkspaceIntegrations = null) { throw null; } + public static Azure.ResourceManager.Grafana.Models.ManagedGrafanaProperties ManagedGrafanaProperties(Azure.ResourceManager.Grafana.Models.GrafanaProvisioningState? provisioningState = default(Azure.ResourceManager.Grafana.Models.GrafanaProvisioningState?), string grafanaVersion = null, string endpoint = null, Azure.ResourceManager.Grafana.Models.GrafanaPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Grafana.Models.GrafanaPublicNetworkAccess?), Azure.ResourceManager.Grafana.Models.GrafanaZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.Grafana.Models.GrafanaZoneRedundancy?), Azure.ResourceManager.Grafana.Models.GrafanaApiKey? apiKey = default(Azure.ResourceManager.Grafana.Models.GrafanaApiKey?), Azure.ResourceManager.Grafana.Models.DeterministicOutboundIP? deterministicOutboundIP = default(Azure.ResourceManager.Grafana.Models.DeterministicOutboundIP?), System.Collections.Generic.IEnumerable outboundIPs = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.Grafana.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.Grafana.Models.AutoGeneratedDomainNameLabelScope?), System.Collections.Generic.IEnumerable monitorWorkspaceIntegrations = null, Azure.ResourceManager.Grafana.Models.EnterpriseConfigurations enterpriseConfigurations = null, Azure.ResourceManager.Grafana.Models.Smtp grafanaConfigurationsSmtp = null, System.Collections.Generic.IDictionary grafanaPlugins = null, string grafanaMajorVersion = null) { throw null; } + public static Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionState ManagedPrivateEndpointConnectionState(Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionStatus? status = default(Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionStatus?), string description = null) { throw null; } + public static Azure.ResourceManager.Grafana.ManagedPrivateEndpointModelData ManagedPrivateEndpointModelData(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.Grafana.Models.GrafanaProvisioningState? provisioningState = default(Azure.ResourceManager.Grafana.Models.GrafanaProvisioningState?), string privateLinkResourceId = null, string privateLinkResourceRegion = null, System.Collections.Generic.IEnumerable groupIds = null, string requestMessage = null, Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionState connectionState = null, System.Uri privateLinkServiceUri = null, string privateLinkServicePrivateIP = null) { throw null; } + public static Azure.ResourceManager.Grafana.Models.MarketplaceTrialQuota MarketplaceTrialQuota(Azure.ResourceManager.Grafana.Models.AvailablePromotion? availablePromotion = default(Azure.ResourceManager.Grafana.Models.AvailablePromotion?), Azure.Core.ResourceIdentifier grafanaResourceId = null, System.DateTimeOffset? trialStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? trialEndOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Grafana.Models.SaasSubscriptionDetails SaasSubscriptionDetails(string planId = null, string offerId = null, string publisherId = null, Azure.ResourceManager.Grafana.Models.SubscriptionTerm term = null) { throw null; } + public static Azure.ResourceManager.Grafana.Models.SubscriptionTerm SubscriptionTerm(string termUnit = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?)) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct AutoGeneratedDomainNameLabelScope : System.IEquatable @@ -161,6 +228,24 @@ public static partial class ArmGrafanaModelFactory public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AvailablePromotion : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AvailablePromotion(string value) { throw null; } + public static Azure.ResourceManager.Grafana.Models.AvailablePromotion FreeTrial { get { throw null; } } + public static Azure.ResourceManager.Grafana.Models.AvailablePromotion None { get { throw null; } } + public bool Equals(Azure.ResourceManager.Grafana.Models.AvailablePromotion other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Grafana.Models.AvailablePromotion left, Azure.ResourceManager.Grafana.Models.AvailablePromotion right) { throw null; } + public static implicit operator Azure.ResourceManager.Grafana.Models.AvailablePromotion (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Grafana.Models.AvailablePromotion left, Azure.ResourceManager.Grafana.Models.AvailablePromotion right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct DeterministicOutboundIP : System.IEquatable { private readonly object _dummy; @@ -178,6 +263,18 @@ public static partial class ArmGrafanaModelFactory public static bool operator !=(Azure.ResourceManager.Grafana.Models.DeterministicOutboundIP left, Azure.ResourceManager.Grafana.Models.DeterministicOutboundIP right) { throw null; } public override string ToString() { throw null; } } + public partial class EnterpriseConfigurations + { + public EnterpriseConfigurations() { } + public Azure.ResourceManager.Grafana.Models.MarketplaceAutoRenew? MarketplaceAutoRenew { get { throw null; } set { } } + public string MarketplacePlanId { get { throw null; } set { } } + } + public partial class EnterpriseDetails + { + internal EnterpriseDetails() { } + public Azure.ResourceManager.Grafana.Models.MarketplaceTrialQuota MarketplaceTrialQuota { get { throw null; } } + public Azure.ResourceManager.Grafana.Models.SaasSubscriptionDetails SaasSubscriptionDetails { get { throw null; } } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct GrafanaApiKey : System.IEquatable { @@ -196,6 +293,17 @@ public static partial class ArmGrafanaModelFactory public static bool operator !=(Azure.ResourceManager.Grafana.Models.GrafanaApiKey left, Azure.ResourceManager.Grafana.Models.GrafanaApiKey right) { throw null; } public override string ToString() { throw null; } } + public partial class GrafanaAvailablePlugin + { + internal GrafanaAvailablePlugin() { } + public string Name { get { throw null; } } + public string PluginId { get { throw null; } } + } + public partial class GrafanaPlugin + { + public GrafanaPlugin() { } + public string PluginId { get { throw null; } } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct GrafanaPrivateEndpointConnectionProvisioningState : System.IEquatable { @@ -308,6 +416,7 @@ public partial class ManagedGrafanaPatch public ManagedGrafanaPatch() { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.Grafana.Models.ManagedGrafanaPatchProperties Properties { get { throw null; } set { } } + public string SkuName { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } } public partial class ManagedGrafanaPatchProperties @@ -315,6 +424,10 @@ public partial class ManagedGrafanaPatchProperties public ManagedGrafanaPatchProperties() { } public Azure.ResourceManager.Grafana.Models.GrafanaApiKey? ApiKey { get { throw null; } set { } } public Azure.ResourceManager.Grafana.Models.DeterministicOutboundIP? DeterministicOutboundIP { get { throw null; } set { } } + public Azure.ResourceManager.Grafana.Models.EnterpriseConfigurations EnterpriseConfigurations { get { throw null; } set { } } + public Azure.ResourceManager.Grafana.Models.Smtp GrafanaConfigurationsSmtp { get { throw null; } set { } } + public string GrafanaMajorVersion { get { throw null; } set { } } + public System.Collections.Generic.IDictionary GrafanaPlugins { get { throw null; } } public System.Collections.Generic.IList MonitorWorkspaceIntegrations { get { throw null; } } public Azure.ResourceManager.Grafana.Models.GrafanaPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public Azure.ResourceManager.Grafana.Models.GrafanaZoneRedundancy? ZoneRedundancy { get { throw null; } set { } } @@ -326,6 +439,10 @@ public ManagedGrafanaProperties() { } public Azure.ResourceManager.Grafana.Models.AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } public Azure.ResourceManager.Grafana.Models.DeterministicOutboundIP? DeterministicOutboundIP { get { throw null; } set { } } public string Endpoint { get { throw null; } } + public Azure.ResourceManager.Grafana.Models.EnterpriseConfigurations EnterpriseConfigurations { get { throw null; } set { } } + public Azure.ResourceManager.Grafana.Models.Smtp GrafanaConfigurationsSmtp { get { throw null; } set { } } + public string GrafanaMajorVersion { get { throw null; } set { } } + public System.Collections.Generic.IDictionary GrafanaPlugins { get { throw null; } } public string GrafanaVersion { get { throw null; } } public System.Collections.Generic.IList MonitorWorkspaceIntegrations { get { throw null; } } public System.Collections.Generic.IReadOnlyList OutboundIPs { get { throw null; } } @@ -334,9 +451,112 @@ public ManagedGrafanaProperties() { } public Azure.ResourceManager.Grafana.Models.GrafanaPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public Azure.ResourceManager.Grafana.Models.GrafanaZoneRedundancy? ZoneRedundancy { get { throw null; } set { } } } + public partial class ManagedPrivateEndpointConnectionState + { + internal ManagedPrivateEndpointConnectionState() { } + public string Description { get { throw null; } } + public Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionStatus? Status { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedPrivateEndpointConnectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedPrivateEndpointConnectionStatus(string value) { throw null; } + public static Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionStatus Approved { get { throw null; } } + public static Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionStatus Disconnected { get { throw null; } } + public static Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionStatus Pending { get { throw null; } } + public static Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionStatus left, Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionStatus left, Azure.ResourceManager.Grafana.Models.ManagedPrivateEndpointConnectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ManagedPrivateEndpointModelPatch + { + public ManagedPrivateEndpointModelPatch() { } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MarketplaceAutoRenew : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MarketplaceAutoRenew(string value) { throw null; } + public static Azure.ResourceManager.Grafana.Models.MarketplaceAutoRenew Disabled { get { throw null; } } + public static Azure.ResourceManager.Grafana.Models.MarketplaceAutoRenew Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.Grafana.Models.MarketplaceAutoRenew other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Grafana.Models.MarketplaceAutoRenew left, Azure.ResourceManager.Grafana.Models.MarketplaceAutoRenew right) { throw null; } + public static implicit operator Azure.ResourceManager.Grafana.Models.MarketplaceAutoRenew (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Grafana.Models.MarketplaceAutoRenew left, Azure.ResourceManager.Grafana.Models.MarketplaceAutoRenew right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MarketplaceTrialQuota + { + internal MarketplaceTrialQuota() { } + public Azure.ResourceManager.Grafana.Models.AvailablePromotion? AvailablePromotion { get { throw null; } } + public Azure.Core.ResourceIdentifier GrafanaResourceId { get { throw null; } } + public System.DateTimeOffset? TrialEndOn { get { throw null; } } + public System.DateTimeOffset? TrialStartOn { get { throw null; } } + } public partial class MonitorWorkspaceIntegration { public MonitorWorkspaceIntegration() { } public Azure.Core.ResourceIdentifier MonitorWorkspaceResourceId { get { throw null; } set { } } } + public partial class SaasSubscriptionDetails + { + internal SaasSubscriptionDetails() { } + public string OfferId { get { throw null; } } + public string PlanId { get { throw null; } } + public string PublisherId { get { throw null; } } + public Azure.ResourceManager.Grafana.Models.SubscriptionTerm Term { get { throw null; } } + } + public partial class Smtp + { + public Smtp() { } + public bool? Enabled { get { throw null; } set { } } + public string FromAddress { get { throw null; } set { } } + public string FromName { get { throw null; } set { } } + public string Host { get { throw null; } set { } } + public string Password { get { throw null; } set { } } + public bool? SkipVerify { get { throw null; } set { } } + public Azure.ResourceManager.Grafana.Models.StartTLSPolicy? StartTLSPolicy { get { throw null; } set { } } + public string User { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StartTLSPolicy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StartTLSPolicy(string value) { throw null; } + public static Azure.ResourceManager.Grafana.Models.StartTLSPolicy MandatoryStartTLS { get { throw null; } } + public static Azure.ResourceManager.Grafana.Models.StartTLSPolicy NoStartTLS { get { throw null; } } + public static Azure.ResourceManager.Grafana.Models.StartTLSPolicy OpportunisticStartTLS { get { throw null; } } + public bool Equals(Azure.ResourceManager.Grafana.Models.StartTLSPolicy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Grafana.Models.StartTLSPolicy left, Azure.ResourceManager.Grafana.Models.StartTLSPolicy right) { throw null; } + public static implicit operator Azure.ResourceManager.Grafana.Models.StartTLSPolicy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Grafana.Models.StartTLSPolicy left, Azure.ResourceManager.Grafana.Models.StartTLSPolicy right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SubscriptionTerm + { + internal SubscriptionTerm() { } + public System.DateTimeOffset? EndOn { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public string TermUnit { get { throw null; } } + } } diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateEndpointConnectionCollection.cs b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateEndpointConnectionCollection.cs index 462663d5a204..a83a7d18fc23 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateEndpointConnectionCollection.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateEndpointConnectionCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_GrafanaPrivateEndpointConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_PrivateEndpointConnectionsGet() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_Get.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_Get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task Get_PrivateEndpointConnectionsGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_PrivateEndpointConnectionsGet() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_Get.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_Get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Exists_PrivateEndpointConnectionsGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_PrivateEndpointConnectionsGet() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_Get.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_Get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +131,7 @@ public async Task GetIfExists_PrivateEndpointConnectionsGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_PrivateEndpointConnectionsApprove() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_Approve.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_Approve.json // this example is just showing the usage of "PrivateEndpointConnections_Approve" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +168,7 @@ public async Task CreateOrUpdate_PrivateEndpointConnectionsApprove() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_PrivateEndpointConnectionsList() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_List.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_List.json // this example is just showing the usage of "PrivateEndpointConnections_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateEndpointConnectionResource.cs b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateEndpointConnectionResource.cs index bfc99f7b5b9e..e7f76c28ab06 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateEndpointConnectionResource.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateEndpointConnectionResource.cs @@ -22,7 +22,7 @@ public partial class Sample_GrafanaPrivateEndpointConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_PrivateEndpointConnectionsGet() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_Get.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_Get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_PrivateEndpointConnectionsGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_PrivateEndpointConnectionsApprove() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_Approve.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_Approve.json // this example is just showing the usage of "PrivateEndpointConnections_Approve" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Update_PrivateEndpointConnectionsApprove() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_PrivateEndpointConnectionsDelete() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_Delete.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_Delete.json // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateLinkResource.cs b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateLinkResource.cs index a2fec7b03928..5541cb84ceb0 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateLinkResource.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateLinkResource.cs @@ -21,7 +21,7 @@ public partial class Sample_GrafanaPrivateLinkResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_PrivateLinkResourcesGet() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateLinkResources_Get.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateLinkResources_Get.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateLinkResourceCollection.cs b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateLinkResourceCollection.cs index 7a05062e608c..52c002d13e20 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateLinkResourceCollection.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_GrafanaPrivateLinkResourceCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_GrafanaPrivateLinkResourceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_PrivateLinkResourcesList() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateLinkResources_List.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateLinkResources_List.json // this example is just showing the usage of "PrivateLinkResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_PrivateLinkResourcesList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_PrivateLinkResourcesGet() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateLinkResources_Get.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateLinkResources_Get.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_PrivateLinkResourcesGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_PrivateLinkResourcesGet() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateLinkResources_Get.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateLinkResources_Get.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Exists_PrivateLinkResourcesGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_PrivateLinkResourcesGet() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateLinkResources_Get.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateLinkResources_Get.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_ManagedGrafanaCollection.cs b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_ManagedGrafanaCollection.cs index d534c2e796ee..df40ba7dbe29 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_ManagedGrafanaCollection.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_ManagedGrafanaCollection.cs @@ -25,7 +25,7 @@ public partial class Sample_ManagedGrafanaCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GrafanaListByResourceGroup() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_ListByResourceGroup.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_ListByResourceGroup.json // this example is just showing the usage of "Grafana_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task GetAll_GrafanaListByResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GrafanaGet() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_Get.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_Get.json // this example is just showing the usage of "Grafana_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task Get_GrafanaGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GrafanaGet() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_Get.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_Get.json // this example is just showing the usage of "Grafana_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Exists_GrafanaGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GrafanaGet() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_Get.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_Get.json // this example is just showing the usage of "Grafana_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +167,7 @@ public async Task GetIfExists_GrafanaGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_GrafanaCreate() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_Create.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_Create.json // this example is just showing the usage of "Grafana_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -203,6 +203,27 @@ public async Task CreateOrUpdate_GrafanaCreate() MonitorWorkspaceResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"), } }, + EnterpriseConfigurations = new EnterpriseConfigurations() + { + MarketplacePlanId = "myPlanId", + MarketplaceAutoRenew = MarketplaceAutoRenew.Enabled, + }, + GrafanaConfigurationsSmtp = new Smtp() + { + Enabled = true, + Host = "smtp.sendemail.com:587", + User = "username", + Password = "", + FromAddress = "test@sendemail.com", + FromName = "emailsender", + StartTLSPolicy = StartTLSPolicy.OpportunisticStartTLS, + SkipVerify = true, + }, + GrafanaPlugins = +{ +["sample-plugin-id"] = new GrafanaPlugin(), +}, + GrafanaMajorVersion = "9", }, Identity = new ManagedServiceIdentity("SystemAssigned"), Tags = diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_ManagedGrafanaResource.cs b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_ManagedGrafanaResource.cs index b6ad1edece53..8e89a49042a6 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_ManagedGrafanaResource.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_ManagedGrafanaResource.cs @@ -24,7 +24,7 @@ public partial class Sample_ManagedGrafanaResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetManagedGrafanas_GrafanaList() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_List.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_List.json // this example is just showing the usage of "Grafana_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task GetManagedGrafanas_GrafanaList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GrafanaGet() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_Get.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_Get.json // this example is just showing the usage of "Grafana_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task Get_GrafanaGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_GrafanaUpdate() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_Update.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_Update.json // this example is just showing the usage of "Grafana_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,6 +106,7 @@ public async Task Update_GrafanaUpdate() // invoke the operation ManagedGrafanaPatch patch = new ManagedGrafanaPatch() { + SkuName = "Standard", Tags = { ["Environment"] = "Dev 2", @@ -121,6 +122,27 @@ public async Task Update_GrafanaUpdate() MonitorWorkspaceResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"), } }, + EnterpriseConfigurations = new EnterpriseConfigurations() + { + MarketplacePlanId = "myPlanId", + MarketplaceAutoRenew = MarketplaceAutoRenew.Enabled, + }, + GrafanaConfigurationsSmtp = new Smtp() + { + Enabled = true, + Host = "smtp.sendemail.com:587", + User = "username", + Password = "", + FromAddress = "test@sendemail.com", + FromName = "emailsender", + StartTLSPolicy = StartTLSPolicy.OpportunisticStartTLS, + SkipVerify = true, + }, + GrafanaPlugins = +{ +["sample-plugin-id"] = new GrafanaPlugin(), +}, + GrafanaMajorVersion = "9", }, }; ManagedGrafanaResource result = await managedGrafana.UpdateAsync(patch); @@ -137,7 +159,7 @@ public async Task Update_GrafanaUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_GrafanaDelete() { - // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_Delete.json + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_Delete.json // this example is just showing the usage of "Grafana_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -158,5 +180,89 @@ public async Task Delete_GrafanaDelete() Console.WriteLine($"Succeeded"); } + + // EnterpriseDetails_Post + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CheckEnterpriseDetails_EnterpriseDetailsPost() + { + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/EnterpriseDetails_Post.json + // this example is just showing the usage of "Grafana_CheckEnterpriseDetails" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ManagedGrafanaResource created on azure + // for more information of creating ManagedGrafanaResource, please refer to the document of ManagedGrafanaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string workspaceName = "myWorkspace"; + ResourceIdentifier managedGrafanaResourceId = ManagedGrafanaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + ManagedGrafanaResource managedGrafana = client.GetManagedGrafanaResource(managedGrafanaResourceId); + + // invoke the operation + EnterpriseDetails result = await managedGrafana.CheckEnterpriseDetailsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Grafana_FetchAvailablePlugins + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task FetchAvailablePlugins_GrafanaFetchAvailablePlugins() + { + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_FetchAvailablePlugins.json + // this example is just showing the usage of "Grafana_FetchAvailablePlugins" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ManagedGrafanaResource created on azure + // for more information of creating ManagedGrafanaResource, please refer to the document of ManagedGrafanaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string workspaceName = "myWorkspace"; + ResourceIdentifier managedGrafanaResourceId = ManagedGrafanaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + ManagedGrafanaResource managedGrafana = client.GetManagedGrafanaResource(managedGrafanaResourceId); + + // invoke the operation and iterate over the result + await foreach (GrafanaAvailablePlugin item in managedGrafana.FetchAvailablePluginsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // ManagedPrivateEndpoint_Refresh + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task RefreshManagedPrivateEndpoint_ManagedPrivateEndpointRefresh() + { + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Refresh.json + // this example is just showing the usage of "ManagedPrivateEndpoints_Refresh" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ManagedGrafanaResource created on azure + // for more information of creating ManagedGrafanaResource, please refer to the document of ManagedGrafanaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string workspaceName = "myWorkspace"; + ResourceIdentifier managedGrafanaResourceId = ManagedGrafanaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + ManagedGrafanaResource managedGrafana = client.GetManagedGrafanaResource(managedGrafanaResourceId); + + // invoke the operation + await managedGrafana.RefreshManagedPrivateEndpointAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_ManagedPrivateEndpointModelCollection.cs b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_ManagedPrivateEndpointModelCollection.cs new file mode 100644 index 000000000000..c02e18381f15 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_ManagedPrivateEndpointModelCollection.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.Grafana; + +namespace Azure.ResourceManager.Grafana.Samples +{ + public partial class Sample_ManagedPrivateEndpointModelCollection + { + // ManagedPrivateEndpoint_List + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ManagedPrivateEndpointList() + { + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_List.json + // this example is just showing the usage of "ManagedPrivateEndpoints_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ManagedGrafanaResource created on azure + // for more information of creating ManagedGrafanaResource, please refer to the document of ManagedGrafanaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string workspaceName = "myWorkspace"; + ResourceIdentifier managedGrafanaResourceId = ManagedGrafanaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + ManagedGrafanaResource managedGrafana = client.GetManagedGrafanaResource(managedGrafanaResourceId); + + // get the collection of this ManagedPrivateEndpointModelResource + ManagedPrivateEndpointModelCollection collection = managedGrafana.GetManagedPrivateEndpointModels(); + + // invoke the operation and iterate over the result + await foreach (ManagedPrivateEndpointModelResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ManagedPrivateEndpointModelData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // ManagedPrivateEndpoint_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_ManagedPrivateEndpointGet() + { + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Get.json + // this example is just showing the usage of "ManagedPrivateEndpoints_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ManagedGrafanaResource created on azure + // for more information of creating ManagedGrafanaResource, please refer to the document of ManagedGrafanaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string workspaceName = "myWorkspace"; + ResourceIdentifier managedGrafanaResourceId = ManagedGrafanaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + ManagedGrafanaResource managedGrafana = client.GetManagedGrafanaResource(managedGrafanaResourceId); + + // get the collection of this ManagedPrivateEndpointModelResource + ManagedPrivateEndpointModelCollection collection = managedGrafana.GetManagedPrivateEndpointModels(); + + // invoke the operation + string managedPrivateEndpointName = "myMPEName"; + ManagedPrivateEndpointModelResource result = await collection.GetAsync(managedPrivateEndpointName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ManagedPrivateEndpointModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // ManagedPrivateEndpoint_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_ManagedPrivateEndpointGet() + { + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Get.json + // this example is just showing the usage of "ManagedPrivateEndpoints_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ManagedGrafanaResource created on azure + // for more information of creating ManagedGrafanaResource, please refer to the document of ManagedGrafanaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string workspaceName = "myWorkspace"; + ResourceIdentifier managedGrafanaResourceId = ManagedGrafanaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + ManagedGrafanaResource managedGrafana = client.GetManagedGrafanaResource(managedGrafanaResourceId); + + // get the collection of this ManagedPrivateEndpointModelResource + ManagedPrivateEndpointModelCollection collection = managedGrafana.GetManagedPrivateEndpointModels(); + + // invoke the operation + string managedPrivateEndpointName = "myMPEName"; + bool result = await collection.ExistsAsync(managedPrivateEndpointName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // ManagedPrivateEndpoint_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_ManagedPrivateEndpointGet() + { + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Get.json + // this example is just showing the usage of "ManagedPrivateEndpoints_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ManagedGrafanaResource created on azure + // for more information of creating ManagedGrafanaResource, please refer to the document of ManagedGrafanaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string workspaceName = "myWorkspace"; + ResourceIdentifier managedGrafanaResourceId = ManagedGrafanaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + ManagedGrafanaResource managedGrafana = client.GetManagedGrafanaResource(managedGrafanaResourceId); + + // get the collection of this ManagedPrivateEndpointModelResource + ManagedPrivateEndpointModelCollection collection = managedGrafana.GetManagedPrivateEndpointModels(); + + // invoke the operation + string managedPrivateEndpointName = "myMPEName"; + NullableResponse response = await collection.GetIfExistsAsync(managedPrivateEndpointName); + ManagedPrivateEndpointModelResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ManagedPrivateEndpointModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // ManagedPrivateEndpoint_Create + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_ManagedPrivateEndpointCreate() + { + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Create.json + // this example is just showing the usage of "ManagedPrivateEndpoints_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ManagedGrafanaResource created on azure + // for more information of creating ManagedGrafanaResource, please refer to the document of ManagedGrafanaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string workspaceName = "myWorkspace"; + ResourceIdentifier managedGrafanaResourceId = ManagedGrafanaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + ManagedGrafanaResource managedGrafana = client.GetManagedGrafanaResource(managedGrafanaResourceId); + + // get the collection of this ManagedPrivateEndpointModelResource + ManagedPrivateEndpointModelCollection collection = managedGrafana.GetManagedPrivateEndpointModels(); + + // invoke the operation + string managedPrivateEndpointName = "myMPEName"; + ManagedPrivateEndpointModelData data = new ManagedPrivateEndpointModelData(new AzureLocation("West US")) + { + PrivateLinkResourceId = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-000000000000/resourceGroups/xx-rg/providers/Microsoft.Kusto/Clusters/sampleKustoResource", + PrivateLinkResourceRegion = "West US", + GroupIds = +{ +"grafana" +}, + RequestMessage = "Example Request Message", + PrivateLinkServiceUri = new Uri("my-self-hosted-influxdb.westus.mydomain.com"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, managedPrivateEndpointName, data); + ManagedPrivateEndpointModelResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ManagedPrivateEndpointModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_ManagedPrivateEndpointModelResource.cs b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_ManagedPrivateEndpointModelResource.cs new file mode 100644 index 000000000000..42db97146600 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/samples/Generated/Samples/Sample_ManagedPrivateEndpointModelResource.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.Grafana; +using Azure.ResourceManager.Grafana.Models; + +namespace Azure.ResourceManager.Grafana.Samples +{ + public partial class Sample_ManagedPrivateEndpointModelResource + { + // ManagedPrivateEndpoint_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_ManagedPrivateEndpointGet() + { + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Get.json + // this example is just showing the usage of "ManagedPrivateEndpoints_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ManagedPrivateEndpointModelResource created on azure + // for more information of creating ManagedPrivateEndpointModelResource, please refer to the document of ManagedPrivateEndpointModelResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string workspaceName = "myWorkspace"; + string managedPrivateEndpointName = "myMPEName"; + ResourceIdentifier managedPrivateEndpointModelResourceId = ManagedPrivateEndpointModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, managedPrivateEndpointName); + ManagedPrivateEndpointModelResource managedPrivateEndpointModel = client.GetManagedPrivateEndpointModelResource(managedPrivateEndpointModelResourceId); + + // invoke the operation + ManagedPrivateEndpointModelResource result = await managedPrivateEndpointModel.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ManagedPrivateEndpointModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // ManagedPrivateEndpoints_Patch + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_ManagedPrivateEndpointsPatch() + { + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Patch.json + // this example is just showing the usage of "ManagedPrivateEndpoints_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ManagedPrivateEndpointModelResource created on azure + // for more information of creating ManagedPrivateEndpointModelResource, please refer to the document of ManagedPrivateEndpointModelResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string workspaceName = "myWorkspace"; + string managedPrivateEndpointName = "myMPEName"; + ResourceIdentifier managedPrivateEndpointModelResourceId = ManagedPrivateEndpointModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, managedPrivateEndpointName); + ManagedPrivateEndpointModelResource managedPrivateEndpointModel = client.GetManagedPrivateEndpointModelResource(managedPrivateEndpointModelResourceId); + + // invoke the operation + ManagedPrivateEndpointModelPatch patch = new ManagedPrivateEndpointModelPatch() + { + Tags = +{ +["Environment"] = "Dev 2", +}, + }; + ArmOperation lro = await managedPrivateEndpointModel.UpdateAsync(WaitUntil.Completed, patch); + ManagedPrivateEndpointModelResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ManagedPrivateEndpointModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // ManagedPrivateEndpoint_Delete + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_ManagedPrivateEndpointDelete() + { + // Generated from example definition: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Delete.json + // this example is just showing the usage of "ManagedPrivateEndpoints_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ManagedPrivateEndpointModelResource created on azure + // for more information of creating ManagedPrivateEndpointModelResource, please refer to the document of ManagedPrivateEndpointModelResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string workspaceName = "myWorkspace"; + string managedPrivateEndpointName = "myMPEName"; + ResourceIdentifier managedPrivateEndpointModelResourceId = ManagedPrivateEndpointModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, managedPrivateEndpointName); + ManagedPrivateEndpointModelResource managedPrivateEndpointModel = client.GetManagedPrivateEndpointModelResource(managedPrivateEndpointModelResourceId); + + // invoke the operation + await managedPrivateEndpointModel.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ArmGrafanaModelFactory.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ArmGrafanaModelFactory.cs index 563ac10a77bc..288530617a8f 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ArmGrafanaModelFactory.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ArmGrafanaModelFactory.cs @@ -47,14 +47,19 @@ public static ManagedGrafanaData ManagedGrafanaData(ResourceIdentifier id = null /// The private endpoint connections of the Grafana instance. /// Scope for dns deterministic name hash calculation. /// GrafanaIntegrations is a bundled observability experience (e.g. pre-configured data source, tailored Grafana dashboards, alerting defaults) for common monitoring scenarios. + /// Enterprise settings of a Grafana instance. + /// Server configurations of a Grafana instance. + /// Installed plugin list of the Grafana instance. Key is plugin id, value is plugin definition. + /// The major Grafana software version to target. /// A new instance for mocking. - public static ManagedGrafanaProperties ManagedGrafanaProperties(GrafanaProvisioningState? provisioningState = null, string grafanaVersion = null, string endpoint = null, GrafanaPublicNetworkAccess? publicNetworkAccess = null, GrafanaZoneRedundancy? zoneRedundancy = null, GrafanaApiKey? apiKey = null, DeterministicOutboundIP? deterministicOutboundIP = null, IEnumerable outboundIPs = null, IEnumerable privateEndpointConnections = null, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = null, IEnumerable monitorWorkspaceIntegrations = null) + public static ManagedGrafanaProperties ManagedGrafanaProperties(GrafanaProvisioningState? provisioningState = null, string grafanaVersion = null, string endpoint = null, GrafanaPublicNetworkAccess? publicNetworkAccess = null, GrafanaZoneRedundancy? zoneRedundancy = null, GrafanaApiKey? apiKey = null, DeterministicOutboundIP? deterministicOutboundIP = null, IEnumerable outboundIPs = null, IEnumerable privateEndpointConnections = null, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = null, IEnumerable monitorWorkspaceIntegrations = null, EnterpriseConfigurations enterpriseConfigurations = null, Smtp grafanaConfigurationsSmtp = null, IDictionary grafanaPlugins = null, string grafanaMajorVersion = null) { outboundIPs ??= new List(); privateEndpointConnections ??= new List(); monitorWorkspaceIntegrations ??= new List(); + grafanaPlugins ??= new Dictionary(); - return new ManagedGrafanaProperties(provisioningState, grafanaVersion, endpoint, publicNetworkAccess, zoneRedundancy, apiKey, deterministicOutboundIP, outboundIPs?.ToList(), privateEndpointConnections?.ToList(), autoGeneratedDomainNameLabelScope, monitorWorkspaceIntegrations != null ? new GrafanaIntegrations(monitorWorkspaceIntegrations?.ToList()) : null); + return new ManagedGrafanaProperties(provisioningState, grafanaVersion, endpoint, publicNetworkAccess, zoneRedundancy, apiKey, deterministicOutboundIP, outboundIPs?.ToList(), privateEndpointConnections?.ToList(), autoGeneratedDomainNameLabelScope, monitorWorkspaceIntegrations != null ? new GrafanaIntegrations(monitorWorkspaceIntegrations?.ToList()) : null, enterpriseConfigurations, grafanaConfigurationsSmtp != null ? new GrafanaConfigurations(grafanaConfigurationsSmtp) : null, grafanaPlugins, grafanaMajorVersion); } /// Initializes a new instance of GrafanaPrivateEndpointConnectionData. @@ -74,6 +79,14 @@ public static GrafanaPrivateEndpointConnectionData GrafanaPrivateEndpointConnect return new GrafanaPrivateEndpointConnectionData(id, name, resourceType, systemData, privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, connectionState, groupIds?.ToList(), provisioningState); } + /// Initializes a new instance of GrafanaPlugin. + /// Grafana plugin id. + /// A new instance for mocking. + public static GrafanaPlugin GrafanaPlugin(string pluginId = null) + { + return new GrafanaPlugin(pluginId); + } + /// Initializes a new instance of GrafanaPrivateLinkResourceData. /// The id. /// The name. @@ -91,5 +104,88 @@ public static GrafanaPrivateLinkResourceData GrafanaPrivateLinkResourceData(Reso return new GrafanaPrivateLinkResourceData(id, name, resourceType, systemData, provisioningState, groupId, requiredMembers?.ToList(), requiredZoneNames?.ToList()); } + + /// Initializes a new instance of EnterpriseDetails. + /// SaaS subscription details of a Grafana instance. + /// The allocation details of the per subscription free trial slot of the subscription. + /// A new instance for mocking. + public static EnterpriseDetails EnterpriseDetails(SaasSubscriptionDetails saasSubscriptionDetails = null, MarketplaceTrialQuota marketplaceTrialQuota = null) + { + return new EnterpriseDetails(saasSubscriptionDetails, marketplaceTrialQuota); + } + + /// Initializes a new instance of SaasSubscriptionDetails. + /// The plan Id of the SaaS subscription. + /// The offer Id of the SaaS subscription. + /// The publisher Id of the SaaS subscription. + /// The billing term of the SaaS Subscription. + /// A new instance for mocking. + public static SaasSubscriptionDetails SaasSubscriptionDetails(string planId = null, string offerId = null, string publisherId = null, SubscriptionTerm term = null) + { + return new SaasSubscriptionDetails(planId, offerId, publisherId, term); + } + + /// Initializes a new instance of SubscriptionTerm. + /// The unit of the billing term. + /// The date and time in UTC of when the billing term starts. + /// The date and time in UTC of when the billing term ends. + /// A new instance for mocking. + public static SubscriptionTerm SubscriptionTerm(string termUnit = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null) + { + return new SubscriptionTerm(termUnit, startOn, endOn); + } + + /// Initializes a new instance of MarketplaceTrialQuota. + /// Available enterprise promotion for the subscription. + /// Resource Id of the Grafana resource which is doing the trial. + /// The date and time in UTC of when the trial starts. + /// The date and time in UTC of when the trial ends. + /// A new instance for mocking. + public static MarketplaceTrialQuota MarketplaceTrialQuota(AvailablePromotion? availablePromotion = null, ResourceIdentifier grafanaResourceId = null, DateTimeOffset? trialStartOn = null, DateTimeOffset? trialEndOn = null) + { + return new MarketplaceTrialQuota(availablePromotion, grafanaResourceId, trialStartOn, trialEndOn); + } + + /// Initializes a new instance of GrafanaAvailablePlugin. + /// Grafana plugin id. + /// Grafana plugin display name. + /// A new instance for mocking. + public static GrafanaAvailablePlugin GrafanaAvailablePlugin(string pluginId = null, string name = null) + { + return new GrafanaAvailablePlugin(pluginId, name); + } + + /// Initializes a new instance of ManagedPrivateEndpointModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Provisioning state of the resource. + /// The ARM resource ID of the resource for which the managed private endpoint is pointing to. + /// The region of the resource to which the managed private endpoint is pointing to. + /// The group Ids of the managed private endpoint. + /// User input request message of the managed private endpoint. + /// The state of managed private endpoint connection. + /// The URL of the data store behind the private link service. It would be the URL in the Grafana data source configuration page without the protocol and port. + /// The private IP of private endpoint after approval. This property is empty before connection is approved. + /// A new instance for mocking. + public static ManagedPrivateEndpointModelData ManagedPrivateEndpointModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GrafanaProvisioningState? provisioningState = null, string privateLinkResourceId = null, string privateLinkResourceRegion = null, IEnumerable groupIds = null, string requestMessage = null, ManagedPrivateEndpointConnectionState connectionState = null, Uri privateLinkServiceUri = null, string privateLinkServicePrivateIP = null) + { + tags ??= new Dictionary(); + groupIds ??= new List(); + + return new ManagedPrivateEndpointModelData(id, name, resourceType, systemData, tags, location, provisioningState, privateLinkResourceId, privateLinkResourceRegion, groupIds?.ToList(), requestMessage, connectionState, privateLinkServiceUri, privateLinkServicePrivateIP); + } + + /// Initializes a new instance of ManagedPrivateEndpointConnectionState. + /// The approval/rejection status of managed private endpoint connection. + /// Gets or sets the reason for approval/rejection of the connection. + /// A new instance for mocking. + public static ManagedPrivateEndpointConnectionState ManagedPrivateEndpointConnectionState(ManagedPrivateEndpointConnectionStatus? status = null, string description = null) + { + return new ManagedPrivateEndpointConnectionState(status, description); + } } } diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaExtensions.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaExtensions.cs index 31bbc71412cf..380e730a2cfb 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaExtensions.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaExtensions.cs @@ -106,6 +106,25 @@ public static GrafanaPrivateLinkResource GetGrafanaPrivateLinkResource(this ArmC } #endregion + #region ManagedPrivateEndpointModelResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ManagedPrivateEndpointModelResource GetManagedPrivateEndpointModelResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + ManagedPrivateEndpointModelResource.ValidateResourceId(id); + return new ManagedPrivateEndpointModelResource(client, id); + } + ); + } + #endregion + /// Gets a collection of ManagedGrafanaResources in the ResourceGroupResource. /// The instance the method will execute against. /// An object representing collection of ManagedGrafanaResources and their operations over a ManagedGrafanaResource. diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/LongRunningOperation/ManagedPrivateEndpointModelOperationSource.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/LongRunningOperation/ManagedPrivateEndpointModelOperationSource.cs new file mode 100644 index 000000000000..7a05e6a4f54f --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/LongRunningOperation/ManagedPrivateEndpointModelOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Grafana +{ + internal class ManagedPrivateEndpointModelOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ManagedPrivateEndpointModelOperationSource(ArmClient client) + { + _client = client; + } + + ManagedPrivateEndpointModelResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ManagedPrivateEndpointModelData.DeserializeManagedPrivateEndpointModelData(document.RootElement); + return new ManagedPrivateEndpointModelResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ManagedPrivateEndpointModelData.DeserializeManagedPrivateEndpointModelData(document.RootElement); + return new ManagedPrivateEndpointModelResource(_client, data); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedGrafanaResource.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedGrafanaResource.cs index 831be61daa7f..304be0614f4a 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedGrafanaResource.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedGrafanaResource.cs @@ -10,6 +10,7 @@ using System.Globalization; using System.Threading; using System.Threading.Tasks; +using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; @@ -36,6 +37,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _managedGrafanaGrafanaClientDiagnostics; private readonly GrafanaRestOperations _managedGrafanaGrafanaRestClient; + private readonly ClientDiagnostics _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics; + private readonly ManagedPrivateEndpointsRestOperations _managedPrivateEndpointModelManagedPrivateEndpointsRestClient; private readonly ManagedGrafanaData _data; /// Initializes a new instance of the class for mocking. @@ -60,6 +63,9 @@ internal ManagedGrafanaResource(ArmClient client, ResourceIdentifier id) : base( _managedGrafanaGrafanaClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Grafana", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string managedGrafanaGrafanaApiVersion); _managedGrafanaGrafanaRestClient = new GrafanaRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, managedGrafanaGrafanaApiVersion); + _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Grafana", ManagedPrivateEndpointModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ManagedPrivateEndpointModelResource.ResourceType, out string managedPrivateEndpointModelManagedPrivateEndpointsApiVersion); + _managedPrivateEndpointModelManagedPrivateEndpointsRestClient = new ManagedPrivateEndpointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, managedPrivateEndpointModelManagedPrivateEndpointsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -195,6 +201,59 @@ public virtual Response GetGrafanaPrivateLinkResourc return GetGrafanaPrivateLinkResources().Get(privateLinkResourceName, cancellationToken); } + /// Gets a collection of ManagedPrivateEndpointModelResources in the ManagedGrafana. + /// An object representing collection of ManagedPrivateEndpointModelResources and their operations over a ManagedPrivateEndpointModelResource. + public virtual ManagedPrivateEndpointModelCollection GetManagedPrivateEndpointModels() + { + return GetCachedClient(Client => new ManagedPrivateEndpointModelCollection(Client, Id)); + } + + /// + /// Get a specific managed private endpoint of a grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The managed private endpoint name of Azure Managed Grafana. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetManagedPrivateEndpointModelAsync(string managedPrivateEndpointName, CancellationToken cancellationToken = default) + { + return await GetManagedPrivateEndpointModels().GetAsync(managedPrivateEndpointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a specific managed private endpoint of a grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The managed private endpoint name of Azure Managed Grafana. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetManagedPrivateEndpointModel(string managedPrivateEndpointName, CancellationToken cancellationToken = default) + { + return GetManagedPrivateEndpointModels().Get(managedPrivateEndpointName, cancellationToken); + } + /// /// Get the properties of a specific workspace for Grafana resource. /// @@ -395,6 +454,174 @@ public virtual Response Update(ManagedGrafanaPatch patch } } + /// + /// Retrieve enterprise add-on details information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/checkEnterpriseDetails + /// + /// + /// Operation Id + /// Grafana_CheckEnterpriseDetails + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> CheckEnterpriseDetailsAsync(CancellationToken cancellationToken = default) + { + using var scope = _managedGrafanaGrafanaClientDiagnostics.CreateScope("ManagedGrafanaResource.CheckEnterpriseDetails"); + scope.Start(); + try + { + var response = await _managedGrafanaGrafanaRestClient.CheckEnterpriseDetailsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieve enterprise add-on details information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/checkEnterpriseDetails + /// + /// + /// Operation Id + /// Grafana_CheckEnterpriseDetails + /// + /// + /// + /// The cancellation token to use. + public virtual Response CheckEnterpriseDetails(CancellationToken cancellationToken = default) + { + using var scope = _managedGrafanaGrafanaClientDiagnostics.CreateScope("ManagedGrafanaResource.CheckEnterpriseDetails"); + scope.Start(); + try + { + var response = _managedGrafanaGrafanaRestClient.CheckEnterpriseDetails(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/fetchAvailablePlugins + /// + /// + /// Operation Id + /// Grafana_FetchAvailablePlugins + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable FetchAvailablePluginsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _managedGrafanaGrafanaRestClient.CreateFetchAvailablePluginsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, GrafanaAvailablePlugin.DeserializeGrafanaAvailablePlugin, _managedGrafanaGrafanaClientDiagnostics, Pipeline, "ManagedGrafanaResource.FetchAvailablePlugins", "value", null, cancellationToken); + } + + /// + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/fetchAvailablePlugins + /// + /// + /// Operation Id + /// Grafana_FetchAvailablePlugins + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable FetchAvailablePlugins(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _managedGrafanaGrafanaRestClient.CreateFetchAvailablePluginsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, GrafanaAvailablePlugin.DeserializeGrafanaAvailablePlugin, _managedGrafanaGrafanaClientDiagnostics, Pipeline, "ManagedGrafanaResource.FetchAvailablePlugins", "value", null, cancellationToken); + } + + /// + /// Refresh and sync managed private endpoints of a grafana resource to latest state. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/refreshManagedPrivateEndpoints + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Refresh + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task RefreshManagedPrivateEndpointAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedGrafanaResource.RefreshManagedPrivateEndpoint"); + scope.Start(); + try + { + var response = await _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.RefreshAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new GrafanaArmOperation(_managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics, Pipeline, _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.CreateRefreshRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Refresh and sync managed private endpoints of a grafana resource to latest state. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/refreshManagedPrivateEndpoints + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Refresh + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation RefreshManagedPrivateEndpoint(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedGrafanaResource.RefreshManagedPrivateEndpoint"); + scope.Start(); + try + { + var response = _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.Refresh(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new GrafanaArmOperation(_managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics, Pipeline, _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.CreateRefreshRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Add a tag to the current resource. /// diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedPrivateEndpointModelCollection.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedPrivateEndpointModelCollection.cs new file mode 100644 index 000000000000..c541939ee12d --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedPrivateEndpointModelCollection.cs @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Grafana +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetManagedPrivateEndpointModels method from an instance of . + /// + public partial class ManagedPrivateEndpointModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics; + private readonly ManagedPrivateEndpointsRestOperations _managedPrivateEndpointModelManagedPrivateEndpointsRestClient; + + /// Initializes a new instance of the class for mocking. + protected ManagedPrivateEndpointModelCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ManagedPrivateEndpointModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Grafana", ManagedPrivateEndpointModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ManagedPrivateEndpointModelResource.ResourceType, out string managedPrivateEndpointModelManagedPrivateEndpointsApiVersion); + _managedPrivateEndpointModelManagedPrivateEndpointsRestClient = new ManagedPrivateEndpointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, managedPrivateEndpointModelManagedPrivateEndpointsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ManagedGrafanaResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ManagedGrafanaResource.ResourceType), nameof(id)); + } + + /// + /// Create or update a managed private endpoint for a grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Create + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The managed private endpoint name of Azure Managed Grafana. + /// The managed private endpoint to be created or updated. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string managedPrivateEndpointName, ManagedPrivateEndpointModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedPrivateEndpointName, data, cancellationToken).ConfigureAwait(false); + var operation = new GrafanaArmOperation(new ManagedPrivateEndpointModelOperationSource(Client), _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics, Pipeline, _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedPrivateEndpointName, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a managed private endpoint for a grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Create + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The managed private endpoint name of Azure Managed Grafana. + /// The managed private endpoint to be created or updated. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string managedPrivateEndpointName, ManagedPrivateEndpointModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedPrivateEndpointName, data, cancellationToken); + var operation = new GrafanaArmOperation(new ManagedPrivateEndpointModelOperationSource(Client), _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics, Pipeline, _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedPrivateEndpointName, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a specific managed private endpoint of a grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The managed private endpoint name of Azure Managed Grafana. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string managedPrivateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelCollection.Get"); + scope.Start(); + try + { + var response = await _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedPrivateEndpointName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ManagedPrivateEndpointModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a specific managed private endpoint of a grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The managed private endpoint name of Azure Managed Grafana. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string managedPrivateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelCollection.Get"); + scope.Start(); + try + { + var response = _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedPrivateEndpointName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ManagedPrivateEndpointModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List all managed private endpoints of a grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_List + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedPrivateEndpointModelResource(Client, ManagedPrivateEndpointModelData.DeserializeManagedPrivateEndpointModelData(e)), _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics, Pipeline, "ManagedPrivateEndpointModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List all managed private endpoints of a grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_List + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedPrivateEndpointModelResource(Client, ManagedPrivateEndpointModelData.DeserializeManagedPrivateEndpointModelData(e)), _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics, Pipeline, "ManagedPrivateEndpointModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The managed private endpoint name of Azure Managed Grafana. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string managedPrivateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelCollection.Exists"); + scope.Start(); + try + { + var response = await _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedPrivateEndpointName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The managed private endpoint name of Azure Managed Grafana. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string managedPrivateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelCollection.Exists"); + scope.Start(); + try + { + var response = _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedPrivateEndpointName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The managed private endpoint name of Azure Managed Grafana. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string managedPrivateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedPrivateEndpointName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ManagedPrivateEndpointModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The managed private endpoint name of Azure Managed Grafana. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string managedPrivateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedPrivateEndpointName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ManagedPrivateEndpointModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedPrivateEndpointModelData.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedPrivateEndpointModelData.cs new file mode 100644 index 000000000000..2cffe650fe69 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedPrivateEndpointModelData.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Grafana.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Grafana +{ + /// + /// A class representing the ManagedPrivateEndpointModel data model. + /// The managed private endpoint resource type. + /// + public partial class ManagedPrivateEndpointModelData : TrackedResourceData + { + /// Initializes a new instance of ManagedPrivateEndpointModelData. + /// The location. + public ManagedPrivateEndpointModelData(AzureLocation location) : base(location) + { + GroupIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of ManagedPrivateEndpointModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Provisioning state of the resource. + /// The ARM resource ID of the resource for which the managed private endpoint is pointing to. + /// The region of the resource to which the managed private endpoint is pointing to. + /// The group Ids of the managed private endpoint. + /// User input request message of the managed private endpoint. + /// The state of managed private endpoint connection. + /// The URL of the data store behind the private link service. It would be the URL in the Grafana data source configuration page without the protocol and port. + /// The private IP of private endpoint after approval. This property is empty before connection is approved. + internal ManagedPrivateEndpointModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GrafanaProvisioningState? provisioningState, string privateLinkResourceId, string privateLinkResourceRegion, IList groupIds, string requestMessage, ManagedPrivateEndpointConnectionState connectionState, Uri privateLinkServiceUri, string privateLinkServicePrivateIP) : base(id, name, resourceType, systemData, tags, location) + { + ProvisioningState = provisioningState; + PrivateLinkResourceId = privateLinkResourceId; + PrivateLinkResourceRegion = privateLinkResourceRegion; + GroupIds = groupIds; + RequestMessage = requestMessage; + ConnectionState = connectionState; + PrivateLinkServiceUri = privateLinkServiceUri; + PrivateLinkServicePrivateIP = privateLinkServicePrivateIP; + } + + /// Provisioning state of the resource. + public GrafanaProvisioningState? ProvisioningState { get; } + /// The ARM resource ID of the resource for which the managed private endpoint is pointing to. + public string PrivateLinkResourceId { get; set; } + /// The region of the resource to which the managed private endpoint is pointing to. + public string PrivateLinkResourceRegion { get; set; } + /// The group Ids of the managed private endpoint. + public IList GroupIds { get; } + /// User input request message of the managed private endpoint. + public string RequestMessage { get; set; } + /// The state of managed private endpoint connection. + public ManagedPrivateEndpointConnectionState ConnectionState { get; } + /// The URL of the data store behind the private link service. It would be the URL in the Grafana data source configuration page without the protocol and port. + public Uri PrivateLinkServiceUri { get; set; } + /// The private IP of private endpoint after approval. This property is empty before connection is approved. + public string PrivateLinkServicePrivateIP { get; } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedPrivateEndpointModelResource.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedPrivateEndpointModelResource.cs new file mode 100644 index 000000000000..f7e6d8e3c274 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedPrivateEndpointModelResource.cs @@ -0,0 +1,609 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Grafana.Models; + +namespace Azure.ResourceManager.Grafana +{ + /// + /// A Class representing a ManagedPrivateEndpointModel along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetManagedPrivateEndpointModelResource method. + /// Otherwise you can get one from its parent resource using the GetManagedPrivateEndpointModel method. + /// + public partial class ManagedPrivateEndpointModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string managedPrivateEndpointName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics; + private readonly ManagedPrivateEndpointsRestOperations _managedPrivateEndpointModelManagedPrivateEndpointsRestClient; + private readonly ManagedPrivateEndpointModelData _data; + + /// Initializes a new instance of the class for mocking. + protected ManagedPrivateEndpointModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ManagedPrivateEndpointModelResource(ArmClient client, ManagedPrivateEndpointModelData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ManagedPrivateEndpointModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Grafana", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string managedPrivateEndpointModelManagedPrivateEndpointsApiVersion); + _managedPrivateEndpointModelManagedPrivateEndpointsRestClient = new ManagedPrivateEndpointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, managedPrivateEndpointModelManagedPrivateEndpointsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Dashboard/grafana/managedPrivateEndpoints"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ManagedPrivateEndpointModelData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a specific managed private endpoint of a grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelResource.Get"); + scope.Start(); + try + { + var response = await _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ManagedPrivateEndpointModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a specific managed private endpoint of a grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelResource.Get"); + scope.Start(); + try + { + var response = _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ManagedPrivateEndpointModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a managed private endpoint for a grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelResource.Delete"); + scope.Start(); + try + { + var response = await _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new GrafanaArmOperation(_managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics, Pipeline, _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a managed private endpoint for a grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelResource.Delete"); + scope.Start(); + try + { + var response = _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new GrafanaArmOperation(_managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics, Pipeline, _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a managed private endpoint for an existing grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Update + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Properties that can be updated to an existing managed private endpoint. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ManagedPrivateEndpointModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelResource.Update"); + scope.Start(); + try + { + var response = await _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new GrafanaArmOperation(new ManagedPrivateEndpointModelOperationSource(Client), _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics, Pipeline, _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a managed private endpoint for an existing grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Update + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Properties that can be updated to an existing managed private endpoint. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ManagedPrivateEndpointModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelResource.Update"); + scope.Start(); + try + { + var response = _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new GrafanaArmOperation(new ManagedPrivateEndpointModelOperationSource(Client), _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics, Pipeline, _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ManagedPrivateEndpointModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ManagedPrivateEndpointModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ManagedPrivateEndpointModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ManagedPrivateEndpointModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ManagedPrivateEndpointModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ManagedPrivateEndpointModelPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ManagedPrivateEndpointModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ManagedPrivateEndpointModelPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ManagedPrivateEndpointModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ManagedPrivateEndpointModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName} + /// + /// + /// Operation Id + /// ManagedPrivateEndpoints_Get + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _managedPrivateEndpointModelManagedPrivateEndpointsClientDiagnostics.CreateScope("ManagedPrivateEndpointModelResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _managedPrivateEndpointModelManagedPrivateEndpointsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ManagedPrivateEndpointModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ManagedPrivateEndpointModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/AvailablePromotion.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/AvailablePromotion.cs new file mode 100644 index 000000000000..8cd0522ecbe5 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/AvailablePromotion.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Grafana.Models +{ + /// The AvailablePromotion. + public readonly partial struct AvailablePromotion : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AvailablePromotion(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string FreeTrialValue = "FreeTrial"; + + /// None. + public static AvailablePromotion None { get; } = new AvailablePromotion(NoneValue); + /// FreeTrial. + public static AvailablePromotion FreeTrial { get; } = new AvailablePromotion(FreeTrialValue); + /// Determines if two values are the same. + public static bool operator ==(AvailablePromotion left, AvailablePromotion right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AvailablePromotion left, AvailablePromotion right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AvailablePromotion(string value) => new AvailablePromotion(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AvailablePromotion other && Equals(other); + /// + public bool Equals(AvailablePromotion other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/EnterpriseConfigurations.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/EnterpriseConfigurations.Serialization.cs new file mode 100644 index 000000000000..cc9c382eec04 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/EnterpriseConfigurations.Serialization.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Grafana.Models +{ + public partial class EnterpriseConfigurations : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(MarketplacePlanId)) + { + writer.WritePropertyName("marketplacePlanId"u8); + writer.WriteStringValue(MarketplacePlanId); + } + if (Optional.IsDefined(MarketplaceAutoRenew)) + { + writer.WritePropertyName("marketplaceAutoRenew"u8); + writer.WriteStringValue(MarketplaceAutoRenew.Value.ToString()); + } + writer.WriteEndObject(); + } + + internal static EnterpriseConfigurations DeserializeEnterpriseConfigurations(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional marketplacePlanId = default; + Optional marketplaceAutoRenew = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("marketplacePlanId"u8)) + { + marketplacePlanId = property.Value.GetString(); + continue; + } + if (property.NameEquals("marketplaceAutoRenew"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + marketplaceAutoRenew = new MarketplaceAutoRenew(property.Value.GetString()); + continue; + } + } + return new EnterpriseConfigurations(marketplacePlanId.Value, Optional.ToNullable(marketplaceAutoRenew)); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/EnterpriseConfigurations.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/EnterpriseConfigurations.cs new file mode 100644 index 000000000000..15e6c7d89e27 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/EnterpriseConfigurations.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Grafana.Models +{ + /// Enterprise settings of a Grafana instance. + public partial class EnterpriseConfigurations + { + /// Initializes a new instance of EnterpriseConfigurations. + public EnterpriseConfigurations() + { + } + + /// Initializes a new instance of EnterpriseConfigurations. + /// The Plan Id of the Azure Marketplace subscription for the Enterprise plugins. + /// The AutoRenew setting of the Enterprise subscription. + internal EnterpriseConfigurations(string marketplacePlanId, MarketplaceAutoRenew? marketplaceAutoRenew) + { + MarketplacePlanId = marketplacePlanId; + MarketplaceAutoRenew = marketplaceAutoRenew; + } + + /// The Plan Id of the Azure Marketplace subscription for the Enterprise plugins. + public string MarketplacePlanId { get; set; } + /// The AutoRenew setting of the Enterprise subscription. + public MarketplaceAutoRenew? MarketplaceAutoRenew { get; set; } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/EnterpriseDetails.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/EnterpriseDetails.Serialization.cs new file mode 100644 index 000000000000..2bcd67adca98 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/EnterpriseDetails.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Grafana.Models +{ + public partial class EnterpriseDetails + { + internal static EnterpriseDetails DeserializeEnterpriseDetails(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional saasSubscriptionDetails = default; + Optional marketplaceTrialQuota = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("saasSubscriptionDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + saasSubscriptionDetails = SaasSubscriptionDetails.DeserializeSaasSubscriptionDetails(property.Value); + continue; + } + if (property.NameEquals("marketplaceTrialQuota"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + marketplaceTrialQuota = MarketplaceTrialQuota.DeserializeMarketplaceTrialQuota(property.Value); + continue; + } + } + return new EnterpriseDetails(saasSubscriptionDetails.Value, marketplaceTrialQuota.Value); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/EnterpriseDetails.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/EnterpriseDetails.cs new file mode 100644 index 000000000000..e72517467c08 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/EnterpriseDetails.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Grafana.Models +{ + /// Enterprise details of a Grafana instance. + public partial class EnterpriseDetails + { + /// Initializes a new instance of EnterpriseDetails. + internal EnterpriseDetails() + { + } + + /// Initializes a new instance of EnterpriseDetails. + /// SaaS subscription details of a Grafana instance. + /// The allocation details of the per subscription free trial slot of the subscription. + internal EnterpriseDetails(SaasSubscriptionDetails saasSubscriptionDetails, MarketplaceTrialQuota marketplaceTrialQuota) + { + SaasSubscriptionDetails = saasSubscriptionDetails; + MarketplaceTrialQuota = marketplaceTrialQuota; + } + + /// SaaS subscription details of a Grafana instance. + public SaasSubscriptionDetails SaasSubscriptionDetails { get; } + /// The allocation details of the per subscription free trial slot of the subscription. + public MarketplaceTrialQuota MarketplaceTrialQuota { get; } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaAvailablePlugin.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaAvailablePlugin.Serialization.cs new file mode 100644 index 000000000000..64b39cf89f83 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaAvailablePlugin.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Grafana.Models +{ + public partial class GrafanaAvailablePlugin + { + internal static GrafanaAvailablePlugin DeserializeGrafanaAvailablePlugin(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional pluginId = default; + Optional name = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("pluginId"u8)) + { + pluginId = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + } + return new GrafanaAvailablePlugin(pluginId.Value, name.Value); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaAvailablePlugin.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaAvailablePlugin.cs new file mode 100644 index 000000000000..3153cc254348 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaAvailablePlugin.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Grafana.Models +{ + /// Available plugins of grafana. + public partial class GrafanaAvailablePlugin + { + /// Initializes a new instance of GrafanaAvailablePlugin. + internal GrafanaAvailablePlugin() + { + } + + /// Initializes a new instance of GrafanaAvailablePlugin. + /// Grafana plugin id. + /// Grafana plugin display name. + internal GrafanaAvailablePlugin(string pluginId, string name) + { + PluginId = pluginId; + Name = name; + } + + /// Grafana plugin id. + public string PluginId { get; } + /// Grafana plugin display name. + public string Name { get; } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaAvailablePluginListResponse.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaAvailablePluginListResponse.Serialization.cs new file mode 100644 index 000000000000..c7a857803ec3 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaAvailablePluginListResponse.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Grafana.Models +{ + internal partial class GrafanaAvailablePluginListResponse + { + internal static GrafanaAvailablePluginListResponse DeserializeGrafanaAvailablePluginListResponse(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(GrafanaAvailablePlugin.DeserializeGrafanaAvailablePlugin(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new GrafanaAvailablePluginListResponse(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaAvailablePluginListResponse.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaAvailablePluginListResponse.cs new file mode 100644 index 000000000000..a64d67237578 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaAvailablePluginListResponse.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Grafana.Models +{ + /// The GrafanaAvailablePluginListResponse. + internal partial class GrafanaAvailablePluginListResponse + { + /// Initializes a new instance of GrafanaAvailablePluginListResponse. + internal GrafanaAvailablePluginListResponse() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of GrafanaAvailablePluginListResponse. + /// + /// + internal GrafanaAvailablePluginListResponse(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Gets the value. + public IReadOnlyList Value { get; } + /// Gets the next link. + public string NextLink { get; } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaConfigurations.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaConfigurations.Serialization.cs new file mode 100644 index 000000000000..c1e849d4802c --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaConfigurations.Serialization.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Grafana.Models +{ + internal partial class GrafanaConfigurations : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Smtp)) + { + writer.WritePropertyName("smtp"u8); + writer.WriteObjectValue(Smtp); + } + writer.WriteEndObject(); + } + + internal static GrafanaConfigurations DeserializeGrafanaConfigurations(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional smtp = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("smtp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + smtp = Smtp.DeserializeSmtp(property.Value); + continue; + } + } + return new GrafanaConfigurations(smtp.Value); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaConfigurations.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaConfigurations.cs new file mode 100644 index 000000000000..de8c4047bbbc --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaConfigurations.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Grafana.Models +{ + /// Server configurations of a Grafana instance. + internal partial class GrafanaConfigurations + { + /// Initializes a new instance of GrafanaConfigurations. + public GrafanaConfigurations() + { + } + + /// Initializes a new instance of GrafanaConfigurations. + /// + /// Email server settings. + /// https://grafana.com/docs/grafana/v9.0/setup-grafana/configure-grafana/#smtp + /// + internal GrafanaConfigurations(Smtp smtp) + { + Smtp = smtp; + } + + /// + /// Email server settings. + /// https://grafana.com/docs/grafana/v9.0/setup-grafana/configure-grafana/#smtp + /// + public Smtp Smtp { get; set; } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaPlugin.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaPlugin.Serialization.cs new file mode 100644 index 000000000000..c5bbc592df0d --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaPlugin.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Grafana.Models +{ + public partial class GrafanaPlugin : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } + + internal static GrafanaPlugin DeserializeGrafanaPlugin(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional pluginId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("pluginId"u8)) + { + pluginId = property.Value.GetString(); + continue; + } + } + return new GrafanaPlugin(pluginId.Value); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaPlugin.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaPlugin.cs new file mode 100644 index 000000000000..d6e1c1b5659d --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/GrafanaPlugin.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Grafana.Models +{ + /// Plugin of Grafana. + public partial class GrafanaPlugin + { + /// Initializes a new instance of GrafanaPlugin. + public GrafanaPlugin() + { + } + + /// Initializes a new instance of GrafanaPlugin. + /// Grafana plugin id. + internal GrafanaPlugin(string pluginId) + { + PluginId = pluginId; + } + + /// Grafana plugin id. + public string PluginId { get; } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatch.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatch.Serialization.cs index 09b510a6995d..d72d4613dd8a 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatch.Serialization.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatch.Serialization.cs @@ -16,6 +16,11 @@ public partial class ManagedGrafanaPatch : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku); + } if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatch.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatch.cs index 75eddc6eff83..51a25635d389 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatch.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatch.cs @@ -20,6 +20,15 @@ public ManagedGrafanaPatch() Tags = new ChangeTrackingDictionary(); } + /// Gets or sets the sku. + internal ManagedGrafanaSku Sku { get; set; } + /// Gets or sets the sku name. + public string SkuName + { + get => Sku is null ? default : Sku.Name; + set => Sku = new ManagedGrafanaSku(value); + } + /// The managed identity of the grafana resource. public ManagedServiceIdentity Identity { get; set; } /// The new tags of the grafana resource. diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatchProperties.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatchProperties.Serialization.cs index 937607842576..4c368e502ff5 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatchProperties.Serialization.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatchProperties.Serialization.cs @@ -40,6 +40,32 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("grafanaIntegrations"u8); writer.WriteObjectValue(GrafanaIntegrations); } + if (Optional.IsDefined(EnterpriseConfigurations)) + { + writer.WritePropertyName("enterpriseConfigurations"u8); + writer.WriteObjectValue(EnterpriseConfigurations); + } + if (Optional.IsDefined(GrafanaConfigurations)) + { + writer.WritePropertyName("grafanaConfigurations"u8); + writer.WriteObjectValue(GrafanaConfigurations); + } + if (Optional.IsCollectionDefined(GrafanaPlugins)) + { + writer.WritePropertyName("grafanaPlugins"u8); + writer.WriteStartObject(); + foreach (var item in GrafanaPlugins) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(GrafanaMajorVersion)) + { + writer.WritePropertyName("grafanaMajorVersion"u8); + writer.WriteStringValue(GrafanaMajorVersion); + } writer.WriteEndObject(); } } diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatchProperties.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatchProperties.cs index 8fdcf27f02ad..a8fc760d434e 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatchProperties.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaPatchProperties.cs @@ -6,6 +6,7 @@ #nullable disable using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.Grafana.Models { @@ -15,6 +16,7 @@ public partial class ManagedGrafanaPatchProperties /// Initializes a new instance of ManagedGrafanaPatchProperties. public ManagedGrafanaPatchProperties() { + GrafanaPlugins = new ChangeTrackingDictionary(); } /// The zone redundancy setting of the Grafana instance. @@ -37,5 +39,29 @@ public IList MonitorWorkspaceIntegrations return GrafanaIntegrations.MonitorWorkspaceIntegrations; } } + + /// Enterprise settings of a Grafana instance. + public EnterpriseConfigurations EnterpriseConfigurations { get; set; } + /// Server configurations of a Grafana instance. + internal GrafanaConfigurations GrafanaConfigurations { get; set; } + /// + /// Email server settings. + /// https://grafana.com/docs/grafana/v9.0/setup-grafana/configure-grafana/#smtp + /// + public Smtp GrafanaConfigurationsSmtp + { + get => GrafanaConfigurations is null ? default : GrafanaConfigurations.Smtp; + set + { + if (GrafanaConfigurations is null) + GrafanaConfigurations = new GrafanaConfigurations(); + GrafanaConfigurations.Smtp = value; + } + } + + /// Update of Grafana plugin. Key is plugin id, value is plugin definition. If plugin definition is null, plugin with given plugin id will be removed. Otherwise, given plugin will be installed. + public IDictionary GrafanaPlugins { get; } + /// The major Grafana software version to target. + public string GrafanaMajorVersion { get; set; } } } diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaProperties.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaProperties.Serialization.cs index 7b881bd41b01..d7bb6f93a17a 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaProperties.Serialization.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaProperties.Serialization.cs @@ -47,6 +47,32 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("grafanaIntegrations"u8); writer.WriteObjectValue(GrafanaIntegrations); } + if (Optional.IsDefined(EnterpriseConfigurations)) + { + writer.WritePropertyName("enterpriseConfigurations"u8); + writer.WriteObjectValue(EnterpriseConfigurations); + } + if (Optional.IsDefined(GrafanaConfigurations)) + { + writer.WritePropertyName("grafanaConfigurations"u8); + writer.WriteObjectValue(GrafanaConfigurations); + } + if (Optional.IsCollectionDefined(GrafanaPlugins)) + { + writer.WritePropertyName("grafanaPlugins"u8); + writer.WriteStartObject(); + foreach (var item in GrafanaPlugins) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(GrafanaMajorVersion)) + { + writer.WritePropertyName("grafanaMajorVersion"u8); + writer.WriteStringValue(GrafanaMajorVersion); + } writer.WriteEndObject(); } @@ -67,6 +93,10 @@ internal static ManagedGrafanaProperties DeserializeManagedGrafanaProperties(Jso Optional> privateEndpointConnections = default; Optional autoGeneratedDomainNameLabelScope = default; Optional grafanaIntegrations = default; + Optional enterpriseConfigurations = default; + Optional grafanaConfigurations = default; + Optional> grafanaPlugins = default; + Optional grafanaMajorVersion = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("provisioningState"u8)) @@ -170,8 +200,45 @@ internal static ManagedGrafanaProperties DeserializeManagedGrafanaProperties(Jso grafanaIntegrations = GrafanaIntegrations.DeserializeGrafanaIntegrations(property.Value); continue; } + if (property.NameEquals("enterpriseConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enterpriseConfigurations = EnterpriseConfigurations.DeserializeEnterpriseConfigurations(property.Value); + continue; + } + if (property.NameEquals("grafanaConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + grafanaConfigurations = GrafanaConfigurations.DeserializeGrafanaConfigurations(property.Value); + continue; + } + if (property.NameEquals("grafanaPlugins"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, GrafanaPlugin.DeserializeGrafanaPlugin(property0.Value)); + } + grafanaPlugins = dictionary; + continue; + } + if (property.NameEquals("grafanaMajorVersion"u8)) + { + grafanaMajorVersion = property.Value.GetString(); + continue; + } } - return new ManagedGrafanaProperties(Optional.ToNullable(provisioningState), grafanaVersion.Value, endpoint.Value, Optional.ToNullable(publicNetworkAccess), Optional.ToNullable(zoneRedundancy), Optional.ToNullable(apiKey), Optional.ToNullable(deterministicOutboundIP), Optional.ToList(outboundIPs), Optional.ToList(privateEndpointConnections), Optional.ToNullable(autoGeneratedDomainNameLabelScope), grafanaIntegrations.Value); + return new ManagedGrafanaProperties(Optional.ToNullable(provisioningState), grafanaVersion.Value, endpoint.Value, Optional.ToNullable(publicNetworkAccess), Optional.ToNullable(zoneRedundancy), Optional.ToNullable(apiKey), Optional.ToNullable(deterministicOutboundIP), Optional.ToList(outboundIPs), Optional.ToList(privateEndpointConnections), Optional.ToNullable(autoGeneratedDomainNameLabelScope), grafanaIntegrations.Value, enterpriseConfigurations.Value, grafanaConfigurations.Value, Optional.ToDictionary(grafanaPlugins), grafanaMajorVersion.Value); } } } diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaProperties.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaProperties.cs index a6cbf9268aa3..fc1686ecbc54 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaProperties.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedGrafanaProperties.cs @@ -19,6 +19,7 @@ public ManagedGrafanaProperties() { OutboundIPs = new ChangeTrackingList(); PrivateEndpointConnections = new ChangeTrackingList(); + GrafanaPlugins = new ChangeTrackingDictionary(); } /// Initializes a new instance of ManagedGrafanaProperties. @@ -33,7 +34,11 @@ public ManagedGrafanaProperties() /// The private endpoint connections of the Grafana instance. /// Scope for dns deterministic name hash calculation. /// GrafanaIntegrations is a bundled observability experience (e.g. pre-configured data source, tailored Grafana dashboards, alerting defaults) for common monitoring scenarios. - internal ManagedGrafanaProperties(GrafanaProvisioningState? provisioningState, string grafanaVersion, string endpoint, GrafanaPublicNetworkAccess? publicNetworkAccess, GrafanaZoneRedundancy? zoneRedundancy, GrafanaApiKey? apiKey, DeterministicOutboundIP? deterministicOutboundIP, IReadOnlyList outboundIPs, IReadOnlyList privateEndpointConnections, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope, GrafanaIntegrations grafanaIntegrations) + /// Enterprise settings of a Grafana instance. + /// Server configurations of a Grafana instance. + /// Installed plugin list of the Grafana instance. Key is plugin id, value is plugin definition. + /// The major Grafana software version to target. + internal ManagedGrafanaProperties(GrafanaProvisioningState? provisioningState, string grafanaVersion, string endpoint, GrafanaPublicNetworkAccess? publicNetworkAccess, GrafanaZoneRedundancy? zoneRedundancy, GrafanaApiKey? apiKey, DeterministicOutboundIP? deterministicOutboundIP, IReadOnlyList outboundIPs, IReadOnlyList privateEndpointConnections, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope, GrafanaIntegrations grafanaIntegrations, EnterpriseConfigurations enterpriseConfigurations, GrafanaConfigurations grafanaConfigurations, IDictionary grafanaPlugins, string grafanaMajorVersion) { ProvisioningState = provisioningState; GrafanaVersion = grafanaVersion; @@ -46,6 +51,10 @@ internal ManagedGrafanaProperties(GrafanaProvisioningState? provisioningState, s PrivateEndpointConnections = privateEndpointConnections; AutoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; GrafanaIntegrations = grafanaIntegrations; + EnterpriseConfigurations = enterpriseConfigurations; + GrafanaConfigurations = grafanaConfigurations; + GrafanaPlugins = grafanaPlugins; + GrafanaMajorVersion = grafanaMajorVersion; } /// Provisioning state of the resource. @@ -80,5 +89,29 @@ public IList MonitorWorkspaceIntegrations return GrafanaIntegrations.MonitorWorkspaceIntegrations; } } + + /// Enterprise settings of a Grafana instance. + public EnterpriseConfigurations EnterpriseConfigurations { get; set; } + /// Server configurations of a Grafana instance. + internal GrafanaConfigurations GrafanaConfigurations { get; set; } + /// + /// Email server settings. + /// https://grafana.com/docs/grafana/v9.0/setup-grafana/configure-grafana/#smtp + /// + public Smtp GrafanaConfigurationsSmtp + { + get => GrafanaConfigurations is null ? default : GrafanaConfigurations.Smtp; + set + { + if (GrafanaConfigurations is null) + GrafanaConfigurations = new GrafanaConfigurations(); + GrafanaConfigurations.Smtp = value; + } + } + + /// Installed plugin list of the Grafana instance. Key is plugin id, value is plugin definition. + public IDictionary GrafanaPlugins { get; } + /// The major Grafana software version to target. + public string GrafanaMajorVersion { get; set; } } } diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointConnectionState.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointConnectionState.Serialization.cs new file mode 100644 index 000000000000..fb0e681aaf9a --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointConnectionState.Serialization.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Grafana.Models +{ + public partial class ManagedPrivateEndpointConnectionState + { + internal static ManagedPrivateEndpointConnectionState DeserializeManagedPrivateEndpointConnectionState(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional status = default; + Optional description = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new ManagedPrivateEndpointConnectionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + } + return new ManagedPrivateEndpointConnectionState(Optional.ToNullable(status), description.Value); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointConnectionState.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointConnectionState.cs new file mode 100644 index 000000000000..0d160a415b79 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointConnectionState.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Grafana.Models +{ + /// The state of managed private endpoint connection. + public partial class ManagedPrivateEndpointConnectionState + { + /// Initializes a new instance of ManagedPrivateEndpointConnectionState. + internal ManagedPrivateEndpointConnectionState() + { + } + + /// Initializes a new instance of ManagedPrivateEndpointConnectionState. + /// The approval/rejection status of managed private endpoint connection. + /// Gets or sets the reason for approval/rejection of the connection. + internal ManagedPrivateEndpointConnectionState(ManagedPrivateEndpointConnectionStatus? status, string description) + { + Status = status; + Description = description; + } + + /// The approval/rejection status of managed private endpoint connection. + public ManagedPrivateEndpointConnectionStatus? Status { get; } + /// Gets or sets the reason for approval/rejection of the connection. + public string Description { get; } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointConnectionStatus.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointConnectionStatus.cs new file mode 100644 index 000000000000..388baef691f1 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointConnectionStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Grafana.Models +{ + /// The approval/rejection status of managed private endpoint connection. + public readonly partial struct ManagedPrivateEndpointConnectionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedPrivateEndpointConnectionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "Pending"; + private const string ApprovedValue = "Approved"; + private const string RejectedValue = "Rejected"; + private const string DisconnectedValue = "Disconnected"; + + /// Pending. + public static ManagedPrivateEndpointConnectionStatus Pending { get; } = new ManagedPrivateEndpointConnectionStatus(PendingValue); + /// Approved. + public static ManagedPrivateEndpointConnectionStatus Approved { get; } = new ManagedPrivateEndpointConnectionStatus(ApprovedValue); + /// Rejected. + public static ManagedPrivateEndpointConnectionStatus Rejected { get; } = new ManagedPrivateEndpointConnectionStatus(RejectedValue); + /// Disconnected. + public static ManagedPrivateEndpointConnectionStatus Disconnected { get; } = new ManagedPrivateEndpointConnectionStatus(DisconnectedValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedPrivateEndpointConnectionStatus left, ManagedPrivateEndpointConnectionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedPrivateEndpointConnectionStatus left, ManagedPrivateEndpointConnectionStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ManagedPrivateEndpointConnectionStatus(string value) => new ManagedPrivateEndpointConnectionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedPrivateEndpointConnectionStatus other && Equals(other); + /// + public bool Equals(ManagedPrivateEndpointConnectionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointModelData.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointModelData.Serialization.cs new file mode 100644 index 000000000000..9ffe964049e8 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointModelData.Serialization.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Grafana.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Grafana +{ + public partial class ManagedPrivateEndpointModelData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(PrivateLinkResourceId)) + { + writer.WritePropertyName("privateLinkResourceId"u8); + writer.WriteStringValue(PrivateLinkResourceId); + } + if (Optional.IsDefined(PrivateLinkResourceRegion)) + { + writer.WritePropertyName("privateLinkResourceRegion"u8); + writer.WriteStringValue(PrivateLinkResourceRegion); + } + if (Optional.IsCollectionDefined(GroupIds)) + { + writer.WritePropertyName("groupIds"u8); + writer.WriteStartArray(); + foreach (var item in GroupIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(RequestMessage)) + { + writer.WritePropertyName("requestMessage"u8); + writer.WriteStringValue(RequestMessage); + } + if (Optional.IsDefined(PrivateLinkServiceUri)) + { + writer.WritePropertyName("privateLinkServiceUrl"u8); + writer.WriteStringValue(PrivateLinkServiceUri.AbsoluteUri); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ManagedPrivateEndpointModelData DeserializeManagedPrivateEndpointModelData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional provisioningState = default; + Optional privateLinkResourceId = default; + Optional privateLinkResourceRegion = default; + Optional> groupIds = default; + Optional requestMessage = default; + Optional connectionState = default; + Optional privateLinkServiceUrl = default; + Optional privateLinkServicePrivateIP = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new GrafanaProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("privateLinkResourceId"u8)) + { + privateLinkResourceId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("privateLinkResourceRegion"u8)) + { + privateLinkResourceRegion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("groupIds"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + groupIds = array; + continue; + } + if (property0.NameEquals("requestMessage"u8)) + { + requestMessage = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("connectionState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionState = ManagedPrivateEndpointConnectionState.DeserializeManagedPrivateEndpointConnectionState(property0.Value); + continue; + } + if (property0.NameEquals("privateLinkServiceUrl"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateLinkServiceUrl = new Uri(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("privateLinkServicePrivateIP"u8)) + { + privateLinkServicePrivateIP = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new ManagedPrivateEndpointModelData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, Optional.ToNullable(provisioningState), privateLinkResourceId.Value, privateLinkResourceRegion.Value, Optional.ToList(groupIds), requestMessage.Value, connectionState.Value, privateLinkServiceUrl.Value, privateLinkServicePrivateIP.Value); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointModelListResponse.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointModelListResponse.Serialization.cs new file mode 100644 index 000000000000..38d745716e2f --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointModelListResponse.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Grafana; + +namespace Azure.ResourceManager.Grafana.Models +{ + internal partial class ManagedPrivateEndpointModelListResponse + { + internal static ManagedPrivateEndpointModelListResponse DeserializeManagedPrivateEndpointModelListResponse(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ManagedPrivateEndpointModelData.DeserializeManagedPrivateEndpointModelData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ManagedPrivateEndpointModelListResponse(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointModelListResponse.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointModelListResponse.cs new file mode 100644 index 000000000000..b251f21a8d20 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointModelListResponse.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Grafana; + +namespace Azure.ResourceManager.Grafana.Models +{ + /// The list of managed private endpoints of a grafana resource. + internal partial class ManagedPrivateEndpointModelListResponse + { + /// Initializes a new instance of ManagedPrivateEndpointModelListResponse. + internal ManagedPrivateEndpointModelListResponse() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of ManagedPrivateEndpointModelListResponse. + /// + /// + internal ManagedPrivateEndpointModelListResponse(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Gets the value. + public IReadOnlyList Value { get; } + /// Gets the next link. + public string NextLink { get; } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointModelPatch.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointModelPatch.Serialization.cs new file mode 100644 index 000000000000..fe3936dbf15a --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointModelPatch.Serialization.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Grafana.Models +{ + public partial class ManagedPrivateEndpointModelPatch : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointModelPatch.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointModelPatch.cs new file mode 100644 index 000000000000..bd8d022226ab --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/ManagedPrivateEndpointModelPatch.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Grafana.Models +{ + /// The parameters for a PATCH request to a managed private endpoint. + public partial class ManagedPrivateEndpointModelPatch + { + /// Initializes a new instance of ManagedPrivateEndpointModelPatch. + public ManagedPrivateEndpointModelPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// The new tags of the managed private endpoint. + public IDictionary Tags { get; } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/MarketplaceAutoRenew.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/MarketplaceAutoRenew.cs new file mode 100644 index 000000000000..81b3b5847d84 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/MarketplaceAutoRenew.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Grafana.Models +{ + /// The AutoRenew setting of the Enterprise subscription. + public readonly partial struct MarketplaceAutoRenew : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MarketplaceAutoRenew(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DisabledValue = "Disabled"; + private const string EnabledValue = "Enabled"; + + /// Disabled. + public static MarketplaceAutoRenew Disabled { get; } = new MarketplaceAutoRenew(DisabledValue); + /// Enabled. + public static MarketplaceAutoRenew Enabled { get; } = new MarketplaceAutoRenew(EnabledValue); + /// Determines if two values are the same. + public static bool operator ==(MarketplaceAutoRenew left, MarketplaceAutoRenew right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MarketplaceAutoRenew left, MarketplaceAutoRenew right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MarketplaceAutoRenew(string value) => new MarketplaceAutoRenew(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MarketplaceAutoRenew other && Equals(other); + /// + public bool Equals(MarketplaceAutoRenew other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/MarketplaceTrialQuota.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/MarketplaceTrialQuota.Serialization.cs new file mode 100644 index 000000000000..3b989de58e3e --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/MarketplaceTrialQuota.Serialization.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Grafana.Models +{ + public partial class MarketplaceTrialQuota + { + internal static MarketplaceTrialQuota DeserializeMarketplaceTrialQuota(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional availablePromotion = default; + Optional grafanaResourceId = default; + Optional trialStartAt = default; + Optional trialEndAt = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("availablePromotion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availablePromotion = new AvailablePromotion(property.Value.GetString()); + continue; + } + if (property.NameEquals("grafanaResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + grafanaResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("trialStartAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + trialStartAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("trialEndAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + trialEndAt = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new MarketplaceTrialQuota(Optional.ToNullable(availablePromotion), grafanaResourceId.Value, Optional.ToNullable(trialStartAt), Optional.ToNullable(trialEndAt)); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/MarketplaceTrialQuota.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/MarketplaceTrialQuota.cs new file mode 100644 index 000000000000..41f12e3c2dad --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/MarketplaceTrialQuota.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Grafana.Models +{ + /// The allocation details of the per subscription free trial slot of the subscription. + public partial class MarketplaceTrialQuota + { + /// Initializes a new instance of MarketplaceTrialQuota. + internal MarketplaceTrialQuota() + { + } + + /// Initializes a new instance of MarketplaceTrialQuota. + /// Available enterprise promotion for the subscription. + /// Resource Id of the Grafana resource which is doing the trial. + /// The date and time in UTC of when the trial starts. + /// The date and time in UTC of when the trial ends. + internal MarketplaceTrialQuota(AvailablePromotion? availablePromotion, ResourceIdentifier grafanaResourceId, DateTimeOffset? trialStartOn, DateTimeOffset? trialEndOn) + { + AvailablePromotion = availablePromotion; + GrafanaResourceId = grafanaResourceId; + TrialStartOn = trialStartOn; + TrialEndOn = trialEndOn; + } + + /// Available enterprise promotion for the subscription. + public AvailablePromotion? AvailablePromotion { get; } + /// Resource Id of the Grafana resource which is doing the trial. + public ResourceIdentifier GrafanaResourceId { get; } + /// The date and time in UTC of when the trial starts. + public DateTimeOffset? TrialStartOn { get; } + /// The date and time in UTC of when the trial ends. + public DateTimeOffset? TrialEndOn { get; } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/SaasSubscriptionDetails.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/SaasSubscriptionDetails.Serialization.cs new file mode 100644 index 000000000000..4cfe1003be79 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/SaasSubscriptionDetails.Serialization.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Grafana.Models +{ + public partial class SaasSubscriptionDetails + { + internal static SaasSubscriptionDetails DeserializeSaasSubscriptionDetails(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional planId = default; + Optional offerId = default; + Optional publisherId = default; + Optional term = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("planId"u8)) + { + planId = property.Value.GetString(); + continue; + } + if (property.NameEquals("offerId"u8)) + { + offerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("publisherId"u8)) + { + publisherId = property.Value.GetString(); + continue; + } + if (property.NameEquals("term"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + term = SubscriptionTerm.DeserializeSubscriptionTerm(property.Value); + continue; + } + } + return new SaasSubscriptionDetails(planId.Value, offerId.Value, publisherId.Value, term.Value); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/SaasSubscriptionDetails.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/SaasSubscriptionDetails.cs new file mode 100644 index 000000000000..9e3aca51e97b --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/SaasSubscriptionDetails.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Grafana.Models +{ + /// SaaS subscription details of a Grafana instance. + public partial class SaasSubscriptionDetails + { + /// Initializes a new instance of SaasSubscriptionDetails. + internal SaasSubscriptionDetails() + { + } + + /// Initializes a new instance of SaasSubscriptionDetails. + /// The plan Id of the SaaS subscription. + /// The offer Id of the SaaS subscription. + /// The publisher Id of the SaaS subscription. + /// The billing term of the SaaS Subscription. + internal SaasSubscriptionDetails(string planId, string offerId, string publisherId, SubscriptionTerm term) + { + PlanId = planId; + OfferId = offerId; + PublisherId = publisherId; + Term = term; + } + + /// The plan Id of the SaaS subscription. + public string PlanId { get; } + /// The offer Id of the SaaS subscription. + public string OfferId { get; } + /// The publisher Id of the SaaS subscription. + public string PublisherId { get; } + /// The billing term of the SaaS Subscription. + public SubscriptionTerm Term { get; } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/Smtp.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/Smtp.Serialization.cs new file mode 100644 index 000000000000..35665b4fdcf0 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/Smtp.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Grafana.Models +{ + public partial class Smtp : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Host)) + { + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + } + if (Optional.IsDefined(User)) + { + writer.WritePropertyName("user"u8); + writer.WriteStringValue(User); + } + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + } + if (Optional.IsDefined(FromAddress)) + { + writer.WritePropertyName("fromAddress"u8); + writer.WriteStringValue(FromAddress); + } + if (Optional.IsDefined(FromName)) + { + writer.WritePropertyName("fromName"u8); + writer.WriteStringValue(FromName); + } + if (Optional.IsDefined(StartTLSPolicy)) + { + writer.WritePropertyName("startTLSPolicy"u8); + writer.WriteStringValue(StartTLSPolicy.Value.ToString()); + } + if (Optional.IsDefined(SkipVerify)) + { + writer.WritePropertyName("skipVerify"u8); + writer.WriteBooleanValue(SkipVerify.Value); + } + writer.WriteEndObject(); + } + + internal static Smtp DeserializeSmtp(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional enabled = default; + Optional host = default; + Optional user = default; + Optional password = default; + Optional fromAddress = default; + Optional fromName = default; + Optional startTLSPolicy = default; + Optional skipVerify = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("user"u8)) + { + user = property.Value.GetString(); + continue; + } + if (property.NameEquals("password"u8)) + { + password = property.Value.GetString(); + continue; + } + if (property.NameEquals("fromAddress"u8)) + { + fromAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("fromName"u8)) + { + fromName = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTLSPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTLSPolicy = new StartTLSPolicy(property.Value.GetString()); + continue; + } + if (property.NameEquals("skipVerify"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + skipVerify = property.Value.GetBoolean(); + continue; + } + } + return new Smtp(Optional.ToNullable(enabled), host.Value, user.Value, password.Value, fromAddress.Value, fromName.Value, Optional.ToNullable(startTLSPolicy), Optional.ToNullable(skipVerify)); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/Smtp.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/Smtp.cs new file mode 100644 index 000000000000..11865cd5926b --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/Smtp.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Grafana.Models +{ + /// + /// Email server settings. + /// https://grafana.com/docs/grafana/v9.0/setup-grafana/configure-grafana/#smtp + /// + public partial class Smtp + { + /// Initializes a new instance of Smtp. + public Smtp() + { + } + + /// Initializes a new instance of Smtp. + /// Enable this to allow Grafana to send email. Default is false. + /// SMTP server hostname with port, e.g. test.email.net:587. + /// User of SMTP auth. + /// Password of SMTP auth. If the password contains # or ;, then you have to wrap it with triple quotes. + /// + /// Address used when sending out emails + /// https://pkg.go.dev/net/mail#Address + /// + /// + /// Name to be used when sending out emails. Default is "Azure Managed Grafana Notification" + /// https://pkg.go.dev/net/mail#Address + /// + /// + /// The StartTLSPolicy setting of the SMTP configuration + /// https://pkg.go.dev/github.com/go-mail/mail#StartTLSPolicy + /// + /// + /// Verify SSL for SMTP server. Default is false + /// https://pkg.go.dev/crypto/tls#Config + /// + internal Smtp(bool? enabled, string host, string user, string password, string fromAddress, string fromName, StartTLSPolicy? startTLSPolicy, bool? skipVerify) + { + Enabled = enabled; + Host = host; + User = user; + Password = password; + FromAddress = fromAddress; + FromName = fromName; + StartTLSPolicy = startTLSPolicy; + SkipVerify = skipVerify; + } + + /// Enable this to allow Grafana to send email. Default is false. + public bool? Enabled { get; set; } + /// SMTP server hostname with port, e.g. test.email.net:587. + public string Host { get; set; } + /// User of SMTP auth. + public string User { get; set; } + /// Password of SMTP auth. If the password contains # or ;, then you have to wrap it with triple quotes. + public string Password { get; set; } + /// + /// Address used when sending out emails + /// https://pkg.go.dev/net/mail#Address + /// + public string FromAddress { get; set; } + /// + /// Name to be used when sending out emails. Default is "Azure Managed Grafana Notification" + /// https://pkg.go.dev/net/mail#Address + /// + public string FromName { get; set; } + /// + /// The StartTLSPolicy setting of the SMTP configuration + /// https://pkg.go.dev/github.com/go-mail/mail#StartTLSPolicy + /// + public StartTLSPolicy? StartTLSPolicy { get; set; } + /// + /// Verify SSL for SMTP server. Default is false + /// https://pkg.go.dev/crypto/tls#Config + /// + public bool? SkipVerify { get; set; } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/StartTLSPolicy.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/StartTLSPolicy.cs new file mode 100644 index 000000000000..b66332770d62 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/StartTLSPolicy.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Grafana.Models +{ + /// + /// The StartTLSPolicy setting of the SMTP configuration + /// https://pkg.go.dev/github.com/go-mail/mail#StartTLSPolicy + /// + public readonly partial struct StartTLSPolicy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StartTLSPolicy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OpportunisticStartTLSValue = "OpportunisticStartTLS"; + private const string MandatoryStartTLSValue = "MandatoryStartTLS"; + private const string NoStartTLSValue = "NoStartTLS"; + + /// OpportunisticStartTLS. + public static StartTLSPolicy OpportunisticStartTLS { get; } = new StartTLSPolicy(OpportunisticStartTLSValue); + /// MandatoryStartTLS. + public static StartTLSPolicy MandatoryStartTLS { get; } = new StartTLSPolicy(MandatoryStartTLSValue); + /// NoStartTLS. + public static StartTLSPolicy NoStartTLS { get; } = new StartTLSPolicy(NoStartTLSValue); + /// Determines if two values are the same. + public static bool operator ==(StartTLSPolicy left, StartTLSPolicy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StartTLSPolicy left, StartTLSPolicy right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator StartTLSPolicy(string value) => new StartTLSPolicy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StartTLSPolicy other && Equals(other); + /// + public bool Equals(StartTLSPolicy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/SubscriptionTerm.Serialization.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/SubscriptionTerm.Serialization.cs new file mode 100644 index 000000000000..6a8f85cb32c2 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/SubscriptionTerm.Serialization.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Grafana.Models +{ + public partial class SubscriptionTerm + { + internal static SubscriptionTerm DeserializeSubscriptionTerm(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional termUnit = default; + Optional startDate = default; + Optional endDate = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("termUnit"u8)) + { + termUnit = property.Value.GetString(); + continue; + } + if (property.NameEquals("startDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endDate = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new SubscriptionTerm(termUnit.Value, Optional.ToNullable(startDate), Optional.ToNullable(endDate)); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/SubscriptionTerm.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/SubscriptionTerm.cs new file mode 100644 index 000000000000..dbf60199cd17 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Models/SubscriptionTerm.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Grafana.Models +{ + /// The current billing term of the SaaS Subscription. + public partial class SubscriptionTerm + { + /// Initializes a new instance of SubscriptionTerm. + internal SubscriptionTerm() + { + } + + /// Initializes a new instance of SubscriptionTerm. + /// The unit of the billing term. + /// The date and time in UTC of when the billing term starts. + /// The date and time in UTC of when the billing term ends. + internal SubscriptionTerm(string termUnit, DateTimeOffset? startOn, DateTimeOffset? endOn) + { + TermUnit = termUnit; + StartOn = startOn; + EndOn = endOn; + } + + /// The unit of the billing term. + public string TermUnit { get; } + /// The date and time in UTC of when the billing term starts. + public DateTimeOffset? StartOn { get; } + /// The date and time in UTC of when the billing term ends. + public DateTimeOffset? EndOn { get; } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/RestOperations/GrafanaRestOperations.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/RestOperations/GrafanaRestOperations.cs index d675cc04f392..4a3e5dbbee57 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/RestOperations/GrafanaRestOperations.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/RestOperations/GrafanaRestOperations.cs @@ -33,7 +33,7 @@ public GrafanaRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-08-01"; + _apiVersion = apiVersion ?? "2023-09-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -497,6 +497,162 @@ public Response Delete(string subscriptionId, string resourceGroupName, string w } } + internal HttpMessage CreateCheckEnterpriseDetailsRequest(string subscriptionId, string resourceGroupName, string workspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Dashboard/grafana/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/checkEnterpriseDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieve enterprise add-on details information. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> CheckEnterpriseDetailsAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateCheckEnterpriseDetailsRequest(subscriptionId, resourceGroupName, workspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EnterpriseDetails value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EnterpriseDetails.DeserializeEnterpriseDetails(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieve enterprise add-on details information. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CheckEnterpriseDetails(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateCheckEnterpriseDetailsRequest(subscriptionId, resourceGroupName, workspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EnterpriseDetails value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EnterpriseDetails.DeserializeEnterpriseDetails(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateFetchAvailablePluginsRequest(string subscriptionId, string resourceGroupName, string workspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Dashboard/grafana/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/fetchAvailablePlugins", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> FetchAvailablePluginsAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateFetchAvailablePluginsRequest(subscriptionId, resourceGroupName, workspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GrafanaAvailablePluginListResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GrafanaAvailablePluginListResponse.DeserializeGrafanaAvailablePluginListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response FetchAvailablePlugins(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateFetchAvailablePluginsRequest(subscriptionId, resourceGroupName, workspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GrafanaAvailablePluginListResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GrafanaAvailablePluginListResponse.DeserializeGrafanaAvailablePluginListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/RestOperations/ManagedPrivateEndpointsRestOperations.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/RestOperations/ManagedPrivateEndpointsRestOperations.cs new file mode 100644 index 000000000000..005e19ea62e8 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/RestOperations/ManagedPrivateEndpointsRestOperations.cs @@ -0,0 +1,600 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Grafana.Models; + +namespace Azure.ResourceManager.Grafana +{ + internal partial class ManagedPrivateEndpointsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ManagedPrivateEndpointsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ManagedPrivateEndpointsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Dashboard/grafana/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/managedPrivateEndpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all managed private endpoints of a grafana resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ManagedPrivateEndpointModelListResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ManagedPrivateEndpointModelListResponse.DeserializeManagedPrivateEndpointModelListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all managed private endpoints of a grafana resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ManagedPrivateEndpointModelListResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ManagedPrivateEndpointModelListResponse.DeserializeManagedPrivateEndpointModelListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRefreshRequest(string subscriptionId, string resourceGroupName, string workspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Dashboard/grafana/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/refreshManagedPrivateEndpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Refresh and sync managed private endpoints of a grafana resource to latest state. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task RefreshAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateRefreshRequest(subscriptionId, resourceGroupName, workspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Refresh and sync managed private endpoints of a grafana resource to latest state. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Refresh(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateRefreshRequest(subscriptionId, resourceGroupName, workspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string managedPrivateEndpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Dashboard/grafana/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/managedPrivateEndpoints/", false); + uri.AppendPath(managedPrivateEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a specific managed private endpoint of a grafana resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The managed private endpoint name of Azure Managed Grafana. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string managedPrivateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, managedPrivateEndpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ManagedPrivateEndpointModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ManagedPrivateEndpointModelData.DeserializeManagedPrivateEndpointModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ManagedPrivateEndpointModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a specific managed private endpoint of a grafana resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The managed private endpoint name of Azure Managed Grafana. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string managedPrivateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, managedPrivateEndpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ManagedPrivateEndpointModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ManagedPrivateEndpointModelData.DeserializeManagedPrivateEndpointModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ManagedPrivateEndpointModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string managedPrivateEndpointName, ManagedPrivateEndpointModelData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Dashboard/grafana/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/managedPrivateEndpoints/", false); + uri.AppendPath(managedPrivateEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update a managed private endpoint for a grafana resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The managed private endpoint name of Azure Managed Grafana. + /// The managed private endpoint to be created or updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string managedPrivateEndpointName, ManagedPrivateEndpointModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, managedPrivateEndpointName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update a managed private endpoint for a grafana resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The managed private endpoint name of Azure Managed Grafana. + /// The managed private endpoint to be created or updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string workspaceName, string managedPrivateEndpointName, ManagedPrivateEndpointModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, managedPrivateEndpointName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string managedPrivateEndpointName, ManagedPrivateEndpointModelPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Dashboard/grafana/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/managedPrivateEndpoints/", false); + uri.AppendPath(managedPrivateEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a managed private endpoint for an existing grafana resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The managed private endpoint name of Azure Managed Grafana. + /// Properties that can be updated to an existing managed private endpoint. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string managedPrivateEndpointName, ManagedPrivateEndpointModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, workspaceName, managedPrivateEndpointName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a managed private endpoint for an existing grafana resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The managed private endpoint name of Azure Managed Grafana. + /// Properties that can be updated to an existing managed private endpoint. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string workspaceName, string managedPrivateEndpointName, ManagedPrivateEndpointModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, workspaceName, managedPrivateEndpointName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string managedPrivateEndpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Dashboard/grafana/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/managedPrivateEndpoints/", false); + uri.AppendPath(managedPrivateEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a managed private endpoint for a grafana resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The managed private endpoint name of Azure Managed Grafana. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string managedPrivateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, managedPrivateEndpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a managed private endpoint for a grafana resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The managed private endpoint name of Azure Managed Grafana. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string managedPrivateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(managedPrivateEndpointName, nameof(managedPrivateEndpointName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, managedPrivateEndpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all managed private endpoints of a grafana resource. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ManagedPrivateEndpointModelListResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ManagedPrivateEndpointModelListResponse.DeserializeManagedPrivateEndpointModelListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all managed private endpoints of a grafana resource. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The workspace name of Azure Managed Grafana. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ManagedPrivateEndpointModelListResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ManagedPrivateEndpointModelListResponse.DeserializeManagedPrivateEndpointModelListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 5b810b112c9b..ba2a8d7348a1 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -33,7 +33,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-08-01"; + _apiVersion = apiVersion ?? "2023-09-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index b9c8f496ba27..f3aed9f02204 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -33,7 +33,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-08-01"; + _apiVersion = apiVersion ?? "2023-09-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/autorest.md b/sdk/grafana/Azure.ResourceManager.Grafana/src/autorest.md index 3cce3b1d1064..5e163fc2cade 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/autorest.md +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: Grafana namespace: Azure.ResourceManager.Grafana -require: https://github.com/Azure/azure-rest-api-specs/blob/6080b0126065467abbb3e096b25ed4ad6c22fa1f/specification/dashboard/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/31410201ec0d7c04df35e33221baa87bfc03cb63/specification/dashboard/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: