< Summary

Class:Azure.ResourceManager.KeyVault.Models.KeyPermissions
Assembly:Azure.ResourceManager.KeyVault
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\KeyPermissions.cs
Covered lines:4
Uncovered lines:21
Coverable lines:25
Total lines:93
Line coverage:16% (4 of 25)
Covered branches:1
Total branches:6
Branch coverage:16.6% (1 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%50%
get_Encrypt()-0%100%
get_Decrypt()-0%100%
get_WrapKey()-0%100%
get_UnwrapKey()-0%100%
get_Sign()-0%100%
get_Verify()-0%100%
get_Get()-0%100%
get_List()-0%100%
get_Create()-0%100%
get_Update()-0%100%
get_Import()-0%100%
get_Delete()-0%100%
get_Backup()-0%100%
get_Restore()-0%100%
get_Recover()-0%100%
get_Purge()-0%100%
op_Equality(...)-0%100%
op_Inequality(...)-0%100%
op_Implicit(...)-0%100%
Equals(...)-0%0%
Equals(...)-100%100%
GetHashCode()-0%0%
ToString()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\KeyPermissions.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;
 9using System.ComponentModel;
 10
 11namespace Azure.ResourceManager.KeyVault.Models
 12{
 13    /// <summary> The KeyPermissions. </summary>
 14    public readonly partial struct KeyPermissions : IEquatable<KeyPermissions>
 15    {
 16        private readonly string _value;
 17
 18        /// <summary> Determines if two <see cref="KeyPermissions"/> values are the same. </summary>
 19        /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception>
 20        public KeyPermissions(string value)
 21        {
 9222            _value = value ?? throw new ArgumentNullException(nameof(value));
 9223        }
 24
 25        private const string EncryptValue = "encrypt";
 26        private const string DecryptValue = "decrypt";
 27        private const string WrapKeyValue = "wrapKey";
 28        private const string UnwrapKeyValue = "unwrapKey";
 29        private const string SignValue = "sign";
 30        private const string VerifyValue = "verify";
 31        private const string GetValue = "get";
 32        private const string ListValue = "list";
 33        private const string CreateValue = "create";
 34        private const string UpdateValue = "update";
 35        private const string ImportValue = "import";
 36        private const string DeleteValue = "delete";
 37        private const string BackupValue = "backup";
 38        private const string RestoreValue = "restore";
 39        private const string RecoverValue = "recover";
 40        private const string PurgeValue = "purge";
 41
 42        /// <summary> encrypt. </summary>
 043        public static KeyPermissions Encrypt { get; } = new KeyPermissions(EncryptValue);
 44        /// <summary> decrypt. </summary>
 045        public static KeyPermissions Decrypt { get; } = new KeyPermissions(DecryptValue);
 46        /// <summary> wrapKey. </summary>
 047        public static KeyPermissions WrapKey { get; } = new KeyPermissions(WrapKeyValue);
 48        /// <summary> unwrapKey. </summary>
 049        public static KeyPermissions UnwrapKey { get; } = new KeyPermissions(UnwrapKeyValue);
 50        /// <summary> sign. </summary>
 051        public static KeyPermissions Sign { get; } = new KeyPermissions(SignValue);
 52        /// <summary> verify. </summary>
 053        public static KeyPermissions Verify { get; } = new KeyPermissions(VerifyValue);
 54        /// <summary> get. </summary>
 055        public static KeyPermissions Get { get; } = new KeyPermissions(GetValue);
 56        /// <summary> list. </summary>
 057        public static KeyPermissions List { get; } = new KeyPermissions(ListValue);
 58        /// <summary> create. </summary>
 059        public static KeyPermissions Create { get; } = new KeyPermissions(CreateValue);
 60        /// <summary> update. </summary>
 061        public static KeyPermissions Update { get; } = new KeyPermissions(UpdateValue);
 62        /// <summary> import. </summary>
 063        public static KeyPermissions Import { get; } = new KeyPermissions(ImportValue);
 64        /// <summary> delete. </summary>
 065        public static KeyPermissions Delete { get; } = new KeyPermissions(DeleteValue);
 66        /// <summary> backup. </summary>
 067        public static KeyPermissions Backup { get; } = new KeyPermissions(BackupValue);
 68        /// <summary> restore. </summary>
 069        public static KeyPermissions Restore { get; } = new KeyPermissions(RestoreValue);
 70        /// <summary> recover. </summary>
 071        public static KeyPermissions Recover { get; } = new KeyPermissions(RecoverValue);
 72        /// <summary> purge. </summary>
 073        public static KeyPermissions Purge { get; } = new KeyPermissions(PurgeValue);
 74        /// <summary> Determines if two <see cref="KeyPermissions"/> values are the same. </summary>
 075        public static bool operator ==(KeyPermissions left, KeyPermissions right) => left.Equals(right);
 76        /// <summary> Determines if two <see cref="KeyPermissions"/> values are not the same. </summary>
 077        public static bool operator !=(KeyPermissions left, KeyPermissions right) => !left.Equals(right);
 78        /// <summary> Converts a string to a <see cref="KeyPermissions"/>. </summary>
 079        public static implicit operator KeyPermissions(string value) => new KeyPermissions(value);
 80
 81        /// <inheritdoc />
 82        [EditorBrowsable(EditorBrowsableState.Never)]
 083        public override bool Equals(object obj) => obj is KeyPermissions other && Equals(other);
 84        /// <inheritdoc />
 2085        public bool Equals(KeyPermissions other) => string.Equals(_value, other._value, StringComparison.InvariantCultur
 86
 87        /// <inheritdoc />
 88        [EditorBrowsable(EditorBrowsableState.Never)]
 089        public override int GetHashCode() => _value?.GetHashCode() ?? 0;
 90        /// <inheritdoc />
 9691        public override string ToString() => _value;
 92    }
 93}