< Summary

Class:Microsoft.Azure.KeyVault.Models.CertificatePolicy
Assembly:Microsoft.Azure.KeyVault
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Microsoft.Azure.KeyVault\src\Generated\Models\CertificatePolicy.cs
Covered lines:12
Uncovered lines:13
Coverable lines:25
Total lines:131
Line coverage:48% (12 of 25)
Covered branches:3
Total branches:8
Branch coverage:37.5% (3 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
get_Id()-0%100%
get_KeyProperties()-100%100%
get_SecretProperties()-100%100%
get_X509CertificateProperties()-100%100%
get_LifetimeActions()-100%100%
get_IssuerParameters()-100%100%
get_Attributes()-100%100%
Validate()-57.14%37.5%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Microsoft.Azure.KeyVault\src\Generated\Models\CertificatePolicy.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.KeyVault.Models
 12{
 13    using Newtonsoft.Json;
 14    using System.Collections;
 15    using System.Collections.Generic;
 16    using System.Linq;
 17
 18    /// <summary>
 19    /// Management policy for a certificate.
 20    /// </summary>
 21    public partial class CertificatePolicy
 22    {
 23        /// <summary>
 24        /// Initializes a new instance of the CertificatePolicy class.
 25        /// </summary>
 13026        public CertificatePolicy()
 27        {
 28            CustomInit();
 13029        }
 30
 31        /// <summary>
 32        /// Initializes a new instance of the CertificatePolicy class.
 33        /// </summary>
 34        /// <param name="id">The certificate id.</param>
 35        /// <param name="keyProperties">Properties of the key backing a
 36        /// certificate.</param>
 37        /// <param name="secretProperties">Properties of the secret backing a
 38        /// certificate.</param>
 39        /// <param name="x509CertificateProperties">Properties of the X509
 40        /// component of a certificate.</param>
 41        /// <param name="lifetimeActions">Actions that will be performed by Key
 42        /// Vault over the lifetime of a certificate.</param>
 43        /// <param name="issuerParameters">Parameters for the issuer of the
 44        /// X509 component of a certificate.</param>
 45        /// <param name="attributes">The certificate attributes.</param>
 046        public CertificatePolicy(string id = default(string), KeyProperties keyProperties = default(KeyProperties), Secr
 47        {
 048            Id = id;
 049            KeyProperties = keyProperties;
 050            SecretProperties = secretProperties;
 051            X509CertificateProperties = x509CertificateProperties;
 052            LifetimeActions = lifetimeActions;
 053            IssuerParameters = issuerParameters;
 054            Attributes = attributes;
 55            CustomInit();
 056        }
 57
 58        /// <summary>
 59        /// An initialization method that performs custom operations like setting defaults
 60        /// </summary>
 61        partial void CustomInit();
 62
 63        /// <summary>
 64        /// Gets the certificate id.
 65        /// </summary>
 66        [JsonProperty(PropertyName = "id")]
 067        public string Id { get; private set; }
 68
 69        /// <summary>
 70        /// Gets or sets properties of the key backing a certificate.
 71        /// </summary>
 72        [JsonProperty(PropertyName = "key_props")]
 26473        public KeyProperties KeyProperties { get; set; }
 74
 75        /// <summary>
 76        /// Gets or sets properties of the secret backing a certificate.
 77        /// </summary>
 78        [JsonProperty(PropertyName = "secret_props")]
 26479        public SecretProperties SecretProperties { get; set; }
 80
 81        /// <summary>
 82        /// Gets or sets properties of the X509 component of a certificate.
 83        /// </summary>
 84        [JsonProperty(PropertyName = "x509_props")]
 28285        public X509CertificateProperties X509CertificateProperties { get; set; }
 86
 87        /// <summary>
 88        /// Gets or sets actions that will be performed by Key Vault over the
 89        /// lifetime of a certificate.
 90        /// </summary>
 91        [JsonProperty(PropertyName = "lifetime_actions")]
 26692        public IList<LifetimeAction> LifetimeActions { get; set; }
 93
 94        /// <summary>
 95        /// Gets or sets parameters for the issuer of the X509 component of a
 96        /// certificate.
 97        /// </summary>
 98        [JsonProperty(PropertyName = "issuer")]
 24499        public IssuerParameters IssuerParameters { get; set; }
 100
 101        /// <summary>
 102        /// Gets or sets the certificate attributes.
 103        /// </summary>
 104        [JsonProperty(PropertyName = "attributes")]
 230105        public CertificateAttributes Attributes { get; set; }
 106
 107        /// <summary>
 108        /// Validate the object.
 109        /// </summary>
 110        /// <exception cref="Rest.ValidationException">
 111        /// Thrown if validation fails
 112        /// </exception>
 113        public virtual void Validate()
 114        {
 36115            if (X509CertificateProperties != null)
 116            {
 8117                X509CertificateProperties.Validate();
 118            }
 36119            if (LifetimeActions != null)
 120            {
 0121                foreach (var element in LifetimeActions)
 122                {
 0123                    if (element != null)
 124                    {
 0125                        element.Validate();
 126                    }
 127                }
 128            }
 36129        }
 130    }
 131}