// PATCH registers a handler for a PATCH request to the given route
181936
func (r *Router) PATCH(route string, handler interface{}) *Router {
	r.Handle(MethodPATCH, route, handler)
	return r
}
142510
func (zones *Zones) Patch(ctx context.Context, id string, patch *ZonePatch) (err error) {
	buffer := new(bytes.Buffer)
	err = json.NewEncoder(buffer).Encode(patch)
	if err != nil {
		return
	}
	response, err := httpDo(ctx, zones.Options, "POST", apiURL("/zones/%s", id), buffer)
	if err != nil {
		return
	}
	defer response.Body.Close()
	_, err = readResponse(response.Body)
	return
}
1226303
func (s *Server) Patch(path string, h HandlerFunc, opts ...HandlerOption) {
	s.register(http.MethodPatch, path, h, opts...)
}
55128
func (s *Sling) Patch(pathURL string) *Sling {
	s.method = "PATCH"
	return s.Path(pathURL)
}
397867
func Patch(pattern web.PatternType, handler web.HandlerType) {
	DefaultMux.Patch(pattern, handler)
}
544728
func (r *Route) Handler(h Handler) *Route {
	r.route.Handler(r.handler(h))
	return r
}
638566
func (r *GroupService) Patch(appId string, id string, group *Group) *GroupPatchCall {
	c := &GroupPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.appId = appId
	c.id = id
	c.group = group
	return c
}
1263120
func (m *RouteMux) Patch(pattern string, handler http.HandlerFunc) {
	m.AddRoute(PATCH, pattern, handler)
}
251945
func (c *Client) Patch() *Request {
	req := c.Request()
	req.Method("PATCH")
	return req
}
679580
func (r *Router) Handler(req *http.Request) (route *Route, h Handler, vars map[string]string) {
	var match mux.RouteMatch

	if r.mux.Match(req, &match) {
		route = r.getOrCreateRoute(match.Route, "")
		h = match.Handler.(Handler)
		vars = match.Vars
		return
	}

	if r.NotFoundHandler == nil {
		h = HandlerFunc(NotFound)
		return
	}

	h = r.NotFoundHandler
	return
}
96275
func (g *Group) Patch(path string, h HandlerFunc, opts ...HandlerOption) {
	g.add(path, h, opts, http.MethodPatch)
}
491345
func (a *Application) Patch(patchedApplication *Application) (*Application, *http.Response, []error) {
	o, err := json.Marshal(a)
	if err != nil {
		return nil, nil, []error{err}
	}

	p, err := json.Marshal(patchedApplication)
	if err != nil {
		return nil, nil, []error{err}
	}

	patch, err := jsonpatch.CreatePatch([]byte(o), []byte(p))
	if err != nil {
		fmt.Printf("Error creating JSON patch:%v", err)
		return nil, nil, []error{err}
	}

	patchBytes, err := json.Marshal(patch)
	if err != nil {
		return nil, nil, []error{err}
	}
	k := kumoru.New()

	k.Logger.Debugf("Patch string: %s", patchBytes)

	k.Patch(fmt.Sprintf("%s/v1/applications/%s", k.EndPoint.Application, a.UUID))
	k.TargetType = "json-patch+json"
	k.RawString = string(string(patchBytes))
	k.SignRequest(true)

	resp, body, errs := k.End()

	if len(errs) > 0 {
		return a, resp, errs
	}

	if resp.StatusCode >= 400 {
		errs = append(errs, fmt.Errorf("%s", resp.Status))
	}

	pApp := Application{}
	err = json.Unmarshal([]byte(body), &pApp)

	if err != nil {
		errs = append(errs, err)
		return a, resp, errs
	}

	return &pApp, resp, nil
}
580355
func (es *EnvironmentsService) Patch(ctx context.Context, name string, patch *EnvironmentPatchRequest) (e *Environment, resp *APIResponse, err error) {
	e = &Environment{}
	_, resp, err = es.client.patchAction(ctx, &APIClientRequest{
		Path:         "admin/environments/" + name,
		RequestBody:  patch,
		ResponseBody: e,
		APIVersion:   apiV2,
	})

	return
}
1110749
func (rc *RequestConfig) PATCH(path string) *RequestConfig {
	rc.Path = path
	rc.Method = "PATCH"

	return rc
}
916740
func (f *Fibre) Patch(p string, h HandlerFunc) {
	f.router.Add(PATCH, p, h)
}
863425
func (c *FakeOAuthAccessTokens) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *oauth.OAuthAccessToken, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootPatchSubresourceAction(oauthaccesstokensResource, name, pt, data, subresources...), &oauth.OAuthAccessToken{})
	if obj == nil {
		return nil, err
	}
	return obj.(*oauth.OAuthAccessToken), err
}
59611
func (c *FakeServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *corev1.Service, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, name, pt, data, subresources...), &corev1.Service{})

	if obj == nil {
		return nil, err
	}
	return obj.(*corev1.Service), err
}