Пример #1
0
        /// <inheritdoc/>
        public async Task <Team> UpdateTeamAsync(string teamId, string name)
        {
            var teamParams = new TeamParams {
                Name = name
            };

            return(await TeamsClient.PutResultAsync <Team, TeamParams>($"{WxTeamsConstants.TeamsUrl}/{teamId}", teamParams));
        }
Пример #2
0
        /// <inheritdoc/>
        public async Task <TeamMembership> UpdateTeamMembership(string membershipId, bool isModerator)
        {
            var props = new MembershipParams {
                IsModerator = isModerator
            };

            return(await TeamsClient.PutResultAsync <TeamMembership, MembershipParams>($"{WxTeamsConstants.TeamMembershipsUrl}/{membershipId}", props));
        }
Пример #3
0
        /// <inheritdoc/>
        public async Task <Room> UpdateRoomAsync(string roomId, string title)
        {
            var props = new RoomParams {
                Title = title
            };

            return(await TeamsClient.PutResultAsync <Room, RoomParams>($"{WxTeamsConstants.RoomsUrl}/{roomId}", props));
        }
Пример #4
0
        /// <inheritdoc/>
        public async Task <ResourceGroupMembership> UpdateResourceGroupMembershipAsync(string resourceGroupMembershipId,
                                                                                       string resourceGroupId, string licenseId, string personId, string personOrgId, ResourceMembershipStatus status)
        {
            var membershipParams = new ResourceMembershipParams
            {
                LicenseId       = licenseId,
                PersonId        = personId,
                PersonOrgId     = personOrgId,
                ResourceGroupId = resourceGroupId,
                Status          = status
            };

            return(await TeamsClient.PutResultAsync <ResourceGroupMembership, ResourceMembershipParams>(
                       $"{WxTeamsConstants.ResourceMembershipsUrl}/{resourceGroupMembershipId}",
                       membershipParams));
        }
Пример #5
0
        /// <inheritdoc/>
        public async Task <Webhook> UpdateWebhookAsync(string webhookId, string name, string targetUrl, string secret = "",
                                                       WebhookStatus?status = null)
        {
            ValidateWebhookParameters(name, targetUrl);

            var webhookParams = new WebhookParams
            {
                Name      = name,
                TargetUrl = targetUrl
            };

            if (!string.IsNullOrEmpty(secret))
            {
                webhookParams.Secret = secret;
            }

            if (status != null)
            {
                webhookParams.Status = status;
            }

            return(await TeamsClient.PutResultAsync <Webhook, WebhookParams>($"{WxTeamsConstants.WebhooksUrl}/{webhookId}", webhookParams));
        }
Пример #6
0
 /// <inheritdoc/>
 public async Task <Person> UpdateUserAsync(IUpdateablePerson personParams)
 => await TeamsClient.PutResultAsync <Person, IUpdateablePerson>($"{WxTeamsConstants.PeopleUrl}/{personParams.Id}", personParams);