// GetPatch returns the Patch field if it's non-nil, zero value otherwise.
550427
func (c *CommitFile) GetPatch() string {
	if c == nil || c.Patch == nil {
		return ""
	}
	return *c.Patch
}
18327
func keepOrDeleteNullInJsonPatch(patch []byte, keepNull bool) ([]byte, map[string]interface{}, error) {
	var patchMap map[string]interface{}
	err := json.Unmarshal(patch, &patchMap)
	if err != nil {
		return nil, nil, err
	}
	filteredMap, err := keepOrDeleteNullInObj(patchMap, keepNull)
	if err != nil {
		return nil, nil, err
	}
	o, err := json.Marshal(filteredMap)
	return o, filteredMap, err
}
894585
func (p *PullRequest) GetPatchURL() string {
	if p == nil || p.PatchURL == nil {
		return ""
	}
	return *p.PatchURL
}
840719
func ChangeResourcePatch(info *resource.Info, changeCause string) ([]byte, error) {
	oldData, err := json.Marshal(info.Object)
	if err != nil {
		return nil, err
	}
	if err := RecordChangeCause(info.Object, changeCause); err != nil {
		return nil, err
	}
	newData, err := json.Marshal(info.Object)
	if err != nil {
		return nil, err
	}
	return strategicpatch.CreateTwoWayMergePatch(oldData, newData, info.Object)
}
421251
func MergeMergePatches(patch1Data, patch2Data []byte) ([]byte, error) {
	return doMergePatch(patch1Data, patch2Data, true)
}
39962
func (_class HostPatchClass) GetSize(sessionID SessionRef, self HostPatchRef) (_retval int, _err error) {
	_method := "host_patch.get_size"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertHostPatchRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertIntToGo(_method + " -> ", _result.Value)
	return
}
624391
func (c *CommitsComparison) GetPatchURL() string {
	if c == nil || c.PatchURL == nil {
		return ""
	}
	return *c.PatchURL
}
1027304
func (c *FakeKeysets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.Keyset, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewPatchSubresourceAction(keysetsResource, c.ns, name, data, subresources...), &v1alpha2.Keyset{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha2.Keyset), err
}
171311
func (_class HostPatchClass) GetHost(sessionID SessionRef, self HostPatchRef) (_retval HostRef, _err error) {
	_method := "host_patch.get_host"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertHostPatchRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertHostRefToGo(_method + " -> ", _result.Value)
	return
}
1145493
func (_class PoolPatchClass) GetByNameLabel(sessionID SessionRef, label string) (_retval []PoolPatchRef, _err error) {
	_method := "pool_patch.get_by_name_label"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_labelArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "label"), label)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _labelArg)
	if _err != nil {
		return
	}
	_retval, _err = convertPoolPatchRefSetToGo(_method + " -> ", _result.Value)
	return
}
1226303
func (s *Server) Patch(path string, h HandlerFunc, opts ...HandlerOption) {
	s.register(http.MethodPatch, path, h, opts...)
}
268826
func (_class HostPatchClass) GetTimestampApplied(sessionID SessionRef, self HostPatchRef) (_retval time.Time, _err error) {
	_method := "host_patch.get_timestamp_applied"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertHostPatchRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertTimeToGo(_method + " -> ", _result.Value)
	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
}
1367518
func (obj *GenericDimension) ApplyPatchesRaw(ctx context.Context, patches interface{})error {
	err := obj.rpc(ctx, "ApplyPatches", nil, ensureEncodable(patches))
	return err 
}
1161104
func (c Changes) PatchContext(ctx context.Context) (*Patch, error) {
	return getPatchContext(ctx, "", c...)
}
447641
func (r *Router) Patch(path string, fn http.HandlerFunc) *Router {
	return r.Method(http.MethodPatch, path, fn)
}
1258140
func (v Version) NextPatchLevel(level int) Version {
	return Version{Number: v.Number - 0.01, PatchLevel: level}
}