< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\StorageBlobCreatedEventData.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\StorageBlobCreatedEventData.Serialization.cs
Covered lines:57
Uncovered lines:20
Coverable lines:77
Total lines:167
Line coverage:74% (57 of 77)
Covered branches:21
Total branches:26
Branch coverage:80.7% (21 of 26)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Api()-0%100%
get_ClientRequestId()-0%100%
get_RequestId()-0%100%
get_ETag()-0%100%
get_ContentType()-0%100%
get_ContentLength()-0%100%
get_ContentOffset()-0%100%
get_BlobType()-0%100%
get_Url()-100%100%
get_Sequencer()-0%100%
get_Identity()-0%100%
get_StorageDiagnostics()-0%100%
DeserializeStorageBlobCreatedEventData(...)-85.71%80.77%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\StorageBlobCreatedEventData.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8namespace Azure.Messaging.EventGrid.SystemEvents
 9{
 10    /// <summary> Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobCreated event. </summary
 11    public partial class StorageBlobCreatedEventData
 12    {
 13        /// <summary> Initializes a new instance of StorageBlobCreatedEventData. </summary>
 014        internal StorageBlobCreatedEventData()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of StorageBlobCreatedEventData. </summary>
 19        /// <param name="api"> The name of the API/operation that triggered this event. </param>
 20        /// <param name="clientRequestId"> A request id provided by the client of the storage API operation that trigger
 21        /// <param name="requestId"> The request id generated by the Storage service for the storage API operation that 
 22        /// <param name="eTag"> The etag of the blob at the time this event was triggered. </param>
 23        /// <param name="contentType"> The content type of the blob. This is the same as what would be returned in the C
 24        /// <param name="contentLength"> The size of the blob in bytes. This is the same as what would be returned in th
 25        /// <param name="contentOffset"> The offset of the blob in bytes. </param>
 26        /// <param name="blobType"> The type of blob. </param>
 27        /// <param name="url"> The path to the blob. </param>
 28        /// <param name="sequencer"> An opaque string value representing the logical sequence of events for any particul
 29        /// <param name="identity"> The identity of the requester that triggered this event. </param>
 30        /// <param name="storageDiagnostics"> For service use only. Diagnostic data occasionally included by the Azure S
 631        internal StorageBlobCreatedEventData(string api, string clientRequestId, string requestId, string eTag, string c
 32        {
 633            Api = api;
 634            ClientRequestId = clientRequestId;
 635            RequestId = requestId;
 636            ETag = eTag;
 637            ContentType = contentType;
 638            ContentLength = contentLength;
 639            ContentOffset = contentOffset;
 640            BlobType = blobType;
 641            Url = url;
 642            Sequencer = sequencer;
 643            Identity = identity;
 644            StorageDiagnostics = storageDiagnostics;
 645        }
 46
 47        /// <summary> The name of the API/operation that triggered this event. </summary>
 048        public string Api { get; }
 49        /// <summary> A request id provided by the client of the storage API operation that triggered this event. </summ
 050        public string ClientRequestId { get; }
 51        /// <summary> The request id generated by the Storage service for the storage API operation that triggered this 
 052        public string RequestId { get; }
 53        /// <summary> The etag of the blob at the time this event was triggered. </summary>
 054        public string ETag { get; }
 55        /// <summary> The content type of the blob. This is the same as what would be returned in the Content-Type heade
 056        public string ContentType { get; }
 57        /// <summary> The size of the blob in bytes. This is the same as what would be returned in the Content-Length he
 058        public long? ContentLength { get; }
 59        /// <summary> The offset of the blob in bytes. </summary>
 060        public long? ContentOffset { get; }
 61        /// <summary> The type of blob. </summary>
 062        public string BlobType { get; }
 63        /// <summary> The path to the blob. </summary>
 264        public string Url { get; }
 65        /// <summary> An opaque string value representing the logical sequence of events for any particular blob name. U
 066        public string Sequencer { get; }
 67        /// <summary> The identity of the requester that triggered this event. </summary>
 068        public string Identity { get; }
 69        /// <summary> For service use only. Diagnostic data occasionally included by the Azure Storage service. This pro
 070        public object StorageDiagnostics { get; }
 71    }
 72}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\StorageBlobCreatedEventData.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.Messaging.EventGrid.SystemEvents
 12{
 13    public partial class StorageBlobCreatedEventData
 14    {
 15        internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventData(JsonElement element)
 16        {
 617            Optional<string> api = default;
 618            Optional<string> clientRequestId = default;
 619            Optional<string> requestId = default;
 620            Optional<string> eTag = default;
 621            Optional<string> contentType = default;
 622            Optional<long> contentLength = default;
 623            Optional<long> contentOffset = default;
 624            Optional<string> blobType = default;
 625            Optional<string> url = default;
 626            Optional<string> sequencer = default;
 627            Optional<string> identity = default;
 628            Optional<object> storageDiagnostics = default;
 12029            foreach (var property in element.EnumerateObject())
 30            {
 5431                if (property.NameEquals("api"))
 32                {
 633                    api = property.Value.GetString();
 634                    continue;
 35                }
 4836                if (property.NameEquals("clientRequestId"))
 37                {
 638                    clientRequestId = property.Value.GetString();
 639                    continue;
 40                }
 4241                if (property.NameEquals("requestId"))
 42                {
 643                    requestId = property.Value.GetString();
 644                    continue;
 45                }
 3646                if (property.NameEquals("eTag"))
 47                {
 648                    eTag = property.Value.GetString();
 649                    continue;
 50                }
 3051                if (property.NameEquals("contentType"))
 52                {
 653                    contentType = property.Value.GetString();
 654                    continue;
 55                }
 2456                if (property.NameEquals("contentLength"))
 57                {
 658                    contentLength = property.Value.GetInt64();
 659                    continue;
 60                }
 1861                if (property.NameEquals("contentOffset"))
 62                {
 063                    contentOffset = property.Value.GetInt64();
 064                    continue;
 65                }
 1866                if (property.NameEquals("blobType"))
 67                {
 668                    blobType = property.Value.GetString();
 669                    continue;
 70                }
 1271                if (property.NameEquals("url"))
 72                {
 673                    url = property.Value.GetString();
 674                    continue;
 75                }
 676                if (property.NameEquals("sequencer"))
 77                {
 678                    sequencer = property.Value.GetString();
 679                    continue;
 80                }
 081                if (property.NameEquals("identity"))
 82                {
 083                    identity = property.Value.GetString();
 084                    continue;
 85                }
 086                if (property.NameEquals("storageDiagnostics"))
 87                {
 088                    storageDiagnostics = property.Value.GetObject();
 89                    continue;
 90                }
 91            }
 692            return new StorageBlobCreatedEventData(api.Value, clientRequestId.Value, requestId.Value, eTag.Value, conten
 93        }
 94    }
 95}