< Summary

Class:Microsoft.Azure.Graph.RBAC.Models.GroupCreateParameters
Assembly:Microsoft.Azure.Graph.RBAC
File(s):C:\Git\azure-sdk-for-net\sdk\graphrbac\Microsoft.Azure.Graph.RBAC\src\Generated\Models\GroupCreateParameters.cs
Covered lines:12
Uncovered lines:8
Coverable lines:20
Total lines:112
Line coverage:60% (12 of 20)
Covered branches:2
Total branches:4
Branch coverage:50% (2 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
.cctor()-100%100%
get_AdditionalProperties()-0%100%
get_DisplayName()-100%100%
get_MailNickname()-100%100%
get_MailEnabled()-100%100%
get_SecurityEnabled()-100%100%
Validate()-60%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\graphrbac\Microsoft.Azure.Graph.RBAC\src\Generated\Models\GroupCreateParameters.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.Graph.RBAC.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Collections;
 16    using System.Collections.Generic;
 17    using System.Linq;
 18
 19    /// <summary>
 20    /// Request parameters for creating a new group.
 21    /// </summary>
 22    public partial class GroupCreateParameters
 23    {
 24        /// <summary>
 25        /// Initializes a new instance of the GroupCreateParameters class.
 26        /// </summary>
 427        public GroupCreateParameters()
 28        {
 29            CustomInit();
 430        }
 31
 32        /// <summary>
 33        /// Initializes a new instance of the GroupCreateParameters class.
 34        /// </summary>
 35        /// <param name="displayName">Group display name</param>
 36        /// <param name="mailNickname">Mail nickname</param>
 37        /// <param name="additionalProperties">Unmatched properties from the
 38        /// message are deserialized this collection</param>
 039        public GroupCreateParameters(string displayName, string mailNickname, IDictionary<string, object> additionalProp
 40        {
 041            AdditionalProperties = additionalProperties;
 042            DisplayName = displayName;
 043            MailNickname = mailNickname;
 44            CustomInit();
 045        }
 46        /// <summary>
 47        /// Static constructor for GroupCreateParameters class.
 48        /// </summary>
 49        static GroupCreateParameters()
 50        {
 251            MailEnabled = false;
 252            SecurityEnabled = true;
 253        }
 54
 55        /// <summary>
 56        /// An initialization method that performs custom operations like setting defaults
 57        /// </summary>
 58        partial void CustomInit();
 59
 60        /// <summary>
 61        /// Gets or sets unmatched properties from the message are deserialized
 62        /// this collection
 63        /// </summary>
 64        [JsonExtensionData]
 065        public IDictionary<string, object> AdditionalProperties { get; set; }
 66
 67        /// <summary>
 68        /// Gets or sets group display name
 69        /// </summary>
 70        [JsonProperty(PropertyName = "displayName")]
 1271        public string DisplayName { get; set; }
 72
 73        /// <summary>
 74        /// Gets or sets mail nickname
 75        /// </summary>
 76        [JsonProperty(PropertyName = "mailNickname")]
 1277        public string MailNickname { get; set; }
 78
 79        /// <summary>
 80        /// Whether the group is mail-enabled. Must be false. This is because
 81        /// only pure security groups can be created using the Graph API.
 82        /// </summary>
 83        [JsonProperty(PropertyName = "mailEnabled")]
 684        public static bool MailEnabled { get; private set; }
 85
 86        /// <summary>
 87        /// Whether the group is a security group. Must be true. This is
 88        /// because only pure security groups can be created using the Graph
 89        /// API.
 90        /// </summary>
 91        [JsonProperty(PropertyName = "securityEnabled")]
 692        public static bool SecurityEnabled { get; private set; }
 93
 94        /// <summary>
 95        /// Validate the object.
 96        /// </summary>
 97        /// <exception cref="ValidationException">
 98        /// Thrown if validation fails
 99        /// </exception>
 100        public virtual void Validate()
 101        {
 4102            if (DisplayName == null)
 103            {
 0104                throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName");
 105            }
 4106            if (MailNickname == null)
 107            {
 0108                throw new ValidationException(ValidationRules.CannotBeNull, "MailNickname");
 109            }
 4110        }
 111    }
 112}