Exemple #1
0
        /// <summary>
        /// Create a new user role in your account's default service
        /// </summary>
        /// <param name="friendlyName"> A string to describe the new resource </param>
        /// <param name="type"> The type of role </param>
        /// <param name="permission"> A permission the role should have </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Role </returns>
        public static RoleResource Create(string friendlyName,
                                          RoleResource.RoleTypeEnum type,
                                          List <string> permission,
                                          ITwilioRestClient client = null)
        {
            var options = new CreateRoleOptions(friendlyName, type, permission);

            return(Create(options, client));
        }
Exemple #2
0
        /// <summary>
        /// Create a new user role in your account's default service
        /// </summary>
        /// <param name="friendlyName"> A string to describe the new resource </param>
        /// <param name="type"> The type of role </param>
        /// <param name="permission"> A permission the role should have </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Role </returns>
        public static async System.Threading.Tasks.Task <RoleResource> CreateAsync(string friendlyName,
                                                                                   RoleResource.RoleTypeEnum type,
                                                                                   List <string> permission,
                                                                                   ITwilioRestClient client = null)
        {
            var options = new CreateRoleOptions(friendlyName, type, permission);

            return(await CreateAsync(options, client));
        }
Exemple #3
0
 /// <summary>
 /// Construct a new CreateRoleOptions
 /// </summary>
 /// <param name="friendlyName"> A string to describe the new resource </param>
 /// <param name="type"> The type of role </param>
 /// <param name="permission"> A permission the role should have </param>
 public CreateRoleOptions(string friendlyName, RoleResource.RoleTypeEnum type, List <string> permission)
 {
     FriendlyName = friendlyName;
     Type         = type;
     Permission   = permission;
 }