// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: cheqd/resource/v2/resource.proto

package types

import (
	fmt "fmt"
	_ "github.com/cosmos/gogoproto/gogoproto"
	proto "github.com/cosmos/gogoproto/proto"
	_ "github.com/cosmos/gogoproto/types"
	github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
	io "io"
	math "math"
	math_bits "math/bits"
	time "time"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _ = time.Kitchen

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package

// Resource stores the contents of a DID-Linked Resource
type Resource struct {
	// bytes is the raw data of the Resource
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}

func (m *Resource) Reset()         { *m = Resource{} }
func (m *Resource) String() string { return proto.CompactTextString(m) }
func (*Resource) ProtoMessage()    {}
func (*Resource) Descriptor() ([]byte, []int) {
	return fileDescriptor_abfe0b32f2a40f67, []int{0}
}
func (m *Resource) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_Resource.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *Resource) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Resource.Merge(m, src)
}
func (m *Resource) XXX_Size() int {
	return m.Size()
}
func (m *Resource) XXX_DiscardUnknown() {
	xxx_messageInfo_Resource.DiscardUnknown(m)
}

var xxx_messageInfo_Resource proto.InternalMessageInfo

func (m *Resource) GetData() []byte {
	if m != nil {
		return m.Data
	}
	return nil
}

// Metadata stores the metadata of a DID-Linked Resource
type Metadata struct {
	// collection_id is the ID of the collection that the Resource belongs to. Defined client-side.
	// This field is the unique identifier of the DID linked to this Resource
	// Format: <unique-identifier>
	//
	// Examples:
	// - c82f2b02-bdab-4dd7-b833-3e143745d612
	// - wGHEXrZvJxR8vw5P3UWH1j
	CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"resourceCollectionId"`
	// id is the ID of the Resource. Defined client-side.
	// This field is a unique identifier for this specific version of the Resource.
	// Format: <uuid>
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"resourceId"`
	// name is a human-readable name for the Resource. Defined client-side.
	// Does not change between different versions.
	// Example: PassportSchema, EducationTrustRegistry
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"resourceName"`
	// version is a human-readable semantic version for the Resource. Defined client-side.
	// Stored as a string. OPTIONAL.
	// Example: 1.0.0, v2.1.0
	Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"resourceVersion"`
	// resource_type is a Resource type that identifies what the Resource is. Defined client-side.
	// This is NOT the same as the resource's media type.
	// Example: AnonCredsSchema, StatusList2021
	ResourceType string `protobuf:"bytes,5,opt,name=resource_type,json=resourceType,proto3" json:"resourceType"`
	// List of alternative URIs for the SAME Resource.
	AlsoKnownAs []*AlternativeUri `protobuf:"bytes,6,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"resourceAlternativeUri"`
	// media_type is IANA media type of the Resource. Defined ledger-side.
	// Example: application/json, image/png
	MediaType string `protobuf:"bytes,7,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"`
	// created is the time at which the Resource was created. Defined ledger-side.
	// Format: RFC3339
	// Example: 2021-01-01T00:00:00Z
	Created time.Time `protobuf:"bytes,8,opt,name=created,proto3,stdtime" json:"created"`
	// checksum is a SHA-256 checksum hash of the Resource. Defined ledger-side.
	// Example: d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f
	Checksum string `protobuf:"bytes,9,opt,name=checksum,proto3" json:"checksum,omitempty"`
	// previous_version_id is the ID of the previous version of the Resource. Defined ledger-side.
	// This is based on the Resource's name and Resource type to determine whether it's the same Resource.
	// Format: <uuid>
	PreviousVersionId string `protobuf:"bytes,10,opt,name=previous_version_id,json=previousVersionId,proto3" json:"previous_version_id,omitempty"`
	// next_version_id is the ID of the next version of the Resource. Defined ledger-side.
	// This is based on the Resource's name and Resource type to determine whether it's the same Resource.
	// Format: <uuid>
	NextVersionId string `protobuf:"bytes,11,opt,name=next_version_id,json=nextVersionId,proto3" json:"next_version_id,omitempty"`
}

func (m *Metadata) Reset()         { *m = Metadata{} }
func (m *Metadata) String() string { return proto.CompactTextString(m) }
func (*Metadata) ProtoMessage()    {}
func (*Metadata) Descriptor() ([]byte, []int) {
	return fileDescriptor_abfe0b32f2a40f67, []int{1}
}
func (m *Metadata) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_Metadata.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *Metadata) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Metadata.Merge(m, src)
}
func (m *Metadata) XXX_Size() int {
	return m.Size()
}
func (m *Metadata) XXX_DiscardUnknown() {
	xxx_messageInfo_Metadata.DiscardUnknown(m)
}

var xxx_messageInfo_Metadata proto.InternalMessageInfo

func (m *Metadata) GetCollectionId() string {
	if m != nil {
		return m.CollectionId
	}
	return ""
}

func (m *Metadata) GetId() string {
	if m != nil {
		return m.Id
	}
	return ""
}

func (m *Metadata) GetName() string {
	if m != nil {
		return m.Name
	}
	return ""
}

func (m *Metadata) GetVersion() string {
	if m != nil {
		return m.Version
	}
	return ""
}

func (m *Metadata) GetResourceType() string {
	if m != nil {
		return m.ResourceType
	}
	return ""
}

func (m *Metadata) GetAlsoKnownAs() []*AlternativeUri {
	if m != nil {
		return m.AlsoKnownAs
	}
	return nil
}

func (m *Metadata) GetMediaType() string {
	if m != nil {
		return m.MediaType
	}
	return ""
}

func (m *Metadata) GetCreated() time.Time {
	if m != nil {
		return m.Created
	}
	return time.Time{}
}

func (m *Metadata) GetChecksum() string {
	if m != nil {
		return m.Checksum
	}
	return ""
}

func (m *Metadata) GetPreviousVersionId() string {
	if m != nil {
		return m.PreviousVersionId
	}
	return ""
}

func (m *Metadata) GetNextVersionId() string {
	if m != nil {
		return m.NextVersionId
	}
	return ""
}

// AlternativeUri are alternative URIs that can be used to access the Resource.
// By default, at least the DID URI equivalent of the Resource is populated.
type AlternativeUri struct {
	// uri is the URI of the Resource.
	// Examples:
	// - did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e
	// - https://resolver..cheqd.net/1.0/identifiers/did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e
	// - https://example.com/example.json
	// - https://gateway.ipfs.io/ipfs/bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe
	// - ipfs://bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe
	Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"`
	// description is a human-readable description of the URI. Defined client-side.
	// Examples:
	// - did-uri
	// - http-uri
	// - ipfs-uri
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
}

func (m *AlternativeUri) Reset()         { *m = AlternativeUri{} }
func (m *AlternativeUri) String() string { return proto.CompactTextString(m) }
func (*AlternativeUri) ProtoMessage()    {}
func (*AlternativeUri) Descriptor() ([]byte, []int) {
	return fileDescriptor_abfe0b32f2a40f67, []int{2}
}
func (m *AlternativeUri) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *AlternativeUri) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_AlternativeUri.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *AlternativeUri) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AlternativeUri.Merge(m, src)
}
func (m *AlternativeUri) XXX_Size() int {
	return m.Size()
}
func (m *AlternativeUri) XXX_DiscardUnknown() {
	xxx_messageInfo_AlternativeUri.DiscardUnknown(m)
}

var xxx_messageInfo_AlternativeUri proto.InternalMessageInfo

func (m *AlternativeUri) GetUri() string {
	if m != nil {
		return m.Uri
	}
	return ""
}

func (m *AlternativeUri) GetDescription() string {
	if m != nil {
		return m.Description
	}
	return ""
}

// ResourceWithMetadata describes the overall structure of a DID-Linked Resource
type ResourceWithMetadata struct {
	Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"linkedResource"`
	Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"linkedResourceMetadata"`
}

func (m *ResourceWithMetadata) Reset()         { *m = ResourceWithMetadata{} }
func (m *ResourceWithMetadata) String() string { return proto.CompactTextString(m) }
func (*ResourceWithMetadata) ProtoMessage()    {}
func (*ResourceWithMetadata) Descriptor() ([]byte, []int) {
	return fileDescriptor_abfe0b32f2a40f67, []int{3}
}
func (m *ResourceWithMetadata) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *ResourceWithMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_ResourceWithMetadata.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *ResourceWithMetadata) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ResourceWithMetadata.Merge(m, src)
}
func (m *ResourceWithMetadata) XXX_Size() int {
	return m.Size()
}
func (m *ResourceWithMetadata) XXX_DiscardUnknown() {
	xxx_messageInfo_ResourceWithMetadata.DiscardUnknown(m)
}

var xxx_messageInfo_ResourceWithMetadata proto.InternalMessageInfo

func (m *ResourceWithMetadata) GetResource() *Resource {
	if m != nil {
		return m.Resource
	}
	return nil
}

func (m *ResourceWithMetadata) GetMetadata() *Metadata {
	if m != nil {
		return m.Metadata
	}
	return nil
}

func init() {
	proto.RegisterType((*Resource)(nil), "cheqd.resource.v2.Resource")
	proto.RegisterType((*Metadata)(nil), "cheqd.resource.v2.Metadata")
	proto.RegisterType((*AlternativeUri)(nil), "cheqd.resource.v2.AlternativeUri")
	proto.RegisterType((*ResourceWithMetadata)(nil), "cheqd.resource.v2.ResourceWithMetadata")
}

func init() { proto.RegisterFile("cheqd/resource/v2/resource.proto", fileDescriptor_abfe0b32f2a40f67) }

var fileDescriptor_abfe0b32f2a40f67 = []byte{
	// 595 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x54, 0x4f, 0x6f, 0xd3, 0x4e,
	0x10, 0x8d, 0xdb, 0xfc, 0x5a, 0x77, 0xd2, 0xf4, 0xcf, 0xfe, 0x2a, 0xb0, 0x82, 0xb0, 0x43, 0xc4,
	0xa1, 0x87, 0x62, 0x8b, 0x00, 0x47, 0x90, 0x1a, 0x10, 0x52, 0x55, 0xc1, 0x61, 0x29, 0x20, 0x71,
	0x89, 0x5c, 0xef, 0x90, 0xac, 0x1a, 0x7b, 0x83, 0xbd, 0x0e, 0xed, 0xb7, 0xe8, 0xc7, 0xe1, 0xc6,
	0xb5, 0xc7, 0x1e, 0x39, 0x19, 0xd4, 0xdc, 0xf2, 0x29, 0xd0, 0xae, 0xb3, 0x26, 0x51, 0x7b, 0x89,
	0x66, 0xe6, 0xbd, 0x79, 0x1e, 0xcf, 0x9b, 0x18, 0xda, 0xd1, 0x10, 0xbf, 0xb1, 0x20, 0xc5, 0x4c,
	0xe4, 0x69, 0x84, 0xc1, 0xa4, 0x5b, 0xc5, 0xfe, 0x38, 0x15, 0x52, 0x90, 0x5d, 0xcd, 0xf0, 0xab,
	0xea, 0xa4, 0xdb, 0xda, 0x1b, 0x88, 0x81, 0xd0, 0x68, 0xa0, 0xa2, 0x92, 0xd8, 0xf2, 0x06, 0x42,
	0x0c, 0x46, 0x18, 0xe8, 0xec, 0x34, 0xff, 0x1a, 0x48, 0x1e, 0x63, 0x26, 0xc3, 0x78, 0x5c, 0x12,
	0x3a, 0x2e, 0xd8, 0x74, 0xae, 0x42, 0x08, 0xd4, 0x59, 0x28, 0x43, 0xc7, 0x6a, 0x5b, 0xfb, 0x9b,
	0x54, 0xc7, 0x9d, 0x9f, 0x75, 0xb0, 0xdf, 0xa1, 0x0c, 0x55, 0x42, 0x5e, 0x42, 0x33, 0x12, 0xa3,
	0x11, 0x46, 0x92, 0x8b, 0xa4, 0xcf, 0x99, 0x66, 0x6e, 0xf4, 0x9c, 0x59, 0xe1, 0xed, 0x99, 0x59,
	0x5e, 0x57, 0x84, 0x23, 0x46, 0x37, 0xa3, 0x85, 0x8c, 0xb8, 0xb0, 0xc2, 0x99, 0xb3, 0xa2, 0x7b,
	0xb6, 0x66, 0x85, 0x07, 0xa6, 0xe7, 0x88, 0xd1, 0x15, 0xce, 0xc8, 0x63, 0xa8, 0x27, 0x61, 0x8c,
	0xce, 0xaa, 0x66, 0xec, 0xcc, 0x0a, 0x6f, 0xd3, 0x30, 0xde, 0x87, 0x31, 0x52, 0x8d, 0x92, 0xa7,
	0xb0, 0x3e, 0xc1, 0x34, 0xe3, 0x22, 0x71, 0xea, 0x9a, 0x78, 0xff, 0xaa, 0xf0, 0xac, 0x59, 0xe1,
	0x6d, 0x1b, 0xf2, 0xa7, 0x12, 0xa6, 0x86, 0x47, 0x5e, 0x40, 0xd3, 0x60, 0x7d, 0x79, 0x31, 0x46,
	0xe7, 0xbf, 0xdb, 0x4f, 0x38, 0xb9, 0x18, 0x23, 0x5d, 0xca, 0x08, 0x42, 0x33, 0x1c, 0x65, 0xa2,
	0x7f, 0x96, 0x88, 0xef, 0x49, 0x3f, 0xcc, 0x9c, 0xb5, 0xf6, 0xea, 0x7e, 0xa3, 0xfb, 0xc8, 0xbf,
	0xb5, 0x7d, 0xff, 0x70, 0x24, 0x31, 0x4d, 0x42, 0xc9, 0x27, 0xf8, 0x31, 0xe5, 0x3d, 0x77, 0x3e,
	0xd2, 0x3d, 0xc3, 0x59, 0xc6, 0x69, 0x43, 0xe9, 0x1e, 0x2b, 0xd9, 0xc3, 0x8c, 0x3c, 0x04, 0x88,
	0x91, 0xf1, 0xb0, 0x1c, 0x6d, 0x5d, 0x8d, 0x46, 0x37, 0x74, 0x45, 0x4f, 0xf1, 0x0a, 0xd6, 0xa3,
	0x14, 0x43, 0x89, 0xcc, 0xb1, 0xdb, 0xd6, 0x7e, 0xa3, 0xdb, 0xf2, 0x4b, 0x53, 0x7d, 0x63, 0xaa,
	0x7f, 0x62, 0x4c, 0xed, 0xd9, 0x57, 0x85, 0x57, 0xbb, 0xfc, 0xed, 0x59, 0xd4, 0x34, 0x91, 0x16,
	0xd8, 0xd1, 0x10, 0xa3, 0xb3, 0x2c, 0x8f, 0x9d, 0x0d, 0x2d, 0x5e, 0xe5, 0xe4, 0x39, 0xfc, 0x3f,
	0x4e, 0x71, 0xc2, 0x45, 0x9e, 0xf5, 0xe7, 0xcb, 0x52, 0xb6, 0x82, 0x5e, 0x4f, 0x5d, 0xbd, 0x04,
	0xdd, 0x35, 0x84, 0xf9, 0x56, 0x8f, 0x18, 0x39, 0x80, 0xed, 0x04, 0xcf, 0xe5, 0x62, 0x47, 0x63,
	0xa1, 0xa3, 0xa9, 0xc0, 0x8a, 0xdd, 0x79, 0x03, 0x5b, 0xcb, 0x6f, 0x4f, 0x76, 0x60, 0x35, 0x4f,
	0x79, 0x79, 0x3c, 0x54, 0x85, 0xa4, 0x0d, 0x0d, 0x86, 0x59, 0x94, 0xf2, 0xb1, 0x3a, 0x95, 0xf2,
	0x44, 0xe8, 0x62, 0xa9, 0xf3, 0xc3, 0x82, 0x3d, 0x73, 0xa8, 0x9f, 0xb9, 0x1c, 0x56, 0x37, 0x79,
	0x0c, 0xb6, 0x59, 0xb2, 0x56, 0x6c, 0x74, 0x1f, 0xdc, 0xe1, 0x8f, 0x69, 0xed, 0x91, 0x59, 0xe1,
	0x6d, 0x8d, 0x78, 0x72, 0x86, 0xcc, 0xd4, 0x68, 0x25, 0x40, 0x3e, 0x80, 0x1d, 0xcf, 0x85, 0xf5,
	0x10, 0x77, 0x8b, 0x99, 0x67, 0xf7, 0x5a, 0xca, 0xe2, 0x65, 0x31, 0x83, 0xd1, 0x4a, 0xa8, 0xf7,
	0xf6, 0xea, 0xc6, 0xb5, 0xae, 0x6f, 0x5c, 0xeb, 0xcf, 0x8d, 0x6b, 0x5d, 0x4e, 0xdd, 0xda, 0xf5,
	0xd4, 0xad, 0xfd, 0x9a, 0xba, 0xb5, 0x2f, 0x07, 0x03, 0x2e, 0x87, 0xf9, 0xa9, 0x1f, 0x89, 0x38,
	0x28, 0xff, 0xf3, 0xfa, 0xf7, 0x49, 0x22, 0x18, 0x06, 0xe7, 0xff, 0x3e, 0x00, 0xea, 0x30, 0xb2,
	0xd3, 0x35, 0xed, 0xf7, 0xb3, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xcb, 0xb4, 0xc8, 0xa0, 0x1f,
	0x04, 0x00, 0x00,
}

func (m *Resource) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *Resource) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Data) > 0 {
		i -= len(m.Data)
		copy(dAtA[i:], m.Data)
		i = encodeVarintResource(dAtA, i, uint64(len(m.Data)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *Metadata) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *Metadata) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.NextVersionId) > 0 {
		i -= len(m.NextVersionId)
		copy(dAtA[i:], m.NextVersionId)
		i = encodeVarintResource(dAtA, i, uint64(len(m.NextVersionId)))
		i--
		dAtA[i] = 0x5a
	}
	if len(m.PreviousVersionId) > 0 {
		i -= len(m.PreviousVersionId)
		copy(dAtA[i:], m.PreviousVersionId)
		i = encodeVarintResource(dAtA, i, uint64(len(m.PreviousVersionId)))
		i--
		dAtA[i] = 0x52
	}
	if len(m.Checksum) > 0 {
		i -= len(m.Checksum)
		copy(dAtA[i:], m.Checksum)
		i = encodeVarintResource(dAtA, i, uint64(len(m.Checksum)))
		i--
		dAtA[i] = 0x4a
	}
	n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Created, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Created):])
	if err1 != nil {
		return 0, err1
	}
	i -= n1
	i = encodeVarintResource(dAtA, i, uint64(n1))
	i--
	dAtA[i] = 0x42
	if len(m.MediaType) > 0 {
		i -= len(m.MediaType)
		copy(dAtA[i:], m.MediaType)
		i = encodeVarintResource(dAtA, i, uint64(len(m.MediaType)))
		i--
		dAtA[i] = 0x3a
	}
	if len(m.AlsoKnownAs) > 0 {
		for iNdEx := len(m.AlsoKnownAs) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.AlsoKnownAs[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintResource(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x32
		}
	}
	if len(m.ResourceType) > 0 {
		i -= len(m.ResourceType)
		copy(dAtA[i:], m.ResourceType)
		i = encodeVarintResource(dAtA, i, uint64(len(m.ResourceType)))
		i--
		dAtA[i] = 0x2a
	}
	if len(m.Version) > 0 {
		i -= len(m.Version)
		copy(dAtA[i:], m.Version)
		i = encodeVarintResource(dAtA, i, uint64(len(m.Version)))
		i--
		dAtA[i] = 0x22
	}
	if len(m.Name) > 0 {
		i -= len(m.Name)
		copy(dAtA[i:], m.Name)
		i = encodeVarintResource(dAtA, i, uint64(len(m.Name)))
		i--
		dAtA[i] = 0x1a
	}
	if len(m.Id) > 0 {
		i -= len(m.Id)
		copy(dAtA[i:], m.Id)
		i = encodeVarintResource(dAtA, i, uint64(len(m.Id)))
		i--
		dAtA[i] = 0x12
	}
	if len(m.CollectionId) > 0 {
		i -= len(m.CollectionId)
		copy(dAtA[i:], m.CollectionId)
		i = encodeVarintResource(dAtA, i, uint64(len(m.CollectionId)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *AlternativeUri) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *AlternativeUri) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *AlternativeUri) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Description) > 0 {
		i -= len(m.Description)
		copy(dAtA[i:], m.Description)
		i = encodeVarintResource(dAtA, i, uint64(len(m.Description)))
		i--
		dAtA[i] = 0x12
	}
	if len(m.Uri) > 0 {
		i -= len(m.Uri)
		copy(dAtA[i:], m.Uri)
		i = encodeVarintResource(dAtA, i, uint64(len(m.Uri)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *ResourceWithMetadata) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *ResourceWithMetadata) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *ResourceWithMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Metadata != nil {
		{
			size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintResource(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x12
	}
	if m.Resource != nil {
		{
			size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintResource(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func encodeVarintResource(dAtA []byte, offset int, v uint64) int {
	offset -= sovResource(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *Resource) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.Data)
	if l > 0 {
		n += 1 + l + sovResource(uint64(l))
	}
	return n
}

func (m *Metadata) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.CollectionId)
	if l > 0 {
		n += 1 + l + sovResource(uint64(l))
	}
	l = len(m.Id)
	if l > 0 {
		n += 1 + l + sovResource(uint64(l))
	}
	l = len(m.Name)
	if l > 0 {
		n += 1 + l + sovResource(uint64(l))
	}
	l = len(m.Version)
	if l > 0 {
		n += 1 + l + sovResource(uint64(l))
	}
	l = len(m.ResourceType)
	if l > 0 {
		n += 1 + l + sovResource(uint64(l))
	}
	if len(m.AlsoKnownAs) > 0 {
		for _, e := range m.AlsoKnownAs {
			l = e.Size()
			n += 1 + l + sovResource(uint64(l))
		}
	}
	l = len(m.MediaType)
	if l > 0 {
		n += 1 + l + sovResource(uint64(l))
	}
	l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Created)
	n += 1 + l + sovResource(uint64(l))
	l = len(m.Checksum)
	if l > 0 {
		n += 1 + l + sovResource(uint64(l))
	}
	l = len(m.PreviousVersionId)
	if l > 0 {
		n += 1 + l + sovResource(uint64(l))
	}
	l = len(m.NextVersionId)
	if l > 0 {
		n += 1 + l + sovResource(uint64(l))
	}
	return n
}

func (m *AlternativeUri) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.Uri)
	if l > 0 {
		n += 1 + l + sovResource(uint64(l))
	}
	l = len(m.Description)
	if l > 0 {
		n += 1 + l + sovResource(uint64(l))
	}
	return n
}

func (m *ResourceWithMetadata) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Resource != nil {
		l = m.Resource.Size()
		n += 1 + l + sovResource(uint64(l))
	}
	if m.Metadata != nil {
		l = m.Metadata.Size()
		n += 1 + l + sovResource(uint64(l))
	}
	return n
}

func sovResource(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozResource(x uint64) (n int) {
	return sovResource(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Resource) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowResource
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: Resource: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Resource: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + byteLen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
			if m.Data == nil {
				m.Data = []byte{}
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipResource(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthResource
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *Metadata) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowResource
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: Metadata: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field CollectionId", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.CollectionId = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Id = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Name = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Version = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 5:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ResourceType", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ResourceType = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 6:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field AlsoKnownAs", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.AlsoKnownAs = append(m.AlsoKnownAs, &AlternativeUri{})
			if err := m.AlsoKnownAs[len(m.AlsoKnownAs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 7:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field MediaType", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.MediaType = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 8:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Created", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Created, dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 9:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Checksum = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 10:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field PreviousVersionId", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.PreviousVersionId = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 11:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field NextVersionId", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.NextVersionId = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipResource(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthResource
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *AlternativeUri) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowResource
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: AlternativeUri: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: AlternativeUri: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Uri = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Description = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipResource(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthResource
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *ResourceWithMetadata) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowResource
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: ResourceWithMetadata: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: ResourceWithMetadata: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Resource == nil {
				m.Resource = &Resource{}
			}
			if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowResource
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthResource
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthResource
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Metadata == nil {
				m.Metadata = &Metadata{}
			}
			if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipResource(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthResource
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipResource(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
	depth := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowResource
			}
			if iNdEx >= l {
				return 0, io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		wireType := int(wire & 0x7)
		switch wireType {
		case 0:
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowResource
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				iNdEx++
				if dAtA[iNdEx-1] < 0x80 {
					break
				}
			}
		case 1:
			iNdEx += 8
		case 2:
			var length int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowResource
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if length < 0 {
				return 0, ErrInvalidLengthResource
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupResource
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthResource
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthResource        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowResource          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupResource = fmt.Errorf("proto: unexpected end of group")
)
