コード例 #1
0
        private void List(string spaceId, string personId, string personEmail, int?max, Action <WebexApiEventArgs <List <Membership> > > completionHandler)
        {
            ServiceRequest request = BuildRequest();

            request.Method      = HttpMethod.GET;
            request.RootElement = "items";
            if (spaceId != null)
            {
                request.AddQueryParameters("roomId", spaceId);
            }
            if (personId != null)
            {
                request.AddQueryParameters("personId", personId);
            }
            if (personEmail != null)
            {
                request.AddQueryParameters("personEmail", personEmail);
            }
            if (max != null)
            {
                request.AddQueryParameters("max", max);
            }

            request.Execute <List <Membership> >(completionHandler);
        }
コード例 #2
0
        /// <summary>
        /// Lists all team memberships where the authenticated user belongs.
        /// </summary>
        /// <param name="teamId">Limit results to a specific team, by ID.</param>
        /// <param name="max">The maximum number of team memberships in the response.</param>
        /// <param name="completionHandler">The completion event handler.</param>
        /// <remarks>Since: 0.1.0</remarks>
        public void List(string teamId, int?max, Action <WebexApiEventArgs <List <TeamMembership> > > completionHandler)
        {
            ServiceRequest request = BuildRequest();

            request.Method      = HttpMethod.GET;
            request.RootElement = "items";
            if (teamId != null)
            {
                request.AddQueryParameters("teamId", teamId);
            }
            if (max != null)
            {
                request.AddQueryParameters("max", max.ToString());
            }

            request.Execute <List <TeamMembership> >(completionHandler);
        }
コード例 #3
0
        /// <summary>
        /// Updates a webhook by id.
        /// </summary>
        /// <param name="webhookId">The identifier of  the webhook.</param>
        /// <param name="name">A user-friendly name for this webhook.</param>
        /// <param name="targetUrl">The URL that receives POST requests for each event.</param>
        /// <param name="completionHandler">The completion event handler.</param>
        /// <remarks>Since: 0.1.0</remarks>
        public void Update(string webhookId, string name, string targetUrl, Action <WebexApiEventArgs <Webhook> > completionHandler)
        {
            ServiceRequest request = BuildRequest();

            request.Method   = HttpMethod.PUT;
            request.Resource = webhookId;
            if (name != null)
            {
                request.AddQueryParameters("name", name);
            }
            if (targetUrl != null)
            {
                request.AddQueryParameters("targetUrl", targetUrl);
            }

            request.Execute <Webhook>(completionHandler);
        }
コード例 #4
0
        /// <summary>
        /// Lists all spaces where the authenticated user belongs.
        /// </summary>
        /// <param name="teamId">If not null, only list the spaces that are associated with the team by team id.</param>
        /// <param name="max">The maximum number of spaces in the response. If null, all spaces are listed.</param>
        /// <param name="type">If not null, only list the spaces of this type. Otherwise all spaces are listed.</param>
        /// <param name="sortBy">If not null, sort results by spaceId(id), most recent activity(lastactivity), or most recently created(created).</param>
        /// <param name="completionHandler">The completion handler.</param>
        /// <remarks>Since: 0.1.0</remarks>
        public void List(string teamId, int?max, SpaceType?type, SpaceSortType?sortBy, Action <WebexApiEventArgs <List <Space> > > completionHandler)
        {
            ServiceRequest request = BuildRequest();

            request.Method      = HttpMethod.GET;
            request.RootElement = "items";
            if (teamId != null)
            {
                request.AddQueryParameters("teamId", teamId);
            }
            if (max != null)
            {
                request.AddQueryParameters("max", max);
            }
            if (type != null)
            {
                request.AddQueryParameters("type", type.ToString().ToLower());
            }
            if (sortBy != null)
            {
                string strSortBy = null;
                switch (sortBy)
                {
                case SpaceSortType.ById:
                    strSortBy = "id";
                    break;

                case SpaceSortType.ByLastActivity:
                    strSortBy = "lastactivity";
                    break;

                case SpaceSortType.ByCreated:
                    strSortBy = "created";
                    break;

                default:
                    completionHandler?.Invoke(new WebexApiEventArgs <List <Space> >(false, new WebexError(WebexErrorCode.IllegalOperation, "sort type is invalid."), null));
                    return;
                }
                request.AddQueryParameters("sortBy", strSortBy);
            }

            request.Execute <List <Space> >(completionHandler);
        }
コード例 #5
0
        /// <summary>
        /// Lists people in the authenticated user's organization.
        /// </summary>
        /// <param name="email">if not null, only list people with this email address.</param>
        /// <param name="displayName">if not null, only list people whose name starts with this string.</param>
        /// <param name="max">The maximum number of people in the response.</param>
        /// <param name="completionHandler">The completion event handler.</param>
        /// <remarks>Since: 0.1.0</remarks>
        public void List(string email, string displayName, int?max, Action <WebexApiEventArgs <List <Person> > > completionHandler)
        {
            ServiceRequest request = BuildRequest();

            request.RootElement = "items";
            if (email != null)
            {
                request.AddQueryParameters("email", email);
            }
            if (displayName != null)
            {
                request.AddQueryParameters("displayName", displayName);
            }
            if (max != null)
            {
                request.AddQueryParameters("max", max);
            }

            request.Execute <List <Person> >(completionHandler);
        }
コード例 #6
0
        /// <summary>
        /// Updates the details for a space by id.
        /// </summary>
        /// <param name="spaceId">The identifier of the space.</param>
        /// <param name="title">A user-friendly name for the space.</param>
        /// <param name="completionHandler">The completion event handler.</param>
        /// <remarks>Since: 0.1.0</remarks>
        public void Update(string spaceId, string title, Action <WebexApiEventArgs <Space> > completionHandler)
        {
            ServiceRequest request = BuildRequest();

            request.Method   = HttpMethod.PUT;
            request.Resource = spaceId;
            if (title != null)
            {
                request.AddQueryParameters("title", title);
            }

            request.Execute <Space>(completionHandler);
        }
コード例 #7
0
        /// <summary>
        /// Updates the details for a membership by id.
        /// </summary>
        /// <param name="membershipId">The identifier of the membership.</param>
        /// <param name="isModerator">if set to <c>true</c> [is moderator of the team]. The default is false.</param>
        /// <param name="completionHandler">The completion event handler.</param>
        /// <remarks>Since: 0.1.0</remarks>
        public void Update(string membershipId, bool?isModerator, Action <WebexApiEventArgs <TeamMembership> > completionHandler)
        {
            ServiceRequest request = BuildRequest();

            request.Method   = HttpMethod.PUT;
            request.Resource = membershipId;
            if (isModerator != null)
            {
                request.AddQueryParameters("isModerator", isModerator);
            }

            request.Execute <TeamMembership>(completionHandler);
        }
コード例 #8
0
        /// <summary>
        /// Lists teams to which the authenticated user belongs.
        /// </summary>
        /// <param name="max">The maximum number of teams in the response. if null, list all teams.</param>
        /// <param name="completionHandler">The completion event handler.</param>
        /// <remarks>Since: 0.1.0</remarks>
        public void List(int?max, Action <WebexApiEventArgs <List <Team> > > completionHandler)
        {
            ServiceRequest request = BuildRequest();

            request.Method      = HttpMethod.GET;
            request.RootElement = "items";
            if (max != null)
            {
                request.AddQueryParameters("max", max);
            }

            request.Execute <List <Team> >(completionHandler);
        }
コード例 #9
0
        /// <summary>
        /// Updates the details for a team by id.
        /// </summary>
        /// <param name="teamId">The team id.</param>
        /// <param name="name">A user-friendly name for the team.</param>
        /// <param name="completionHandler">The completion event handler.</param>
        /// <remarks>Since: 0.1.0</remarks>
        public void Update(string teamId, string name, Action <WebexApiEventArgs <Team> > completionHandler)
        {
            ServiceRequest request = BuildRequest();

            request.Method   = HttpMethod.PUT;
            request.Resource = teamId;
            if (name != null)
            {
                request.AddQueryParameters("name", name);
            }

            request.Execute <Team>(completionHandler);
        }
コード例 #10
0
        private void List(string spaceId, string personId, string personEmail, int?max, Action <WebexApiEventArgs <List <Membership> > > completionHandler)
        {
            ServiceRequest request = BuildRequest();

            request.Method      = HttpMethod.GET;
            request.RootElement = "items";
            if (spaceId != null)
            {
                request.AddQueryParameters("roomId", spaceId);
            }
            if (personId != null)
            {
                request.AddQueryParameters("personId", personId);
            }
            if (personEmail != null)
            {
                request.AddQueryParameters("personEmail", personEmail);
            }
            if (max != null)
            {
                request.AddQueryParameters("max", max.ToString());
            }

            request.Execute <List <InternalMembership> >(r =>
            {
                List <Membership> m = null;
                if (r.IsSuccess)
                {
                    m = new List <Membership>();
                    foreach (var item in r.Data)
                    {
                        m.Add(ConvertToMembership(item));
                    }
                }
                completionHandler?.Invoke(new WebexApiEventArgs <List <Membership> >(r.IsSuccess, r.Error, m));
            });
        }