Skip to content

Commit

Permalink
Fix Tags property (#39776)
Browse files Browse the repository at this point in the history
* Fix Tags property

* Generate API and fix model factory
  • Loading branch information
JoshLove-msft authored Nov 7, 2023
1 parent 1efa389 commit f2f704a
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ public static partial class EventGridModelFactory
public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData ResourceNotificationsResourceDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null) { throw null; }
public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementCreatedOrUpdatedEventData ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; }
public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementDeletedEventData ResourceNotificationsResourceManagementDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null) { throw null; }
public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails ResourceNotificationsResourceUpdatedDetails(string id = null, string name = null, string resourceType = null, string location = null, System.Collections.Generic.IReadOnlyDictionary<string, string> resourceTags = null, System.Collections.Generic.IReadOnlyDictionary<string, object> properties = null) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails ResourceNotificationsResourceUpdatedDetails(string id = null, string name = null, string resourceType = null, string location = null, string tags = null, System.Collections.Generic.IReadOnlyDictionary<string, object> properties = null) { throw null; }
public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData ResourceNotificationsResourceUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; }
public static Azure.Messaging.EventGrid.SystemEvents.ResourceWriteCancelEventData ResourceWriteCancelEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, string authorization = null, string claims = null, string correlationId = null, string httpRequest = null) { throw null; }
Expand Down Expand Up @@ -2876,8 +2878,10 @@ internal ResourceNotificationsResourceUpdatedDetails() { }
public string Name { get { throw null; } }
public System.Collections.Generic.IReadOnlyDictionary<string, object> Properties { get { throw null; } }
public Azure.Core.ResourceIdentifier Resource { get { throw null; } }
public System.Collections.Generic.IReadOnlyDictionary<string, string> ResourceTags { get { throw null; } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public string ResourceType { get { throw null; } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public string Tags { get { throw null; } }
}
public partial class ResourceNotificationsResourceUpdatedEventData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,26 @@ public static AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string

return new AcsRouterJobReceivedEventData(jobId, channelReference, channelId, queueId, labels, tags, status, classificationPolicyId, priority, requestedWorkerSelectors?.ToList(), scheduledOn, unavailableForMatching);
}

/// <summary> Initializes a new instance of ResourceNotificationsResourceUpdatedDetails. </summary>
/// <param name="id"> id of the resource for which the event is being emitted. </param>
/// <param name="name"> name of the resource for which the event is being emitted. </param>
/// <param name="resourceType"> the type of the resource for which the event is being emitted. </param>
/// <param name="location"> the location of the resource for which the event is being emitted. </param>
/// <param name="tags"> the tags on the resource for which the event is being emitted. </param>
/// <param name="properties"> properties in the payload of the resource for which the event is being emitted. </param>
/// <returns> A new <see cref="SystemEvents.ResourceNotificationsResourceUpdatedDetails"/> instance for mocking. </returns>
[EditorBrowsable(EditorBrowsableState.Never)]
public static ResourceNotificationsResourceUpdatedDetails ResourceNotificationsResourceUpdatedDetails(string id = null, string name = null, string resourceType = null, string location = null, string tags = null, IReadOnlyDictionary<string, object> properties = null)
{
properties ??= new Dictionary<string, object>();

return new ResourceNotificationsResourceUpdatedDetails(id, name, resourceType, location,
new Dictionary<string, string>(), properties)
{
Tags = tags
};
}
}
#pragma warning restore CA1054 // URI-like parameters should not be strings
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;
using System.ComponentModel;
using Azure.Core;

Expand Down Expand Up @@ -41,5 +42,13 @@ public ResourceIdentifier Resource
/// <summary> the location of the resource for which the event is being emitted. </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public string Location { get; }

/// <summary> the tags on the resource for which the event is being emitted. </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public string Tags { get; internal set; }

/// <summary> the tags on the resource for which the event is being emitted. </summary>
[CodeGenMember("Tags")]
public IReadOnlyDictionary<string, string> ResourceTags { get; }
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code.

``` yaml
title: EventGridClient
require: https://github.com/Azure/azure-rest-api-specs/blob/b7a863f0edae81b8261b7029caf833f2bee2ec99/specification/eventgrid/data-plane/readme.md
require: https://github.com/Azure/azure-rest-api-specs/blob/11bbc2b1df2e915a2227a6a1a48a27b9e67c3311/specification/eventgrid/data-plane/readme.md
generation1-convenience-client: true
model-factory-for-hlc:
- MediaJobOutputAsset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4375,7 +4375,7 @@ public void ConsumeCloudEventResourceCreatedOrUpdatedEvent()
""subject"": ""/subscriptions/{subscription-id}/resourceGroups/{rg-name}/providers/Microsoft.Storage/storageAccounts/{storageAccount-name}"",
""data"": {
""resourceInfo"": {
""tags"": """",
""tags"": {},
""id"": ""/subscriptions/319a9601-1ec0-0000-aebc-8fe82724c81e/resourceGroups/{rg-name}/providers/Microsoft.Storage/storageAccounts/{storageAccount-name}"",
""name"": ""StorageAccount-name"",
""type"": ""Microsoft.Storage/storageAccounts"",
Expand Down

0 comments on commit f2f704a

Please sign in to comment.