Update a tag.


@return UpdateResponse|ResponseInterface
500502
public function update(string $domain, string $tag, string $description)
    {
        Assert::stringNotEmpty($domain);
        Assert::stringNotEmpty($tag);

        $params = [
            'description' => $description,
        ];

        $response = $this->httpPut(sprintf('/v3/%s/tags/%s', $domain, $tag), $params);

        return $this->hydrateResponse($response, UpdateResponse::class);
    }
875127
public function destroy(TagRequest $request, Tag $tag)
    {
        try {

            $tag->delete();
            return $this->response->message(trans('messages.success.deleted', ['Module' => trans('blog::tag.name')]))
                ->code(202)
                ->status('success')
                ->url(guard_url('blog/tag/0'))
                ->redirect();

        } catch (Exception $e) {

            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('blog/tag/' . $tag->getRouteKey()))
                ->redirect();
        }

    }
1135650
public function updateTagName($tagId, $tagName)
    {
        $result = $this->httpRaw(self::WECHAT_TAG_CREATE_PREFIX, [
            'tagid' => $tagId,
            'tagname' => $tagName
        ], [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['errcode']) && ($result['errcode'] ? $this->dump([$result,$this->getAccessToken()]) : !$result['errcode']);
    }
1207609
def update(self, tag_id, name):
        
        name = to_text(name)
        return self._post(
            'tags/update',
            data={
                'tag': {
                    'id': int(tag_id),
                    'name': name
                }
            }
        )
207502
public function update(int $tagId, string $name)
    {
        $params = [
            'tag' => [
                'id' => $tagId,
                'name' => $name,
            ],
        ];

        return $this->httpPostJson('cgi-bin/tags/update', $params);
    }
596828
protected function update() {
		
		if(!is_null($this->callback)) {
			
			// Not using application/javascript for compatibility reasons with older browsers.
			$this->headers->set('Content-Type', 'text/javascript');
				
			return $this->setContent(sprintf('/**/%s(%s);', $this->callback, $this->data)); 

		}
		
		// set header only when there is none or when it equals 'text/javascript' (from a previous update with callback)
		// in order to not overwrite a custom definition

		if(!$this->headers->has('Content-Type') || $this->headers->get('Content-Type') === 'text/javascript') {
			$this->headers->set('Content-Type', 'application/json');
		}

		return $this->setContent($this->data);

	}
1210143
public function update($id)
    {
        $content = $this->repository->getById($id);
        if (!empty($content)) {
            $this->authorize('update', $content);
            $input   = $this->validator->validate('update');
            $content = $this->repository->update($content, $input, auth()->user());
            return $this->respondWithSuccess($content, new ContentTransformer);
        }
        return $this->respondNotFound();
    }
1241176
public function actionUpdateStatus()
    {
        $this->requirePostRequest();
        $request = Craft::$app->getRequest();

        // Fetch list id from hidden input
        $listId = $request->getRequiredBodyParam('listId');
        $memberId = $request->getRequiredBodyParam('memberId');
        $memberStatus = $request->getRequiredBodyParam('status');

        // Set params
        $params = [
          'status' => $memberStatus,
        ];

        // Patch request to update member status
        $response = HttpService::request('PATCH', 'lists/'.$listId.'/members/'.$memberId, $params);

        if ($response['success'] and $response['statusCode'] === 200) {
          Craft::$app->getSession()->setNotice('Member status updated.');
          return $this->redirectToPostedUrl();
        } elseif ($response['success'] and $response['statusCode'] !== 200) {
          Craft::$app->session->setFlash('errorBody', $response['body']);
          Craft::$app->getSession()->setError($response['statusCode'].' '.$response['reason']);
        } else {
          Craft::$app->getSession()->setError($response['reason']);
        }

        return $this->redirectToPostedUrl();
    }
484469
private function updateContentTable()
    {
        $metadata = $this->em->getClassMetadata('BackBee\ClassContent\AbstractClassContent');
        $table = $metadata->getTableName();
        $field = $metadata->discriminatorColumn['name'];

        return $this->executeUpdate($table, $field);
    }
829854
public function addTag(Tag $tag)
    {
        if (!$this->tags->contains($tag)) {
            $this->tags->add($tag);
            return true;
        }
        return false;
    }
888511
public function update()
    {
        $updated = $this->repository->update(Request::all());

        return response()->json([
            'error' => !$updated,
        ]);
    }
802206
public Observable<ServiceResponse<Tag>> updateTagWithServiceResponseAsync(UUID projectId, UUID tagId, Tag updatedTag) {
        if (projectId == null) {
            throw new IllegalArgumentException("Parameter projectId is required and cannot be null.");
        }
        if (tagId == null) {
            throw new IllegalArgumentException("Parameter tagId is required and cannot be null.");
        }
        if (updatedTag == null) {
            throw new IllegalArgumentException("Parameter updatedTag is required and cannot be null.");
        }
        if (this.client.apiKey() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null.");
        }
        Validator.validate(updatedTag);
        return service.updateTag(projectId, tagId, updatedTag, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Tag>>>() {
                @Override
                public Observable<ServiceResponse<Tag>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<Tag> clientResponse = updateTagDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
388575
def update_tags(self, image_id, new_tags):
        
        # Do not add :param list in the docstring above until this is solved:
        # https://github.com/sphinx-doc/sphinx/issues/2549
        old_image = self.get(image_id)

        old_tags = frozenset(old_image.tags)
        new_tags = frozenset(new_tags)

        to_add = list(new_tags - old_tags)
        to_remove = list(old_tags - new_tags)

        add_response, remove_response = None, None

        if to_add:
            add_response = self._post('/images/%s/tag' % image_id,
                                      {'tags': to_add}, 'image')

        if to_remove:
            remove_response = self._post('/images/%s/untag' % image_id,
                                         {'tags': to_remove}, 'image')

        return remove_response or add_response or self.get(image_id)
1096434
public function update(Request $request, $id)
    {
        $this->validate($request, ['text' => 'required|max:64|regex:/^[ a-zA-Z0-9_.-]*$/']);

        $tag = Tag()::findOrFail($id);
        $tag->text = $request->text;
        $tag->save();
    }
1100590
public function actionFollowerTag()
    {
        Yii::$app->response->format = Response::FORMAT_JSON;
        $tagId = Yii::$app->request->post('tag_id', null);
        if (($tag = Tag::findOne($tagId)) == null) {
            throw new NotFoundHttpException ();
        } else {
            /** @var \yuncms\user\models\User $user */
            $user = Yii::$app->user->identity;
            if ($user->hasTagValues($tag->id)) {
                $user->removeTagValues($tag->id);
                $user->save();
                return ['status' => 'unFollowed'];
            } else {
                $user->addTagValues($tag->id);
                $user->save();
                return ['status' => 'followed'];
            }
        }
    }
623470
def tag_update(self, tag_id, category):
        
        param = {'tag[category]': category}
        return self._get('pools/{0}.json'.format(tag_id), param, method='PUT',
                         auth=True)
757334
public function addTag(Tag $tag)
    {
        $tag->setBlog($this);
        $this->tags->add($tag);

        return $tag;
    }