// Patch adds the route to the router using the PATCH HTTP method.
514014
func (r *Route) Patch(handlers ...Handler) *Route {
	return r.group.add("PATCH", r.path, handlers)
}
565199
func (g *routeGroup) Patch(path string, h http.HandlerFunc) {
	g.handle(http.MethodPatch, path, 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
}
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
}
358894
func (r *SubRouter) PATCH(route string, handler interface{}) *SubRouter {
	route = r.prefixedRoute(route)
	if r.parent != nil {
		r.parent.handleReg(MethodPATCH, route, handler, r.prefixes)
	}

	return r
}
183934
func (c *FakeValidatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, pt, data, subresources...), &v1beta1.ValidatingWebhookConfiguration{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1beta1.ValidatingWebhookConfiguration), err
}
636346
func (F *Frisby) Patch(url string) *Frisby {
	F.Method = "PATCH"
	F.Url = url
	return F
}
1181873
func (c *users) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *user.User, err error) {
	result = &user.User{}
	err = c.client.Patch(pt).
		Resource("users").
		SubResource(subresources...).
		Name(name).
		Body(data).
		Do().
		Into(result)
	return
}
311206
func (c *FakeExamples) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *crv1.Example, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewPatchSubresourceAction(examplesResource, c.ns, name, pt, data, subresources...), &crv1.Example{})

	if obj == nil {
		return nil, err
	}
	return obj.(*crv1.Example), err
}
289589
func (r *Router) PATCH(path string, handlers ...HandlerFunc) {
	r.Handle("PATCH", path, handlers)
}
244677
func (e *Echo) Patch(path string, h interface{}, m ...interface{}) {
	e.add(PATCH, "", path, h, m...)
}
254509
func Patch(base []byte, v interface{}) ([]byte, error) {
	//Clone struct v, v shoud not be modified
	rv := reflect.ValueOf(v)
	for rv.Kind() == reflect.Ptr {
		rv = rv.Elem()
	}
	pv := reflect.New(rv.Type())
	pv.Elem().Set(rv)

	nv := pv.Interface()

	//unmarshal base
	table, err := toml.Parse(base)
	if err != nil {
		return nil, err
	}

	if err := toml.UnmarshalTable(table, nv); err != nil {
		return nil, err
	}

	return Marshal(nv)
}
1031816
func (c *Client) Patch(URI string, data interface{}, decoded interface{}) (*http.Response, error) {
	req, err := c.NewJSONRequest("PATCH", URI, data)
	if err != nil {
		return nil, err
	}
	resp, err := c.DoRest(req, decoded)
	if err != nil {
		return nil, err
	}
	if resp.StatusCode != http.StatusAccepted {
		return nil, fmt.Errorf("Unexpected http code %d on URL %v. expecting %d", resp.StatusCode, resp.Request.URL, http.StatusAccepted)
	}
	return resp, err
}
1263120
func (m *RouteMux) Patch(pattern string, handler http.HandlerFunc) {
	m.AddRoute(PATCH, pattern, handler)
}
864158
func (app *App) PATCH(route string, handler interface{}) *App {
	app.defaultRouter.Handle(MethodPATCH, route, handler)
	return app
}
267571
func (records *Records) Patch(ctx context.Context, record *Record) (err error) {
	buffer := new(bytes.Buffer)
	err = json.NewEncoder(buffer).Encode(record)
	if err != nil {
		return
	}
	response, err := httpDo(ctx, records.Options, "PUT", apiURL("/zones/%s/dns_records/%s", record.ZoneID, record.ID), buffer)
	if err != nil {
		return
	}
	defer response.Body.Close()
	_, err = readResponse(response.Body)
	return
}
100574
func (c *FakeConfigMaps) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *corev1.ConfigMap, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewPatchSubresourceAction(configmapsResource, c.ns, name, pt, data, subresources...), &corev1.ConfigMap{})

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