< Summary

Class:Azure.ResourceManager.Storage.Models.AccountSasParameters
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\AccountSasParameters.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\AccountSasParameters.Serialization.cs
Covered lines:35
Uncovered lines:12
Coverable lines:47
Total lines:115
Line coverage:74.4% (35 of 47)
Covered branches:7
Total branches:8
Branch coverage:87.5% (7 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
.ctor(...)-0%100%
get_Services()-100%100%
get_ResourceTypes()-100%100%
get_Permissions()-100%100%
get_IPAddressOrRange()-100%100%
get_Protocols()-100%100%
get_SharedAccessStartTime()-100%100%
get_SharedAccessExpiryTime()-100%100%
get_KeyToSign()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-91.3%87.5%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\AccountSasParameters.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;
 9
 10namespace Azure.ResourceManager.Storage.Models
 11{
 12    /// <summary> The parameters to list SAS credentials of a storage account. </summary>
 13    public partial class AccountSasParameters
 14    {
 15        /// <summary> Initializes a new instance of AccountSasParameters. </summary>
 16        /// <param name="services"> The signed services accessible with the account SAS. Possible values include: Blob (
 17        /// <param name="resourceTypes"> The signed resource types that are accessible with the account SAS. Service (s)
 18        /// <param name="permissions"> The signed permissions for the account SAS. Possible values include: Read (r), Wr
 19        /// <param name="sharedAccessExpiryTime"> The time at which the shared access signature becomes invalid. </param
 2020        public AccountSasParameters(Services services, SignedResourceTypes resourceTypes, Permissions permissions, DateT
 21        {
 2022            Services = services;
 2023            ResourceTypes = resourceTypes;
 2024            Permissions = permissions;
 2025            SharedAccessExpiryTime = sharedAccessExpiryTime;
 2026        }
 27
 28        /// <summary> Initializes a new instance of AccountSasParameters. </summary>
 29        /// <param name="services"> The signed services accessible with the account SAS. Possible values include: Blob (
 30        /// <param name="resourceTypes"> The signed resource types that are accessible with the account SAS. Service (s)
 31        /// <param name="permissions"> The signed permissions for the account SAS. Possible values include: Read (r), Wr
 32        /// <param name="iPAddressOrRange"> An IP address or a range of IP addresses from which to accept requests. </pa
 33        /// <param name="protocols"> The protocol permitted for a request made with the account SAS. </param>
 34        /// <param name="sharedAccessStartTime"> The time at which the SAS becomes valid. </param>
 35        /// <param name="sharedAccessExpiryTime"> The time at which the shared access signature becomes invalid. </param
 36        /// <param name="keyToSign"> The key to sign the account SAS token with. </param>
 037        internal AccountSasParameters(Services services, SignedResourceTypes resourceTypes, Permissions permissions, str
 38        {
 039            Services = services;
 040            ResourceTypes = resourceTypes;
 041            Permissions = permissions;
 042            IPAddressOrRange = iPAddressOrRange;
 043            Protocols = protocols;
 044            SharedAccessStartTime = sharedAccessStartTime;
 045            SharedAccessExpiryTime = sharedAccessExpiryTime;
 046            KeyToSign = keyToSign;
 047        }
 48
 49        /// <summary> The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q),
 2850        public Services Services { get; }
 51        /// <summary> The signed resource types that are accessible with the account SAS. Service (s): Access to service
 2852        public SignedResourceTypes ResourceTypes { get; }
 53        /// <summary> The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (
 2854        public Permissions Permissions { get; }
 55        /// <summary> An IP address or a range of IP addresses from which to accept requests. </summary>
 2056        public string IPAddressOrRange { get; set; }
 57        /// <summary> The protocol permitted for a request made with the account SAS. </summary>
 3658        public HttpProtocol? Protocols { get; set; }
 59        /// <summary> The time at which the SAS becomes valid. </summary>
 3260        public DateTimeOffset? SharedAccessStartTime { get; set; }
 61        /// <summary> The time at which the shared access signature becomes invalid. </summary>
 2062        public DateTimeOffset SharedAccessExpiryTime { get; }
 63        /// <summary> The key to sign the account SAS token with. </summary>
 2064        public string KeyToSign { get; set; }
 65    }
 66}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\AccountSasParameters.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.ResourceManager.Storage.Models
 12{
 13    public partial class AccountSasParameters : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 1217            writer.WriteStartObject();
 1218            writer.WritePropertyName("signedServices");
 1219            writer.WriteStringValue(Services.ToString());
 1220            writer.WritePropertyName("signedResourceTypes");
 1221            writer.WriteStringValue(ResourceTypes.ToString());
 1222            writer.WritePropertyName("signedPermission");
 1223            writer.WriteStringValue(Permissions.ToString());
 1224            if (IPAddressOrRange != null)
 25            {
 026                writer.WritePropertyName("signedIp");
 027                writer.WriteStringValue(IPAddressOrRange);
 28            }
 1229            if (Protocols != null)
 30            {
 431                writer.WritePropertyName("signedProtocol");
 432                writer.WriteStringValue(Protocols.Value.ToSerialString());
 33            }
 1234            if (SharedAccessStartTime != null)
 35            {
 436                writer.WritePropertyName("signedStart");
 437                writer.WriteStringValue(SharedAccessStartTime.Value, "O");
 38            }
 1239            writer.WritePropertyName("signedExpiry");
 1240            writer.WriteStringValue(SharedAccessExpiryTime, "O");
 1241            if (KeyToSign != null)
 42            {
 443                writer.WritePropertyName("keyToSign");
 444                writer.WriteStringValue(KeyToSign);
 45            }
 1246            writer.WriteEndObject();
 1247        }
 48    }
 49}