예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InlineObject" /> class.
 /// </summary>
 /// <param name="description">The description of the channel..</param>
 /// <param name="link">The link to access the channel. You can use a custom name in the URL in place of a numeric channel ID, as in &#x60;/channels/{url_custom}&#x60;..</param>
 /// <param name="name">The name of the channel. (required).</param>
 /// <param name="privacy">The privacy level of the channel.  Option descriptions:  * &#x60;anybody&#x60; - Anyone can access the channel.  * &#x60;moderators&#x60; - Only moderators can access the channel.  * &#x60;user&#x60; - Only moderators and designated users can access the channel.  (required).</param>
 public InlineObject(string description = default(string), string link = default(string), string name = default(string), PrivacyEnum privacy = default(PrivacyEnum))
 {
     // to ensure "name" is required (not null)
     this.Name        = name ?? throw new ArgumentNullException("name is a required property for InlineObject and cannot be null");
     this.Privacy     = privacy;
     this.Description = description;
     this.Link        = link;
 }
예제 #2
0
        private string GetPrivacyString(PrivacyEnum privacy)
        {
            switch (privacy)
            {
            case PrivacyEnum.Friends: return("friends");

            case PrivacyEnum.Me: return("me");

            case PrivacyEnum.None: return("none");

            case PrivacyEnum.Public: return("public");

            default: return("public");
            }
        }
예제 #3
0
 private string GetPrivacyString(PrivacyEnum privacy)
 {
     switch (privacy)
     {
         case PrivacyEnum.Friends: return "friends";
         case PrivacyEnum.Me: return "me";
         case PrivacyEnum.None: return "none";
         case PrivacyEnum.Public: return "public";
         default: return "public";
     }
 }