Exemplo n.º 1
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="SharedContentLinkMetadataBase"
        /// /> class.</para>
        /// </summary>
        /// <param name="audienceOptions">The audience options that are available for the
        /// content. Some audience options may be unavailable. For example, team_only may be
        /// unavailable if the content is not owned by a user on a team. The 'default' audience
        /// option is always available if the user can modify link settings.</param>
        /// <param name="currentAudience">The current audience of the link.</param>
        /// <param name="linkPermissions">A list of permissions for actions you can perform on
        /// the link.</param>
        /// <param name="passwordProtected">Whether the link is protected by a
        /// password.</param>
        /// <param name="accessLevel">The access level on the link for this file.</param>
        /// <param name="audienceRestrictingSharedFolder">The shared folder that prevents the
        /// link audience for this link from being more restrictive.</param>
        /// <param name="expiry">Whether the link has an expiry set on it. A link with an
        /// expiry will have its  audience changed to members when the expiry is
        /// reached.</param>
        public SharedContentLinkMetadataBase(col.IEnumerable <LinkAudience> audienceOptions,
                                             LinkAudience currentAudience,
                                             col.IEnumerable <LinkPermission> linkPermissions,
                                             bool passwordProtected,
                                             AccessLevel accessLevel = null,
                                             AudienceRestrictingSharedFolder audienceRestrictingSharedFolder = null,
                                             sys.DateTime?expiry = null)
        {
            var audienceOptionsList = enc.Util.ToList(audienceOptions);

            if (audienceOptions == null)
            {
                throw new sys.ArgumentNullException("audienceOptions");
            }

            if (currentAudience == null)
            {
                throw new sys.ArgumentNullException("currentAudience");
            }

            var linkPermissionsList = enc.Util.ToList(linkPermissions);

            if (linkPermissions == null)
            {
                throw new sys.ArgumentNullException("linkPermissions");
            }

            this.AudienceOptions   = audienceOptionsList;
            this.CurrentAudience   = currentAudience;
            this.LinkPermissions   = linkPermissionsList;
            this.PasswordProtected = passwordProtected;
            this.AccessLevel       = accessLevel;
            this.AudienceRestrictingSharedFolder = audienceRestrictingSharedFolder;
            this.Expiry = expiry;
        }
 /// <summary>
 /// <para>Initializes a new instance of the <see
 /// cref="ExpectedSharedContentLinkMetadata" /> class.</para>
 /// </summary>
 /// <param name="audienceOptions">The audience options that are available for the
 /// content. Some audience options may be unavailable. For example, team_only may be
 /// unavailable if the content is not owned by a user on a team. The 'default' audience
 /// option is always available if the user can modify link settings.</param>
 /// <param name="currentAudience">The current audience of the link.</param>
 /// <param name="linkPermissions">A list of permissions for actions you can perform on
 /// the link.</param>
 /// <param name="passwordProtected">Whether the link is protected by a
 /// password.</param>
 /// <param name="accessLevel">The access level on the link for this file.</param>
 /// <param name="audienceRestrictingSharedFolder">The shared folder that prevents the
 /// link audience for this link from being more restrictive.</param>
 /// <param name="expiry">Whether the link has an expiry set on it. A link with an
 /// expiry will have its  audience changed to members when the expiry is
 /// reached.</param>
 public ExpectedSharedContentLinkMetadata(col.IEnumerable <LinkAudience> audienceOptions,
                                          LinkAudience currentAudience,
                                          col.IEnumerable <LinkPermission> linkPermissions,
                                          bool passwordProtected,
                                          AccessLevel accessLevel = null,
                                          AudienceRestrictingSharedFolder audienceRestrictingSharedFolder = null,
                                          sys.DateTime?expiry = null)
     : base(audienceOptions, currentAudience, linkPermissions, passwordProtected, accessLevel, audienceRestrictingSharedFolder, expiry)
 {
 }
Exemplo n.º 3
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="SharedContentLinkMetadata" />
        /// class.</para>
        /// </summary>
        /// <param name="audienceOptions">The audience options that are available for the
        /// content. Some audience options may be unavailable. For example, team_only may be
        /// unavailable if the content is not owned by a user on a team. The 'default' audience
        /// option is always available if the user can modify link settings.</param>
        /// <param name="currentAudience">The current audience of the link.</param>
        /// <param name="linkPermissions">A list of permissions for actions you can perform on
        /// the link.</param>
        /// <param name="passwordProtected">Whether the link is protected by a
        /// password.</param>
        /// <param name="url">The URL of the link.</param>
        /// <param name="accessLevel">The access level on the link for this file.</param>
        /// <param name="audienceRestrictingSharedFolder">The shared folder that prevents the
        /// link audience for this link from being more restrictive.</param>
        /// <param name="expiry">Whether the link has an expiry set on it. A link with an
        /// expiry will have its  audience changed to members when the expiry is
        /// reached.</param>
        public SharedContentLinkMetadata(col.IEnumerable <LinkAudience> audienceOptions,
                                         LinkAudience currentAudience,
                                         col.IEnumerable <LinkPermission> linkPermissions,
                                         bool passwordProtected,
                                         string url,
                                         AccessLevel accessLevel = null,
                                         AudienceRestrictingSharedFolder audienceRestrictingSharedFolder = null,
                                         sys.DateTime?expiry = null)
            : base(audienceOptions, currentAudience, linkPermissions, passwordProtected, accessLevel, audienceRestrictingSharedFolder, expiry)
        {
            if (url == null)
            {
                throw new sys.ArgumentNullException("url");
            }

            this.Url = url;
        }