// Patch applies the patch and returns the patched validatingWebhookConfiguration.
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
}
1102191
func (c *FakeOAuthClients) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *oauth.OAuthClient, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootPatchSubresourceAction(oauthclientsResource, name, pt, data, subresources...), &oauth.OAuthClient{})
	if obj == nil {
		return nil, err
	}
	return obj.(*oauth.OAuthClient), err
}
251945
func (c *Client) Patch() *Request {
	req := c.Request()
	req.Method("PATCH")
	return req
}
530547
func (p *PullRequestsService) Patch() (patch io.ReadCloser, result *Result) {
	return p.client.getBody(p.URL, patchMediaType)
}
638601
func (c *FakeAPIServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apiregistration.APIService, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootPatchSubresourceAction(apiservicesResource, name, pt, data, subresources...), &apiregistration.APIService{})
	if obj == nil {
		return nil, err
	}
	return obj.(*apiregistration.APIService), err
}
382388
func (c *FakeMutatingWebhookConfigurations) Update(mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration) (result *v1beta1.MutatingWebhookConfiguration, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &v1beta1.MutatingWebhookConfiguration{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1beta1.MutatingWebhookConfiguration), err
}
1002837
func (r *Router) Patch(pattern string, handler http.HandlerFunc) {
	r.AddRoute(PATCH, pattern, handler)
}
1132093
func Patch(url string, v ...interface{}) (*Resp, error) {
	return std.Patch(url, v...)
}
1327811
func (c *RESTClient) Patch(pt types.PatchType) *Request {
	return c.Verb("PATCH").SetHeader("Content-Type", string(pt))
}
1362366
func (c *FakeEvents) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Event, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, name, pt, data, subresources...), &v1beta1.Event{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1beta1.Event), err
}
1273495
func (c *FakeSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *corev1.Secret, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewPatchSubresourceAction(secretsResource, c.ns, name, pt, data, subresources...), &corev1.Secret{})

	if obj == nil {
		return nil, err
	}
	return obj.(*corev1.Secret), 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
}
349878
func (rt *Router) Patch(path string, handler http.Handler) {
	rt.Handle(http.MethodPatch, path, handler)
}
601562
func (c *FakeHelmReleases) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.HelmRelease, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewPatchSubresourceAction(helmreleasesResource, c.ns, name, pt, data, subresources...), &v1beta1.HelmRelease{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1beta1.HelmRelease), err
}
122305
func (c *FakeSSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHCredential, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewPatchSubresourceAction(sshcredentialsResource, c.ns, name, data, subresources...), &v1alpha1.SSHCredential{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.SSHCredential), err
}
1281600
func (c *FakeFoos) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Foo, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewPatchSubresourceAction(foosResource, c.ns, name, pt, data, subresources...), &v1alpha1.Foo{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.Foo), err
}
565199
func (g *routeGroup) Patch(path string, h http.HandlerFunc) {
	g.handle(http.MethodPatch, path, h)
}