You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: cose.go
    path of file: ./repos/ko/vendor/github.com/sigstore/rekor/pkg/generated/models
    
    the code of the file until where you have to start completion: // Code generated by go-swagger; DO NOT EDIT.

//
// Copyright 2021 
    
func (m *Cose) UnmarshalJSON(raw []byte) error {
	var data struct {

		// api version
		// Required: true
		// Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
		APIVersion *string `json:"apiVersion"`

		// spec
		// Required: true
		Spec CoseSchema `json:"spec"`
	}
	buf := bytes.NewBuffer(raw)
	dec := json.NewDecoder(buf)
	dec.UseNumber()

	if err := dec.Decode(&data); err != nil {
		return err
	}

	var base struct {
		/* Just the base type fields. Used for unmashalling polymorphic types.*/

		Kind string `json:"kind"`
	}
	buf = bytes.NewBuffer(raw)
	dec = json.NewDecoder(buf)
	dec.UseNumber()

	if err := dec.Decode(&base); err != nil {
		return err
	}

	var result Cose

	if base.Kind != result.Kind() {
		/* Not the type we're looking for. */
		return errors.New(422, "invalid kind value: %q", base.Kind)
	}

	result.APIVersion = data.APIVersion
	result.Spec = data.Spec

	*m = result

	return nil
}