Update a device group name.

@param int    $groupId
@param string $name

@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
556767
public function update(int $groupId, string $name)
    {
        $params = [
            'group_id' => $groupId,
            'group_name' => $name,
        ];

        return $this->httpPostJson('shakearound/device/group/update', $params);
    }
421634
public function setGroupId( $groupId )
    {
        $this->groupId = (int) $groupId ?: null;

        if ( $this->group && $this->group->id != $this->groupId )
        {
            $this->group = null;
        }

        return $this;
    }
748718
public function updateMemberGroup($openId, $toGroupId)
    {
        return $this->auth(function () use ($openId, $toGroupId) {
            return $this->http->postJson(
                $this->baseUrl . 'cgi-bin/groups/members/update?access_token=' . $this->accessToken,
                json_encode(
                    [
                        'openid' => $openId,
                        'to_groupid' => $toGroupId,
                    ],
                    JSON_UNESCAPED_UNICODE
                )
            );
        });
    }
389589
public function getGroupMember($groupId, $memberId)
	{
		return $this->sendRequest(
			$this->createRequest('GET', sprintf('groups/%d/members/%d', $groupId, $memberId))
		);
	}
1233996
def update_group(self, group_id, new_name):
        
        data = {
            'id': group_id,
            'name': new_name,
        }
        try:
            response = self.post('updateGroup', data)
        except Exception:
            pass

        # Apollo returns a 404 here for some unholy reason, despite actually
        # renaming the group.
        response = self.post('loadGroups', {'groupId': group_id})[0]
        return _fix_group(response)
252661
public function fetchGroup($groupId)
    {
        $result = $this->_get($this->_groupUrl($groupId));
        return Deserialize::groupResponse($result);
    }
548860
public function loadGroup($groupId)
    {
        $groups = $this->mapper->extractGroupsFromRows(
            $this->contentTypeGateway->loadGroupData([$groupId])
        );

        if (count($groups) !== 1) {
            throw new Exception\TypeGroupNotFound($groupId);
        }

        return $groups[0];
    }
989568
public function groupUpdate($group_id,$group_name){
        $params=array(
            'group_id'=>$group_id,
            'group_name'=>$group_name
        );
        $rst = $this->_request->post($this->_url . 'group/update', $params);
        return $this->_client->rst($rst);
    }
256237
public function updateTeamName($name)
    {
        $response = $this->rest->post(
            static::TEAM_PATH,
            array(
                'name' => $name
            )
        );

        $this->checkResponse($response);

        return new Team($response);
    }
518716
public function retrieveGroup($groupId)
    {
        $query = $this->newGroupQuery($groupId);
        //$query->setGroupId($groupId);

        try {
            $group = $this->getGroupEntry($query);
        } catch (Zend_Gdata_Gapps_ServiceException $e) {
            // Set the group to null if not found
            if ($e->hasError(Zend_Gdata_Gapps_Error::ENTITY_DOES_NOT_EXIST)) {
                $group = null;
            } else {
                throw $e;
            }
        }
        return $group;
    }
1357546
public function getCapabilitiesNameForGroup($groupID)
    {
        if (!array_key_exists($groupID, $this->_groupIDCapabilitiesMap)) {
            throw new WURFL_WURFLException("The Group ID " . $groupID . " supplied does not exist");
        }
        return $this->_groupIDCapabilitiesMap [$groupID];
    }
272133
public function loadObjectStateListData($groupId)
    {
        try {
            return $this->innerGateway->loadObjectStateListData($groupId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
958158
public function getCapabilitiesNameForGroup($groupID)
    {
        if (!array_key_exists($groupID, $this->groupIDCapabilitiesMap)) {
            throw new \InvalidArgumentException('The Group ID ' . $groupID . ' supplied does not exist');
        }

        return $this->groupIDCapabilitiesMap[$groupID];
    }
295899
public function deleteGroup($groupId)
    {
        $objectStates = $this->loadObjectStates($groupId);
        foreach ($objectStates as $objectState) {
            $this->objectStateGateway->deleteObjectStateLinks($objectState->id);
            $this->objectStateGateway->deleteObjectState($objectState->id);
        }

        $this->objectStateGateway->deleteObjectStateGroup($groupId);
    }
794884
public function updateGroup($gid, $name = null) {
		$group = WechatUserGroup::findOne($gid);
		if(!$group) {
			throw new ErrorException('数据查询失败');
		}

		$data = $this->getData('/cgi-bin/groups/update', [
			'access_token' => $this->getAccessToken(),
		], Json::encode([
			'group' => ['id' => $group->gid, 'name' => $name ? : $group->name],
		]));

		$result = $this->errcode == 0;
		if($result && $name) {
			$group->name = $name;
			$group->save();
		}

		return $result;
	}
383667
public static function update_conversation_name(int $conversationid, string $name) {
        global $DB;

        if ($conversation = $DB->get_record('message_conversations', array('id' => $conversationid))) {
            if ($name <> $conversation->name) {
                $conversation->name = $name;
                $conversation->timemodified = time();
                $DB->update_record('message_conversations', $conversation);
            }
        }
    }
977443
public function changeGroup ($userOpenID, $groupID)
    {
        $failed = $this->changeAllGroups([$userOpenID], $groupID);

        if (count($failed) <= 0) {
            return true;
        }

        return false;
    }