From 6e75a2c65d8eb489757762bcc12690e95edf64f6 Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Tue, 21 Jan 2025 15:19:44 -0500 Subject: [PATCH 01/14] blob: early store implementation, wip --- blob/memory/store.go | 43 + blob/memory/store_test.go | 15 + blob/store.go | 58 + blob/tests/store.go | 74 + database/prisma/db/db_gen.go | 12775 +++++++++++++++++++++----------- database/prisma/schema.prisma | 20 + 6 files changed, 8631 insertions(+), 4354 deletions(-) create mode 100644 blob/memory/store.go create mode 100644 blob/memory/store_test.go create mode 100644 blob/store.go create mode 100644 blob/tests/store.go diff --git a/blob/memory/store.go b/blob/memory/store.go new file mode 100644 index 0000000..7165b62 --- /dev/null +++ b/blob/memory/store.go @@ -0,0 +1,43 @@ +package memory + +import ( + "context" + "sync" + + "github.com/code-payments/flipchat-server/blob" +) + +type store struct { + mu sync.RWMutex + data map[string]*blob.Blob +} + +func NewInMemory() blob.Store { + return &store{ + data: make(map[string]*blob.Blob), + } +} + +func (s *store) CreateBlob(ctx context.Context, b *blob.Blob) error { + s.mu.Lock() + defer s.mu.Unlock() + + key := string(b.ID) + if _, found := s.data[key]; found { + return blob.ErrExists + } + s.data[key] = b.Clone() + return nil +} + +func (s *store) GetBlob(ctx context.Context, id []byte) (*blob.Blob, error) { + s.mu.RLock() + defer s.mu.RUnlock() + + key := string(id) + bl, found := s.data[key] + if !found { + return nil, blob.ErrNotFound + } + return bl.Clone(), nil +} diff --git a/blob/memory/store_test.go b/blob/memory/store_test.go new file mode 100644 index 0000000..25a53a7 --- /dev/null +++ b/blob/memory/store_test.go @@ -0,0 +1,15 @@ +package memory + +import ( + "testing" + + "github.com/code-payments/flipchat-server/blob/tests" +) + +func TestBlob_MemoryStore(t *testing.T) { + testStore := NewInMemory() + teardown := func() { + // testStore.(*memory).reset() + } + tests.RunStoreTests(t, testStore, teardown) +} diff --git a/blob/store.go b/blob/store.go new file mode 100644 index 0000000..45656de --- /dev/null +++ b/blob/store.go @@ -0,0 +1,58 @@ +package blob + +import ( + "context" + "errors" + "time" +) + +var ( + ErrExists = errors.New("blob already exists") + ErrNotFound = errors.New("blob not found") +) + +type BlobType int + +const ( + BlobTypeUnknown BlobType = iota + BlobTypeImage + BlobTypeVideo + BlobTypeAudio +) + +// Blob holds blob info +type Blob struct { + ID []byte + Owner string + Type BlobType + S3URL string + Size int64 + Metadata []byte + Flagged bool + CreatedAt time.Time +} + +// Clone creates a deep copy +func (b *Blob) Clone() *Blob { + idCopy := make([]byte, len(b.ID)) + copy(idCopy, b.ID) + metadataCopy := make([]byte, len(b.Metadata)) + copy(metadataCopy, b.Metadata) + + return &Blob{ + ID: idCopy, + Owner: b.Owner, + Type: b.Type, + S3URL: b.S3URL, + Size: b.Size, + Metadata: metadataCopy, + Flagged: b.Flagged, + CreatedAt: b.CreatedAt, + } +} + +// Store is an interface for blob operations +type Store interface { + CreateBlob(ctx context.Context, blob *Blob) error + GetBlob(ctx context.Context, id []byte) (*Blob, error) +} diff --git a/blob/tests/store.go b/blob/tests/store.go new file mode 100644 index 0000000..b90c025 --- /dev/null +++ b/blob/tests/store.go @@ -0,0 +1,74 @@ +package tests + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/code-payments/flipchat-server/blob" +) + +func RunStoreTests(t *testing.T, s blob.Store, teardown func()) { + for _, tf := range []func(t *testing.T, s blob.Store){ + testCreateAndGet, + testCreateDuplicate, + } { + tf(t, s) + teardown() + } +} + +func testCreateAndGet(t *testing.T, s blob.Store) { + ctx := context.Background() + + // Attempt to retrieve a non-existent blob + _, err := s.GetBlob(ctx, []byte{0x01, 0x02}) + require.ErrorIs(t, err, blob.ErrNotFound) + + // Create a new blob + now := time.Now() + testBlob := &blob.Blob{ + ID: []byte{0x05, 0x06}, + Owner: "test-owner", + Type: blob.BlobTypeImage, + S3URL: "s3://test-bucket/test-key", + Size: 12345, + Metadata: []byte("some metadata"), + Flagged: false, + CreatedAt: now, + } + require.NoError(t, s.CreateBlob(ctx, testBlob)) + + // Retrieve and verify + got, err := s.GetBlob(ctx, testBlob.ID) + require.NoError(t, err) + require.NotNil(t, got) + require.Equal(t, testBlob.Owner, got.Owner) + require.Equal(t, testBlob.Size, got.Size) + require.Equal(t, testBlob.Type, got.Type) + require.Equal(t, testBlob.S3URL, got.S3URL) + require.Equal(t, testBlob.Flagged, got.Flagged) + require.Equal(t, testBlob.Metadata, got.Metadata) + require.WithinDuration(t, testBlob.CreatedAt, got.CreatedAt, time.Second) +} + +func testCreateDuplicate(t *testing.T, s blob.Store) { + ctx := context.Background() + + // Create an initial blob + blobID := []byte{0x09, 0x0A} + testBlob := &blob.Blob{ + ID: blobID, + Owner: "duplicate-owner", + Type: blob.BlobTypeAudio, + S3URL: "s3://audio-bucket/audio-key", + Size: 999, + } + require.NoError(t, s.CreateBlob(ctx, testBlob)) + + // Creating again with the same ID should fail + err := s.CreateBlob(ctx, testBlob) + require.ErrorIs(t, err, blob.ErrExists) +} diff --git a/database/prisma/db/db_gen.go b/database/prisma/db/db_gen.go index 1838e38..285e869 100644 --- a/database/prisma/db/db_gen.go +++ b/database/prisma/db/db_gen.go @@ -270,6 +270,26 @@ model Iap { @@map("flipchat_iap") } + +model Blob { + // Fields + id Bytes @id + + userId String + type Int @db.SmallInt + s3Url String + size Int + metadata Bytes + flagged Boolean @default(false) + + createdAt DateTime @default(now()) + + // Relations + + // Constraints + + @@map("flipchat_blob") +} ` const schemaDatasourceURL = "" const schemaEnvVarName = "DATABASE_URL" @@ -350,6 +370,7 @@ func newClient() *PrismaClient { c.Pointer = pointerActions{client: c} c.PushToken = pushTokenActions{client: c} c.Iap = iapActions{client: c} + c.Blob = blobActions{client: c} c.Prisma = &PrismaActions{ Raw: &raw.Raw{Engine: c}, @@ -392,6 +413,8 @@ type PrismaClient struct { PushToken pushTokenActions // Iap provides access to CRUD methods. Iap iapActions + // Blob provides access to CRUD methods. + Blob blobActions } // --- template enums.gotpl --- @@ -510,6 +533,19 @@ const ( IapScalarFieldEnumCreatedAt IapScalarFieldEnum = "createdAt" ) +type BlobScalarFieldEnum string + +const ( + BlobScalarFieldEnumID BlobScalarFieldEnum = "id" + BlobScalarFieldEnumUserID BlobScalarFieldEnum = "userId" + BlobScalarFieldEnumType BlobScalarFieldEnum = "type" + BlobScalarFieldEnumS3URL BlobScalarFieldEnum = "s3Url" + BlobScalarFieldEnumSize BlobScalarFieldEnum = "size" + BlobScalarFieldEnumMetadata BlobScalarFieldEnum = "metadata" + BlobScalarFieldEnumFlagged BlobScalarFieldEnum = "flagged" + BlobScalarFieldEnumCreatedAt BlobScalarFieldEnum = "createdAt" +) + type SortOrder string const ( @@ -708,6 +744,24 @@ const iapFieldState iapPrismaFields = "state" const iapFieldCreatedAt iapPrismaFields = "createdAt" +type blobPrismaFields = prismaFields + +const blobFieldID blobPrismaFields = "id" + +const blobFieldUserID blobPrismaFields = "userId" + +const blobFieldType blobPrismaFields = "type" + +const blobFieldS3URL blobPrismaFields = "s3Url" + +const blobFieldSize blobPrismaFields = "size" + +const blobFieldMetadata blobPrismaFields = "metadata" + +const blobFieldFlagged blobPrismaFields = "flagged" + +const blobFieldCreatedAt blobPrismaFields = "createdAt" + // --- template mock.gotpl --- func NewMock() (*PrismaClient, *Mock, func(t *testing.T)) { expectations := new([]mock.Expectation) @@ -754,6 +808,10 @@ func NewMock() (*PrismaClient, *Mock, func(t *testing.T)) { mock: m, } + m.Blob = blobMock{ + mock: m, + } + return pc, m, m.Ensure } @@ -777,6 +835,8 @@ type Mock struct { PushToken pushTokenMock Iap iapMock + + Blob blobMock } type userMock struct { @@ -1157,6 +1217,48 @@ func (m *iapMockExec) Errors(err error) { }) } +type blobMock struct { + mock *Mock +} + +type BlobMockExpectParam interface { + ExtractQuery() builder.Query + blobModel() +} + +func (m *blobMock) Expect(query BlobMockExpectParam) *blobMockExec { + return &blobMockExec{ + mock: m.mock, + query: query.ExtractQuery(), + } +} + +type blobMockExec struct { + mock *Mock + query builder.Query +} + +func (m *blobMockExec) Returns(v BlobModel) { + *m.mock.Expectations = append(*m.mock.Expectations, mock.Expectation{ + Query: m.query, + Want: &v, + }) +} + +func (m *blobMockExec) ReturnsMany(v []BlobModel) { + *m.mock.Expectations = append(*m.mock.Expectations, mock.Expectation{ + Query: m.query, + Want: &v, + }) +} + +func (m *blobMockExec) Errors(err error) { + *m.mock.Expectations = append(*m.mock.Expectations, mock.Expectation{ + Query: m.query, + WantErr: err, + }) +} + // --- template models.gotpl --- // UserModel represents the User model and is a wrapper for accessing fields and methods @@ -1508,6 +1610,40 @@ type RawIapModel struct { type RelationsIap struct { } +// BlobModel represents the Blob model and is a wrapper for accessing fields and methods +type BlobModel struct { + InnerBlob + RelationsBlob +} + +// InnerBlob holds the actual data +type InnerBlob struct { + ID Bytes `json:"id"` + UserID string `json:"userId"` + Type int `json:"type"` + S3URL string `json:"s3Url"` + Size int `json:"size"` + Metadata Bytes `json:"metadata"` + Flagged bool `json:"flagged"` + CreatedAt DateTime `json:"createdAt"` +} + +// RawBlobModel is a struct for Blob when used in raw queries +type RawBlobModel struct { + ID RawBytes `json:"id"` + UserID RawString `json:"userId"` + Type RawInt `json:"type"` + S3URL RawString `json:"s3Url"` + Size RawInt `json:"size"` + Metadata RawBytes `json:"metadata"` + Flagged RawBoolean `json:"flagged"` + CreatedAt RawDateTime `json:"createdAt"` +} + +// RelationsBlob holds the relation data separately +type RelationsBlob struct { +} + // --- template query.gotpl --- // User acts as a namespaces to access query methods for the User model @@ -20796,6610 +20932,9645 @@ func (r iapQueryCreatedAtDateTime) Field() iapPrismaFields { return iapFieldCreatedAt } -// --- template actions.gotpl --- -var countOutput = []builder.Output{ - {Name: "count"}, -} +// Blob acts as a namespaces to access query methods for the Blob model +var Blob = blobQuery{} -type userActions struct { - // client holds the prisma client - client *PrismaClient -} +// blobQuery exposes query functions for the blob model +type blobQuery struct { -var userOutput = []builder.Output{ - {Name: "id"}, - {Name: "displayName"}, - {Name: "isStaff"}, - {Name: "isRegistered"}, - {Name: "createdAt"}, - {Name: "updatedAt"}, -} + // ID + // + // @required + ID blobQueryIDBytes -type UserRelationWith interface { - getQuery() builder.Query - with() - userRelation() -} + // UserID + // + // @required + UserID blobQueryUserIDString -type UserWhereParam interface { - field() builder.Field - getQuery() builder.Query - userModel() -} + // Type + // + // @required + Type blobQueryTypeInt -type userDefaultParam struct { - data builder.Field - query builder.Query -} + // S3URL + // + // @required + S3URL blobQueryS3URLString -func (p userDefaultParam) field() builder.Field { - return p.data -} + // Size + // + // @required + Size blobQuerySizeInt -func (p userDefaultParam) getQuery() builder.Query { - return p.query -} + // Metadata + // + // @required + Metadata blobQueryMetadataBytes -func (p userDefaultParam) userModel() {} + // Flagged + // + // @required + Flagged blobQueryFlaggedBoolean -type UserOrderByParam interface { - field() builder.Field - getQuery() builder.Query - userModel() + // CreatedAt + // + // @required + CreatedAt blobQueryCreatedAtDateTime } -type userOrderByParam struct { - data builder.Field - query builder.Query -} +func (blobQuery) Not(params ...BlobWhereParam) blobDefaultParam { + var fields []builder.Field -func (p userOrderByParam) field() builder.Field { - return p.data -} + for _, q := range params { + fields = append(fields, q.field()) + } -func (p userOrderByParam) getQuery() builder.Query { - return p.query + return blobDefaultParam{ + data: builder.Field{ + Name: "NOT", + List: true, + WrapList: true, + Fields: fields, + }, + } } -func (p userOrderByParam) userModel() {} +func (blobQuery) Or(params ...BlobWhereParam) blobDefaultParam { + var fields []builder.Field -type UserCursorParam interface { - field() builder.Field - getQuery() builder.Query - userModel() - isCursor() -} + for _, q := range params { + fields = append(fields, q.field()) + } -type userCursorParam struct { - data builder.Field - query builder.Query + return blobDefaultParam{ + data: builder.Field{ + Name: "OR", + List: true, + WrapList: true, + Fields: fields, + }, + } } -func (p userCursorParam) field() builder.Field { - return p.data -} +func (blobQuery) And(params ...BlobWhereParam) blobDefaultParam { + var fields []builder.Field -func (p userCursorParam) isCursor() {} + for _, q := range params { + fields = append(fields, q.field()) + } -func (p userCursorParam) getQuery() builder.Query { - return p.query + return blobDefaultParam{ + data: builder.Field{ + Name: "AND", + List: true, + WrapList: true, + Fields: fields, + }, + } } -func (p userCursorParam) userModel() {} +// base struct +type blobQueryIDBytes struct{} + +// Set the required value of ID +func (r blobQueryIDBytes) Set(value Bytes) blobWithPrismaIDSetParam { + + return blobWithPrismaIDSetParam{ + data: builder.Field{ + Name: "id", + Value: value, + }, + } -type UserParamUnique interface { - field() builder.Field - getQuery() builder.Query - unique() - userModel() } -type userParamUnique struct { - data builder.Field - query builder.Query +// Set the optional value of ID dynamically +func (r blobQueryIDBytes) SetIfPresent(value *Bytes) blobWithPrismaIDSetParam { + if value == nil { + return blobWithPrismaIDSetParam{} + } + + return r.Set(*value) } -func (p userParamUnique) userModel() {} +func (r blobQueryIDBytes) Equals(value Bytes) blobWithPrismaIDEqualsUniqueParam { -func (userParamUnique) unique() {} + return blobWithPrismaIDEqualsUniqueParam{ + data: builder.Field{ + Name: "id", + Fields: []builder.Field{ + { + Name: "equals", + Value: value, + }, + }, + }, + } +} -func (p userParamUnique) field() builder.Field { - return p.data +func (r blobQueryIDBytes) EqualsIfPresent(value *Bytes) blobWithPrismaIDEqualsUniqueParam { + if value == nil { + return blobWithPrismaIDEqualsUniqueParam{} + } + return r.Equals(*value) } -func (p userParamUnique) getQuery() builder.Query { - return p.query +func (r blobQueryIDBytes) Order(direction SortOrder) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "id", + Value: direction, + }, + } } -type UserEqualsWhereParam interface { - field() builder.Field - getQuery() builder.Query - equals() - userModel() +func (r blobQueryIDBytes) Cursor(cursor Bytes) blobCursorParam { + return blobCursorParam{ + data: builder.Field{ + Name: "id", + Value: cursor, + }, + } } -type userEqualsParam struct { - data builder.Field - query builder.Query +func (r blobQueryIDBytes) In(value []Bytes) blobParamUnique { + return blobParamUnique{ + data: builder.Field{ + Name: "id", + Fields: []builder.Field{ + { + Name: "in", + Value: value, + }, + }, + }, + } } -func (p userEqualsParam) userModel() {} +func (r blobQueryIDBytes) InIfPresent(value []Bytes) blobParamUnique { + if value == nil { + return blobParamUnique{} + } + return r.In(value) +} -func (userEqualsParam) equals() {} +func (r blobQueryIDBytes) NotIn(value []Bytes) blobParamUnique { + return blobParamUnique{ + data: builder.Field{ + Name: "id", + Fields: []builder.Field{ + { + Name: "notIn", + Value: value, + }, + }, + }, + } +} -func (p userEqualsParam) field() builder.Field { - return p.data +func (r blobQueryIDBytes) NotInIfPresent(value []Bytes) blobParamUnique { + if value == nil { + return blobParamUnique{} + } + return r.NotIn(value) } -func (p userEqualsParam) getQuery() builder.Query { - return p.query +func (r blobQueryIDBytes) Not(value Bytes) blobParamUnique { + return blobParamUnique{ + data: builder.Field{ + Name: "id", + Fields: []builder.Field{ + { + Name: "not", + Value: value, + }, + }, + }, + } } -type UserEqualsUniqueWhereParam interface { - field() builder.Field - getQuery() builder.Query - equals() - unique() - userModel() +func (r blobQueryIDBytes) NotIfPresent(value *Bytes) blobParamUnique { + if value == nil { + return blobParamUnique{} + } + return r.Not(*value) } -type userEqualsUniqueParam struct { - data builder.Field - query builder.Query +func (r blobQueryIDBytes) Field() blobPrismaFields { + return blobFieldID } -func (p userEqualsUniqueParam) userModel() {} +// base struct +type blobQueryUserIDString struct{} -func (userEqualsUniqueParam) unique() {} -func (userEqualsUniqueParam) equals() {} +// Set the required value of UserID +func (r blobQueryUserIDString) Set(value string) blobWithPrismaUserIDSetParam { -func (p userEqualsUniqueParam) field() builder.Field { - return p.data -} + return blobWithPrismaUserIDSetParam{ + data: builder.Field{ + Name: "userId", + Value: value, + }, + } -func (p userEqualsUniqueParam) getQuery() builder.Query { - return p.query } -type UserSetParam interface { - field() builder.Field - settable() - userModel() -} +// Set the optional value of UserID dynamically +func (r blobQueryUserIDString) SetIfPresent(value *String) blobWithPrismaUserIDSetParam { + if value == nil { + return blobWithPrismaUserIDSetParam{} + } -type userSetParam struct { - data builder.Field + return r.Set(*value) } -func (userSetParam) settable() {} +func (r blobQueryUserIDString) Equals(value string) blobWithPrismaUserIDEqualsParam { -func (p userSetParam) field() builder.Field { - return p.data + return blobWithPrismaUserIDEqualsParam{ + data: builder.Field{ + Name: "userId", + Fields: []builder.Field{ + { + Name: "equals", + Value: value, + }, + }, + }, + } } -func (p userSetParam) userModel() {} - -type UserWithPrismaIDEqualsSetParam interface { - field() builder.Field - getQuery() builder.Query - equals() - userModel() - idField() +func (r blobQueryUserIDString) EqualsIfPresent(value *string) blobWithPrismaUserIDEqualsParam { + if value == nil { + return blobWithPrismaUserIDEqualsParam{} + } + return r.Equals(*value) } -type UserWithPrismaIDSetParam interface { - field() builder.Field - getQuery() builder.Query - userModel() - idField() +func (r blobQueryUserIDString) Order(direction SortOrder) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "userId", + Value: direction, + }, + } } -type userWithPrismaIDSetParam struct { - data builder.Field - query builder.Query +func (r blobQueryUserIDString) Cursor(cursor string) blobCursorParam { + return blobCursorParam{ + data: builder.Field{ + Name: "userId", + Value: cursor, + }, + } } -func (p userWithPrismaIDSetParam) field() builder.Field { - return p.data +func (r blobQueryUserIDString) In(value []string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "userId", + Fields: []builder.Field{ + { + Name: "in", + Value: value, + }, + }, + }, + } } -func (p userWithPrismaIDSetParam) getQuery() builder.Query { - return p.query +func (r blobQueryUserIDString) InIfPresent(value []string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.In(value) } -func (p userWithPrismaIDSetParam) userModel() {} - -func (p userWithPrismaIDSetParam) idField() {} - -type UserWithPrismaIDWhereParam interface { - field() builder.Field - getQuery() builder.Query - userModel() - idField() +func (r blobQueryUserIDString) NotIn(value []string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "userId", + Fields: []builder.Field{ + { + Name: "notIn", + Value: value, + }, + }, + }, + } } -type userWithPrismaIDEqualsParam struct { - data builder.Field - query builder.Query +func (r blobQueryUserIDString) NotInIfPresent(value []string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.NotIn(value) } -func (p userWithPrismaIDEqualsParam) field() builder.Field { - return p.data +func (r blobQueryUserIDString) Lt(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "userId", + Fields: []builder.Field{ + { + Name: "lt", + Value: value, + }, + }, + }, + } } -func (p userWithPrismaIDEqualsParam) getQuery() builder.Query { - return p.query +func (r blobQueryUserIDString) LtIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Lt(*value) } -func (p userWithPrismaIDEqualsParam) userModel() {} - -func (p userWithPrismaIDEqualsParam) idField() {} - -func (userWithPrismaIDSetParam) settable() {} -func (userWithPrismaIDEqualsParam) equals() {} - -type userWithPrismaIDEqualsUniqueParam struct { - data builder.Field - query builder.Query +func (r blobQueryUserIDString) Lte(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "userId", + Fields: []builder.Field{ + { + Name: "lte", + Value: value, + }, + }, + }, + } } -func (p userWithPrismaIDEqualsUniqueParam) field() builder.Field { - return p.data +func (r blobQueryUserIDString) LteIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Lte(*value) } -func (p userWithPrismaIDEqualsUniqueParam) getQuery() builder.Query { - return p.query +func (r blobQueryUserIDString) Gt(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "userId", + Fields: []builder.Field{ + { + Name: "gt", + Value: value, + }, + }, + }, + } } -func (p userWithPrismaIDEqualsUniqueParam) userModel() {} -func (p userWithPrismaIDEqualsUniqueParam) idField() {} - -func (userWithPrismaIDEqualsUniqueParam) unique() {} -func (userWithPrismaIDEqualsUniqueParam) equals() {} - -type UserWithPrismaDisplayNameEqualsSetParam interface { - field() builder.Field - getQuery() builder.Query - equals() - userModel() - displayNameField() +func (r blobQueryUserIDString) GtIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Gt(*value) } -type UserWithPrismaDisplayNameSetParam interface { - field() builder.Field - getQuery() builder.Query - userModel() - displayNameField() +func (r blobQueryUserIDString) Gte(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "userId", + Fields: []builder.Field{ + { + Name: "gte", + Value: value, + }, + }, + }, + } } -type userWithPrismaDisplayNameSetParam struct { - data builder.Field - query builder.Query +func (r blobQueryUserIDString) GteIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Gte(*value) } -func (p userWithPrismaDisplayNameSetParam) field() builder.Field { +func (r blobQueryUserIDString) Contains(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "userId", + Fields: []builder.Field{ + { + Name: "contains", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryUserIDString) ContainsIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Contains(*value) +} + +func (r blobQueryUserIDString) StartsWith(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "userId", + Fields: []builder.Field{ + { + Name: "startsWith", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryUserIDString) StartsWithIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.StartsWith(*value) +} + +func (r blobQueryUserIDString) EndsWith(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "userId", + Fields: []builder.Field{ + { + Name: "endsWith", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryUserIDString) EndsWithIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.EndsWith(*value) +} + +func (r blobQueryUserIDString) Mode(value QueryMode) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "userId", + Fields: []builder.Field{ + { + Name: "mode", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryUserIDString) ModeIfPresent(value *QueryMode) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Mode(*value) +} + +func (r blobQueryUserIDString) Not(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "userId", + Fields: []builder.Field{ + { + Name: "not", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryUserIDString) NotIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Not(*value) +} + +// deprecated: Use StartsWith instead. + +func (r blobQueryUserIDString) HasPrefix(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "userId", + Fields: []builder.Field{ + { + Name: "starts_with", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use StartsWithIfPresent instead. +func (r blobQueryUserIDString) HasPrefixIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.HasPrefix(*value) +} + +// deprecated: Use EndsWith instead. + +func (r blobQueryUserIDString) HasSuffix(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "userId", + Fields: []builder.Field{ + { + Name: "ends_with", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use EndsWithIfPresent instead. +func (r blobQueryUserIDString) HasSuffixIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.HasSuffix(*value) +} + +func (r blobQueryUserIDString) Field() blobPrismaFields { + return blobFieldUserID +} + +// base struct +type blobQueryTypeInt struct{} + +// Set the required value of Type +func (r blobQueryTypeInt) Set(value int) blobWithPrismaTypeSetParam { + + return blobWithPrismaTypeSetParam{ + data: builder.Field{ + Name: "type", + Value: value, + }, + } + +} + +// Set the optional value of Type dynamically +func (r blobQueryTypeInt) SetIfPresent(value *Int) blobWithPrismaTypeSetParam { + if value == nil { + return blobWithPrismaTypeSetParam{} + } + + return r.Set(*value) +} + +// Increment the required value of Type +func (r blobQueryTypeInt) Increment(value int) blobWithPrismaTypeSetParam { + return blobWithPrismaTypeSetParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + builder.Field{ + Name: "increment", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryTypeInt) IncrementIfPresent(value *int) blobWithPrismaTypeSetParam { + if value == nil { + return blobWithPrismaTypeSetParam{} + } + return r.Increment(*value) +} + +// Decrement the required value of Type +func (r blobQueryTypeInt) Decrement(value int) blobWithPrismaTypeSetParam { + return blobWithPrismaTypeSetParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + builder.Field{ + Name: "decrement", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryTypeInt) DecrementIfPresent(value *int) blobWithPrismaTypeSetParam { + if value == nil { + return blobWithPrismaTypeSetParam{} + } + return r.Decrement(*value) +} + +// Multiply the required value of Type +func (r blobQueryTypeInt) Multiply(value int) blobWithPrismaTypeSetParam { + return blobWithPrismaTypeSetParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + builder.Field{ + Name: "multiply", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryTypeInt) MultiplyIfPresent(value *int) blobWithPrismaTypeSetParam { + if value == nil { + return blobWithPrismaTypeSetParam{} + } + return r.Multiply(*value) +} + +// Divide the required value of Type +func (r blobQueryTypeInt) Divide(value int) blobWithPrismaTypeSetParam { + return blobWithPrismaTypeSetParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + builder.Field{ + Name: "divide", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryTypeInt) DivideIfPresent(value *int) blobWithPrismaTypeSetParam { + if value == nil { + return blobWithPrismaTypeSetParam{} + } + return r.Divide(*value) +} + +func (r blobQueryTypeInt) Equals(value int) blobWithPrismaTypeEqualsParam { + + return blobWithPrismaTypeEqualsParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + { + Name: "equals", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryTypeInt) EqualsIfPresent(value *int) blobWithPrismaTypeEqualsParam { + if value == nil { + return blobWithPrismaTypeEqualsParam{} + } + return r.Equals(*value) +} + +func (r blobQueryTypeInt) Order(direction SortOrder) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "type", + Value: direction, + }, + } +} + +func (r blobQueryTypeInt) Cursor(cursor int) blobCursorParam { + return blobCursorParam{ + data: builder.Field{ + Name: "type", + Value: cursor, + }, + } +} + +func (r blobQueryTypeInt) In(value []int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + { + Name: "in", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryTypeInt) InIfPresent(value []int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.In(value) +} + +func (r blobQueryTypeInt) NotIn(value []int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + { + Name: "notIn", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryTypeInt) NotInIfPresent(value []int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.NotIn(value) +} + +func (r blobQueryTypeInt) Lt(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + { + Name: "lt", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryTypeInt) LtIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Lt(*value) +} + +func (r blobQueryTypeInt) Lte(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + { + Name: "lte", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryTypeInt) LteIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Lte(*value) +} + +func (r blobQueryTypeInt) Gt(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + { + Name: "gt", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryTypeInt) GtIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Gt(*value) +} + +func (r blobQueryTypeInt) Gte(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + { + Name: "gte", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryTypeInt) GteIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Gte(*value) +} + +func (r blobQueryTypeInt) Not(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + { + Name: "not", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryTypeInt) NotIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Not(*value) +} + +// deprecated: Use Lt instead. + +func (r blobQueryTypeInt) LT(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + { + Name: "lt", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use LtIfPresent instead. +func (r blobQueryTypeInt) LTIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.LT(*value) +} + +// deprecated: Use Lte instead. + +func (r blobQueryTypeInt) LTE(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + { + Name: "lte", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use LteIfPresent instead. +func (r blobQueryTypeInt) LTEIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.LTE(*value) +} + +// deprecated: Use Gt instead. + +func (r blobQueryTypeInt) GT(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + { + Name: "gt", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use GtIfPresent instead. +func (r blobQueryTypeInt) GTIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.GT(*value) +} + +// deprecated: Use Gte instead. + +func (r blobQueryTypeInt) GTE(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "type", + Fields: []builder.Field{ + { + Name: "gte", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use GteIfPresent instead. +func (r blobQueryTypeInt) GTEIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.GTE(*value) +} + +func (r blobQueryTypeInt) Field() blobPrismaFields { + return blobFieldType +} + +// base struct +type blobQueryS3URLString struct{} + +// Set the required value of S3URL +func (r blobQueryS3URLString) Set(value string) blobWithPrismaS3URLSetParam { + + return blobWithPrismaS3URLSetParam{ + data: builder.Field{ + Name: "s3Url", + Value: value, + }, + } + +} + +// Set the optional value of S3URL dynamically +func (r blobQueryS3URLString) SetIfPresent(value *String) blobWithPrismaS3URLSetParam { + if value == nil { + return blobWithPrismaS3URLSetParam{} + } + + return r.Set(*value) +} + +func (r blobQueryS3URLString) Equals(value string) blobWithPrismaS3URLEqualsParam { + + return blobWithPrismaS3URLEqualsParam{ + data: builder.Field{ + Name: "s3Url", + Fields: []builder.Field{ + { + Name: "equals", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryS3URLString) EqualsIfPresent(value *string) blobWithPrismaS3URLEqualsParam { + if value == nil { + return blobWithPrismaS3URLEqualsParam{} + } + return r.Equals(*value) +} + +func (r blobQueryS3URLString) Order(direction SortOrder) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "s3Url", + Value: direction, + }, + } +} + +func (r blobQueryS3URLString) Cursor(cursor string) blobCursorParam { + return blobCursorParam{ + data: builder.Field{ + Name: "s3Url", + Value: cursor, + }, + } +} + +func (r blobQueryS3URLString) In(value []string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "s3Url", + Fields: []builder.Field{ + { + Name: "in", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryS3URLString) InIfPresent(value []string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.In(value) +} + +func (r blobQueryS3URLString) NotIn(value []string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "s3Url", + Fields: []builder.Field{ + { + Name: "notIn", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryS3URLString) NotInIfPresent(value []string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.NotIn(value) +} + +func (r blobQueryS3URLString) Lt(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "s3Url", + Fields: []builder.Field{ + { + Name: "lt", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryS3URLString) LtIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Lt(*value) +} + +func (r blobQueryS3URLString) Lte(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "s3Url", + Fields: []builder.Field{ + { + Name: "lte", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryS3URLString) LteIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Lte(*value) +} + +func (r blobQueryS3URLString) Gt(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "s3Url", + Fields: []builder.Field{ + { + Name: "gt", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryS3URLString) GtIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Gt(*value) +} + +func (r blobQueryS3URLString) Gte(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "s3Url", + Fields: []builder.Field{ + { + Name: "gte", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryS3URLString) GteIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Gte(*value) +} + +func (r blobQueryS3URLString) Contains(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "s3Url", + Fields: []builder.Field{ + { + Name: "contains", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryS3URLString) ContainsIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Contains(*value) +} + +func (r blobQueryS3URLString) StartsWith(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "s3Url", + Fields: []builder.Field{ + { + Name: "startsWith", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryS3URLString) StartsWithIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.StartsWith(*value) +} + +func (r blobQueryS3URLString) EndsWith(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "s3Url", + Fields: []builder.Field{ + { + Name: "endsWith", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryS3URLString) EndsWithIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.EndsWith(*value) +} + +func (r blobQueryS3URLString) Mode(value QueryMode) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "s3Url", + Fields: []builder.Field{ + { + Name: "mode", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryS3URLString) ModeIfPresent(value *QueryMode) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Mode(*value) +} + +func (r blobQueryS3URLString) Not(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "s3Url", + Fields: []builder.Field{ + { + Name: "not", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryS3URLString) NotIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Not(*value) +} + +// deprecated: Use StartsWith instead. + +func (r blobQueryS3URLString) HasPrefix(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "s3Url", + Fields: []builder.Field{ + { + Name: "starts_with", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use StartsWithIfPresent instead. +func (r blobQueryS3URLString) HasPrefixIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.HasPrefix(*value) +} + +// deprecated: Use EndsWith instead. + +func (r blobQueryS3URLString) HasSuffix(value string) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "s3Url", + Fields: []builder.Field{ + { + Name: "ends_with", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use EndsWithIfPresent instead. +func (r blobQueryS3URLString) HasSuffixIfPresent(value *string) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.HasSuffix(*value) +} + +func (r blobQueryS3URLString) Field() blobPrismaFields { + return blobFieldS3URL +} + +// base struct +type blobQuerySizeInt struct{} + +// Set the required value of Size +func (r blobQuerySizeInt) Set(value int) blobWithPrismaSizeSetParam { + + return blobWithPrismaSizeSetParam{ + data: builder.Field{ + Name: "size", + Value: value, + }, + } + +} + +// Set the optional value of Size dynamically +func (r blobQuerySizeInt) SetIfPresent(value *Int) blobWithPrismaSizeSetParam { + if value == nil { + return blobWithPrismaSizeSetParam{} + } + + return r.Set(*value) +} + +// Increment the required value of Size +func (r blobQuerySizeInt) Increment(value int) blobWithPrismaSizeSetParam { + return blobWithPrismaSizeSetParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + builder.Field{ + Name: "increment", + Value: value, + }, + }, + }, + } +} + +func (r blobQuerySizeInt) IncrementIfPresent(value *int) blobWithPrismaSizeSetParam { + if value == nil { + return blobWithPrismaSizeSetParam{} + } + return r.Increment(*value) +} + +// Decrement the required value of Size +func (r blobQuerySizeInt) Decrement(value int) blobWithPrismaSizeSetParam { + return blobWithPrismaSizeSetParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + builder.Field{ + Name: "decrement", + Value: value, + }, + }, + }, + } +} + +func (r blobQuerySizeInt) DecrementIfPresent(value *int) blobWithPrismaSizeSetParam { + if value == nil { + return blobWithPrismaSizeSetParam{} + } + return r.Decrement(*value) +} + +// Multiply the required value of Size +func (r blobQuerySizeInt) Multiply(value int) blobWithPrismaSizeSetParam { + return blobWithPrismaSizeSetParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + builder.Field{ + Name: "multiply", + Value: value, + }, + }, + }, + } +} + +func (r blobQuerySizeInt) MultiplyIfPresent(value *int) blobWithPrismaSizeSetParam { + if value == nil { + return blobWithPrismaSizeSetParam{} + } + return r.Multiply(*value) +} + +// Divide the required value of Size +func (r blobQuerySizeInt) Divide(value int) blobWithPrismaSizeSetParam { + return blobWithPrismaSizeSetParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + builder.Field{ + Name: "divide", + Value: value, + }, + }, + }, + } +} + +func (r blobQuerySizeInt) DivideIfPresent(value *int) blobWithPrismaSizeSetParam { + if value == nil { + return blobWithPrismaSizeSetParam{} + } + return r.Divide(*value) +} + +func (r blobQuerySizeInt) Equals(value int) blobWithPrismaSizeEqualsParam { + + return blobWithPrismaSizeEqualsParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + { + Name: "equals", + Value: value, + }, + }, + }, + } +} + +func (r blobQuerySizeInt) EqualsIfPresent(value *int) blobWithPrismaSizeEqualsParam { + if value == nil { + return blobWithPrismaSizeEqualsParam{} + } + return r.Equals(*value) +} + +func (r blobQuerySizeInt) Order(direction SortOrder) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "size", + Value: direction, + }, + } +} + +func (r blobQuerySizeInt) Cursor(cursor int) blobCursorParam { + return blobCursorParam{ + data: builder.Field{ + Name: "size", + Value: cursor, + }, + } +} + +func (r blobQuerySizeInt) In(value []int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + { + Name: "in", + Value: value, + }, + }, + }, + } +} + +func (r blobQuerySizeInt) InIfPresent(value []int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.In(value) +} + +func (r blobQuerySizeInt) NotIn(value []int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + { + Name: "notIn", + Value: value, + }, + }, + }, + } +} + +func (r blobQuerySizeInt) NotInIfPresent(value []int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.NotIn(value) +} + +func (r blobQuerySizeInt) Lt(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + { + Name: "lt", + Value: value, + }, + }, + }, + } +} + +func (r blobQuerySizeInt) LtIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Lt(*value) +} + +func (r blobQuerySizeInt) Lte(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + { + Name: "lte", + Value: value, + }, + }, + }, + } +} + +func (r blobQuerySizeInt) LteIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Lte(*value) +} + +func (r blobQuerySizeInt) Gt(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + { + Name: "gt", + Value: value, + }, + }, + }, + } +} + +func (r blobQuerySizeInt) GtIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Gt(*value) +} + +func (r blobQuerySizeInt) Gte(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + { + Name: "gte", + Value: value, + }, + }, + }, + } +} + +func (r blobQuerySizeInt) GteIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Gte(*value) +} + +func (r blobQuerySizeInt) Not(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + { + Name: "not", + Value: value, + }, + }, + }, + } +} + +func (r blobQuerySizeInt) NotIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Not(*value) +} + +// deprecated: Use Lt instead. + +func (r blobQuerySizeInt) LT(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + { + Name: "lt", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use LtIfPresent instead. +func (r blobQuerySizeInt) LTIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.LT(*value) +} + +// deprecated: Use Lte instead. + +func (r blobQuerySizeInt) LTE(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + { + Name: "lte", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use LteIfPresent instead. +func (r blobQuerySizeInt) LTEIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.LTE(*value) +} + +// deprecated: Use Gt instead. + +func (r blobQuerySizeInt) GT(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + { + Name: "gt", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use GtIfPresent instead. +func (r blobQuerySizeInt) GTIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.GT(*value) +} + +// deprecated: Use Gte instead. + +func (r blobQuerySizeInt) GTE(value int) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "size", + Fields: []builder.Field{ + { + Name: "gte", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use GteIfPresent instead. +func (r blobQuerySizeInt) GTEIfPresent(value *int) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.GTE(*value) +} + +func (r blobQuerySizeInt) Field() blobPrismaFields { + return blobFieldSize +} + +// base struct +type blobQueryMetadataBytes struct{} + +// Set the required value of Metadata +func (r blobQueryMetadataBytes) Set(value Bytes) blobWithPrismaMetadataSetParam { + + return blobWithPrismaMetadataSetParam{ + data: builder.Field{ + Name: "metadata", + Value: value, + }, + } + +} + +// Set the optional value of Metadata dynamically +func (r blobQueryMetadataBytes) SetIfPresent(value *Bytes) blobWithPrismaMetadataSetParam { + if value == nil { + return blobWithPrismaMetadataSetParam{} + } + + return r.Set(*value) +} + +func (r blobQueryMetadataBytes) Equals(value Bytes) blobWithPrismaMetadataEqualsParam { + + return blobWithPrismaMetadataEqualsParam{ + data: builder.Field{ + Name: "metadata", + Fields: []builder.Field{ + { + Name: "equals", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryMetadataBytes) EqualsIfPresent(value *Bytes) blobWithPrismaMetadataEqualsParam { + if value == nil { + return blobWithPrismaMetadataEqualsParam{} + } + return r.Equals(*value) +} + +func (r blobQueryMetadataBytes) Order(direction SortOrder) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "metadata", + Value: direction, + }, + } +} + +func (r blobQueryMetadataBytes) Cursor(cursor Bytes) blobCursorParam { + return blobCursorParam{ + data: builder.Field{ + Name: "metadata", + Value: cursor, + }, + } +} + +func (r blobQueryMetadataBytes) In(value []Bytes) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "metadata", + Fields: []builder.Field{ + { + Name: "in", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryMetadataBytes) InIfPresent(value []Bytes) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.In(value) +} + +func (r blobQueryMetadataBytes) NotIn(value []Bytes) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "metadata", + Fields: []builder.Field{ + { + Name: "notIn", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryMetadataBytes) NotInIfPresent(value []Bytes) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.NotIn(value) +} + +func (r blobQueryMetadataBytes) Not(value Bytes) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "metadata", + Fields: []builder.Field{ + { + Name: "not", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryMetadataBytes) NotIfPresent(value *Bytes) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Not(*value) +} + +func (r blobQueryMetadataBytes) Field() blobPrismaFields { + return blobFieldMetadata +} + +// base struct +type blobQueryFlaggedBoolean struct{} + +// Set the required value of Flagged +func (r blobQueryFlaggedBoolean) Set(value bool) blobSetParam { + + return blobSetParam{ + data: builder.Field{ + Name: "flagged", + Value: value, + }, + } + +} + +// Set the optional value of Flagged dynamically +func (r blobQueryFlaggedBoolean) SetIfPresent(value *Boolean) blobSetParam { + if value == nil { + return blobSetParam{} + } + + return r.Set(*value) +} + +func (r blobQueryFlaggedBoolean) Equals(value bool) blobWithPrismaFlaggedEqualsParam { + + return blobWithPrismaFlaggedEqualsParam{ + data: builder.Field{ + Name: "flagged", + Fields: []builder.Field{ + { + Name: "equals", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryFlaggedBoolean) EqualsIfPresent(value *bool) blobWithPrismaFlaggedEqualsParam { + if value == nil { + return blobWithPrismaFlaggedEqualsParam{} + } + return r.Equals(*value) +} + +func (r blobQueryFlaggedBoolean) Order(direction SortOrder) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "flagged", + Value: direction, + }, + } +} + +func (r blobQueryFlaggedBoolean) Cursor(cursor bool) blobCursorParam { + return blobCursorParam{ + data: builder.Field{ + Name: "flagged", + Value: cursor, + }, + } +} + +func (r blobQueryFlaggedBoolean) Field() blobPrismaFields { + return blobFieldFlagged +} + +// base struct +type blobQueryCreatedAtDateTime struct{} + +// Set the required value of CreatedAt +func (r blobQueryCreatedAtDateTime) Set(value DateTime) blobSetParam { + + return blobSetParam{ + data: builder.Field{ + Name: "createdAt", + Value: value, + }, + } + +} + +// Set the optional value of CreatedAt dynamically +func (r blobQueryCreatedAtDateTime) SetIfPresent(value *DateTime) blobSetParam { + if value == nil { + return blobSetParam{} + } + + return r.Set(*value) +} + +func (r blobQueryCreatedAtDateTime) Equals(value DateTime) blobWithPrismaCreatedAtEqualsParam { + + return blobWithPrismaCreatedAtEqualsParam{ + data: builder.Field{ + Name: "createdAt", + Fields: []builder.Field{ + { + Name: "equals", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryCreatedAtDateTime) EqualsIfPresent(value *DateTime) blobWithPrismaCreatedAtEqualsParam { + if value == nil { + return blobWithPrismaCreatedAtEqualsParam{} + } + return r.Equals(*value) +} + +func (r blobQueryCreatedAtDateTime) Order(direction SortOrder) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "createdAt", + Value: direction, + }, + } +} + +func (r blobQueryCreatedAtDateTime) Cursor(cursor DateTime) blobCursorParam { + return blobCursorParam{ + data: builder.Field{ + Name: "createdAt", + Value: cursor, + }, + } +} + +func (r blobQueryCreatedAtDateTime) In(value []DateTime) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "createdAt", + Fields: []builder.Field{ + { + Name: "in", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryCreatedAtDateTime) InIfPresent(value []DateTime) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.In(value) +} + +func (r blobQueryCreatedAtDateTime) NotIn(value []DateTime) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "createdAt", + Fields: []builder.Field{ + { + Name: "notIn", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryCreatedAtDateTime) NotInIfPresent(value []DateTime) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.NotIn(value) +} + +func (r blobQueryCreatedAtDateTime) Lt(value DateTime) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "createdAt", + Fields: []builder.Field{ + { + Name: "lt", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryCreatedAtDateTime) LtIfPresent(value *DateTime) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Lt(*value) +} + +func (r blobQueryCreatedAtDateTime) Lte(value DateTime) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "createdAt", + Fields: []builder.Field{ + { + Name: "lte", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryCreatedAtDateTime) LteIfPresent(value *DateTime) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Lte(*value) +} + +func (r blobQueryCreatedAtDateTime) Gt(value DateTime) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "createdAt", + Fields: []builder.Field{ + { + Name: "gt", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryCreatedAtDateTime) GtIfPresent(value *DateTime) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Gt(*value) +} + +func (r blobQueryCreatedAtDateTime) Gte(value DateTime) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "createdAt", + Fields: []builder.Field{ + { + Name: "gte", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryCreatedAtDateTime) GteIfPresent(value *DateTime) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Gte(*value) +} + +func (r blobQueryCreatedAtDateTime) Not(value DateTime) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "createdAt", + Fields: []builder.Field{ + { + Name: "not", + Value: value, + }, + }, + }, + } +} + +func (r blobQueryCreatedAtDateTime) NotIfPresent(value *DateTime) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Not(*value) +} + +// deprecated: Use Lt instead. + +func (r blobQueryCreatedAtDateTime) Before(value DateTime) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "createdAt", + Fields: []builder.Field{ + { + Name: "lt", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use LtIfPresent instead. +func (r blobQueryCreatedAtDateTime) BeforeIfPresent(value *DateTime) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.Before(*value) +} + +// deprecated: Use Gt instead. + +func (r blobQueryCreatedAtDateTime) After(value DateTime) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "createdAt", + Fields: []builder.Field{ + { + Name: "gt", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use GtIfPresent instead. +func (r blobQueryCreatedAtDateTime) AfterIfPresent(value *DateTime) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.After(*value) +} + +// deprecated: Use Lte instead. + +func (r blobQueryCreatedAtDateTime) BeforeEquals(value DateTime) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "createdAt", + Fields: []builder.Field{ + { + Name: "lte", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use LteIfPresent instead. +func (r blobQueryCreatedAtDateTime) BeforeEqualsIfPresent(value *DateTime) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.BeforeEquals(*value) +} + +// deprecated: Use Gte instead. + +func (r blobQueryCreatedAtDateTime) AfterEquals(value DateTime) blobDefaultParam { + return blobDefaultParam{ + data: builder.Field{ + Name: "createdAt", + Fields: []builder.Field{ + { + Name: "gte", + Value: value, + }, + }, + }, + } +} + +// deprecated: Use GteIfPresent instead. +func (r blobQueryCreatedAtDateTime) AfterEqualsIfPresent(value *DateTime) blobDefaultParam { + if value == nil { + return blobDefaultParam{} + } + return r.AfterEquals(*value) +} + +func (r blobQueryCreatedAtDateTime) Field() blobPrismaFields { + return blobFieldCreatedAt +} + +// --- template actions.gotpl --- +var countOutput = []builder.Output{ + {Name: "count"}, +} + +type userActions struct { + // client holds the prisma client + client *PrismaClient +} + +var userOutput = []builder.Output{ + {Name: "id"}, + {Name: "displayName"}, + {Name: "isStaff"}, + {Name: "isRegistered"}, + {Name: "createdAt"}, + {Name: "updatedAt"}, +} + +type UserRelationWith interface { + getQuery() builder.Query + with() + userRelation() +} + +type UserWhereParam interface { + field() builder.Field + getQuery() builder.Query + userModel() +} + +type userDefaultParam struct { + data builder.Field + query builder.Query +} + +func (p userDefaultParam) field() builder.Field { + return p.data +} + +func (p userDefaultParam) getQuery() builder.Query { + return p.query +} + +func (p userDefaultParam) userModel() {} + +type UserOrderByParam interface { + field() builder.Field + getQuery() builder.Query + userModel() +} + +type userOrderByParam struct { + data builder.Field + query builder.Query +} + +func (p userOrderByParam) field() builder.Field { + return p.data +} + +func (p userOrderByParam) getQuery() builder.Query { + return p.query +} + +func (p userOrderByParam) userModel() {} + +type UserCursorParam interface { + field() builder.Field + getQuery() builder.Query + userModel() + isCursor() +} + +type userCursorParam struct { + data builder.Field + query builder.Query +} + +func (p userCursorParam) field() builder.Field { + return p.data +} + +func (p userCursorParam) isCursor() {} + +func (p userCursorParam) getQuery() builder.Query { + return p.query +} + +func (p userCursorParam) userModel() {} + +type UserParamUnique interface { + field() builder.Field + getQuery() builder.Query + unique() + userModel() +} + +type userParamUnique struct { + data builder.Field + query builder.Query +} + +func (p userParamUnique) userModel() {} + +func (userParamUnique) unique() {} + +func (p userParamUnique) field() builder.Field { + return p.data +} + +func (p userParamUnique) getQuery() builder.Query { + return p.query +} + +type UserEqualsWhereParam interface { + field() builder.Field + getQuery() builder.Query + equals() + userModel() +} + +type userEqualsParam struct { + data builder.Field + query builder.Query +} + +func (p userEqualsParam) userModel() {} + +func (userEqualsParam) equals() {} + +func (p userEqualsParam) field() builder.Field { + return p.data +} + +func (p userEqualsParam) getQuery() builder.Query { + return p.query +} + +type UserEqualsUniqueWhereParam interface { + field() builder.Field + getQuery() builder.Query + equals() + unique() + userModel() +} + +type userEqualsUniqueParam struct { + data builder.Field + query builder.Query +} + +func (p userEqualsUniqueParam) userModel() {} + +func (userEqualsUniqueParam) unique() {} +func (userEqualsUniqueParam) equals() {} + +func (p userEqualsUniqueParam) field() builder.Field { + return p.data +} + +func (p userEqualsUniqueParam) getQuery() builder.Query { + return p.query +} + +type UserSetParam interface { + field() builder.Field + settable() + userModel() +} + +type userSetParam struct { + data builder.Field +} + +func (userSetParam) settable() {} + +func (p userSetParam) field() builder.Field { + return p.data +} + +func (p userSetParam) userModel() {} + +type UserWithPrismaIDEqualsSetParam interface { + field() builder.Field + getQuery() builder.Query + equals() + userModel() + idField() +} + +type UserWithPrismaIDSetParam interface { + field() builder.Field + getQuery() builder.Query + userModel() + idField() +} + +type userWithPrismaIDSetParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaIDSetParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaIDSetParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaIDSetParam) userModel() {} + +func (p userWithPrismaIDSetParam) idField() {} + +type UserWithPrismaIDWhereParam interface { + field() builder.Field + getQuery() builder.Query + userModel() + idField() +} + +type userWithPrismaIDEqualsParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaIDEqualsParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaIDEqualsParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaIDEqualsParam) userModel() {} + +func (p userWithPrismaIDEqualsParam) idField() {} + +func (userWithPrismaIDSetParam) settable() {} +func (userWithPrismaIDEqualsParam) equals() {} + +type userWithPrismaIDEqualsUniqueParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaIDEqualsUniqueParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaIDEqualsUniqueParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaIDEqualsUniqueParam) userModel() {} +func (p userWithPrismaIDEqualsUniqueParam) idField() {} + +func (userWithPrismaIDEqualsUniqueParam) unique() {} +func (userWithPrismaIDEqualsUniqueParam) equals() {} + +type UserWithPrismaDisplayNameEqualsSetParam interface { + field() builder.Field + getQuery() builder.Query + equals() + userModel() + displayNameField() +} + +type UserWithPrismaDisplayNameSetParam interface { + field() builder.Field + getQuery() builder.Query + userModel() + displayNameField() +} + +type userWithPrismaDisplayNameSetParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaDisplayNameSetParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaDisplayNameSetParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaDisplayNameSetParam) userModel() {} + +func (p userWithPrismaDisplayNameSetParam) displayNameField() {} + +type UserWithPrismaDisplayNameWhereParam interface { + field() builder.Field + getQuery() builder.Query + userModel() + displayNameField() +} + +type userWithPrismaDisplayNameEqualsParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaDisplayNameEqualsParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaDisplayNameEqualsParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaDisplayNameEqualsParam) userModel() {} + +func (p userWithPrismaDisplayNameEqualsParam) displayNameField() {} + +func (userWithPrismaDisplayNameSetParam) settable() {} +func (userWithPrismaDisplayNameEqualsParam) equals() {} + +type userWithPrismaDisplayNameEqualsUniqueParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaDisplayNameEqualsUniqueParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaDisplayNameEqualsUniqueParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaDisplayNameEqualsUniqueParam) userModel() {} +func (p userWithPrismaDisplayNameEqualsUniqueParam) displayNameField() {} + +func (userWithPrismaDisplayNameEqualsUniqueParam) unique() {} +func (userWithPrismaDisplayNameEqualsUniqueParam) equals() {} + +type UserWithPrismaIsStaffEqualsSetParam interface { + field() builder.Field + getQuery() builder.Query + equals() + userModel() + isStaffField() +} + +type UserWithPrismaIsStaffSetParam interface { + field() builder.Field + getQuery() builder.Query + userModel() + isStaffField() +} + +type userWithPrismaIsStaffSetParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaIsStaffSetParam) field() builder.Field { return p.data } -func (p userWithPrismaDisplayNameSetParam) getQuery() builder.Query { +func (p userWithPrismaIsStaffSetParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaDisplayNameSetParam) userModel() {} +func (p userWithPrismaIsStaffSetParam) userModel() {} -func (p userWithPrismaDisplayNameSetParam) displayNameField() {} +func (p userWithPrismaIsStaffSetParam) isStaffField() {} -type UserWithPrismaDisplayNameWhereParam interface { +type UserWithPrismaIsStaffWhereParam interface { field() builder.Field getQuery() builder.Query userModel() - displayNameField() + isStaffField() } -type userWithPrismaDisplayNameEqualsParam struct { +type userWithPrismaIsStaffEqualsParam struct { data builder.Field query builder.Query } -func (p userWithPrismaDisplayNameEqualsParam) field() builder.Field { +func (p userWithPrismaIsStaffEqualsParam) field() builder.Field { return p.data } -func (p userWithPrismaDisplayNameEqualsParam) getQuery() builder.Query { +func (p userWithPrismaIsStaffEqualsParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaDisplayNameEqualsParam) userModel() {} +func (p userWithPrismaIsStaffEqualsParam) userModel() {} -func (p userWithPrismaDisplayNameEqualsParam) displayNameField() {} +func (p userWithPrismaIsStaffEqualsParam) isStaffField() {} -func (userWithPrismaDisplayNameSetParam) settable() {} -func (userWithPrismaDisplayNameEqualsParam) equals() {} +func (userWithPrismaIsStaffSetParam) settable() {} +func (userWithPrismaIsStaffEqualsParam) equals() {} -type userWithPrismaDisplayNameEqualsUniqueParam struct { +type userWithPrismaIsStaffEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p userWithPrismaDisplayNameEqualsUniqueParam) field() builder.Field { +func (p userWithPrismaIsStaffEqualsUniqueParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaIsStaffEqualsUniqueParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaIsStaffEqualsUniqueParam) userModel() {} +func (p userWithPrismaIsStaffEqualsUniqueParam) isStaffField() {} + +func (userWithPrismaIsStaffEqualsUniqueParam) unique() {} +func (userWithPrismaIsStaffEqualsUniqueParam) equals() {} + +type UserWithPrismaIsRegisteredEqualsSetParam interface { + field() builder.Field + getQuery() builder.Query + equals() + userModel() + isRegisteredField() +} + +type UserWithPrismaIsRegisteredSetParam interface { + field() builder.Field + getQuery() builder.Query + userModel() + isRegisteredField() +} + +type userWithPrismaIsRegisteredSetParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaIsRegisteredSetParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaIsRegisteredSetParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaIsRegisteredSetParam) userModel() {} + +func (p userWithPrismaIsRegisteredSetParam) isRegisteredField() {} + +type UserWithPrismaIsRegisteredWhereParam interface { + field() builder.Field + getQuery() builder.Query + userModel() + isRegisteredField() +} + +type userWithPrismaIsRegisteredEqualsParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaIsRegisteredEqualsParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaIsRegisteredEqualsParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaIsRegisteredEqualsParam) userModel() {} + +func (p userWithPrismaIsRegisteredEqualsParam) isRegisteredField() {} + +func (userWithPrismaIsRegisteredSetParam) settable() {} +func (userWithPrismaIsRegisteredEqualsParam) equals() {} + +type userWithPrismaIsRegisteredEqualsUniqueParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaIsRegisteredEqualsUniqueParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaIsRegisteredEqualsUniqueParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaIsRegisteredEqualsUniqueParam) userModel() {} +func (p userWithPrismaIsRegisteredEqualsUniqueParam) isRegisteredField() {} + +func (userWithPrismaIsRegisteredEqualsUniqueParam) unique() {} +func (userWithPrismaIsRegisteredEqualsUniqueParam) equals() {} + +type UserWithPrismaPublicKeysEqualsSetParam interface { + field() builder.Field + getQuery() builder.Query + equals() + userModel() + publicKeysField() +} + +type UserWithPrismaPublicKeysSetParam interface { + field() builder.Field + getQuery() builder.Query + userModel() + publicKeysField() +} + +type userWithPrismaPublicKeysSetParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaPublicKeysSetParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaPublicKeysSetParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaPublicKeysSetParam) userModel() {} + +func (p userWithPrismaPublicKeysSetParam) publicKeysField() {} + +type UserWithPrismaPublicKeysWhereParam interface { + field() builder.Field + getQuery() builder.Query + userModel() + publicKeysField() +} + +type userWithPrismaPublicKeysEqualsParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaPublicKeysEqualsParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaPublicKeysEqualsParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaPublicKeysEqualsParam) userModel() {} + +func (p userWithPrismaPublicKeysEqualsParam) publicKeysField() {} + +func (userWithPrismaPublicKeysSetParam) settable() {} +func (userWithPrismaPublicKeysEqualsParam) equals() {} + +type userWithPrismaPublicKeysEqualsUniqueParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaPublicKeysEqualsUniqueParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaPublicKeysEqualsUniqueParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaPublicKeysEqualsUniqueParam) userModel() {} +func (p userWithPrismaPublicKeysEqualsUniqueParam) publicKeysField() {} + +func (userWithPrismaPublicKeysEqualsUniqueParam) unique() {} +func (userWithPrismaPublicKeysEqualsUniqueParam) equals() {} + +type UserWithPrismaCreatedAtEqualsSetParam interface { + field() builder.Field + getQuery() builder.Query + equals() + userModel() + createdAtField() +} + +type UserWithPrismaCreatedAtSetParam interface { + field() builder.Field + getQuery() builder.Query + userModel() + createdAtField() +} + +type userWithPrismaCreatedAtSetParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaCreatedAtSetParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaCreatedAtSetParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaCreatedAtSetParam) userModel() {} + +func (p userWithPrismaCreatedAtSetParam) createdAtField() {} + +type UserWithPrismaCreatedAtWhereParam interface { + field() builder.Field + getQuery() builder.Query + userModel() + createdAtField() +} + +type userWithPrismaCreatedAtEqualsParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaCreatedAtEqualsParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaCreatedAtEqualsParam) userModel() {} + +func (p userWithPrismaCreatedAtEqualsParam) createdAtField() {} + +func (userWithPrismaCreatedAtSetParam) settable() {} +func (userWithPrismaCreatedAtEqualsParam) equals() {} + +type userWithPrismaCreatedAtEqualsUniqueParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaCreatedAtEqualsUniqueParam) userModel() {} +func (p userWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} + +func (userWithPrismaCreatedAtEqualsUniqueParam) unique() {} +func (userWithPrismaCreatedAtEqualsUniqueParam) equals() {} + +type UserWithPrismaUpdatedAtEqualsSetParam interface { + field() builder.Field + getQuery() builder.Query + equals() + userModel() + updatedAtField() +} + +type UserWithPrismaUpdatedAtSetParam interface { + field() builder.Field + getQuery() builder.Query + userModel() + updatedAtField() +} + +type userWithPrismaUpdatedAtSetParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaUpdatedAtSetParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaUpdatedAtSetParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaUpdatedAtSetParam) userModel() {} + +func (p userWithPrismaUpdatedAtSetParam) updatedAtField() {} + +type UserWithPrismaUpdatedAtWhereParam interface { + field() builder.Field + getQuery() builder.Query + userModel() + updatedAtField() +} + +type userWithPrismaUpdatedAtEqualsParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaUpdatedAtEqualsParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaUpdatedAtEqualsParam) userModel() {} + +func (p userWithPrismaUpdatedAtEqualsParam) updatedAtField() {} + +func (userWithPrismaUpdatedAtSetParam) settable() {} +func (userWithPrismaUpdatedAtEqualsParam) equals() {} + +type userWithPrismaUpdatedAtEqualsUniqueParam struct { + data builder.Field + query builder.Query +} + +func (p userWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { + return p.data +} + +func (p userWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { + return p.query +} + +func (p userWithPrismaUpdatedAtEqualsUniqueParam) userModel() {} +func (p userWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} + +func (userWithPrismaUpdatedAtEqualsUniqueParam) unique() {} +func (userWithPrismaUpdatedAtEqualsUniqueParam) equals() {} + +type publicKeyActions struct { + // client holds the prisma client + client *PrismaClient +} + +var publicKeyOutput = []builder.Output{ + {Name: "key"}, + {Name: "userId"}, + {Name: "createdAt"}, + {Name: "updatedAt"}, +} + +type PublicKeyRelationWith interface { + getQuery() builder.Query + with() + publicKeyRelation() +} + +type PublicKeyWhereParam interface { + field() builder.Field + getQuery() builder.Query + publicKeyModel() +} + +type publicKeyDefaultParam struct { + data builder.Field + query builder.Query +} + +func (p publicKeyDefaultParam) field() builder.Field { + return p.data +} + +func (p publicKeyDefaultParam) getQuery() builder.Query { + return p.query +} + +func (p publicKeyDefaultParam) publicKeyModel() {} + +type PublicKeyOrderByParam interface { + field() builder.Field + getQuery() builder.Query + publicKeyModel() +} + +type publicKeyOrderByParam struct { + data builder.Field + query builder.Query +} + +func (p publicKeyOrderByParam) field() builder.Field { + return p.data +} + +func (p publicKeyOrderByParam) getQuery() builder.Query { + return p.query +} + +func (p publicKeyOrderByParam) publicKeyModel() {} + +type PublicKeyCursorParam interface { + field() builder.Field + getQuery() builder.Query + publicKeyModel() + isCursor() +} + +type publicKeyCursorParam struct { + data builder.Field + query builder.Query +} + +func (p publicKeyCursorParam) field() builder.Field { + return p.data +} + +func (p publicKeyCursorParam) isCursor() {} + +func (p publicKeyCursorParam) getQuery() builder.Query { + return p.query +} + +func (p publicKeyCursorParam) publicKeyModel() {} + +type PublicKeyParamUnique interface { + field() builder.Field + getQuery() builder.Query + unique() + publicKeyModel() +} + +type publicKeyParamUnique struct { + data builder.Field + query builder.Query +} + +func (p publicKeyParamUnique) publicKeyModel() {} + +func (publicKeyParamUnique) unique() {} + +func (p publicKeyParamUnique) field() builder.Field { + return p.data +} + +func (p publicKeyParamUnique) getQuery() builder.Query { + return p.query +} + +type PublicKeyEqualsWhereParam interface { + field() builder.Field + getQuery() builder.Query + equals() + publicKeyModel() +} + +type publicKeyEqualsParam struct { + data builder.Field + query builder.Query +} + +func (p publicKeyEqualsParam) publicKeyModel() {} + +func (publicKeyEqualsParam) equals() {} + +func (p publicKeyEqualsParam) field() builder.Field { + return p.data +} + +func (p publicKeyEqualsParam) getQuery() builder.Query { + return p.query +} + +type PublicKeyEqualsUniqueWhereParam interface { + field() builder.Field + getQuery() builder.Query + equals() + unique() + publicKeyModel() +} + +type publicKeyEqualsUniqueParam struct { + data builder.Field + query builder.Query +} + +func (p publicKeyEqualsUniqueParam) publicKeyModel() {} + +func (publicKeyEqualsUniqueParam) unique() {} +func (publicKeyEqualsUniqueParam) equals() {} + +func (p publicKeyEqualsUniqueParam) field() builder.Field { return p.data } -func (p userWithPrismaDisplayNameEqualsUniqueParam) getQuery() builder.Query { +func (p publicKeyEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaDisplayNameEqualsUniqueParam) userModel() {} -func (p userWithPrismaDisplayNameEqualsUniqueParam) displayNameField() {} +type PublicKeySetParam interface { + field() builder.Field + settable() + publicKeyModel() +} -func (userWithPrismaDisplayNameEqualsUniqueParam) unique() {} -func (userWithPrismaDisplayNameEqualsUniqueParam) equals() {} +type publicKeySetParam struct { + data builder.Field +} -type UserWithPrismaIsStaffEqualsSetParam interface { +func (publicKeySetParam) settable() {} + +func (p publicKeySetParam) field() builder.Field { + return p.data +} + +func (p publicKeySetParam) publicKeyModel() {} + +type PublicKeyWithPrismaKeyEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - userModel() - isStaffField() + publicKeyModel() + keyField() } -type UserWithPrismaIsStaffSetParam interface { +type PublicKeyWithPrismaKeySetParam interface { field() builder.Field getQuery() builder.Query - userModel() - isStaffField() + publicKeyModel() + keyField() } -type userWithPrismaIsStaffSetParam struct { +type publicKeyWithPrismaKeySetParam struct { data builder.Field query builder.Query } -func (p userWithPrismaIsStaffSetParam) field() builder.Field { +func (p publicKeyWithPrismaKeySetParam) field() builder.Field { return p.data } -func (p userWithPrismaIsStaffSetParam) getQuery() builder.Query { +func (p publicKeyWithPrismaKeySetParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaIsStaffSetParam) userModel() {} +func (p publicKeyWithPrismaKeySetParam) publicKeyModel() {} -func (p userWithPrismaIsStaffSetParam) isStaffField() {} +func (p publicKeyWithPrismaKeySetParam) keyField() {} -type UserWithPrismaIsStaffWhereParam interface { +type PublicKeyWithPrismaKeyWhereParam interface { field() builder.Field getQuery() builder.Query - userModel() - isStaffField() + publicKeyModel() + keyField() } -type userWithPrismaIsStaffEqualsParam struct { +type publicKeyWithPrismaKeyEqualsParam struct { data builder.Field query builder.Query } -func (p userWithPrismaIsStaffEqualsParam) field() builder.Field { +func (p publicKeyWithPrismaKeyEqualsParam) field() builder.Field { return p.data } -func (p userWithPrismaIsStaffEqualsParam) getQuery() builder.Query { +func (p publicKeyWithPrismaKeyEqualsParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaIsStaffEqualsParam) userModel() {} +func (p publicKeyWithPrismaKeyEqualsParam) publicKeyModel() {} -func (p userWithPrismaIsStaffEqualsParam) isStaffField() {} +func (p publicKeyWithPrismaKeyEqualsParam) keyField() {} -func (userWithPrismaIsStaffSetParam) settable() {} -func (userWithPrismaIsStaffEqualsParam) equals() {} +func (publicKeyWithPrismaKeySetParam) settable() {} +func (publicKeyWithPrismaKeyEqualsParam) equals() {} -type userWithPrismaIsStaffEqualsUniqueParam struct { +type publicKeyWithPrismaKeyEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p userWithPrismaIsStaffEqualsUniqueParam) field() builder.Field { +func (p publicKeyWithPrismaKeyEqualsUniqueParam) field() builder.Field { return p.data } -func (p userWithPrismaIsStaffEqualsUniqueParam) getQuery() builder.Query { +func (p publicKeyWithPrismaKeyEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaIsStaffEqualsUniqueParam) userModel() {} -func (p userWithPrismaIsStaffEqualsUniqueParam) isStaffField() {} +func (p publicKeyWithPrismaKeyEqualsUniqueParam) publicKeyModel() {} +func (p publicKeyWithPrismaKeyEqualsUniqueParam) keyField() {} -func (userWithPrismaIsStaffEqualsUniqueParam) unique() {} -func (userWithPrismaIsStaffEqualsUniqueParam) equals() {} +func (publicKeyWithPrismaKeyEqualsUniqueParam) unique() {} +func (publicKeyWithPrismaKeyEqualsUniqueParam) equals() {} -type UserWithPrismaIsRegisteredEqualsSetParam interface { +type PublicKeyWithPrismaUserIDEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - userModel() - isRegisteredField() + publicKeyModel() + userIDField() } -type UserWithPrismaIsRegisteredSetParam interface { +type PublicKeyWithPrismaUserIDSetParam interface { field() builder.Field getQuery() builder.Query - userModel() - isRegisteredField() + publicKeyModel() + userIDField() } -type userWithPrismaIsRegisteredSetParam struct { +type publicKeyWithPrismaUserIDSetParam struct { data builder.Field query builder.Query } -func (p userWithPrismaIsRegisteredSetParam) field() builder.Field { +func (p publicKeyWithPrismaUserIDSetParam) field() builder.Field { return p.data } -func (p userWithPrismaIsRegisteredSetParam) getQuery() builder.Query { +func (p publicKeyWithPrismaUserIDSetParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaIsRegisteredSetParam) userModel() {} +func (p publicKeyWithPrismaUserIDSetParam) publicKeyModel() {} -func (p userWithPrismaIsRegisteredSetParam) isRegisteredField() {} +func (p publicKeyWithPrismaUserIDSetParam) userIDField() {} -type UserWithPrismaIsRegisteredWhereParam interface { +type PublicKeyWithPrismaUserIDWhereParam interface { field() builder.Field getQuery() builder.Query - userModel() - isRegisteredField() + publicKeyModel() + userIDField() } -type userWithPrismaIsRegisteredEqualsParam struct { +type publicKeyWithPrismaUserIDEqualsParam struct { data builder.Field query builder.Query } -func (p userWithPrismaIsRegisteredEqualsParam) field() builder.Field { +func (p publicKeyWithPrismaUserIDEqualsParam) field() builder.Field { return p.data } -func (p userWithPrismaIsRegisteredEqualsParam) getQuery() builder.Query { +func (p publicKeyWithPrismaUserIDEqualsParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaIsRegisteredEqualsParam) userModel() {} +func (p publicKeyWithPrismaUserIDEqualsParam) publicKeyModel() {} -func (p userWithPrismaIsRegisteredEqualsParam) isRegisteredField() {} +func (p publicKeyWithPrismaUserIDEqualsParam) userIDField() {} -func (userWithPrismaIsRegisteredSetParam) settable() {} -func (userWithPrismaIsRegisteredEqualsParam) equals() {} +func (publicKeyWithPrismaUserIDSetParam) settable() {} +func (publicKeyWithPrismaUserIDEqualsParam) equals() {} -type userWithPrismaIsRegisteredEqualsUniqueParam struct { +type publicKeyWithPrismaUserIDEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p userWithPrismaIsRegisteredEqualsUniqueParam) field() builder.Field { +func (p publicKeyWithPrismaUserIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p userWithPrismaIsRegisteredEqualsUniqueParam) getQuery() builder.Query { +func (p publicKeyWithPrismaUserIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaIsRegisteredEqualsUniqueParam) userModel() {} -func (p userWithPrismaIsRegisteredEqualsUniqueParam) isRegisteredField() {} +func (p publicKeyWithPrismaUserIDEqualsUniqueParam) publicKeyModel() {} +func (p publicKeyWithPrismaUserIDEqualsUniqueParam) userIDField() {} -func (userWithPrismaIsRegisteredEqualsUniqueParam) unique() {} -func (userWithPrismaIsRegisteredEqualsUniqueParam) equals() {} +func (publicKeyWithPrismaUserIDEqualsUniqueParam) unique() {} +func (publicKeyWithPrismaUserIDEqualsUniqueParam) equals() {} -type UserWithPrismaPublicKeysEqualsSetParam interface { +type PublicKeyWithPrismaCreatedAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - userModel() - publicKeysField() + publicKeyModel() + createdAtField() } -type UserWithPrismaPublicKeysSetParam interface { +type PublicKeyWithPrismaCreatedAtSetParam interface { field() builder.Field getQuery() builder.Query - userModel() - publicKeysField() + publicKeyModel() + createdAtField() } -type userWithPrismaPublicKeysSetParam struct { +type publicKeyWithPrismaCreatedAtSetParam struct { data builder.Field query builder.Query } -func (p userWithPrismaPublicKeysSetParam) field() builder.Field { +func (p publicKeyWithPrismaCreatedAtSetParam) field() builder.Field { return p.data } -func (p userWithPrismaPublicKeysSetParam) getQuery() builder.Query { +func (p publicKeyWithPrismaCreatedAtSetParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaPublicKeysSetParam) userModel() {} +func (p publicKeyWithPrismaCreatedAtSetParam) publicKeyModel() {} -func (p userWithPrismaPublicKeysSetParam) publicKeysField() {} +func (p publicKeyWithPrismaCreatedAtSetParam) createdAtField() {} -type UserWithPrismaPublicKeysWhereParam interface { +type PublicKeyWithPrismaCreatedAtWhereParam interface { field() builder.Field getQuery() builder.Query - userModel() - publicKeysField() + publicKeyModel() + createdAtField() } -type userWithPrismaPublicKeysEqualsParam struct { +type publicKeyWithPrismaCreatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p userWithPrismaPublicKeysEqualsParam) field() builder.Field { +func (p publicKeyWithPrismaCreatedAtEqualsParam) field() builder.Field { return p.data } -func (p userWithPrismaPublicKeysEqualsParam) getQuery() builder.Query { +func (p publicKeyWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaPublicKeysEqualsParam) userModel() {} +func (p publicKeyWithPrismaCreatedAtEqualsParam) publicKeyModel() {} -func (p userWithPrismaPublicKeysEqualsParam) publicKeysField() {} +func (p publicKeyWithPrismaCreatedAtEqualsParam) createdAtField() {} -func (userWithPrismaPublicKeysSetParam) settable() {} -func (userWithPrismaPublicKeysEqualsParam) equals() {} +func (publicKeyWithPrismaCreatedAtSetParam) settable() {} +func (publicKeyWithPrismaCreatedAtEqualsParam) equals() {} -type userWithPrismaPublicKeysEqualsUniqueParam struct { +type publicKeyWithPrismaCreatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p userWithPrismaPublicKeysEqualsUniqueParam) field() builder.Field { +func (p publicKeyWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p userWithPrismaPublicKeysEqualsUniqueParam) getQuery() builder.Query { +func (p publicKeyWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaPublicKeysEqualsUniqueParam) userModel() {} -func (p userWithPrismaPublicKeysEqualsUniqueParam) publicKeysField() {} +func (p publicKeyWithPrismaCreatedAtEqualsUniqueParam) publicKeyModel() {} +func (p publicKeyWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} -func (userWithPrismaPublicKeysEqualsUniqueParam) unique() {} -func (userWithPrismaPublicKeysEqualsUniqueParam) equals() {} +func (publicKeyWithPrismaCreatedAtEqualsUniqueParam) unique() {} +func (publicKeyWithPrismaCreatedAtEqualsUniqueParam) equals() {} -type UserWithPrismaCreatedAtEqualsSetParam interface { +type PublicKeyWithPrismaUpdatedAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - userModel() - createdAtField() + publicKeyModel() + updatedAtField() } -type UserWithPrismaCreatedAtSetParam interface { +type PublicKeyWithPrismaUpdatedAtSetParam interface { field() builder.Field getQuery() builder.Query - userModel() - createdAtField() + publicKeyModel() + updatedAtField() } -type userWithPrismaCreatedAtSetParam struct { +type publicKeyWithPrismaUpdatedAtSetParam struct { data builder.Field query builder.Query } -func (p userWithPrismaCreatedAtSetParam) field() builder.Field { +func (p publicKeyWithPrismaUpdatedAtSetParam) field() builder.Field { return p.data } -func (p userWithPrismaCreatedAtSetParam) getQuery() builder.Query { +func (p publicKeyWithPrismaUpdatedAtSetParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaCreatedAtSetParam) userModel() {} +func (p publicKeyWithPrismaUpdatedAtSetParam) publicKeyModel() {} -func (p userWithPrismaCreatedAtSetParam) createdAtField() {} +func (p publicKeyWithPrismaUpdatedAtSetParam) updatedAtField() {} -type UserWithPrismaCreatedAtWhereParam interface { +type PublicKeyWithPrismaUpdatedAtWhereParam interface { field() builder.Field getQuery() builder.Query - userModel() - createdAtField() + publicKeyModel() + updatedAtField() } -type userWithPrismaCreatedAtEqualsParam struct { +type publicKeyWithPrismaUpdatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p userWithPrismaCreatedAtEqualsParam) field() builder.Field { +func (p publicKeyWithPrismaUpdatedAtEqualsParam) field() builder.Field { return p.data } -func (p userWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { +func (p publicKeyWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaCreatedAtEqualsParam) userModel() {} +func (p publicKeyWithPrismaUpdatedAtEqualsParam) publicKeyModel() {} -func (p userWithPrismaCreatedAtEqualsParam) createdAtField() {} +func (p publicKeyWithPrismaUpdatedAtEqualsParam) updatedAtField() {} -func (userWithPrismaCreatedAtSetParam) settable() {} -func (userWithPrismaCreatedAtEqualsParam) equals() {} +func (publicKeyWithPrismaUpdatedAtSetParam) settable() {} +func (publicKeyWithPrismaUpdatedAtEqualsParam) equals() {} -type userWithPrismaCreatedAtEqualsUniqueParam struct { +type publicKeyWithPrismaUpdatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p userWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { +func (p publicKeyWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p userWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p publicKeyWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaCreatedAtEqualsUniqueParam) userModel() {} -func (p userWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} +func (p publicKeyWithPrismaUpdatedAtEqualsUniqueParam) publicKeyModel() {} +func (p publicKeyWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} -func (userWithPrismaCreatedAtEqualsUniqueParam) unique() {} -func (userWithPrismaCreatedAtEqualsUniqueParam) equals() {} +func (publicKeyWithPrismaUpdatedAtEqualsUniqueParam) unique() {} +func (publicKeyWithPrismaUpdatedAtEqualsUniqueParam) equals() {} -type UserWithPrismaUpdatedAtEqualsSetParam interface { +type PublicKeyWithPrismaUserEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - userModel() - updatedAtField() + publicKeyModel() + userField() } -type UserWithPrismaUpdatedAtSetParam interface { +type PublicKeyWithPrismaUserSetParam interface { field() builder.Field getQuery() builder.Query - userModel() - updatedAtField() + publicKeyModel() + userField() } -type userWithPrismaUpdatedAtSetParam struct { +type publicKeyWithPrismaUserSetParam struct { data builder.Field query builder.Query } -func (p userWithPrismaUpdatedAtSetParam) field() builder.Field { +func (p publicKeyWithPrismaUserSetParam) field() builder.Field { return p.data } -func (p userWithPrismaUpdatedAtSetParam) getQuery() builder.Query { +func (p publicKeyWithPrismaUserSetParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaUpdatedAtSetParam) userModel() {} +func (p publicKeyWithPrismaUserSetParam) publicKeyModel() {} -func (p userWithPrismaUpdatedAtSetParam) updatedAtField() {} +func (p publicKeyWithPrismaUserSetParam) userField() {} -type UserWithPrismaUpdatedAtWhereParam interface { +type PublicKeyWithPrismaUserWhereParam interface { field() builder.Field getQuery() builder.Query - userModel() - updatedAtField() + publicKeyModel() + userField() } -type userWithPrismaUpdatedAtEqualsParam struct { +type publicKeyWithPrismaUserEqualsParam struct { data builder.Field query builder.Query } -func (p userWithPrismaUpdatedAtEqualsParam) field() builder.Field { +func (p publicKeyWithPrismaUserEqualsParam) field() builder.Field { return p.data } -func (p userWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { +func (p publicKeyWithPrismaUserEqualsParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaUpdatedAtEqualsParam) userModel() {} +func (p publicKeyWithPrismaUserEqualsParam) publicKeyModel() {} -func (p userWithPrismaUpdatedAtEqualsParam) updatedAtField() {} +func (p publicKeyWithPrismaUserEqualsParam) userField() {} -func (userWithPrismaUpdatedAtSetParam) settable() {} -func (userWithPrismaUpdatedAtEqualsParam) equals() {} +func (publicKeyWithPrismaUserSetParam) settable() {} +func (publicKeyWithPrismaUserEqualsParam) equals() {} -type userWithPrismaUpdatedAtEqualsUniqueParam struct { +type publicKeyWithPrismaUserEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p userWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { +func (p publicKeyWithPrismaUserEqualsUniqueParam) field() builder.Field { return p.data } -func (p userWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p publicKeyWithPrismaUserEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p userWithPrismaUpdatedAtEqualsUniqueParam) userModel() {} -func (p userWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} +func (p publicKeyWithPrismaUserEqualsUniqueParam) publicKeyModel() {} +func (p publicKeyWithPrismaUserEqualsUniqueParam) userField() {} -func (userWithPrismaUpdatedAtEqualsUniqueParam) unique() {} -func (userWithPrismaUpdatedAtEqualsUniqueParam) equals() {} +func (publicKeyWithPrismaUserEqualsUniqueParam) unique() {} +func (publicKeyWithPrismaUserEqualsUniqueParam) equals() {} -type publicKeyActions struct { +type intentActions struct { // client holds the prisma client client *PrismaClient } -var publicKeyOutput = []builder.Output{ - {Name: "key"}, - {Name: "userId"}, +var intentOutput = []builder.Output{ + {Name: "id"}, + {Name: "isFulfilled"}, {Name: "createdAt"}, {Name: "updatedAt"}, } -type PublicKeyRelationWith interface { +type IntentRelationWith interface { getQuery() builder.Query with() - publicKeyRelation() + intentRelation() } -type PublicKeyWhereParam interface { +type IntentWhereParam interface { field() builder.Field getQuery() builder.Query - publicKeyModel() + intentModel() } -type publicKeyDefaultParam struct { +type intentDefaultParam struct { data builder.Field query builder.Query } -func (p publicKeyDefaultParam) field() builder.Field { +func (p intentDefaultParam) field() builder.Field { return p.data } -func (p publicKeyDefaultParam) getQuery() builder.Query { +func (p intentDefaultParam) getQuery() builder.Query { return p.query } -func (p publicKeyDefaultParam) publicKeyModel() {} +func (p intentDefaultParam) intentModel() {} -type PublicKeyOrderByParam interface { +type IntentOrderByParam interface { field() builder.Field getQuery() builder.Query - publicKeyModel() + intentModel() } -type publicKeyOrderByParam struct { +type intentOrderByParam struct { data builder.Field query builder.Query } -func (p publicKeyOrderByParam) field() builder.Field { +func (p intentOrderByParam) field() builder.Field { return p.data } -func (p publicKeyOrderByParam) getQuery() builder.Query { +func (p intentOrderByParam) getQuery() builder.Query { return p.query } -func (p publicKeyOrderByParam) publicKeyModel() {} +func (p intentOrderByParam) intentModel() {} -type PublicKeyCursorParam interface { +type IntentCursorParam interface { field() builder.Field getQuery() builder.Query - publicKeyModel() + intentModel() isCursor() } -type publicKeyCursorParam struct { +type intentCursorParam struct { data builder.Field query builder.Query } -func (p publicKeyCursorParam) field() builder.Field { +func (p intentCursorParam) field() builder.Field { return p.data } -func (p publicKeyCursorParam) isCursor() {} +func (p intentCursorParam) isCursor() {} -func (p publicKeyCursorParam) getQuery() builder.Query { +func (p intentCursorParam) getQuery() builder.Query { return p.query } -func (p publicKeyCursorParam) publicKeyModel() {} +func (p intentCursorParam) intentModel() {} -type PublicKeyParamUnique interface { +type IntentParamUnique interface { field() builder.Field getQuery() builder.Query unique() - publicKeyModel() + intentModel() } -type publicKeyParamUnique struct { +type intentParamUnique struct { data builder.Field query builder.Query } -func (p publicKeyParamUnique) publicKeyModel() {} +func (p intentParamUnique) intentModel() {} -func (publicKeyParamUnique) unique() {} +func (intentParamUnique) unique() {} -func (p publicKeyParamUnique) field() builder.Field { +func (p intentParamUnique) field() builder.Field { return p.data } -func (p publicKeyParamUnique) getQuery() builder.Query { +func (p intentParamUnique) getQuery() builder.Query { return p.query } -type PublicKeyEqualsWhereParam interface { +type IntentEqualsWhereParam interface { field() builder.Field getQuery() builder.Query equals() - publicKeyModel() + intentModel() } -type publicKeyEqualsParam struct { +type intentEqualsParam struct { data builder.Field query builder.Query } -func (p publicKeyEqualsParam) publicKeyModel() {} +func (p intentEqualsParam) intentModel() {} -func (publicKeyEqualsParam) equals() {} +func (intentEqualsParam) equals() {} -func (p publicKeyEqualsParam) field() builder.Field { +func (p intentEqualsParam) field() builder.Field { return p.data } -func (p publicKeyEqualsParam) getQuery() builder.Query { +func (p intentEqualsParam) getQuery() builder.Query { return p.query } -type PublicKeyEqualsUniqueWhereParam interface { +type IntentEqualsUniqueWhereParam interface { field() builder.Field getQuery() builder.Query equals() unique() - publicKeyModel() + intentModel() } -type publicKeyEqualsUniqueParam struct { +type intentEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p publicKeyEqualsUniqueParam) publicKeyModel() {} +func (p intentEqualsUniqueParam) intentModel() {} -func (publicKeyEqualsUniqueParam) unique() {} -func (publicKeyEqualsUniqueParam) equals() {} +func (intentEqualsUniqueParam) unique() {} +func (intentEqualsUniqueParam) equals() {} -func (p publicKeyEqualsUniqueParam) field() builder.Field { +func (p intentEqualsUniqueParam) field() builder.Field { return p.data } -func (p publicKeyEqualsUniqueParam) getQuery() builder.Query { +func (p intentEqualsUniqueParam) getQuery() builder.Query { return p.query } -type PublicKeySetParam interface { +type IntentSetParam interface { field() builder.Field settable() - publicKeyModel() + intentModel() } -type publicKeySetParam struct { +type intentSetParam struct { data builder.Field } -func (publicKeySetParam) settable() {} +func (intentSetParam) settable() {} -func (p publicKeySetParam) field() builder.Field { +func (p intentSetParam) field() builder.Field { return p.data } -func (p publicKeySetParam) publicKeyModel() {} +func (p intentSetParam) intentModel() {} -type PublicKeyWithPrismaKeyEqualsSetParam interface { +type IntentWithPrismaIDEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - publicKeyModel() - keyField() + intentModel() + idField() } -type PublicKeyWithPrismaKeySetParam interface { +type IntentWithPrismaIDSetParam interface { field() builder.Field getQuery() builder.Query - publicKeyModel() - keyField() + intentModel() + idField() } -type publicKeyWithPrismaKeySetParam struct { +type intentWithPrismaIDSetParam struct { data builder.Field query builder.Query } -func (p publicKeyWithPrismaKeySetParam) field() builder.Field { +func (p intentWithPrismaIDSetParam) field() builder.Field { return p.data } -func (p publicKeyWithPrismaKeySetParam) getQuery() builder.Query { +func (p intentWithPrismaIDSetParam) getQuery() builder.Query { return p.query } -func (p publicKeyWithPrismaKeySetParam) publicKeyModel() {} +func (p intentWithPrismaIDSetParam) intentModel() {} -func (p publicKeyWithPrismaKeySetParam) keyField() {} +func (p intentWithPrismaIDSetParam) idField() {} -type PublicKeyWithPrismaKeyWhereParam interface { +type IntentWithPrismaIDWhereParam interface { field() builder.Field getQuery() builder.Query - publicKeyModel() - keyField() + intentModel() + idField() } -type publicKeyWithPrismaKeyEqualsParam struct { +type intentWithPrismaIDEqualsParam struct { data builder.Field query builder.Query } -func (p publicKeyWithPrismaKeyEqualsParam) field() builder.Field { +func (p intentWithPrismaIDEqualsParam) field() builder.Field { return p.data } -func (p publicKeyWithPrismaKeyEqualsParam) getQuery() builder.Query { +func (p intentWithPrismaIDEqualsParam) getQuery() builder.Query { return p.query } -func (p publicKeyWithPrismaKeyEqualsParam) publicKeyModel() {} +func (p intentWithPrismaIDEqualsParam) intentModel() {} -func (p publicKeyWithPrismaKeyEqualsParam) keyField() {} +func (p intentWithPrismaIDEqualsParam) idField() {} -func (publicKeyWithPrismaKeySetParam) settable() {} -func (publicKeyWithPrismaKeyEqualsParam) equals() {} +func (intentWithPrismaIDSetParam) settable() {} +func (intentWithPrismaIDEqualsParam) equals() {} -type publicKeyWithPrismaKeyEqualsUniqueParam struct { +type intentWithPrismaIDEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p publicKeyWithPrismaKeyEqualsUniqueParam) field() builder.Field { +func (p intentWithPrismaIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p publicKeyWithPrismaKeyEqualsUniqueParam) getQuery() builder.Query { +func (p intentWithPrismaIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p publicKeyWithPrismaKeyEqualsUniqueParam) publicKeyModel() {} -func (p publicKeyWithPrismaKeyEqualsUniqueParam) keyField() {} +func (p intentWithPrismaIDEqualsUniqueParam) intentModel() {} +func (p intentWithPrismaIDEqualsUniqueParam) idField() {} -func (publicKeyWithPrismaKeyEqualsUniqueParam) unique() {} -func (publicKeyWithPrismaKeyEqualsUniqueParam) equals() {} +func (intentWithPrismaIDEqualsUniqueParam) unique() {} +func (intentWithPrismaIDEqualsUniqueParam) equals() {} -type PublicKeyWithPrismaUserIDEqualsSetParam interface { +type IntentWithPrismaIsFulfilledEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - publicKeyModel() - userIDField() + intentModel() + isFulfilledField() } -type PublicKeyWithPrismaUserIDSetParam interface { +type IntentWithPrismaIsFulfilledSetParam interface { field() builder.Field getQuery() builder.Query - publicKeyModel() - userIDField() + intentModel() + isFulfilledField() } -type publicKeyWithPrismaUserIDSetParam struct { +type intentWithPrismaIsFulfilledSetParam struct { data builder.Field query builder.Query } -func (p publicKeyWithPrismaUserIDSetParam) field() builder.Field { +func (p intentWithPrismaIsFulfilledSetParam) field() builder.Field { return p.data } -func (p publicKeyWithPrismaUserIDSetParam) getQuery() builder.Query { +func (p intentWithPrismaIsFulfilledSetParam) getQuery() builder.Query { return p.query } -func (p publicKeyWithPrismaUserIDSetParam) publicKeyModel() {} +func (p intentWithPrismaIsFulfilledSetParam) intentModel() {} -func (p publicKeyWithPrismaUserIDSetParam) userIDField() {} +func (p intentWithPrismaIsFulfilledSetParam) isFulfilledField() {} -type PublicKeyWithPrismaUserIDWhereParam interface { +type IntentWithPrismaIsFulfilledWhereParam interface { field() builder.Field getQuery() builder.Query - publicKeyModel() - userIDField() + intentModel() + isFulfilledField() } -type publicKeyWithPrismaUserIDEqualsParam struct { +type intentWithPrismaIsFulfilledEqualsParam struct { data builder.Field query builder.Query } -func (p publicKeyWithPrismaUserIDEqualsParam) field() builder.Field { +func (p intentWithPrismaIsFulfilledEqualsParam) field() builder.Field { return p.data } -func (p publicKeyWithPrismaUserIDEqualsParam) getQuery() builder.Query { +func (p intentWithPrismaIsFulfilledEqualsParam) getQuery() builder.Query { return p.query } -func (p publicKeyWithPrismaUserIDEqualsParam) publicKeyModel() {} +func (p intentWithPrismaIsFulfilledEqualsParam) intentModel() {} -func (p publicKeyWithPrismaUserIDEqualsParam) userIDField() {} +func (p intentWithPrismaIsFulfilledEqualsParam) isFulfilledField() {} -func (publicKeyWithPrismaUserIDSetParam) settable() {} -func (publicKeyWithPrismaUserIDEqualsParam) equals() {} +func (intentWithPrismaIsFulfilledSetParam) settable() {} +func (intentWithPrismaIsFulfilledEqualsParam) equals() {} -type publicKeyWithPrismaUserIDEqualsUniqueParam struct { +type intentWithPrismaIsFulfilledEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p publicKeyWithPrismaUserIDEqualsUniqueParam) field() builder.Field { +func (p intentWithPrismaIsFulfilledEqualsUniqueParam) field() builder.Field { return p.data } -func (p publicKeyWithPrismaUserIDEqualsUniqueParam) getQuery() builder.Query { +func (p intentWithPrismaIsFulfilledEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p publicKeyWithPrismaUserIDEqualsUniqueParam) publicKeyModel() {} -func (p publicKeyWithPrismaUserIDEqualsUniqueParam) userIDField() {} +func (p intentWithPrismaIsFulfilledEqualsUniqueParam) intentModel() {} +func (p intentWithPrismaIsFulfilledEqualsUniqueParam) isFulfilledField() {} -func (publicKeyWithPrismaUserIDEqualsUniqueParam) unique() {} -func (publicKeyWithPrismaUserIDEqualsUniqueParam) equals() {} +func (intentWithPrismaIsFulfilledEqualsUniqueParam) unique() {} +func (intentWithPrismaIsFulfilledEqualsUniqueParam) equals() {} -type PublicKeyWithPrismaCreatedAtEqualsSetParam interface { +type IntentWithPrismaCreatedAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - publicKeyModel() + intentModel() createdAtField() } -type PublicKeyWithPrismaCreatedAtSetParam interface { +type IntentWithPrismaCreatedAtSetParam interface { field() builder.Field getQuery() builder.Query - publicKeyModel() + intentModel() createdAtField() } -type publicKeyWithPrismaCreatedAtSetParam struct { +type intentWithPrismaCreatedAtSetParam struct { data builder.Field query builder.Query } -func (p publicKeyWithPrismaCreatedAtSetParam) field() builder.Field { +func (p intentWithPrismaCreatedAtSetParam) field() builder.Field { return p.data } -func (p publicKeyWithPrismaCreatedAtSetParam) getQuery() builder.Query { +func (p intentWithPrismaCreatedAtSetParam) getQuery() builder.Query { return p.query } -func (p publicKeyWithPrismaCreatedAtSetParam) publicKeyModel() {} +func (p intentWithPrismaCreatedAtSetParam) intentModel() {} -func (p publicKeyWithPrismaCreatedAtSetParam) createdAtField() {} +func (p intentWithPrismaCreatedAtSetParam) createdAtField() {} -type PublicKeyWithPrismaCreatedAtWhereParam interface { +type IntentWithPrismaCreatedAtWhereParam interface { field() builder.Field getQuery() builder.Query - publicKeyModel() + intentModel() createdAtField() } -type publicKeyWithPrismaCreatedAtEqualsParam struct { +type intentWithPrismaCreatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p publicKeyWithPrismaCreatedAtEqualsParam) field() builder.Field { +func (p intentWithPrismaCreatedAtEqualsParam) field() builder.Field { return p.data } -func (p publicKeyWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { +func (p intentWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { return p.query } -func (p publicKeyWithPrismaCreatedAtEqualsParam) publicKeyModel() {} +func (p intentWithPrismaCreatedAtEqualsParam) intentModel() {} -func (p publicKeyWithPrismaCreatedAtEqualsParam) createdAtField() {} +func (p intentWithPrismaCreatedAtEqualsParam) createdAtField() {} -func (publicKeyWithPrismaCreatedAtSetParam) settable() {} -func (publicKeyWithPrismaCreatedAtEqualsParam) equals() {} +func (intentWithPrismaCreatedAtSetParam) settable() {} +func (intentWithPrismaCreatedAtEqualsParam) equals() {} -type publicKeyWithPrismaCreatedAtEqualsUniqueParam struct { +type intentWithPrismaCreatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p publicKeyWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { +func (p intentWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p publicKeyWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p intentWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p publicKeyWithPrismaCreatedAtEqualsUniqueParam) publicKeyModel() {} -func (p publicKeyWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} +func (p intentWithPrismaCreatedAtEqualsUniqueParam) intentModel() {} +func (p intentWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} -func (publicKeyWithPrismaCreatedAtEqualsUniqueParam) unique() {} -func (publicKeyWithPrismaCreatedAtEqualsUniqueParam) equals() {} +func (intentWithPrismaCreatedAtEqualsUniqueParam) unique() {} +func (intentWithPrismaCreatedAtEqualsUniqueParam) equals() {} -type PublicKeyWithPrismaUpdatedAtEqualsSetParam interface { +type IntentWithPrismaUpdatedAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - publicKeyModel() + intentModel() updatedAtField() } -type PublicKeyWithPrismaUpdatedAtSetParam interface { +type IntentWithPrismaUpdatedAtSetParam interface { field() builder.Field getQuery() builder.Query - publicKeyModel() + intentModel() updatedAtField() } -type publicKeyWithPrismaUpdatedAtSetParam struct { +type intentWithPrismaUpdatedAtSetParam struct { data builder.Field query builder.Query } -func (p publicKeyWithPrismaUpdatedAtSetParam) field() builder.Field { +func (p intentWithPrismaUpdatedAtSetParam) field() builder.Field { return p.data } -func (p publicKeyWithPrismaUpdatedAtSetParam) getQuery() builder.Query { +func (p intentWithPrismaUpdatedAtSetParam) getQuery() builder.Query { return p.query } -func (p publicKeyWithPrismaUpdatedAtSetParam) publicKeyModel() {} +func (p intentWithPrismaUpdatedAtSetParam) intentModel() {} -func (p publicKeyWithPrismaUpdatedAtSetParam) updatedAtField() {} +func (p intentWithPrismaUpdatedAtSetParam) updatedAtField() {} -type PublicKeyWithPrismaUpdatedAtWhereParam interface { +type IntentWithPrismaUpdatedAtWhereParam interface { field() builder.Field getQuery() builder.Query - publicKeyModel() + intentModel() updatedAtField() } -type publicKeyWithPrismaUpdatedAtEqualsParam struct { +type intentWithPrismaUpdatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p publicKeyWithPrismaUpdatedAtEqualsParam) field() builder.Field { +func (p intentWithPrismaUpdatedAtEqualsParam) field() builder.Field { return p.data } -func (p publicKeyWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { +func (p intentWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { return p.query } -func (p publicKeyWithPrismaUpdatedAtEqualsParam) publicKeyModel() {} +func (p intentWithPrismaUpdatedAtEqualsParam) intentModel() {} -func (p publicKeyWithPrismaUpdatedAtEqualsParam) updatedAtField() {} +func (p intentWithPrismaUpdatedAtEqualsParam) updatedAtField() {} -func (publicKeyWithPrismaUpdatedAtSetParam) settable() {} -func (publicKeyWithPrismaUpdatedAtEqualsParam) equals() {} +func (intentWithPrismaUpdatedAtSetParam) settable() {} +func (intentWithPrismaUpdatedAtEqualsParam) equals() {} -type publicKeyWithPrismaUpdatedAtEqualsUniqueParam struct { +type intentWithPrismaUpdatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p publicKeyWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { +func (p intentWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p publicKeyWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p intentWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p publicKeyWithPrismaUpdatedAtEqualsUniqueParam) publicKeyModel() {} -func (p publicKeyWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} +func (p intentWithPrismaUpdatedAtEqualsUniqueParam) intentModel() {} +func (p intentWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} -func (publicKeyWithPrismaUpdatedAtEqualsUniqueParam) unique() {} -func (publicKeyWithPrismaUpdatedAtEqualsUniqueParam) equals() {} +func (intentWithPrismaUpdatedAtEqualsUniqueParam) unique() {} +func (intentWithPrismaUpdatedAtEqualsUniqueParam) equals() {} -type PublicKeyWithPrismaUserEqualsSetParam interface { - field() builder.Field +type chatActions struct { + // client holds the prisma client + client *PrismaClient +} + +var chatOutput = []builder.Output{ + {Name: "id"}, + {Name: "displayName"}, + {Name: "roomNumber"}, + {Name: "coverCharge"}, + {Name: "type"}, + {Name: "isOpen"}, + {Name: "createdBy"}, + {Name: "createdAt"}, + {Name: "updatedAt"}, + {Name: "lastActivityAt"}, +} + +type ChatRelationWith interface { getQuery() builder.Query - equals() - publicKeyModel() - userField() + with() + chatRelation() } -type PublicKeyWithPrismaUserSetParam interface { +type ChatWhereParam interface { field() builder.Field getQuery() builder.Query - publicKeyModel() - userField() + chatModel() } -type publicKeyWithPrismaUserSetParam struct { +type chatDefaultParam struct { data builder.Field query builder.Query } -func (p publicKeyWithPrismaUserSetParam) field() builder.Field { +func (p chatDefaultParam) field() builder.Field { return p.data } -func (p publicKeyWithPrismaUserSetParam) getQuery() builder.Query { +func (p chatDefaultParam) getQuery() builder.Query { return p.query } -func (p publicKeyWithPrismaUserSetParam) publicKeyModel() {} - -func (p publicKeyWithPrismaUserSetParam) userField() {} +func (p chatDefaultParam) chatModel() {} -type PublicKeyWithPrismaUserWhereParam interface { +type ChatOrderByParam interface { field() builder.Field getQuery() builder.Query - publicKeyModel() - userField() + chatModel() } -type publicKeyWithPrismaUserEqualsParam struct { +type chatOrderByParam struct { data builder.Field query builder.Query } -func (p publicKeyWithPrismaUserEqualsParam) field() builder.Field { +func (p chatOrderByParam) field() builder.Field { return p.data } -func (p publicKeyWithPrismaUserEqualsParam) getQuery() builder.Query { +func (p chatOrderByParam) getQuery() builder.Query { return p.query } -func (p publicKeyWithPrismaUserEqualsParam) publicKeyModel() {} - -func (p publicKeyWithPrismaUserEqualsParam) userField() {} +func (p chatOrderByParam) chatModel() {} -func (publicKeyWithPrismaUserSetParam) settable() {} -func (publicKeyWithPrismaUserEqualsParam) equals() {} +type ChatCursorParam interface { + field() builder.Field + getQuery() builder.Query + chatModel() + isCursor() +} -type publicKeyWithPrismaUserEqualsUniqueParam struct { +type chatCursorParam struct { data builder.Field query builder.Query } -func (p publicKeyWithPrismaUserEqualsUniqueParam) field() builder.Field { +func (p chatCursorParam) field() builder.Field { return p.data } -func (p publicKeyWithPrismaUserEqualsUniqueParam) getQuery() builder.Query { +func (p chatCursorParam) isCursor() {} + +func (p chatCursorParam) getQuery() builder.Query { return p.query } -func (p publicKeyWithPrismaUserEqualsUniqueParam) publicKeyModel() {} -func (p publicKeyWithPrismaUserEqualsUniqueParam) userField() {} +func (p chatCursorParam) chatModel() {} -func (publicKeyWithPrismaUserEqualsUniqueParam) unique() {} -func (publicKeyWithPrismaUserEqualsUniqueParam) equals() {} +type ChatParamUnique interface { + field() builder.Field + getQuery() builder.Query + unique() + chatModel() +} -type intentActions struct { - // client holds the prisma client - client *PrismaClient +type chatParamUnique struct { + data builder.Field + query builder.Query } -var intentOutput = []builder.Output{ - {Name: "id"}, - {Name: "isFulfilled"}, - {Name: "createdAt"}, - {Name: "updatedAt"}, +func (p chatParamUnique) chatModel() {} + +func (chatParamUnique) unique() {} + +func (p chatParamUnique) field() builder.Field { + return p.data } -type IntentRelationWith interface { - getQuery() builder.Query - with() - intentRelation() +func (p chatParamUnique) getQuery() builder.Query { + return p.query } -type IntentWhereParam interface { +type ChatEqualsWhereParam interface { field() builder.Field getQuery() builder.Query - intentModel() + equals() + chatModel() } -type intentDefaultParam struct { +type chatEqualsParam struct { data builder.Field query builder.Query } -func (p intentDefaultParam) field() builder.Field { +func (p chatEqualsParam) chatModel() {} + +func (chatEqualsParam) equals() {} + +func (p chatEqualsParam) field() builder.Field { return p.data } -func (p intentDefaultParam) getQuery() builder.Query { +func (p chatEqualsParam) getQuery() builder.Query { return p.query } -func (p intentDefaultParam) intentModel() {} - -type IntentOrderByParam interface { +type ChatEqualsUniqueWhereParam interface { field() builder.Field getQuery() builder.Query - intentModel() + equals() + unique() + chatModel() } -type intentOrderByParam struct { +type chatEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p intentOrderByParam) field() builder.Field { +func (p chatEqualsUniqueParam) chatModel() {} + +func (chatEqualsUniqueParam) unique() {} +func (chatEqualsUniqueParam) equals() {} + +func (p chatEqualsUniqueParam) field() builder.Field { return p.data } -func (p intentOrderByParam) getQuery() builder.Query { +func (p chatEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p intentOrderByParam) intentModel() {} +type ChatSetParam interface { + field() builder.Field + settable() + chatModel() +} -type IntentCursorParam interface { +type chatSetParam struct { + data builder.Field +} + +func (chatSetParam) settable() {} + +func (p chatSetParam) field() builder.Field { + return p.data +} + +func (p chatSetParam) chatModel() {} + +type ChatWithPrismaIDEqualsSetParam interface { field() builder.Field getQuery() builder.Query - intentModel() - isCursor() + equals() + chatModel() + idField() } -type intentCursorParam struct { +type ChatWithPrismaIDSetParam interface { + field() builder.Field + getQuery() builder.Query + chatModel() + idField() +} + +type chatWithPrismaIDSetParam struct { data builder.Field query builder.Query } -func (p intentCursorParam) field() builder.Field { +func (p chatWithPrismaIDSetParam) field() builder.Field { return p.data } -func (p intentCursorParam) isCursor() {} - -func (p intentCursorParam) getQuery() builder.Query { +func (p chatWithPrismaIDSetParam) getQuery() builder.Query { return p.query } -func (p intentCursorParam) intentModel() {} +func (p chatWithPrismaIDSetParam) chatModel() {} -type IntentParamUnique interface { +func (p chatWithPrismaIDSetParam) idField() {} + +type ChatWithPrismaIDWhereParam interface { field() builder.Field getQuery() builder.Query - unique() - intentModel() + chatModel() + idField() } -type intentParamUnique struct { +type chatWithPrismaIDEqualsParam struct { data builder.Field query builder.Query } -func (p intentParamUnique) intentModel() {} +func (p chatWithPrismaIDEqualsParam) field() builder.Field { + return p.data +} -func (intentParamUnique) unique() {} +func (p chatWithPrismaIDEqualsParam) getQuery() builder.Query { + return p.query +} -func (p intentParamUnique) field() builder.Field { +func (p chatWithPrismaIDEqualsParam) chatModel() {} + +func (p chatWithPrismaIDEqualsParam) idField() {} + +func (chatWithPrismaIDSetParam) settable() {} +func (chatWithPrismaIDEqualsParam) equals() {} + +type chatWithPrismaIDEqualsUniqueParam struct { + data builder.Field + query builder.Query +} + +func (p chatWithPrismaIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p intentParamUnique) getQuery() builder.Query { +func (p chatWithPrismaIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -type IntentEqualsWhereParam interface { +func (p chatWithPrismaIDEqualsUniqueParam) chatModel() {} +func (p chatWithPrismaIDEqualsUniqueParam) idField() {} + +func (chatWithPrismaIDEqualsUniqueParam) unique() {} +func (chatWithPrismaIDEqualsUniqueParam) equals() {} + +type ChatWithPrismaDisplayNameEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - intentModel() + chatModel() + displayNameField() } -type intentEqualsParam struct { +type ChatWithPrismaDisplayNameSetParam interface { + field() builder.Field + getQuery() builder.Query + chatModel() + displayNameField() +} + +type chatWithPrismaDisplayNameSetParam struct { data builder.Field query builder.Query } -func (p intentEqualsParam) intentModel() {} - -func (intentEqualsParam) equals() {} - -func (p intentEqualsParam) field() builder.Field { +func (p chatWithPrismaDisplayNameSetParam) field() builder.Field { return p.data } -func (p intentEqualsParam) getQuery() builder.Query { +func (p chatWithPrismaDisplayNameSetParam) getQuery() builder.Query { return p.query } -type IntentEqualsUniqueWhereParam interface { +func (p chatWithPrismaDisplayNameSetParam) chatModel() {} + +func (p chatWithPrismaDisplayNameSetParam) displayNameField() {} + +type ChatWithPrismaDisplayNameWhereParam interface { field() builder.Field getQuery() builder.Query - equals() - unique() - intentModel() + chatModel() + displayNameField() } -type intentEqualsUniqueParam struct { +type chatWithPrismaDisplayNameEqualsParam struct { data builder.Field query builder.Query } -func (p intentEqualsUniqueParam) intentModel() {} - -func (intentEqualsUniqueParam) unique() {} -func (intentEqualsUniqueParam) equals() {} - -func (p intentEqualsUniqueParam) field() builder.Field { +func (p chatWithPrismaDisplayNameEqualsParam) field() builder.Field { return p.data } -func (p intentEqualsUniqueParam) getQuery() builder.Query { +func (p chatWithPrismaDisplayNameEqualsParam) getQuery() builder.Query { return p.query } -type IntentSetParam interface { - field() builder.Field - settable() - intentModel() -} +func (p chatWithPrismaDisplayNameEqualsParam) chatModel() {} -type intentSetParam struct { - data builder.Field -} +func (p chatWithPrismaDisplayNameEqualsParam) displayNameField() {} -func (intentSetParam) settable() {} +func (chatWithPrismaDisplayNameSetParam) settable() {} +func (chatWithPrismaDisplayNameEqualsParam) equals() {} -func (p intentSetParam) field() builder.Field { +type chatWithPrismaDisplayNameEqualsUniqueParam struct { + data builder.Field + query builder.Query +} + +func (p chatWithPrismaDisplayNameEqualsUniqueParam) field() builder.Field { return p.data } -func (p intentSetParam) intentModel() {} +func (p chatWithPrismaDisplayNameEqualsUniqueParam) getQuery() builder.Query { + return p.query +} -type IntentWithPrismaIDEqualsSetParam interface { +func (p chatWithPrismaDisplayNameEqualsUniqueParam) chatModel() {} +func (p chatWithPrismaDisplayNameEqualsUniqueParam) displayNameField() {} + +func (chatWithPrismaDisplayNameEqualsUniqueParam) unique() {} +func (chatWithPrismaDisplayNameEqualsUniqueParam) equals() {} + +type ChatWithPrismaRoomNumberEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - intentModel() - idField() + chatModel() + roomNumberField() } -type IntentWithPrismaIDSetParam interface { +type ChatWithPrismaRoomNumberSetParam interface { field() builder.Field getQuery() builder.Query - intentModel() - idField() + chatModel() + roomNumberField() } -type intentWithPrismaIDSetParam struct { +type chatWithPrismaRoomNumberSetParam struct { data builder.Field query builder.Query } -func (p intentWithPrismaIDSetParam) field() builder.Field { +func (p chatWithPrismaRoomNumberSetParam) field() builder.Field { return p.data } -func (p intentWithPrismaIDSetParam) getQuery() builder.Query { +func (p chatWithPrismaRoomNumberSetParam) getQuery() builder.Query { return p.query } -func (p intentWithPrismaIDSetParam) intentModel() {} +func (p chatWithPrismaRoomNumberSetParam) chatModel() {} -func (p intentWithPrismaIDSetParam) idField() {} +func (p chatWithPrismaRoomNumberSetParam) roomNumberField() {} -type IntentWithPrismaIDWhereParam interface { +type ChatWithPrismaRoomNumberWhereParam interface { field() builder.Field getQuery() builder.Query - intentModel() - idField() + chatModel() + roomNumberField() } -type intentWithPrismaIDEqualsParam struct { +type chatWithPrismaRoomNumberEqualsParam struct { data builder.Field query builder.Query } -func (p intentWithPrismaIDEqualsParam) field() builder.Field { +func (p chatWithPrismaRoomNumberEqualsParam) field() builder.Field { return p.data } -func (p intentWithPrismaIDEqualsParam) getQuery() builder.Query { +func (p chatWithPrismaRoomNumberEqualsParam) getQuery() builder.Query { return p.query } -func (p intentWithPrismaIDEqualsParam) intentModel() {} +func (p chatWithPrismaRoomNumberEqualsParam) chatModel() {} -func (p intentWithPrismaIDEqualsParam) idField() {} +func (p chatWithPrismaRoomNumberEqualsParam) roomNumberField() {} -func (intentWithPrismaIDSetParam) settable() {} -func (intentWithPrismaIDEqualsParam) equals() {} +func (chatWithPrismaRoomNumberSetParam) settable() {} +func (chatWithPrismaRoomNumberEqualsParam) equals() {} -type intentWithPrismaIDEqualsUniqueParam struct { +type chatWithPrismaRoomNumberEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p intentWithPrismaIDEqualsUniqueParam) field() builder.Field { +func (p chatWithPrismaRoomNumberEqualsUniqueParam) field() builder.Field { return p.data } -func (p intentWithPrismaIDEqualsUniqueParam) getQuery() builder.Query { +func (p chatWithPrismaRoomNumberEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p intentWithPrismaIDEqualsUniqueParam) intentModel() {} -func (p intentWithPrismaIDEqualsUniqueParam) idField() {} +func (p chatWithPrismaRoomNumberEqualsUniqueParam) chatModel() {} +func (p chatWithPrismaRoomNumberEqualsUniqueParam) roomNumberField() {} -func (intentWithPrismaIDEqualsUniqueParam) unique() {} -func (intentWithPrismaIDEqualsUniqueParam) equals() {} +func (chatWithPrismaRoomNumberEqualsUniqueParam) unique() {} +func (chatWithPrismaRoomNumberEqualsUniqueParam) equals() {} -type IntentWithPrismaIsFulfilledEqualsSetParam interface { +type ChatWithPrismaCoverChargeEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - intentModel() - isFulfilledField() + chatModel() + coverChargeField() } -type IntentWithPrismaIsFulfilledSetParam interface { +type ChatWithPrismaCoverChargeSetParam interface { field() builder.Field getQuery() builder.Query - intentModel() - isFulfilledField() + chatModel() + coverChargeField() } -type intentWithPrismaIsFulfilledSetParam struct { +type chatWithPrismaCoverChargeSetParam struct { data builder.Field query builder.Query } -func (p intentWithPrismaIsFulfilledSetParam) field() builder.Field { +func (p chatWithPrismaCoverChargeSetParam) field() builder.Field { return p.data } -func (p intentWithPrismaIsFulfilledSetParam) getQuery() builder.Query { +func (p chatWithPrismaCoverChargeSetParam) getQuery() builder.Query { return p.query } -func (p intentWithPrismaIsFulfilledSetParam) intentModel() {} +func (p chatWithPrismaCoverChargeSetParam) chatModel() {} -func (p intentWithPrismaIsFulfilledSetParam) isFulfilledField() {} +func (p chatWithPrismaCoverChargeSetParam) coverChargeField() {} -type IntentWithPrismaIsFulfilledWhereParam interface { +type ChatWithPrismaCoverChargeWhereParam interface { field() builder.Field getQuery() builder.Query - intentModel() - isFulfilledField() + chatModel() + coverChargeField() } -type intentWithPrismaIsFulfilledEqualsParam struct { +type chatWithPrismaCoverChargeEqualsParam struct { data builder.Field query builder.Query } -func (p intentWithPrismaIsFulfilledEqualsParam) field() builder.Field { +func (p chatWithPrismaCoverChargeEqualsParam) field() builder.Field { return p.data } -func (p intentWithPrismaIsFulfilledEqualsParam) getQuery() builder.Query { +func (p chatWithPrismaCoverChargeEqualsParam) getQuery() builder.Query { return p.query } -func (p intentWithPrismaIsFulfilledEqualsParam) intentModel() {} +func (p chatWithPrismaCoverChargeEqualsParam) chatModel() {} -func (p intentWithPrismaIsFulfilledEqualsParam) isFulfilledField() {} +func (p chatWithPrismaCoverChargeEqualsParam) coverChargeField() {} -func (intentWithPrismaIsFulfilledSetParam) settable() {} -func (intentWithPrismaIsFulfilledEqualsParam) equals() {} +func (chatWithPrismaCoverChargeSetParam) settable() {} +func (chatWithPrismaCoverChargeEqualsParam) equals() {} -type intentWithPrismaIsFulfilledEqualsUniqueParam struct { +type chatWithPrismaCoverChargeEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p intentWithPrismaIsFulfilledEqualsUniqueParam) field() builder.Field { +func (p chatWithPrismaCoverChargeEqualsUniqueParam) field() builder.Field { return p.data } -func (p intentWithPrismaIsFulfilledEqualsUniqueParam) getQuery() builder.Query { +func (p chatWithPrismaCoverChargeEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p intentWithPrismaIsFulfilledEqualsUniqueParam) intentModel() {} -func (p intentWithPrismaIsFulfilledEqualsUniqueParam) isFulfilledField() {} - -func (intentWithPrismaIsFulfilledEqualsUniqueParam) unique() {} -func (intentWithPrismaIsFulfilledEqualsUniqueParam) equals() {} +func (p chatWithPrismaCoverChargeEqualsUniqueParam) chatModel() {} +func (p chatWithPrismaCoverChargeEqualsUniqueParam) coverChargeField() {} -type IntentWithPrismaCreatedAtEqualsSetParam interface { +func (chatWithPrismaCoverChargeEqualsUniqueParam) unique() {} +func (chatWithPrismaCoverChargeEqualsUniqueParam) equals() {} + +type ChatWithPrismaTypeEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - intentModel() - createdAtField() + chatModel() + typeField() } -type IntentWithPrismaCreatedAtSetParam interface { +type ChatWithPrismaTypeSetParam interface { field() builder.Field getQuery() builder.Query - intentModel() - createdAtField() + chatModel() + typeField() } -type intentWithPrismaCreatedAtSetParam struct { +type chatWithPrismaTypeSetParam struct { data builder.Field query builder.Query } -func (p intentWithPrismaCreatedAtSetParam) field() builder.Field { +func (p chatWithPrismaTypeSetParam) field() builder.Field { return p.data } -func (p intentWithPrismaCreatedAtSetParam) getQuery() builder.Query { +func (p chatWithPrismaTypeSetParam) getQuery() builder.Query { return p.query } -func (p intentWithPrismaCreatedAtSetParam) intentModel() {} +func (p chatWithPrismaTypeSetParam) chatModel() {} -func (p intentWithPrismaCreatedAtSetParam) createdAtField() {} +func (p chatWithPrismaTypeSetParam) typeField() {} -type IntentWithPrismaCreatedAtWhereParam interface { +type ChatWithPrismaTypeWhereParam interface { field() builder.Field getQuery() builder.Query - intentModel() - createdAtField() + chatModel() + typeField() } -type intentWithPrismaCreatedAtEqualsParam struct { +type chatWithPrismaTypeEqualsParam struct { data builder.Field query builder.Query } -func (p intentWithPrismaCreatedAtEqualsParam) field() builder.Field { +func (p chatWithPrismaTypeEqualsParam) field() builder.Field { return p.data } -func (p intentWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { +func (p chatWithPrismaTypeEqualsParam) getQuery() builder.Query { return p.query } -func (p intentWithPrismaCreatedAtEqualsParam) intentModel() {} +func (p chatWithPrismaTypeEqualsParam) chatModel() {} -func (p intentWithPrismaCreatedAtEqualsParam) createdAtField() {} +func (p chatWithPrismaTypeEqualsParam) typeField() {} -func (intentWithPrismaCreatedAtSetParam) settable() {} -func (intentWithPrismaCreatedAtEqualsParam) equals() {} +func (chatWithPrismaTypeSetParam) settable() {} +func (chatWithPrismaTypeEqualsParam) equals() {} -type intentWithPrismaCreatedAtEqualsUniqueParam struct { +type chatWithPrismaTypeEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p intentWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { +func (p chatWithPrismaTypeEqualsUniqueParam) field() builder.Field { return p.data } -func (p intentWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p chatWithPrismaTypeEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p intentWithPrismaCreatedAtEqualsUniqueParam) intentModel() {} -func (p intentWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} +func (p chatWithPrismaTypeEqualsUniqueParam) chatModel() {} +func (p chatWithPrismaTypeEqualsUniqueParam) typeField() {} -func (intentWithPrismaCreatedAtEqualsUniqueParam) unique() {} -func (intentWithPrismaCreatedAtEqualsUniqueParam) equals() {} +func (chatWithPrismaTypeEqualsUniqueParam) unique() {} +func (chatWithPrismaTypeEqualsUniqueParam) equals() {} -type IntentWithPrismaUpdatedAtEqualsSetParam interface { +type ChatWithPrismaIsOpenEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - intentModel() - updatedAtField() + chatModel() + isOpenField() } -type IntentWithPrismaUpdatedAtSetParam interface { +type ChatWithPrismaIsOpenSetParam interface { field() builder.Field getQuery() builder.Query - intentModel() - updatedAtField() + chatModel() + isOpenField() } -type intentWithPrismaUpdatedAtSetParam struct { +type chatWithPrismaIsOpenSetParam struct { data builder.Field query builder.Query } -func (p intentWithPrismaUpdatedAtSetParam) field() builder.Field { +func (p chatWithPrismaIsOpenSetParam) field() builder.Field { return p.data } -func (p intentWithPrismaUpdatedAtSetParam) getQuery() builder.Query { +func (p chatWithPrismaIsOpenSetParam) getQuery() builder.Query { return p.query } -func (p intentWithPrismaUpdatedAtSetParam) intentModel() {} +func (p chatWithPrismaIsOpenSetParam) chatModel() {} -func (p intentWithPrismaUpdatedAtSetParam) updatedAtField() {} +func (p chatWithPrismaIsOpenSetParam) isOpenField() {} -type IntentWithPrismaUpdatedAtWhereParam interface { +type ChatWithPrismaIsOpenWhereParam interface { field() builder.Field getQuery() builder.Query - intentModel() - updatedAtField() + chatModel() + isOpenField() } -type intentWithPrismaUpdatedAtEqualsParam struct { +type chatWithPrismaIsOpenEqualsParam struct { data builder.Field query builder.Query } -func (p intentWithPrismaUpdatedAtEqualsParam) field() builder.Field { +func (p chatWithPrismaIsOpenEqualsParam) field() builder.Field { return p.data } -func (p intentWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { +func (p chatWithPrismaIsOpenEqualsParam) getQuery() builder.Query { return p.query } -func (p intentWithPrismaUpdatedAtEqualsParam) intentModel() {} +func (p chatWithPrismaIsOpenEqualsParam) chatModel() {} -func (p intentWithPrismaUpdatedAtEqualsParam) updatedAtField() {} +func (p chatWithPrismaIsOpenEqualsParam) isOpenField() {} -func (intentWithPrismaUpdatedAtSetParam) settable() {} -func (intentWithPrismaUpdatedAtEqualsParam) equals() {} +func (chatWithPrismaIsOpenSetParam) settable() {} +func (chatWithPrismaIsOpenEqualsParam) equals() {} -type intentWithPrismaUpdatedAtEqualsUniqueParam struct { +type chatWithPrismaIsOpenEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p intentWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { +func (p chatWithPrismaIsOpenEqualsUniqueParam) field() builder.Field { return p.data } -func (p intentWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p chatWithPrismaIsOpenEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p intentWithPrismaUpdatedAtEqualsUniqueParam) intentModel() {} -func (p intentWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} - -func (intentWithPrismaUpdatedAtEqualsUniqueParam) unique() {} -func (intentWithPrismaUpdatedAtEqualsUniqueParam) equals() {} - -type chatActions struct { - // client holds the prisma client - client *PrismaClient -} +func (p chatWithPrismaIsOpenEqualsUniqueParam) chatModel() {} +func (p chatWithPrismaIsOpenEqualsUniqueParam) isOpenField() {} -var chatOutput = []builder.Output{ - {Name: "id"}, - {Name: "displayName"}, - {Name: "roomNumber"}, - {Name: "coverCharge"}, - {Name: "type"}, - {Name: "isOpen"}, - {Name: "createdBy"}, - {Name: "createdAt"}, - {Name: "updatedAt"}, - {Name: "lastActivityAt"}, -} +func (chatWithPrismaIsOpenEqualsUniqueParam) unique() {} +func (chatWithPrismaIsOpenEqualsUniqueParam) equals() {} -type ChatRelationWith interface { +type ChatWithPrismaCreatedByEqualsSetParam interface { + field() builder.Field getQuery() builder.Query - with() - chatRelation() + equals() + chatModel() + createdByField() } -type ChatWhereParam interface { +type ChatWithPrismaCreatedBySetParam interface { field() builder.Field getQuery() builder.Query chatModel() + createdByField() } -type chatDefaultParam struct { +type chatWithPrismaCreatedBySetParam struct { data builder.Field query builder.Query } -func (p chatDefaultParam) field() builder.Field { +func (p chatWithPrismaCreatedBySetParam) field() builder.Field { return p.data } -func (p chatDefaultParam) getQuery() builder.Query { +func (p chatWithPrismaCreatedBySetParam) getQuery() builder.Query { return p.query } -func (p chatDefaultParam) chatModel() {} +func (p chatWithPrismaCreatedBySetParam) chatModel() {} -type ChatOrderByParam interface { +func (p chatWithPrismaCreatedBySetParam) createdByField() {} + +type ChatWithPrismaCreatedByWhereParam interface { field() builder.Field getQuery() builder.Query chatModel() + createdByField() } -type chatOrderByParam struct { +type chatWithPrismaCreatedByEqualsParam struct { data builder.Field query builder.Query } -func (p chatOrderByParam) field() builder.Field { +func (p chatWithPrismaCreatedByEqualsParam) field() builder.Field { return p.data } -func (p chatOrderByParam) getQuery() builder.Query { +func (p chatWithPrismaCreatedByEqualsParam) getQuery() builder.Query { return p.query } -func (p chatOrderByParam) chatModel() {} +func (p chatWithPrismaCreatedByEqualsParam) chatModel() {} -type ChatCursorParam interface { - field() builder.Field - getQuery() builder.Query - chatModel() - isCursor() -} +func (p chatWithPrismaCreatedByEqualsParam) createdByField() {} -type chatCursorParam struct { +func (chatWithPrismaCreatedBySetParam) settable() {} +func (chatWithPrismaCreatedByEqualsParam) equals() {} + +type chatWithPrismaCreatedByEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p chatCursorParam) field() builder.Field { +func (p chatWithPrismaCreatedByEqualsUniqueParam) field() builder.Field { return p.data } -func (p chatCursorParam) isCursor() {} - -func (p chatCursorParam) getQuery() builder.Query { +func (p chatWithPrismaCreatedByEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p chatCursorParam) chatModel() {} +func (p chatWithPrismaCreatedByEqualsUniqueParam) chatModel() {} +func (p chatWithPrismaCreatedByEqualsUniqueParam) createdByField() {} -type ChatParamUnique interface { +func (chatWithPrismaCreatedByEqualsUniqueParam) unique() {} +func (chatWithPrismaCreatedByEqualsUniqueParam) equals() {} + +type ChatWithPrismaCreatedAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query - unique() + equals() chatModel() + createdAtField() } -type chatParamUnique struct { +type ChatWithPrismaCreatedAtSetParam interface { + field() builder.Field + getQuery() builder.Query + chatModel() + createdAtField() +} + +type chatWithPrismaCreatedAtSetParam struct { data builder.Field query builder.Query } -func (p chatParamUnique) chatModel() {} - -func (chatParamUnique) unique() {} - -func (p chatParamUnique) field() builder.Field { +func (p chatWithPrismaCreatedAtSetParam) field() builder.Field { return p.data } -func (p chatParamUnique) getQuery() builder.Query { +func (p chatWithPrismaCreatedAtSetParam) getQuery() builder.Query { return p.query } -type ChatEqualsWhereParam interface { +func (p chatWithPrismaCreatedAtSetParam) chatModel() {} + +func (p chatWithPrismaCreatedAtSetParam) createdAtField() {} + +type ChatWithPrismaCreatedAtWhereParam interface { field() builder.Field getQuery() builder.Query - equals() chatModel() + createdAtField() } -type chatEqualsParam struct { +type chatWithPrismaCreatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p chatEqualsParam) chatModel() {} - -func (chatEqualsParam) equals() {} - -func (p chatEqualsParam) field() builder.Field { +func (p chatWithPrismaCreatedAtEqualsParam) field() builder.Field { return p.data } -func (p chatEqualsParam) getQuery() builder.Query { +func (p chatWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { return p.query } -type ChatEqualsUniqueWhereParam interface { - field() builder.Field - getQuery() builder.Query - equals() - unique() - chatModel() -} +func (p chatWithPrismaCreatedAtEqualsParam) chatModel() {} -type chatEqualsUniqueParam struct { +func (p chatWithPrismaCreatedAtEqualsParam) createdAtField() {} + +func (chatWithPrismaCreatedAtSetParam) settable() {} +func (chatWithPrismaCreatedAtEqualsParam) equals() {} + +type chatWithPrismaCreatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p chatEqualsUniqueParam) chatModel() {} - -func (chatEqualsUniqueParam) unique() {} -func (chatEqualsUniqueParam) equals() {} - -func (p chatEqualsUniqueParam) field() builder.Field { +func (p chatWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p chatEqualsUniqueParam) getQuery() builder.Query { +func (p chatWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -type ChatSetParam interface { - field() builder.Field - settable() - chatModel() -} - -type chatSetParam struct { - data builder.Field -} - -func (chatSetParam) settable() {} - -func (p chatSetParam) field() builder.Field { - return p.data -} +func (p chatWithPrismaCreatedAtEqualsUniqueParam) chatModel() {} +func (p chatWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} -func (p chatSetParam) chatModel() {} +func (chatWithPrismaCreatedAtEqualsUniqueParam) unique() {} +func (chatWithPrismaCreatedAtEqualsUniqueParam) equals() {} -type ChatWithPrismaIDEqualsSetParam interface { +type ChatWithPrismaUpdatedAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() chatModel() - idField() + updatedAtField() } -type ChatWithPrismaIDSetParam interface { +type ChatWithPrismaUpdatedAtSetParam interface { field() builder.Field getQuery() builder.Query chatModel() - idField() + updatedAtField() } -type chatWithPrismaIDSetParam struct { +type chatWithPrismaUpdatedAtSetParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaIDSetParam) field() builder.Field { +func (p chatWithPrismaUpdatedAtSetParam) field() builder.Field { return p.data } -func (p chatWithPrismaIDSetParam) getQuery() builder.Query { +func (p chatWithPrismaUpdatedAtSetParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaIDSetParam) chatModel() {} +func (p chatWithPrismaUpdatedAtSetParam) chatModel() {} -func (p chatWithPrismaIDSetParam) idField() {} +func (p chatWithPrismaUpdatedAtSetParam) updatedAtField() {} -type ChatWithPrismaIDWhereParam interface { +type ChatWithPrismaUpdatedAtWhereParam interface { field() builder.Field getQuery() builder.Query chatModel() - idField() + updatedAtField() } -type chatWithPrismaIDEqualsParam struct { +type chatWithPrismaUpdatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaIDEqualsParam) field() builder.Field { +func (p chatWithPrismaUpdatedAtEqualsParam) field() builder.Field { return p.data } -func (p chatWithPrismaIDEqualsParam) getQuery() builder.Query { +func (p chatWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaIDEqualsParam) chatModel() {} +func (p chatWithPrismaUpdatedAtEqualsParam) chatModel() {} -func (p chatWithPrismaIDEqualsParam) idField() {} +func (p chatWithPrismaUpdatedAtEqualsParam) updatedAtField() {} -func (chatWithPrismaIDSetParam) settable() {} -func (chatWithPrismaIDEqualsParam) equals() {} +func (chatWithPrismaUpdatedAtSetParam) settable() {} +func (chatWithPrismaUpdatedAtEqualsParam) equals() {} -type chatWithPrismaIDEqualsUniqueParam struct { +type chatWithPrismaUpdatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaIDEqualsUniqueParam) field() builder.Field { +func (p chatWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p chatWithPrismaIDEqualsUniqueParam) getQuery() builder.Query { +func (p chatWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaIDEqualsUniqueParam) chatModel() {} -func (p chatWithPrismaIDEqualsUniqueParam) idField() {} +func (p chatWithPrismaUpdatedAtEqualsUniqueParam) chatModel() {} +func (p chatWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} -func (chatWithPrismaIDEqualsUniqueParam) unique() {} -func (chatWithPrismaIDEqualsUniqueParam) equals() {} +func (chatWithPrismaUpdatedAtEqualsUniqueParam) unique() {} +func (chatWithPrismaUpdatedAtEqualsUniqueParam) equals() {} -type ChatWithPrismaDisplayNameEqualsSetParam interface { +type ChatWithPrismaLastActivityAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() chatModel() - displayNameField() + lastActivityAtField() } -type ChatWithPrismaDisplayNameSetParam interface { +type ChatWithPrismaLastActivityAtSetParam interface { field() builder.Field getQuery() builder.Query chatModel() - displayNameField() + lastActivityAtField() } -type chatWithPrismaDisplayNameSetParam struct { +type chatWithPrismaLastActivityAtSetParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaDisplayNameSetParam) field() builder.Field { +func (p chatWithPrismaLastActivityAtSetParam) field() builder.Field { return p.data } -func (p chatWithPrismaDisplayNameSetParam) getQuery() builder.Query { +func (p chatWithPrismaLastActivityAtSetParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaDisplayNameSetParam) chatModel() {} +func (p chatWithPrismaLastActivityAtSetParam) chatModel() {} -func (p chatWithPrismaDisplayNameSetParam) displayNameField() {} +func (p chatWithPrismaLastActivityAtSetParam) lastActivityAtField() {} -type ChatWithPrismaDisplayNameWhereParam interface { +type ChatWithPrismaLastActivityAtWhereParam interface { field() builder.Field getQuery() builder.Query chatModel() - displayNameField() + lastActivityAtField() } -type chatWithPrismaDisplayNameEqualsParam struct { +type chatWithPrismaLastActivityAtEqualsParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaDisplayNameEqualsParam) field() builder.Field { +func (p chatWithPrismaLastActivityAtEqualsParam) field() builder.Field { return p.data } -func (p chatWithPrismaDisplayNameEqualsParam) getQuery() builder.Query { +func (p chatWithPrismaLastActivityAtEqualsParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaDisplayNameEqualsParam) chatModel() {} +func (p chatWithPrismaLastActivityAtEqualsParam) chatModel() {} -func (p chatWithPrismaDisplayNameEqualsParam) displayNameField() {} +func (p chatWithPrismaLastActivityAtEqualsParam) lastActivityAtField() {} -func (chatWithPrismaDisplayNameSetParam) settable() {} -func (chatWithPrismaDisplayNameEqualsParam) equals() {} +func (chatWithPrismaLastActivityAtSetParam) settable() {} +func (chatWithPrismaLastActivityAtEqualsParam) equals() {} -type chatWithPrismaDisplayNameEqualsUniqueParam struct { +type chatWithPrismaLastActivityAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaDisplayNameEqualsUniqueParam) field() builder.Field { +func (p chatWithPrismaLastActivityAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p chatWithPrismaDisplayNameEqualsUniqueParam) getQuery() builder.Query { +func (p chatWithPrismaLastActivityAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaDisplayNameEqualsUniqueParam) chatModel() {} -func (p chatWithPrismaDisplayNameEqualsUniqueParam) displayNameField() {} +func (p chatWithPrismaLastActivityAtEqualsUniqueParam) chatModel() {} +func (p chatWithPrismaLastActivityAtEqualsUniqueParam) lastActivityAtField() {} -func (chatWithPrismaDisplayNameEqualsUniqueParam) unique() {} -func (chatWithPrismaDisplayNameEqualsUniqueParam) equals() {} +func (chatWithPrismaLastActivityAtEqualsUniqueParam) unique() {} +func (chatWithPrismaLastActivityAtEqualsUniqueParam) equals() {} -type ChatWithPrismaRoomNumberEqualsSetParam interface { +type ChatWithPrismaMembersEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() chatModel() - roomNumberField() + membersField() } -type ChatWithPrismaRoomNumberSetParam interface { +type ChatWithPrismaMembersSetParam interface { field() builder.Field getQuery() builder.Query chatModel() - roomNumberField() + membersField() } -type chatWithPrismaRoomNumberSetParam struct { +type chatWithPrismaMembersSetParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaRoomNumberSetParam) field() builder.Field { +func (p chatWithPrismaMembersSetParam) field() builder.Field { return p.data } -func (p chatWithPrismaRoomNumberSetParam) getQuery() builder.Query { +func (p chatWithPrismaMembersSetParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaRoomNumberSetParam) chatModel() {} +func (p chatWithPrismaMembersSetParam) chatModel() {} -func (p chatWithPrismaRoomNumberSetParam) roomNumberField() {} +func (p chatWithPrismaMembersSetParam) membersField() {} -type ChatWithPrismaRoomNumberWhereParam interface { +type ChatWithPrismaMembersWhereParam interface { field() builder.Field getQuery() builder.Query chatModel() - roomNumberField() + membersField() } -type chatWithPrismaRoomNumberEqualsParam struct { +type chatWithPrismaMembersEqualsParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaRoomNumberEqualsParam) field() builder.Field { +func (p chatWithPrismaMembersEqualsParam) field() builder.Field { return p.data } -func (p chatWithPrismaRoomNumberEqualsParam) getQuery() builder.Query { +func (p chatWithPrismaMembersEqualsParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaRoomNumberEqualsParam) chatModel() {} +func (p chatWithPrismaMembersEqualsParam) chatModel() {} -func (p chatWithPrismaRoomNumberEqualsParam) roomNumberField() {} +func (p chatWithPrismaMembersEqualsParam) membersField() {} -func (chatWithPrismaRoomNumberSetParam) settable() {} -func (chatWithPrismaRoomNumberEqualsParam) equals() {} +func (chatWithPrismaMembersSetParam) settable() {} +func (chatWithPrismaMembersEqualsParam) equals() {} -type chatWithPrismaRoomNumberEqualsUniqueParam struct { +type chatWithPrismaMembersEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaRoomNumberEqualsUniqueParam) field() builder.Field { +func (p chatWithPrismaMembersEqualsUniqueParam) field() builder.Field { return p.data } -func (p chatWithPrismaRoomNumberEqualsUniqueParam) getQuery() builder.Query { +func (p chatWithPrismaMembersEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaRoomNumberEqualsUniqueParam) chatModel() {} -func (p chatWithPrismaRoomNumberEqualsUniqueParam) roomNumberField() {} +func (p chatWithPrismaMembersEqualsUniqueParam) chatModel() {} +func (p chatWithPrismaMembersEqualsUniqueParam) membersField() {} -func (chatWithPrismaRoomNumberEqualsUniqueParam) unique() {} -func (chatWithPrismaRoomNumberEqualsUniqueParam) equals() {} +func (chatWithPrismaMembersEqualsUniqueParam) unique() {} +func (chatWithPrismaMembersEqualsUniqueParam) equals() {} -type ChatWithPrismaCoverChargeEqualsSetParam interface { - field() builder.Field +type memberActions struct { + // client holds the prisma client + client *PrismaClient +} + +var memberOutput = []builder.Output{ + {Name: "chatId"}, + {Name: "userId"}, + {Name: "addedById"}, + {Name: "isMuted"}, + {Name: "isPushEnabled"}, + {Name: "hasModPermission"}, + {Name: "hasSendPermission"}, + {Name: "isSoftDeleted"}, + {Name: "createdAt"}, + {Name: "updatedAt"}, +} + +type MemberRelationWith interface { getQuery() builder.Query - equals() - chatModel() - coverChargeField() + with() + memberRelation() } -type ChatWithPrismaCoverChargeSetParam interface { +type MemberWhereParam interface { field() builder.Field getQuery() builder.Query - chatModel() - coverChargeField() + memberModel() } -type chatWithPrismaCoverChargeSetParam struct { +type memberDefaultParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaCoverChargeSetParam) field() builder.Field { +func (p memberDefaultParam) field() builder.Field { return p.data } -func (p chatWithPrismaCoverChargeSetParam) getQuery() builder.Query { +func (p memberDefaultParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaCoverChargeSetParam) chatModel() {} - -func (p chatWithPrismaCoverChargeSetParam) coverChargeField() {} +func (p memberDefaultParam) memberModel() {} -type ChatWithPrismaCoverChargeWhereParam interface { +type MemberOrderByParam interface { field() builder.Field getQuery() builder.Query - chatModel() - coverChargeField() + memberModel() } -type chatWithPrismaCoverChargeEqualsParam struct { +type memberOrderByParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaCoverChargeEqualsParam) field() builder.Field { +func (p memberOrderByParam) field() builder.Field { return p.data } -func (p chatWithPrismaCoverChargeEqualsParam) getQuery() builder.Query { +func (p memberOrderByParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaCoverChargeEqualsParam) chatModel() {} - -func (p chatWithPrismaCoverChargeEqualsParam) coverChargeField() {} +func (p memberOrderByParam) memberModel() {} -func (chatWithPrismaCoverChargeSetParam) settable() {} -func (chatWithPrismaCoverChargeEqualsParam) equals() {} +type MemberCursorParam interface { + field() builder.Field + getQuery() builder.Query + memberModel() + isCursor() +} -type chatWithPrismaCoverChargeEqualsUniqueParam struct { +type memberCursorParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaCoverChargeEqualsUniqueParam) field() builder.Field { +func (p memberCursorParam) field() builder.Field { return p.data } -func (p chatWithPrismaCoverChargeEqualsUniqueParam) getQuery() builder.Query { +func (p memberCursorParam) isCursor() {} + +func (p memberCursorParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaCoverChargeEqualsUniqueParam) chatModel() {} -func (p chatWithPrismaCoverChargeEqualsUniqueParam) coverChargeField() {} - -func (chatWithPrismaCoverChargeEqualsUniqueParam) unique() {} -func (chatWithPrismaCoverChargeEqualsUniqueParam) equals() {} - -type ChatWithPrismaTypeEqualsSetParam interface { - field() builder.Field - getQuery() builder.Query - equals() - chatModel() - typeField() -} +func (p memberCursorParam) memberModel() {} -type ChatWithPrismaTypeSetParam interface { +type MemberParamUnique interface { field() builder.Field getQuery() builder.Query - chatModel() - typeField() + unique() + memberModel() } -type chatWithPrismaTypeSetParam struct { +type memberParamUnique struct { data builder.Field query builder.Query } -func (p chatWithPrismaTypeSetParam) field() builder.Field { +func (p memberParamUnique) memberModel() {} + +func (memberParamUnique) unique() {} + +func (p memberParamUnique) field() builder.Field { return p.data } -func (p chatWithPrismaTypeSetParam) getQuery() builder.Query { +func (p memberParamUnique) getQuery() builder.Query { return p.query } -func (p chatWithPrismaTypeSetParam) chatModel() {} - -func (p chatWithPrismaTypeSetParam) typeField() {} - -type ChatWithPrismaTypeWhereParam interface { +type MemberEqualsWhereParam interface { field() builder.Field getQuery() builder.Query - chatModel() - typeField() + equals() + memberModel() } -type chatWithPrismaTypeEqualsParam struct { +type memberEqualsParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaTypeEqualsParam) field() builder.Field { +func (p memberEqualsParam) memberModel() {} + +func (memberEqualsParam) equals() {} + +func (p memberEqualsParam) field() builder.Field { return p.data } -func (p chatWithPrismaTypeEqualsParam) getQuery() builder.Query { +func (p memberEqualsParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaTypeEqualsParam) chatModel() {} - -func (p chatWithPrismaTypeEqualsParam) typeField() {} - -func (chatWithPrismaTypeSetParam) settable() {} -func (chatWithPrismaTypeEqualsParam) equals() {} +type MemberEqualsUniqueWhereParam interface { + field() builder.Field + getQuery() builder.Query + equals() + unique() + memberModel() +} -type chatWithPrismaTypeEqualsUniqueParam struct { +type memberEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaTypeEqualsUniqueParam) field() builder.Field { +func (p memberEqualsUniqueParam) memberModel() {} + +func (memberEqualsUniqueParam) unique() {} +func (memberEqualsUniqueParam) equals() {} + +func (p memberEqualsUniqueParam) field() builder.Field { return p.data } -func (p chatWithPrismaTypeEqualsUniqueParam) getQuery() builder.Query { +func (p memberEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaTypeEqualsUniqueParam) chatModel() {} -func (p chatWithPrismaTypeEqualsUniqueParam) typeField() {} +type MemberSetParam interface { + field() builder.Field + settable() + memberModel() +} -func (chatWithPrismaTypeEqualsUniqueParam) unique() {} -func (chatWithPrismaTypeEqualsUniqueParam) equals() {} +type memberSetParam struct { + data builder.Field +} -type ChatWithPrismaIsOpenEqualsSetParam interface { +func (memberSetParam) settable() {} + +func (p memberSetParam) field() builder.Field { + return p.data +} + +func (p memberSetParam) memberModel() {} + +type MemberWithPrismaChatIDEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - chatModel() - isOpenField() + memberModel() + chatIDField() } -type ChatWithPrismaIsOpenSetParam interface { +type MemberWithPrismaChatIDSetParam interface { field() builder.Field getQuery() builder.Query - chatModel() - isOpenField() + memberModel() + chatIDField() } -type chatWithPrismaIsOpenSetParam struct { +type memberWithPrismaChatIDSetParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaIsOpenSetParam) field() builder.Field { +func (p memberWithPrismaChatIDSetParam) field() builder.Field { return p.data } -func (p chatWithPrismaIsOpenSetParam) getQuery() builder.Query { +func (p memberWithPrismaChatIDSetParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaIsOpenSetParam) chatModel() {} +func (p memberWithPrismaChatIDSetParam) memberModel() {} -func (p chatWithPrismaIsOpenSetParam) isOpenField() {} +func (p memberWithPrismaChatIDSetParam) chatIDField() {} -type ChatWithPrismaIsOpenWhereParam interface { +type MemberWithPrismaChatIDWhereParam interface { field() builder.Field getQuery() builder.Query - chatModel() - isOpenField() + memberModel() + chatIDField() } -type chatWithPrismaIsOpenEqualsParam struct { +type memberWithPrismaChatIDEqualsParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaIsOpenEqualsParam) field() builder.Field { +func (p memberWithPrismaChatIDEqualsParam) field() builder.Field { return p.data } -func (p chatWithPrismaIsOpenEqualsParam) getQuery() builder.Query { +func (p memberWithPrismaChatIDEqualsParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaIsOpenEqualsParam) chatModel() {} +func (p memberWithPrismaChatIDEqualsParam) memberModel() {} -func (p chatWithPrismaIsOpenEqualsParam) isOpenField() {} +func (p memberWithPrismaChatIDEqualsParam) chatIDField() {} -func (chatWithPrismaIsOpenSetParam) settable() {} -func (chatWithPrismaIsOpenEqualsParam) equals() {} +func (memberWithPrismaChatIDSetParam) settable() {} +func (memberWithPrismaChatIDEqualsParam) equals() {} -type chatWithPrismaIsOpenEqualsUniqueParam struct { +type memberWithPrismaChatIDEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaIsOpenEqualsUniqueParam) field() builder.Field { +func (p memberWithPrismaChatIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p chatWithPrismaIsOpenEqualsUniqueParam) getQuery() builder.Query { +func (p memberWithPrismaChatIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaIsOpenEqualsUniqueParam) chatModel() {} -func (p chatWithPrismaIsOpenEqualsUniqueParam) isOpenField() {} +func (p memberWithPrismaChatIDEqualsUniqueParam) memberModel() {} +func (p memberWithPrismaChatIDEqualsUniqueParam) chatIDField() {} -func (chatWithPrismaIsOpenEqualsUniqueParam) unique() {} -func (chatWithPrismaIsOpenEqualsUniqueParam) equals() {} +func (memberWithPrismaChatIDEqualsUniqueParam) unique() {} +func (memberWithPrismaChatIDEqualsUniqueParam) equals() {} -type ChatWithPrismaCreatedByEqualsSetParam interface { +type MemberWithPrismaUserIDEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - chatModel() - createdByField() + memberModel() + userIDField() } -type ChatWithPrismaCreatedBySetParam interface { +type MemberWithPrismaUserIDSetParam interface { field() builder.Field getQuery() builder.Query - chatModel() - createdByField() + memberModel() + userIDField() } -type chatWithPrismaCreatedBySetParam struct { +type memberWithPrismaUserIDSetParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaCreatedBySetParam) field() builder.Field { +func (p memberWithPrismaUserIDSetParam) field() builder.Field { return p.data } -func (p chatWithPrismaCreatedBySetParam) getQuery() builder.Query { +func (p memberWithPrismaUserIDSetParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaCreatedBySetParam) chatModel() {} +func (p memberWithPrismaUserIDSetParam) memberModel() {} -func (p chatWithPrismaCreatedBySetParam) createdByField() {} +func (p memberWithPrismaUserIDSetParam) userIDField() {} -type ChatWithPrismaCreatedByWhereParam interface { +type MemberWithPrismaUserIDWhereParam interface { field() builder.Field getQuery() builder.Query - chatModel() - createdByField() + memberModel() + userIDField() } -type chatWithPrismaCreatedByEqualsParam struct { +type memberWithPrismaUserIDEqualsParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaCreatedByEqualsParam) field() builder.Field { +func (p memberWithPrismaUserIDEqualsParam) field() builder.Field { return p.data } -func (p chatWithPrismaCreatedByEqualsParam) getQuery() builder.Query { +func (p memberWithPrismaUserIDEqualsParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaCreatedByEqualsParam) chatModel() {} +func (p memberWithPrismaUserIDEqualsParam) memberModel() {} -func (p chatWithPrismaCreatedByEqualsParam) createdByField() {} +func (p memberWithPrismaUserIDEqualsParam) userIDField() {} -func (chatWithPrismaCreatedBySetParam) settable() {} -func (chatWithPrismaCreatedByEqualsParam) equals() {} +func (memberWithPrismaUserIDSetParam) settable() {} +func (memberWithPrismaUserIDEqualsParam) equals() {} -type chatWithPrismaCreatedByEqualsUniqueParam struct { +type memberWithPrismaUserIDEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaCreatedByEqualsUniqueParam) field() builder.Field { +func (p memberWithPrismaUserIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p chatWithPrismaCreatedByEqualsUniqueParam) getQuery() builder.Query { +func (p memberWithPrismaUserIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaCreatedByEqualsUniqueParam) chatModel() {} -func (p chatWithPrismaCreatedByEqualsUniqueParam) createdByField() {} +func (p memberWithPrismaUserIDEqualsUniqueParam) memberModel() {} +func (p memberWithPrismaUserIDEqualsUniqueParam) userIDField() {} -func (chatWithPrismaCreatedByEqualsUniqueParam) unique() {} -func (chatWithPrismaCreatedByEqualsUniqueParam) equals() {} +func (memberWithPrismaUserIDEqualsUniqueParam) unique() {} +func (memberWithPrismaUserIDEqualsUniqueParam) equals() {} -type ChatWithPrismaCreatedAtEqualsSetParam interface { +type MemberWithPrismaAddedByIDEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - chatModel() - createdAtField() + memberModel() + addedByIDField() } -type ChatWithPrismaCreatedAtSetParam interface { +type MemberWithPrismaAddedByIDSetParam interface { field() builder.Field getQuery() builder.Query - chatModel() - createdAtField() + memberModel() + addedByIDField() } -type chatWithPrismaCreatedAtSetParam struct { +type memberWithPrismaAddedByIDSetParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaCreatedAtSetParam) field() builder.Field { +func (p memberWithPrismaAddedByIDSetParam) field() builder.Field { return p.data } -func (p chatWithPrismaCreatedAtSetParam) getQuery() builder.Query { +func (p memberWithPrismaAddedByIDSetParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaCreatedAtSetParam) chatModel() {} +func (p memberWithPrismaAddedByIDSetParam) memberModel() {} -func (p chatWithPrismaCreatedAtSetParam) createdAtField() {} +func (p memberWithPrismaAddedByIDSetParam) addedByIDField() {} -type ChatWithPrismaCreatedAtWhereParam interface { +type MemberWithPrismaAddedByIDWhereParam interface { field() builder.Field getQuery() builder.Query - chatModel() - createdAtField() + memberModel() + addedByIDField() } -type chatWithPrismaCreatedAtEqualsParam struct { +type memberWithPrismaAddedByIDEqualsParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaCreatedAtEqualsParam) field() builder.Field { +func (p memberWithPrismaAddedByIDEqualsParam) field() builder.Field { return p.data } -func (p chatWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { +func (p memberWithPrismaAddedByIDEqualsParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaCreatedAtEqualsParam) chatModel() {} +func (p memberWithPrismaAddedByIDEqualsParam) memberModel() {} -func (p chatWithPrismaCreatedAtEqualsParam) createdAtField() {} +func (p memberWithPrismaAddedByIDEqualsParam) addedByIDField() {} -func (chatWithPrismaCreatedAtSetParam) settable() {} -func (chatWithPrismaCreatedAtEqualsParam) equals() {} +func (memberWithPrismaAddedByIDSetParam) settable() {} +func (memberWithPrismaAddedByIDEqualsParam) equals() {} -type chatWithPrismaCreatedAtEqualsUniqueParam struct { +type memberWithPrismaAddedByIDEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { +func (p memberWithPrismaAddedByIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p chatWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p memberWithPrismaAddedByIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaCreatedAtEqualsUniqueParam) chatModel() {} -func (p chatWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} +func (p memberWithPrismaAddedByIDEqualsUniqueParam) memberModel() {} +func (p memberWithPrismaAddedByIDEqualsUniqueParam) addedByIDField() {} -func (chatWithPrismaCreatedAtEqualsUniqueParam) unique() {} -func (chatWithPrismaCreatedAtEqualsUniqueParam) equals() {} +func (memberWithPrismaAddedByIDEqualsUniqueParam) unique() {} +func (memberWithPrismaAddedByIDEqualsUniqueParam) equals() {} -type ChatWithPrismaUpdatedAtEqualsSetParam interface { +type MemberWithPrismaIsMutedEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - chatModel() - updatedAtField() + memberModel() + isMutedField() } -type ChatWithPrismaUpdatedAtSetParam interface { +type MemberWithPrismaIsMutedSetParam interface { field() builder.Field getQuery() builder.Query - chatModel() - updatedAtField() + memberModel() + isMutedField() } -type chatWithPrismaUpdatedAtSetParam struct { +type memberWithPrismaIsMutedSetParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaUpdatedAtSetParam) field() builder.Field { +func (p memberWithPrismaIsMutedSetParam) field() builder.Field { return p.data } -func (p chatWithPrismaUpdatedAtSetParam) getQuery() builder.Query { +func (p memberWithPrismaIsMutedSetParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaUpdatedAtSetParam) chatModel() {} +func (p memberWithPrismaIsMutedSetParam) memberModel() {} -func (p chatWithPrismaUpdatedAtSetParam) updatedAtField() {} +func (p memberWithPrismaIsMutedSetParam) isMutedField() {} -type ChatWithPrismaUpdatedAtWhereParam interface { +type MemberWithPrismaIsMutedWhereParam interface { field() builder.Field getQuery() builder.Query - chatModel() - updatedAtField() + memberModel() + isMutedField() } -type chatWithPrismaUpdatedAtEqualsParam struct { +type memberWithPrismaIsMutedEqualsParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaUpdatedAtEqualsParam) field() builder.Field { +func (p memberWithPrismaIsMutedEqualsParam) field() builder.Field { return p.data } -func (p chatWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { +func (p memberWithPrismaIsMutedEqualsParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaUpdatedAtEqualsParam) chatModel() {} +func (p memberWithPrismaIsMutedEqualsParam) memberModel() {} -func (p chatWithPrismaUpdatedAtEqualsParam) updatedAtField() {} +func (p memberWithPrismaIsMutedEqualsParam) isMutedField() {} -func (chatWithPrismaUpdatedAtSetParam) settable() {} -func (chatWithPrismaUpdatedAtEqualsParam) equals() {} +func (memberWithPrismaIsMutedSetParam) settable() {} +func (memberWithPrismaIsMutedEqualsParam) equals() {} -type chatWithPrismaUpdatedAtEqualsUniqueParam struct { +type memberWithPrismaIsMutedEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { +func (p memberWithPrismaIsMutedEqualsUniqueParam) field() builder.Field { return p.data } -func (p chatWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p memberWithPrismaIsMutedEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaUpdatedAtEqualsUniqueParam) chatModel() {} -func (p chatWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} +func (p memberWithPrismaIsMutedEqualsUniqueParam) memberModel() {} +func (p memberWithPrismaIsMutedEqualsUniqueParam) isMutedField() {} -func (chatWithPrismaUpdatedAtEqualsUniqueParam) unique() {} -func (chatWithPrismaUpdatedAtEqualsUniqueParam) equals() {} +func (memberWithPrismaIsMutedEqualsUniqueParam) unique() {} +func (memberWithPrismaIsMutedEqualsUniqueParam) equals() {} -type ChatWithPrismaLastActivityAtEqualsSetParam interface { +type MemberWithPrismaIsPushEnabledEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - chatModel() - lastActivityAtField() + memberModel() + isPushEnabledField() } -type ChatWithPrismaLastActivityAtSetParam interface { +type MemberWithPrismaIsPushEnabledSetParam interface { field() builder.Field getQuery() builder.Query - chatModel() - lastActivityAtField() + memberModel() + isPushEnabledField() } -type chatWithPrismaLastActivityAtSetParam struct { +type memberWithPrismaIsPushEnabledSetParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaLastActivityAtSetParam) field() builder.Field { +func (p memberWithPrismaIsPushEnabledSetParam) field() builder.Field { return p.data } -func (p chatWithPrismaLastActivityAtSetParam) getQuery() builder.Query { +func (p memberWithPrismaIsPushEnabledSetParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaLastActivityAtSetParam) chatModel() {} +func (p memberWithPrismaIsPushEnabledSetParam) memberModel() {} -func (p chatWithPrismaLastActivityAtSetParam) lastActivityAtField() {} +func (p memberWithPrismaIsPushEnabledSetParam) isPushEnabledField() {} -type ChatWithPrismaLastActivityAtWhereParam interface { +type MemberWithPrismaIsPushEnabledWhereParam interface { field() builder.Field getQuery() builder.Query - chatModel() - lastActivityAtField() + memberModel() + isPushEnabledField() } -type chatWithPrismaLastActivityAtEqualsParam struct { +type memberWithPrismaIsPushEnabledEqualsParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaLastActivityAtEqualsParam) field() builder.Field { +func (p memberWithPrismaIsPushEnabledEqualsParam) field() builder.Field { return p.data } -func (p chatWithPrismaLastActivityAtEqualsParam) getQuery() builder.Query { +func (p memberWithPrismaIsPushEnabledEqualsParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaLastActivityAtEqualsParam) chatModel() {} +func (p memberWithPrismaIsPushEnabledEqualsParam) memberModel() {} -func (p chatWithPrismaLastActivityAtEqualsParam) lastActivityAtField() {} +func (p memberWithPrismaIsPushEnabledEqualsParam) isPushEnabledField() {} -func (chatWithPrismaLastActivityAtSetParam) settable() {} -func (chatWithPrismaLastActivityAtEqualsParam) equals() {} +func (memberWithPrismaIsPushEnabledSetParam) settable() {} +func (memberWithPrismaIsPushEnabledEqualsParam) equals() {} -type chatWithPrismaLastActivityAtEqualsUniqueParam struct { +type memberWithPrismaIsPushEnabledEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaLastActivityAtEqualsUniqueParam) field() builder.Field { +func (p memberWithPrismaIsPushEnabledEqualsUniqueParam) field() builder.Field { return p.data } -func (p chatWithPrismaLastActivityAtEqualsUniqueParam) getQuery() builder.Query { +func (p memberWithPrismaIsPushEnabledEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaLastActivityAtEqualsUniqueParam) chatModel() {} -func (p chatWithPrismaLastActivityAtEqualsUniqueParam) lastActivityAtField() {} +func (p memberWithPrismaIsPushEnabledEqualsUniqueParam) memberModel() {} +func (p memberWithPrismaIsPushEnabledEqualsUniqueParam) isPushEnabledField() {} -func (chatWithPrismaLastActivityAtEqualsUniqueParam) unique() {} -func (chatWithPrismaLastActivityAtEqualsUniqueParam) equals() {} +func (memberWithPrismaIsPushEnabledEqualsUniqueParam) unique() {} +func (memberWithPrismaIsPushEnabledEqualsUniqueParam) equals() {} -type ChatWithPrismaMembersEqualsSetParam interface { +type MemberWithPrismaHasModPermissionEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - chatModel() - membersField() + memberModel() + hasModPermissionField() } -type ChatWithPrismaMembersSetParam interface { +type MemberWithPrismaHasModPermissionSetParam interface { field() builder.Field getQuery() builder.Query - chatModel() - membersField() + memberModel() + hasModPermissionField() } -type chatWithPrismaMembersSetParam struct { +type memberWithPrismaHasModPermissionSetParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaMembersSetParam) field() builder.Field { +func (p memberWithPrismaHasModPermissionSetParam) field() builder.Field { return p.data } -func (p chatWithPrismaMembersSetParam) getQuery() builder.Query { +func (p memberWithPrismaHasModPermissionSetParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaMembersSetParam) chatModel() {} +func (p memberWithPrismaHasModPermissionSetParam) memberModel() {} -func (p chatWithPrismaMembersSetParam) membersField() {} +func (p memberWithPrismaHasModPermissionSetParam) hasModPermissionField() {} -type ChatWithPrismaMembersWhereParam interface { +type MemberWithPrismaHasModPermissionWhereParam interface { field() builder.Field getQuery() builder.Query - chatModel() - membersField() + memberModel() + hasModPermissionField() } -type chatWithPrismaMembersEqualsParam struct { +type memberWithPrismaHasModPermissionEqualsParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaMembersEqualsParam) field() builder.Field { +func (p memberWithPrismaHasModPermissionEqualsParam) field() builder.Field { return p.data } -func (p chatWithPrismaMembersEqualsParam) getQuery() builder.Query { +func (p memberWithPrismaHasModPermissionEqualsParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaMembersEqualsParam) chatModel() {} +func (p memberWithPrismaHasModPermissionEqualsParam) memberModel() {} -func (p chatWithPrismaMembersEqualsParam) membersField() {} +func (p memberWithPrismaHasModPermissionEqualsParam) hasModPermissionField() {} -func (chatWithPrismaMembersSetParam) settable() {} -func (chatWithPrismaMembersEqualsParam) equals() {} +func (memberWithPrismaHasModPermissionSetParam) settable() {} +func (memberWithPrismaHasModPermissionEqualsParam) equals() {} -type chatWithPrismaMembersEqualsUniqueParam struct { +type memberWithPrismaHasModPermissionEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p chatWithPrismaMembersEqualsUniqueParam) field() builder.Field { +func (p memberWithPrismaHasModPermissionEqualsUniqueParam) field() builder.Field { return p.data } -func (p chatWithPrismaMembersEqualsUniqueParam) getQuery() builder.Query { +func (p memberWithPrismaHasModPermissionEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p chatWithPrismaMembersEqualsUniqueParam) chatModel() {} -func (p chatWithPrismaMembersEqualsUniqueParam) membersField() {} - -func (chatWithPrismaMembersEqualsUniqueParam) unique() {} -func (chatWithPrismaMembersEqualsUniqueParam) equals() {} - -type memberActions struct { - // client holds the prisma client - client *PrismaClient -} +func (p memberWithPrismaHasModPermissionEqualsUniqueParam) memberModel() {} +func (p memberWithPrismaHasModPermissionEqualsUniqueParam) hasModPermissionField() {} -var memberOutput = []builder.Output{ - {Name: "chatId"}, - {Name: "userId"}, - {Name: "addedById"}, - {Name: "isMuted"}, - {Name: "isPushEnabled"}, - {Name: "hasModPermission"}, - {Name: "hasSendPermission"}, - {Name: "isSoftDeleted"}, - {Name: "createdAt"}, - {Name: "updatedAt"}, -} +func (memberWithPrismaHasModPermissionEqualsUniqueParam) unique() {} +func (memberWithPrismaHasModPermissionEqualsUniqueParam) equals() {} -type MemberRelationWith interface { +type MemberWithPrismaHasSendPermissionEqualsSetParam interface { + field() builder.Field getQuery() builder.Query - with() - memberRelation() + equals() + memberModel() + hasSendPermissionField() } -type MemberWhereParam interface { +type MemberWithPrismaHasSendPermissionSetParam interface { field() builder.Field getQuery() builder.Query memberModel() + hasSendPermissionField() } -type memberDefaultParam struct { +type memberWithPrismaHasSendPermissionSetParam struct { data builder.Field query builder.Query } -func (p memberDefaultParam) field() builder.Field { +func (p memberWithPrismaHasSendPermissionSetParam) field() builder.Field { return p.data } -func (p memberDefaultParam) getQuery() builder.Query { +func (p memberWithPrismaHasSendPermissionSetParam) getQuery() builder.Query { return p.query } -func (p memberDefaultParam) memberModel() {} +func (p memberWithPrismaHasSendPermissionSetParam) memberModel() {} -type MemberOrderByParam interface { +func (p memberWithPrismaHasSendPermissionSetParam) hasSendPermissionField() {} + +type MemberWithPrismaHasSendPermissionWhereParam interface { field() builder.Field getQuery() builder.Query memberModel() + hasSendPermissionField() } -type memberOrderByParam struct { +type memberWithPrismaHasSendPermissionEqualsParam struct { data builder.Field query builder.Query } -func (p memberOrderByParam) field() builder.Field { +func (p memberWithPrismaHasSendPermissionEqualsParam) field() builder.Field { return p.data } -func (p memberOrderByParam) getQuery() builder.Query { +func (p memberWithPrismaHasSendPermissionEqualsParam) getQuery() builder.Query { return p.query } -func (p memberOrderByParam) memberModel() {} +func (p memberWithPrismaHasSendPermissionEqualsParam) memberModel() {} -type MemberCursorParam interface { - field() builder.Field - getQuery() builder.Query - memberModel() - isCursor() -} +func (p memberWithPrismaHasSendPermissionEqualsParam) hasSendPermissionField() {} -type memberCursorParam struct { +func (memberWithPrismaHasSendPermissionSetParam) settable() {} +func (memberWithPrismaHasSendPermissionEqualsParam) equals() {} + +type memberWithPrismaHasSendPermissionEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p memberCursorParam) field() builder.Field { +func (p memberWithPrismaHasSendPermissionEqualsUniqueParam) field() builder.Field { return p.data } -func (p memberCursorParam) isCursor() {} - -func (p memberCursorParam) getQuery() builder.Query { +func (p memberWithPrismaHasSendPermissionEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p memberCursorParam) memberModel() {} +func (p memberWithPrismaHasSendPermissionEqualsUniqueParam) memberModel() {} +func (p memberWithPrismaHasSendPermissionEqualsUniqueParam) hasSendPermissionField() {} -type MemberParamUnique interface { +func (memberWithPrismaHasSendPermissionEqualsUniqueParam) unique() {} +func (memberWithPrismaHasSendPermissionEqualsUniqueParam) equals() {} + +type MemberWithPrismaIsSoftDeletedEqualsSetParam interface { field() builder.Field getQuery() builder.Query - unique() - memberModel() -} - -type memberParamUnique struct { - data builder.Field - query builder.Query -} - -func (p memberParamUnique) memberModel() {} - -func (memberParamUnique) unique() {} - -func (p memberParamUnique) field() builder.Field { - return p.data -} - -func (p memberParamUnique) getQuery() builder.Query { - return p.query + equals() + memberModel() + isSoftDeletedField() } -type MemberEqualsWhereParam interface { +type MemberWithPrismaIsSoftDeletedSetParam interface { field() builder.Field getQuery() builder.Query - equals() memberModel() + isSoftDeletedField() } -type memberEqualsParam struct { +type memberWithPrismaIsSoftDeletedSetParam struct { data builder.Field query builder.Query } -func (p memberEqualsParam) memberModel() {} - -func (memberEqualsParam) equals() {} - -func (p memberEqualsParam) field() builder.Field { +func (p memberWithPrismaIsSoftDeletedSetParam) field() builder.Field { return p.data } -func (p memberEqualsParam) getQuery() builder.Query { +func (p memberWithPrismaIsSoftDeletedSetParam) getQuery() builder.Query { return p.query } -type MemberEqualsUniqueWhereParam interface { +func (p memberWithPrismaIsSoftDeletedSetParam) memberModel() {} + +func (p memberWithPrismaIsSoftDeletedSetParam) isSoftDeletedField() {} + +type MemberWithPrismaIsSoftDeletedWhereParam interface { field() builder.Field getQuery() builder.Query - equals() - unique() memberModel() + isSoftDeletedField() } -type memberEqualsUniqueParam struct { +type memberWithPrismaIsSoftDeletedEqualsParam struct { data builder.Field query builder.Query } -func (p memberEqualsUniqueParam) memberModel() {} - -func (memberEqualsUniqueParam) unique() {} -func (memberEqualsUniqueParam) equals() {} - -func (p memberEqualsUniqueParam) field() builder.Field { +func (p memberWithPrismaIsSoftDeletedEqualsParam) field() builder.Field { return p.data } -func (p memberEqualsUniqueParam) getQuery() builder.Query { +func (p memberWithPrismaIsSoftDeletedEqualsParam) getQuery() builder.Query { return p.query } -type MemberSetParam interface { - field() builder.Field - settable() - memberModel() -} +func (p memberWithPrismaIsSoftDeletedEqualsParam) memberModel() {} -type memberSetParam struct { - data builder.Field -} +func (p memberWithPrismaIsSoftDeletedEqualsParam) isSoftDeletedField() {} -func (memberSetParam) settable() {} +func (memberWithPrismaIsSoftDeletedSetParam) settable() {} +func (memberWithPrismaIsSoftDeletedEqualsParam) equals() {} -func (p memberSetParam) field() builder.Field { +type memberWithPrismaIsSoftDeletedEqualsUniqueParam struct { + data builder.Field + query builder.Query +} + +func (p memberWithPrismaIsSoftDeletedEqualsUniqueParam) field() builder.Field { return p.data } -func (p memberSetParam) memberModel() {} +func (p memberWithPrismaIsSoftDeletedEqualsUniqueParam) getQuery() builder.Query { + return p.query +} -type MemberWithPrismaChatIDEqualsSetParam interface { +func (p memberWithPrismaIsSoftDeletedEqualsUniqueParam) memberModel() {} +func (p memberWithPrismaIsSoftDeletedEqualsUniqueParam) isSoftDeletedField() {} + +func (memberWithPrismaIsSoftDeletedEqualsUniqueParam) unique() {} +func (memberWithPrismaIsSoftDeletedEqualsUniqueParam) equals() {} + +type MemberWithPrismaCreatedAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() memberModel() - chatIDField() + createdAtField() } -type MemberWithPrismaChatIDSetParam interface { +type MemberWithPrismaCreatedAtSetParam interface { field() builder.Field getQuery() builder.Query memberModel() - chatIDField() + createdAtField() } -type memberWithPrismaChatIDSetParam struct { +type memberWithPrismaCreatedAtSetParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaChatIDSetParam) field() builder.Field { +func (p memberWithPrismaCreatedAtSetParam) field() builder.Field { return p.data } -func (p memberWithPrismaChatIDSetParam) getQuery() builder.Query { +func (p memberWithPrismaCreatedAtSetParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaChatIDSetParam) memberModel() {} +func (p memberWithPrismaCreatedAtSetParam) memberModel() {} -func (p memberWithPrismaChatIDSetParam) chatIDField() {} +func (p memberWithPrismaCreatedAtSetParam) createdAtField() {} -type MemberWithPrismaChatIDWhereParam interface { +type MemberWithPrismaCreatedAtWhereParam interface { field() builder.Field getQuery() builder.Query memberModel() - chatIDField() + createdAtField() } -type memberWithPrismaChatIDEqualsParam struct { +type memberWithPrismaCreatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaChatIDEqualsParam) field() builder.Field { +func (p memberWithPrismaCreatedAtEqualsParam) field() builder.Field { return p.data } -func (p memberWithPrismaChatIDEqualsParam) getQuery() builder.Query { +func (p memberWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaChatIDEqualsParam) memberModel() {} +func (p memberWithPrismaCreatedAtEqualsParam) memberModel() {} -func (p memberWithPrismaChatIDEqualsParam) chatIDField() {} +func (p memberWithPrismaCreatedAtEqualsParam) createdAtField() {} -func (memberWithPrismaChatIDSetParam) settable() {} -func (memberWithPrismaChatIDEqualsParam) equals() {} +func (memberWithPrismaCreatedAtSetParam) settable() {} +func (memberWithPrismaCreatedAtEqualsParam) equals() {} -type memberWithPrismaChatIDEqualsUniqueParam struct { +type memberWithPrismaCreatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaChatIDEqualsUniqueParam) field() builder.Field { +func (p memberWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p memberWithPrismaChatIDEqualsUniqueParam) getQuery() builder.Query { +func (p memberWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaChatIDEqualsUniqueParam) memberModel() {} -func (p memberWithPrismaChatIDEqualsUniqueParam) chatIDField() {} +func (p memberWithPrismaCreatedAtEqualsUniqueParam) memberModel() {} +func (p memberWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} -func (memberWithPrismaChatIDEqualsUniqueParam) unique() {} -func (memberWithPrismaChatIDEqualsUniqueParam) equals() {} +func (memberWithPrismaCreatedAtEqualsUniqueParam) unique() {} +func (memberWithPrismaCreatedAtEqualsUniqueParam) equals() {} -type MemberWithPrismaUserIDEqualsSetParam interface { +type MemberWithPrismaUpdatedAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() memberModel() - userIDField() + updatedAtField() } -type MemberWithPrismaUserIDSetParam interface { +type MemberWithPrismaUpdatedAtSetParam interface { field() builder.Field getQuery() builder.Query memberModel() - userIDField() + updatedAtField() } -type memberWithPrismaUserIDSetParam struct { +type memberWithPrismaUpdatedAtSetParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaUserIDSetParam) field() builder.Field { +func (p memberWithPrismaUpdatedAtSetParam) field() builder.Field { return p.data } -func (p memberWithPrismaUserIDSetParam) getQuery() builder.Query { +func (p memberWithPrismaUpdatedAtSetParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaUserIDSetParam) memberModel() {} +func (p memberWithPrismaUpdatedAtSetParam) memberModel() {} -func (p memberWithPrismaUserIDSetParam) userIDField() {} +func (p memberWithPrismaUpdatedAtSetParam) updatedAtField() {} -type MemberWithPrismaUserIDWhereParam interface { +type MemberWithPrismaUpdatedAtWhereParam interface { field() builder.Field getQuery() builder.Query memberModel() - userIDField() + updatedAtField() } -type memberWithPrismaUserIDEqualsParam struct { +type memberWithPrismaUpdatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaUserIDEqualsParam) field() builder.Field { +func (p memberWithPrismaUpdatedAtEqualsParam) field() builder.Field { return p.data } -func (p memberWithPrismaUserIDEqualsParam) getQuery() builder.Query { +func (p memberWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaUserIDEqualsParam) memberModel() {} +func (p memberWithPrismaUpdatedAtEqualsParam) memberModel() {} -func (p memberWithPrismaUserIDEqualsParam) userIDField() {} +func (p memberWithPrismaUpdatedAtEqualsParam) updatedAtField() {} -func (memberWithPrismaUserIDSetParam) settable() {} -func (memberWithPrismaUserIDEqualsParam) equals() {} +func (memberWithPrismaUpdatedAtSetParam) settable() {} +func (memberWithPrismaUpdatedAtEqualsParam) equals() {} -type memberWithPrismaUserIDEqualsUniqueParam struct { +type memberWithPrismaUpdatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaUserIDEqualsUniqueParam) field() builder.Field { +func (p memberWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p memberWithPrismaUserIDEqualsUniqueParam) getQuery() builder.Query { +func (p memberWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaUserIDEqualsUniqueParam) memberModel() {} -func (p memberWithPrismaUserIDEqualsUniqueParam) userIDField() {} +func (p memberWithPrismaUpdatedAtEqualsUniqueParam) memberModel() {} +func (p memberWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} -func (memberWithPrismaUserIDEqualsUniqueParam) unique() {} -func (memberWithPrismaUserIDEqualsUniqueParam) equals() {} +func (memberWithPrismaUpdatedAtEqualsUniqueParam) unique() {} +func (memberWithPrismaUpdatedAtEqualsUniqueParam) equals() {} -type MemberWithPrismaAddedByIDEqualsSetParam interface { +type MemberWithPrismaChatEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() memberModel() - addedByIDField() + chatField() } -type MemberWithPrismaAddedByIDSetParam interface { +type MemberWithPrismaChatSetParam interface { field() builder.Field getQuery() builder.Query memberModel() - addedByIDField() + chatField() } -type memberWithPrismaAddedByIDSetParam struct { +type memberWithPrismaChatSetParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaAddedByIDSetParam) field() builder.Field { +func (p memberWithPrismaChatSetParam) field() builder.Field { return p.data } -func (p memberWithPrismaAddedByIDSetParam) getQuery() builder.Query { +func (p memberWithPrismaChatSetParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaAddedByIDSetParam) memberModel() {} +func (p memberWithPrismaChatSetParam) memberModel() {} -func (p memberWithPrismaAddedByIDSetParam) addedByIDField() {} +func (p memberWithPrismaChatSetParam) chatField() {} -type MemberWithPrismaAddedByIDWhereParam interface { +type MemberWithPrismaChatWhereParam interface { field() builder.Field getQuery() builder.Query memberModel() - addedByIDField() + chatField() } -type memberWithPrismaAddedByIDEqualsParam struct { +type memberWithPrismaChatEqualsParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaAddedByIDEqualsParam) field() builder.Field { +func (p memberWithPrismaChatEqualsParam) field() builder.Field { return p.data } -func (p memberWithPrismaAddedByIDEqualsParam) getQuery() builder.Query { +func (p memberWithPrismaChatEqualsParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaAddedByIDEqualsParam) memberModel() {} +func (p memberWithPrismaChatEqualsParam) memberModel() {} -func (p memberWithPrismaAddedByIDEqualsParam) addedByIDField() {} +func (p memberWithPrismaChatEqualsParam) chatField() {} -func (memberWithPrismaAddedByIDSetParam) settable() {} -func (memberWithPrismaAddedByIDEqualsParam) equals() {} +func (memberWithPrismaChatSetParam) settable() {} +func (memberWithPrismaChatEqualsParam) equals() {} -type memberWithPrismaAddedByIDEqualsUniqueParam struct { +type memberWithPrismaChatEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaAddedByIDEqualsUniqueParam) field() builder.Field { +func (p memberWithPrismaChatEqualsUniqueParam) field() builder.Field { return p.data } -func (p memberWithPrismaAddedByIDEqualsUniqueParam) getQuery() builder.Query { +func (p memberWithPrismaChatEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaAddedByIDEqualsUniqueParam) memberModel() {} -func (p memberWithPrismaAddedByIDEqualsUniqueParam) addedByIDField() {} +func (p memberWithPrismaChatEqualsUniqueParam) memberModel() {} +func (p memberWithPrismaChatEqualsUniqueParam) chatField() {} -func (memberWithPrismaAddedByIDEqualsUniqueParam) unique() {} -func (memberWithPrismaAddedByIDEqualsUniqueParam) equals() {} +func (memberWithPrismaChatEqualsUniqueParam) unique() {} +func (memberWithPrismaChatEqualsUniqueParam) equals() {} -type MemberWithPrismaIsMutedEqualsSetParam interface { - field() builder.Field +type messageActions struct { + // client holds the prisma client + client *PrismaClient +} + +var messageOutput = []builder.Output{ + {Name: "id"}, + {Name: "chatId"}, + {Name: "senderId"}, + {Name: "version"}, + {Name: "contentType"}, + {Name: "content"}, + {Name: "createdAt"}, + {Name: "updatedAt"}, +} + +type MessageRelationWith interface { getQuery() builder.Query - equals() - memberModel() - isMutedField() + with() + messageRelation() } -type MemberWithPrismaIsMutedSetParam interface { +type MessageWhereParam interface { field() builder.Field getQuery() builder.Query - memberModel() - isMutedField() + messageModel() } -type memberWithPrismaIsMutedSetParam struct { +type messageDefaultParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaIsMutedSetParam) field() builder.Field { +func (p messageDefaultParam) field() builder.Field { return p.data } -func (p memberWithPrismaIsMutedSetParam) getQuery() builder.Query { +func (p messageDefaultParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaIsMutedSetParam) memberModel() {} - -func (p memberWithPrismaIsMutedSetParam) isMutedField() {} +func (p messageDefaultParam) messageModel() {} -type MemberWithPrismaIsMutedWhereParam interface { +type MessageOrderByParam interface { field() builder.Field getQuery() builder.Query - memberModel() - isMutedField() + messageModel() } -type memberWithPrismaIsMutedEqualsParam struct { +type messageOrderByParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaIsMutedEqualsParam) field() builder.Field { +func (p messageOrderByParam) field() builder.Field { return p.data } -func (p memberWithPrismaIsMutedEqualsParam) getQuery() builder.Query { +func (p messageOrderByParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaIsMutedEqualsParam) memberModel() {} - -func (p memberWithPrismaIsMutedEqualsParam) isMutedField() {} +func (p messageOrderByParam) messageModel() {} -func (memberWithPrismaIsMutedSetParam) settable() {} -func (memberWithPrismaIsMutedEqualsParam) equals() {} +type MessageCursorParam interface { + field() builder.Field + getQuery() builder.Query + messageModel() + isCursor() +} -type memberWithPrismaIsMutedEqualsUniqueParam struct { +type messageCursorParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaIsMutedEqualsUniqueParam) field() builder.Field { +func (p messageCursorParam) field() builder.Field { return p.data } -func (p memberWithPrismaIsMutedEqualsUniqueParam) getQuery() builder.Query { +func (p messageCursorParam) isCursor() {} + +func (p messageCursorParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaIsMutedEqualsUniqueParam) memberModel() {} -func (p memberWithPrismaIsMutedEqualsUniqueParam) isMutedField() {} - -func (memberWithPrismaIsMutedEqualsUniqueParam) unique() {} -func (memberWithPrismaIsMutedEqualsUniqueParam) equals() {} - -type MemberWithPrismaIsPushEnabledEqualsSetParam interface { - field() builder.Field - getQuery() builder.Query - equals() - memberModel() - isPushEnabledField() -} +func (p messageCursorParam) messageModel() {} -type MemberWithPrismaIsPushEnabledSetParam interface { +type MessageParamUnique interface { field() builder.Field getQuery() builder.Query - memberModel() - isPushEnabledField() + unique() + messageModel() } -type memberWithPrismaIsPushEnabledSetParam struct { +type messageParamUnique struct { data builder.Field query builder.Query } -func (p memberWithPrismaIsPushEnabledSetParam) field() builder.Field { +func (p messageParamUnique) messageModel() {} + +func (messageParamUnique) unique() {} + +func (p messageParamUnique) field() builder.Field { return p.data } -func (p memberWithPrismaIsPushEnabledSetParam) getQuery() builder.Query { +func (p messageParamUnique) getQuery() builder.Query { return p.query } -func (p memberWithPrismaIsPushEnabledSetParam) memberModel() {} - -func (p memberWithPrismaIsPushEnabledSetParam) isPushEnabledField() {} - -type MemberWithPrismaIsPushEnabledWhereParam interface { +type MessageEqualsWhereParam interface { field() builder.Field getQuery() builder.Query - memberModel() - isPushEnabledField() + equals() + messageModel() } -type memberWithPrismaIsPushEnabledEqualsParam struct { +type messageEqualsParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaIsPushEnabledEqualsParam) field() builder.Field { +func (p messageEqualsParam) messageModel() {} + +func (messageEqualsParam) equals() {} + +func (p messageEqualsParam) field() builder.Field { return p.data } -func (p memberWithPrismaIsPushEnabledEqualsParam) getQuery() builder.Query { +func (p messageEqualsParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaIsPushEnabledEqualsParam) memberModel() {} - -func (p memberWithPrismaIsPushEnabledEqualsParam) isPushEnabledField() {} - -func (memberWithPrismaIsPushEnabledSetParam) settable() {} -func (memberWithPrismaIsPushEnabledEqualsParam) equals() {} +type MessageEqualsUniqueWhereParam interface { + field() builder.Field + getQuery() builder.Query + equals() + unique() + messageModel() +} -type memberWithPrismaIsPushEnabledEqualsUniqueParam struct { +type messageEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaIsPushEnabledEqualsUniqueParam) field() builder.Field { +func (p messageEqualsUniqueParam) messageModel() {} + +func (messageEqualsUniqueParam) unique() {} +func (messageEqualsUniqueParam) equals() {} + +func (p messageEqualsUniqueParam) field() builder.Field { return p.data } -func (p memberWithPrismaIsPushEnabledEqualsUniqueParam) getQuery() builder.Query { +func (p messageEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaIsPushEnabledEqualsUniqueParam) memberModel() {} -func (p memberWithPrismaIsPushEnabledEqualsUniqueParam) isPushEnabledField() {} +type MessageSetParam interface { + field() builder.Field + settable() + messageModel() +} -func (memberWithPrismaIsPushEnabledEqualsUniqueParam) unique() {} -func (memberWithPrismaIsPushEnabledEqualsUniqueParam) equals() {} +type messageSetParam struct { + data builder.Field +} -type MemberWithPrismaHasModPermissionEqualsSetParam interface { +func (messageSetParam) settable() {} + +func (p messageSetParam) field() builder.Field { + return p.data +} + +func (p messageSetParam) messageModel() {} + +type MessageWithPrismaIDEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - memberModel() - hasModPermissionField() + messageModel() + idField() } -type MemberWithPrismaHasModPermissionSetParam interface { +type MessageWithPrismaIDSetParam interface { field() builder.Field getQuery() builder.Query - memberModel() - hasModPermissionField() + messageModel() + idField() } -type memberWithPrismaHasModPermissionSetParam struct { +type messageWithPrismaIDSetParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaHasModPermissionSetParam) field() builder.Field { +func (p messageWithPrismaIDSetParam) field() builder.Field { return p.data } -func (p memberWithPrismaHasModPermissionSetParam) getQuery() builder.Query { +func (p messageWithPrismaIDSetParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaHasModPermissionSetParam) memberModel() {} +func (p messageWithPrismaIDSetParam) messageModel() {} -func (p memberWithPrismaHasModPermissionSetParam) hasModPermissionField() {} +func (p messageWithPrismaIDSetParam) idField() {} -type MemberWithPrismaHasModPermissionWhereParam interface { +type MessageWithPrismaIDWhereParam interface { field() builder.Field getQuery() builder.Query - memberModel() - hasModPermissionField() + messageModel() + idField() } -type memberWithPrismaHasModPermissionEqualsParam struct { +type messageWithPrismaIDEqualsParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaHasModPermissionEqualsParam) field() builder.Field { +func (p messageWithPrismaIDEqualsParam) field() builder.Field { return p.data } -func (p memberWithPrismaHasModPermissionEqualsParam) getQuery() builder.Query { +func (p messageWithPrismaIDEqualsParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaHasModPermissionEqualsParam) memberModel() {} +func (p messageWithPrismaIDEqualsParam) messageModel() {} -func (p memberWithPrismaHasModPermissionEqualsParam) hasModPermissionField() {} +func (p messageWithPrismaIDEqualsParam) idField() {} -func (memberWithPrismaHasModPermissionSetParam) settable() {} -func (memberWithPrismaHasModPermissionEqualsParam) equals() {} +func (messageWithPrismaIDSetParam) settable() {} +func (messageWithPrismaIDEqualsParam) equals() {} -type memberWithPrismaHasModPermissionEqualsUniqueParam struct { +type messageWithPrismaIDEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaHasModPermissionEqualsUniqueParam) field() builder.Field { +func (p messageWithPrismaIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p memberWithPrismaHasModPermissionEqualsUniqueParam) getQuery() builder.Query { +func (p messageWithPrismaIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaHasModPermissionEqualsUniqueParam) memberModel() {} -func (p memberWithPrismaHasModPermissionEqualsUniqueParam) hasModPermissionField() {} +func (p messageWithPrismaIDEqualsUniqueParam) messageModel() {} +func (p messageWithPrismaIDEqualsUniqueParam) idField() {} -func (memberWithPrismaHasModPermissionEqualsUniqueParam) unique() {} -func (memberWithPrismaHasModPermissionEqualsUniqueParam) equals() {} +func (messageWithPrismaIDEqualsUniqueParam) unique() {} +func (messageWithPrismaIDEqualsUniqueParam) equals() {} -type MemberWithPrismaHasSendPermissionEqualsSetParam interface { +type MessageWithPrismaChatIDEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - memberModel() - hasSendPermissionField() + messageModel() + chatIDField() } -type MemberWithPrismaHasSendPermissionSetParam interface { +type MessageWithPrismaChatIDSetParam interface { field() builder.Field getQuery() builder.Query - memberModel() - hasSendPermissionField() + messageModel() + chatIDField() } -type memberWithPrismaHasSendPermissionSetParam struct { +type messageWithPrismaChatIDSetParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaHasSendPermissionSetParam) field() builder.Field { +func (p messageWithPrismaChatIDSetParam) field() builder.Field { return p.data } -func (p memberWithPrismaHasSendPermissionSetParam) getQuery() builder.Query { +func (p messageWithPrismaChatIDSetParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaHasSendPermissionSetParam) memberModel() {} +func (p messageWithPrismaChatIDSetParam) messageModel() {} -func (p memberWithPrismaHasSendPermissionSetParam) hasSendPermissionField() {} +func (p messageWithPrismaChatIDSetParam) chatIDField() {} -type MemberWithPrismaHasSendPermissionWhereParam interface { +type MessageWithPrismaChatIDWhereParam interface { field() builder.Field getQuery() builder.Query - memberModel() - hasSendPermissionField() + messageModel() + chatIDField() } -type memberWithPrismaHasSendPermissionEqualsParam struct { +type messageWithPrismaChatIDEqualsParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaHasSendPermissionEqualsParam) field() builder.Field { +func (p messageWithPrismaChatIDEqualsParam) field() builder.Field { return p.data } -func (p memberWithPrismaHasSendPermissionEqualsParam) getQuery() builder.Query { +func (p messageWithPrismaChatIDEqualsParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaHasSendPermissionEqualsParam) memberModel() {} +func (p messageWithPrismaChatIDEqualsParam) messageModel() {} -func (p memberWithPrismaHasSendPermissionEqualsParam) hasSendPermissionField() {} +func (p messageWithPrismaChatIDEqualsParam) chatIDField() {} -func (memberWithPrismaHasSendPermissionSetParam) settable() {} -func (memberWithPrismaHasSendPermissionEqualsParam) equals() {} +func (messageWithPrismaChatIDSetParam) settable() {} +func (messageWithPrismaChatIDEqualsParam) equals() {} -type memberWithPrismaHasSendPermissionEqualsUniqueParam struct { +type messageWithPrismaChatIDEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaHasSendPermissionEqualsUniqueParam) field() builder.Field { +func (p messageWithPrismaChatIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p memberWithPrismaHasSendPermissionEqualsUniqueParam) getQuery() builder.Query { +func (p messageWithPrismaChatIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaHasSendPermissionEqualsUniqueParam) memberModel() {} -func (p memberWithPrismaHasSendPermissionEqualsUniqueParam) hasSendPermissionField() {} +func (p messageWithPrismaChatIDEqualsUniqueParam) messageModel() {} +func (p messageWithPrismaChatIDEqualsUniqueParam) chatIDField() {} -func (memberWithPrismaHasSendPermissionEqualsUniqueParam) unique() {} -func (memberWithPrismaHasSendPermissionEqualsUniqueParam) equals() {} +func (messageWithPrismaChatIDEqualsUniqueParam) unique() {} +func (messageWithPrismaChatIDEqualsUniqueParam) equals() {} -type MemberWithPrismaIsSoftDeletedEqualsSetParam interface { +type MessageWithPrismaSenderIDEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - memberModel() - isSoftDeletedField() + messageModel() + senderIDField() } -type MemberWithPrismaIsSoftDeletedSetParam interface { +type MessageWithPrismaSenderIDSetParam interface { field() builder.Field getQuery() builder.Query - memberModel() - isSoftDeletedField() + messageModel() + senderIDField() } -type memberWithPrismaIsSoftDeletedSetParam struct { +type messageWithPrismaSenderIDSetParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaIsSoftDeletedSetParam) field() builder.Field { +func (p messageWithPrismaSenderIDSetParam) field() builder.Field { return p.data } -func (p memberWithPrismaIsSoftDeletedSetParam) getQuery() builder.Query { +func (p messageWithPrismaSenderIDSetParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaIsSoftDeletedSetParam) memberModel() {} +func (p messageWithPrismaSenderIDSetParam) messageModel() {} -func (p memberWithPrismaIsSoftDeletedSetParam) isSoftDeletedField() {} +func (p messageWithPrismaSenderIDSetParam) senderIDField() {} -type MemberWithPrismaIsSoftDeletedWhereParam interface { +type MessageWithPrismaSenderIDWhereParam interface { field() builder.Field getQuery() builder.Query - memberModel() - isSoftDeletedField() + messageModel() + senderIDField() } -type memberWithPrismaIsSoftDeletedEqualsParam struct { +type messageWithPrismaSenderIDEqualsParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaIsSoftDeletedEqualsParam) field() builder.Field { +func (p messageWithPrismaSenderIDEqualsParam) field() builder.Field { return p.data } -func (p memberWithPrismaIsSoftDeletedEqualsParam) getQuery() builder.Query { +func (p messageWithPrismaSenderIDEqualsParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaIsSoftDeletedEqualsParam) memberModel() {} +func (p messageWithPrismaSenderIDEqualsParam) messageModel() {} -func (p memberWithPrismaIsSoftDeletedEqualsParam) isSoftDeletedField() {} +func (p messageWithPrismaSenderIDEqualsParam) senderIDField() {} -func (memberWithPrismaIsSoftDeletedSetParam) settable() {} -func (memberWithPrismaIsSoftDeletedEqualsParam) equals() {} +func (messageWithPrismaSenderIDSetParam) settable() {} +func (messageWithPrismaSenderIDEqualsParam) equals() {} -type memberWithPrismaIsSoftDeletedEqualsUniqueParam struct { +type messageWithPrismaSenderIDEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaIsSoftDeletedEqualsUniqueParam) field() builder.Field { +func (p messageWithPrismaSenderIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p memberWithPrismaIsSoftDeletedEqualsUniqueParam) getQuery() builder.Query { +func (p messageWithPrismaSenderIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaIsSoftDeletedEqualsUniqueParam) memberModel() {} -func (p memberWithPrismaIsSoftDeletedEqualsUniqueParam) isSoftDeletedField() {} +func (p messageWithPrismaSenderIDEqualsUniqueParam) messageModel() {} +func (p messageWithPrismaSenderIDEqualsUniqueParam) senderIDField() {} -func (memberWithPrismaIsSoftDeletedEqualsUniqueParam) unique() {} -func (memberWithPrismaIsSoftDeletedEqualsUniqueParam) equals() {} +func (messageWithPrismaSenderIDEqualsUniqueParam) unique() {} +func (messageWithPrismaSenderIDEqualsUniqueParam) equals() {} -type MemberWithPrismaCreatedAtEqualsSetParam interface { +type MessageWithPrismaVersionEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - memberModel() - createdAtField() + messageModel() + versionField() } -type MemberWithPrismaCreatedAtSetParam interface { +type MessageWithPrismaVersionSetParam interface { field() builder.Field getQuery() builder.Query - memberModel() - createdAtField() + messageModel() + versionField() } -type memberWithPrismaCreatedAtSetParam struct { +type messageWithPrismaVersionSetParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaCreatedAtSetParam) field() builder.Field { +func (p messageWithPrismaVersionSetParam) field() builder.Field { return p.data } -func (p memberWithPrismaCreatedAtSetParam) getQuery() builder.Query { +func (p messageWithPrismaVersionSetParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaCreatedAtSetParam) memberModel() {} +func (p messageWithPrismaVersionSetParam) messageModel() {} -func (p memberWithPrismaCreatedAtSetParam) createdAtField() {} +func (p messageWithPrismaVersionSetParam) versionField() {} -type MemberWithPrismaCreatedAtWhereParam interface { +type MessageWithPrismaVersionWhereParam interface { field() builder.Field getQuery() builder.Query - memberModel() - createdAtField() + messageModel() + versionField() } -type memberWithPrismaCreatedAtEqualsParam struct { +type messageWithPrismaVersionEqualsParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaCreatedAtEqualsParam) field() builder.Field { +func (p messageWithPrismaVersionEqualsParam) field() builder.Field { return p.data } -func (p memberWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { +func (p messageWithPrismaVersionEqualsParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaCreatedAtEqualsParam) memberModel() {} +func (p messageWithPrismaVersionEqualsParam) messageModel() {} -func (p memberWithPrismaCreatedAtEqualsParam) createdAtField() {} +func (p messageWithPrismaVersionEqualsParam) versionField() {} -func (memberWithPrismaCreatedAtSetParam) settable() {} -func (memberWithPrismaCreatedAtEqualsParam) equals() {} +func (messageWithPrismaVersionSetParam) settable() {} +func (messageWithPrismaVersionEqualsParam) equals() {} -type memberWithPrismaCreatedAtEqualsUniqueParam struct { +type messageWithPrismaVersionEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { +func (p messageWithPrismaVersionEqualsUniqueParam) field() builder.Field { return p.data } -func (p memberWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p messageWithPrismaVersionEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaCreatedAtEqualsUniqueParam) memberModel() {} -func (p memberWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} +func (p messageWithPrismaVersionEqualsUniqueParam) messageModel() {} +func (p messageWithPrismaVersionEqualsUniqueParam) versionField() {} -func (memberWithPrismaCreatedAtEqualsUniqueParam) unique() {} -func (memberWithPrismaCreatedAtEqualsUniqueParam) equals() {} +func (messageWithPrismaVersionEqualsUniqueParam) unique() {} +func (messageWithPrismaVersionEqualsUniqueParam) equals() {} -type MemberWithPrismaUpdatedAtEqualsSetParam interface { +type MessageWithPrismaContentTypeEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - memberModel() - updatedAtField() + messageModel() + contentTypeField() } -type MemberWithPrismaUpdatedAtSetParam interface { +type MessageWithPrismaContentTypeSetParam interface { field() builder.Field getQuery() builder.Query - memberModel() - updatedAtField() + messageModel() + contentTypeField() } -type memberWithPrismaUpdatedAtSetParam struct { +type messageWithPrismaContentTypeSetParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaUpdatedAtSetParam) field() builder.Field { +func (p messageWithPrismaContentTypeSetParam) field() builder.Field { return p.data } -func (p memberWithPrismaUpdatedAtSetParam) getQuery() builder.Query { +func (p messageWithPrismaContentTypeSetParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaUpdatedAtSetParam) memberModel() {} +func (p messageWithPrismaContentTypeSetParam) messageModel() {} -func (p memberWithPrismaUpdatedAtSetParam) updatedAtField() {} +func (p messageWithPrismaContentTypeSetParam) contentTypeField() {} -type MemberWithPrismaUpdatedAtWhereParam interface { +type MessageWithPrismaContentTypeWhereParam interface { field() builder.Field getQuery() builder.Query - memberModel() - updatedAtField() + messageModel() + contentTypeField() } -type memberWithPrismaUpdatedAtEqualsParam struct { +type messageWithPrismaContentTypeEqualsParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaUpdatedAtEqualsParam) field() builder.Field { +func (p messageWithPrismaContentTypeEqualsParam) field() builder.Field { return p.data } -func (p memberWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { +func (p messageWithPrismaContentTypeEqualsParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaUpdatedAtEqualsParam) memberModel() {} +func (p messageWithPrismaContentTypeEqualsParam) messageModel() {} -func (p memberWithPrismaUpdatedAtEqualsParam) updatedAtField() {} +func (p messageWithPrismaContentTypeEqualsParam) contentTypeField() {} -func (memberWithPrismaUpdatedAtSetParam) settable() {} -func (memberWithPrismaUpdatedAtEqualsParam) equals() {} +func (messageWithPrismaContentTypeSetParam) settable() {} +func (messageWithPrismaContentTypeEqualsParam) equals() {} -type memberWithPrismaUpdatedAtEqualsUniqueParam struct { +type messageWithPrismaContentTypeEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { +func (p messageWithPrismaContentTypeEqualsUniqueParam) field() builder.Field { return p.data } -func (p memberWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p messageWithPrismaContentTypeEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaUpdatedAtEqualsUniqueParam) memberModel() {} -func (p memberWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} +func (p messageWithPrismaContentTypeEqualsUniqueParam) messageModel() {} +func (p messageWithPrismaContentTypeEqualsUniqueParam) contentTypeField() {} -func (memberWithPrismaUpdatedAtEqualsUniqueParam) unique() {} -func (memberWithPrismaUpdatedAtEqualsUniqueParam) equals() {} +func (messageWithPrismaContentTypeEqualsUniqueParam) unique() {} +func (messageWithPrismaContentTypeEqualsUniqueParam) equals() {} -type MemberWithPrismaChatEqualsSetParam interface { +type MessageWithPrismaContentEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - memberModel() - chatField() + messageModel() + contentField() } -type MemberWithPrismaChatSetParam interface { +type MessageWithPrismaContentSetParam interface { field() builder.Field getQuery() builder.Query - memberModel() - chatField() + messageModel() + contentField() } -type memberWithPrismaChatSetParam struct { +type messageWithPrismaContentSetParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaChatSetParam) field() builder.Field { +func (p messageWithPrismaContentSetParam) field() builder.Field { return p.data } -func (p memberWithPrismaChatSetParam) getQuery() builder.Query { +func (p messageWithPrismaContentSetParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaChatSetParam) memberModel() {} +func (p messageWithPrismaContentSetParam) messageModel() {} -func (p memberWithPrismaChatSetParam) chatField() {} +func (p messageWithPrismaContentSetParam) contentField() {} -type MemberWithPrismaChatWhereParam interface { +type MessageWithPrismaContentWhereParam interface { field() builder.Field getQuery() builder.Query - memberModel() - chatField() + messageModel() + contentField() } -type memberWithPrismaChatEqualsParam struct { +type messageWithPrismaContentEqualsParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaChatEqualsParam) field() builder.Field { +func (p messageWithPrismaContentEqualsParam) field() builder.Field { return p.data } -func (p memberWithPrismaChatEqualsParam) getQuery() builder.Query { +func (p messageWithPrismaContentEqualsParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaChatEqualsParam) memberModel() {} +func (p messageWithPrismaContentEqualsParam) messageModel() {} -func (p memberWithPrismaChatEqualsParam) chatField() {} +func (p messageWithPrismaContentEqualsParam) contentField() {} -func (memberWithPrismaChatSetParam) settable() {} -func (memberWithPrismaChatEqualsParam) equals() {} +func (messageWithPrismaContentSetParam) settable() {} +func (messageWithPrismaContentEqualsParam) equals() {} -type memberWithPrismaChatEqualsUniqueParam struct { +type messageWithPrismaContentEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p memberWithPrismaChatEqualsUniqueParam) field() builder.Field { +func (p messageWithPrismaContentEqualsUniqueParam) field() builder.Field { return p.data } -func (p memberWithPrismaChatEqualsUniqueParam) getQuery() builder.Query { +func (p messageWithPrismaContentEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p memberWithPrismaChatEqualsUniqueParam) memberModel() {} -func (p memberWithPrismaChatEqualsUniqueParam) chatField() {} - -func (memberWithPrismaChatEqualsUniqueParam) unique() {} -func (memberWithPrismaChatEqualsUniqueParam) equals() {} - -type messageActions struct { - // client holds the prisma client - client *PrismaClient -} +func (p messageWithPrismaContentEqualsUniqueParam) messageModel() {} +func (p messageWithPrismaContentEqualsUniqueParam) contentField() {} -var messageOutput = []builder.Output{ - {Name: "id"}, - {Name: "chatId"}, - {Name: "senderId"}, - {Name: "version"}, - {Name: "contentType"}, - {Name: "content"}, - {Name: "createdAt"}, - {Name: "updatedAt"}, -} +func (messageWithPrismaContentEqualsUniqueParam) unique() {} +func (messageWithPrismaContentEqualsUniqueParam) equals() {} -type MessageRelationWith interface { +type MessageWithPrismaCreatedAtEqualsSetParam interface { + field() builder.Field getQuery() builder.Query - with() - messageRelation() + equals() + messageModel() + createdAtField() } -type MessageWhereParam interface { +type MessageWithPrismaCreatedAtSetParam interface { field() builder.Field getQuery() builder.Query messageModel() + createdAtField() } -type messageDefaultParam struct { +type messageWithPrismaCreatedAtSetParam struct { data builder.Field query builder.Query } -func (p messageDefaultParam) field() builder.Field { +func (p messageWithPrismaCreatedAtSetParam) field() builder.Field { return p.data } -func (p messageDefaultParam) getQuery() builder.Query { +func (p messageWithPrismaCreatedAtSetParam) getQuery() builder.Query { return p.query } -func (p messageDefaultParam) messageModel() {} +func (p messageWithPrismaCreatedAtSetParam) messageModel() {} -type MessageOrderByParam interface { +func (p messageWithPrismaCreatedAtSetParam) createdAtField() {} + +type MessageWithPrismaCreatedAtWhereParam interface { field() builder.Field getQuery() builder.Query messageModel() + createdAtField() } -type messageOrderByParam struct { +type messageWithPrismaCreatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p messageOrderByParam) field() builder.Field { +func (p messageWithPrismaCreatedAtEqualsParam) field() builder.Field { return p.data } -func (p messageOrderByParam) getQuery() builder.Query { +func (p messageWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { return p.query } -func (p messageOrderByParam) messageModel() {} +func (p messageWithPrismaCreatedAtEqualsParam) messageModel() {} -type MessageCursorParam interface { - field() builder.Field - getQuery() builder.Query - messageModel() - isCursor() -} +func (p messageWithPrismaCreatedAtEqualsParam) createdAtField() {} -type messageCursorParam struct { +func (messageWithPrismaCreatedAtSetParam) settable() {} +func (messageWithPrismaCreatedAtEqualsParam) equals() {} + +type messageWithPrismaCreatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p messageCursorParam) field() builder.Field { +func (p messageWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p messageCursorParam) isCursor() {} - -func (p messageCursorParam) getQuery() builder.Query { +func (p messageWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p messageCursorParam) messageModel() {} +func (p messageWithPrismaCreatedAtEqualsUniqueParam) messageModel() {} +func (p messageWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} -type MessageParamUnique interface { +func (messageWithPrismaCreatedAtEqualsUniqueParam) unique() {} +func (messageWithPrismaCreatedAtEqualsUniqueParam) equals() {} + +type MessageWithPrismaUpdatedAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query - unique() + equals() messageModel() + updatedAtField() } -type messageParamUnique struct { +type MessageWithPrismaUpdatedAtSetParam interface { + field() builder.Field + getQuery() builder.Query + messageModel() + updatedAtField() +} + +type messageWithPrismaUpdatedAtSetParam struct { data builder.Field query builder.Query } -func (p messageParamUnique) messageModel() {} - -func (messageParamUnique) unique() {} - -func (p messageParamUnique) field() builder.Field { +func (p messageWithPrismaUpdatedAtSetParam) field() builder.Field { return p.data } -func (p messageParamUnique) getQuery() builder.Query { +func (p messageWithPrismaUpdatedAtSetParam) getQuery() builder.Query { return p.query } -type MessageEqualsWhereParam interface { +func (p messageWithPrismaUpdatedAtSetParam) messageModel() {} + +func (p messageWithPrismaUpdatedAtSetParam) updatedAtField() {} + +type MessageWithPrismaUpdatedAtWhereParam interface { field() builder.Field getQuery() builder.Query - equals() messageModel() + updatedAtField() } -type messageEqualsParam struct { +type messageWithPrismaUpdatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p messageEqualsParam) messageModel() {} - -func (messageEqualsParam) equals() {} - -func (p messageEqualsParam) field() builder.Field { +func (p messageWithPrismaUpdatedAtEqualsParam) field() builder.Field { return p.data } -func (p messageEqualsParam) getQuery() builder.Query { +func (p messageWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { return p.query } -type MessageEqualsUniqueWhereParam interface { - field() builder.Field - getQuery() builder.Query - equals() - unique() - messageModel() -} +func (p messageWithPrismaUpdatedAtEqualsParam) messageModel() {} -type messageEqualsUniqueParam struct { +func (p messageWithPrismaUpdatedAtEqualsParam) updatedAtField() {} + +func (messageWithPrismaUpdatedAtSetParam) settable() {} +func (messageWithPrismaUpdatedAtEqualsParam) equals() {} + +type messageWithPrismaUpdatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p messageEqualsUniqueParam) messageModel() {} - -func (messageEqualsUniqueParam) unique() {} -func (messageEqualsUniqueParam) equals() {} - -func (p messageEqualsUniqueParam) field() builder.Field { +func (p messageWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p messageEqualsUniqueParam) getQuery() builder.Query { +func (p messageWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -type MessageSetParam interface { - field() builder.Field - settable() - messageModel() -} - -type messageSetParam struct { - data builder.Field -} +func (p messageWithPrismaUpdatedAtEqualsUniqueParam) messageModel() {} +func (p messageWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} -func (messageSetParam) settable() {} +func (messageWithPrismaUpdatedAtEqualsUniqueParam) unique() {} +func (messageWithPrismaUpdatedAtEqualsUniqueParam) equals() {} -func (p messageSetParam) field() builder.Field { - return p.data +type pointerActions struct { + // client holds the prisma client + client *PrismaClient } -func (p messageSetParam) messageModel() {} +var pointerOutput = []builder.Output{ + {Name: "chatId"}, + {Name: "userId"}, + {Name: "type"}, + {Name: "value"}, + {Name: "createdAt"}, + {Name: "updatedAt"}, +} -type MessageWithPrismaIDEqualsSetParam interface { - field() builder.Field +type PointerRelationWith interface { getQuery() builder.Query - equals() - messageModel() - idField() + with() + pointerRelation() } -type MessageWithPrismaIDSetParam interface { +type PointerWhereParam interface { field() builder.Field getQuery() builder.Query - messageModel() - idField() + pointerModel() } -type messageWithPrismaIDSetParam struct { +type pointerDefaultParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaIDSetParam) field() builder.Field { +func (p pointerDefaultParam) field() builder.Field { return p.data } -func (p messageWithPrismaIDSetParam) getQuery() builder.Query { +func (p pointerDefaultParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaIDSetParam) messageModel() {} - -func (p messageWithPrismaIDSetParam) idField() {} +func (p pointerDefaultParam) pointerModel() {} -type MessageWithPrismaIDWhereParam interface { +type PointerOrderByParam interface { field() builder.Field getQuery() builder.Query - messageModel() - idField() + pointerModel() } -type messageWithPrismaIDEqualsParam struct { +type pointerOrderByParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaIDEqualsParam) field() builder.Field { +func (p pointerOrderByParam) field() builder.Field { return p.data } -func (p messageWithPrismaIDEqualsParam) getQuery() builder.Query { +func (p pointerOrderByParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaIDEqualsParam) messageModel() {} - -func (p messageWithPrismaIDEqualsParam) idField() {} +func (p pointerOrderByParam) pointerModel() {} -func (messageWithPrismaIDSetParam) settable() {} -func (messageWithPrismaIDEqualsParam) equals() {} +type PointerCursorParam interface { + field() builder.Field + getQuery() builder.Query + pointerModel() + isCursor() +} -type messageWithPrismaIDEqualsUniqueParam struct { +type pointerCursorParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaIDEqualsUniqueParam) field() builder.Field { +func (p pointerCursorParam) field() builder.Field { return p.data } -func (p messageWithPrismaIDEqualsUniqueParam) getQuery() builder.Query { +func (p pointerCursorParam) isCursor() {} + +func (p pointerCursorParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaIDEqualsUniqueParam) messageModel() {} -func (p messageWithPrismaIDEqualsUniqueParam) idField() {} - -func (messageWithPrismaIDEqualsUniqueParam) unique() {} -func (messageWithPrismaIDEqualsUniqueParam) equals() {} - -type MessageWithPrismaChatIDEqualsSetParam interface { - field() builder.Field - getQuery() builder.Query - equals() - messageModel() - chatIDField() -} +func (p pointerCursorParam) pointerModel() {} -type MessageWithPrismaChatIDSetParam interface { +type PointerParamUnique interface { field() builder.Field getQuery() builder.Query - messageModel() - chatIDField() + unique() + pointerModel() } -type messageWithPrismaChatIDSetParam struct { +type pointerParamUnique struct { data builder.Field query builder.Query } -func (p messageWithPrismaChatIDSetParam) field() builder.Field { +func (p pointerParamUnique) pointerModel() {} + +func (pointerParamUnique) unique() {} + +func (p pointerParamUnique) field() builder.Field { return p.data } -func (p messageWithPrismaChatIDSetParam) getQuery() builder.Query { +func (p pointerParamUnique) getQuery() builder.Query { return p.query } -func (p messageWithPrismaChatIDSetParam) messageModel() {} - -func (p messageWithPrismaChatIDSetParam) chatIDField() {} - -type MessageWithPrismaChatIDWhereParam interface { +type PointerEqualsWhereParam interface { field() builder.Field getQuery() builder.Query - messageModel() - chatIDField() + equals() + pointerModel() } -type messageWithPrismaChatIDEqualsParam struct { +type pointerEqualsParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaChatIDEqualsParam) field() builder.Field { +func (p pointerEqualsParam) pointerModel() {} + +func (pointerEqualsParam) equals() {} + +func (p pointerEqualsParam) field() builder.Field { return p.data } -func (p messageWithPrismaChatIDEqualsParam) getQuery() builder.Query { +func (p pointerEqualsParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaChatIDEqualsParam) messageModel() {} - -func (p messageWithPrismaChatIDEqualsParam) chatIDField() {} - -func (messageWithPrismaChatIDSetParam) settable() {} -func (messageWithPrismaChatIDEqualsParam) equals() {} +type PointerEqualsUniqueWhereParam interface { + field() builder.Field + getQuery() builder.Query + equals() + unique() + pointerModel() +} -type messageWithPrismaChatIDEqualsUniqueParam struct { +type pointerEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaChatIDEqualsUniqueParam) field() builder.Field { +func (p pointerEqualsUniqueParam) pointerModel() {} + +func (pointerEqualsUniqueParam) unique() {} +func (pointerEqualsUniqueParam) equals() {} + +func (p pointerEqualsUniqueParam) field() builder.Field { return p.data } -func (p messageWithPrismaChatIDEqualsUniqueParam) getQuery() builder.Query { +func (p pointerEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaChatIDEqualsUniqueParam) messageModel() {} -func (p messageWithPrismaChatIDEqualsUniqueParam) chatIDField() {} +type PointerSetParam interface { + field() builder.Field + settable() + pointerModel() +} + +type pointerSetParam struct { + data builder.Field +} + +func (pointerSetParam) settable() {} + +func (p pointerSetParam) field() builder.Field { + return p.data +} -func (messageWithPrismaChatIDEqualsUniqueParam) unique() {} -func (messageWithPrismaChatIDEqualsUniqueParam) equals() {} +func (p pointerSetParam) pointerModel() {} -type MessageWithPrismaSenderIDEqualsSetParam interface { +type PointerWithPrismaChatIDEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - messageModel() - senderIDField() + pointerModel() + chatIDField() } -type MessageWithPrismaSenderIDSetParam interface { +type PointerWithPrismaChatIDSetParam interface { field() builder.Field getQuery() builder.Query - messageModel() - senderIDField() + pointerModel() + chatIDField() } -type messageWithPrismaSenderIDSetParam struct { +type pointerWithPrismaChatIDSetParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaSenderIDSetParam) field() builder.Field { +func (p pointerWithPrismaChatIDSetParam) field() builder.Field { return p.data } -func (p messageWithPrismaSenderIDSetParam) getQuery() builder.Query { +func (p pointerWithPrismaChatIDSetParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaSenderIDSetParam) messageModel() {} +func (p pointerWithPrismaChatIDSetParam) pointerModel() {} -func (p messageWithPrismaSenderIDSetParam) senderIDField() {} +func (p pointerWithPrismaChatIDSetParam) chatIDField() {} -type MessageWithPrismaSenderIDWhereParam interface { +type PointerWithPrismaChatIDWhereParam interface { field() builder.Field getQuery() builder.Query - messageModel() - senderIDField() + pointerModel() + chatIDField() } -type messageWithPrismaSenderIDEqualsParam struct { +type pointerWithPrismaChatIDEqualsParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaSenderIDEqualsParam) field() builder.Field { +func (p pointerWithPrismaChatIDEqualsParam) field() builder.Field { return p.data } -func (p messageWithPrismaSenderIDEqualsParam) getQuery() builder.Query { +func (p pointerWithPrismaChatIDEqualsParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaSenderIDEqualsParam) messageModel() {} +func (p pointerWithPrismaChatIDEqualsParam) pointerModel() {} -func (p messageWithPrismaSenderIDEqualsParam) senderIDField() {} +func (p pointerWithPrismaChatIDEqualsParam) chatIDField() {} -func (messageWithPrismaSenderIDSetParam) settable() {} -func (messageWithPrismaSenderIDEqualsParam) equals() {} +func (pointerWithPrismaChatIDSetParam) settable() {} +func (pointerWithPrismaChatIDEqualsParam) equals() {} -type messageWithPrismaSenderIDEqualsUniqueParam struct { +type pointerWithPrismaChatIDEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaSenderIDEqualsUniqueParam) field() builder.Field { +func (p pointerWithPrismaChatIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p messageWithPrismaSenderIDEqualsUniqueParam) getQuery() builder.Query { +func (p pointerWithPrismaChatIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaSenderIDEqualsUniqueParam) messageModel() {} -func (p messageWithPrismaSenderIDEqualsUniqueParam) senderIDField() {} +func (p pointerWithPrismaChatIDEqualsUniqueParam) pointerModel() {} +func (p pointerWithPrismaChatIDEqualsUniqueParam) chatIDField() {} -func (messageWithPrismaSenderIDEqualsUniqueParam) unique() {} -func (messageWithPrismaSenderIDEqualsUniqueParam) equals() {} +func (pointerWithPrismaChatIDEqualsUniqueParam) unique() {} +func (pointerWithPrismaChatIDEqualsUniqueParam) equals() {} -type MessageWithPrismaVersionEqualsSetParam interface { +type PointerWithPrismaUserIDEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - messageModel() - versionField() + pointerModel() + userIDField() } -type MessageWithPrismaVersionSetParam interface { +type PointerWithPrismaUserIDSetParam interface { field() builder.Field getQuery() builder.Query - messageModel() - versionField() + pointerModel() + userIDField() } -type messageWithPrismaVersionSetParam struct { +type pointerWithPrismaUserIDSetParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaVersionSetParam) field() builder.Field { +func (p pointerWithPrismaUserIDSetParam) field() builder.Field { return p.data } -func (p messageWithPrismaVersionSetParam) getQuery() builder.Query { +func (p pointerWithPrismaUserIDSetParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaVersionSetParam) messageModel() {} +func (p pointerWithPrismaUserIDSetParam) pointerModel() {} -func (p messageWithPrismaVersionSetParam) versionField() {} +func (p pointerWithPrismaUserIDSetParam) userIDField() {} -type MessageWithPrismaVersionWhereParam interface { +type PointerWithPrismaUserIDWhereParam interface { field() builder.Field getQuery() builder.Query - messageModel() - versionField() + pointerModel() + userIDField() } -type messageWithPrismaVersionEqualsParam struct { +type pointerWithPrismaUserIDEqualsParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaVersionEqualsParam) field() builder.Field { +func (p pointerWithPrismaUserIDEqualsParam) field() builder.Field { return p.data } -func (p messageWithPrismaVersionEqualsParam) getQuery() builder.Query { +func (p pointerWithPrismaUserIDEqualsParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaVersionEqualsParam) messageModel() {} +func (p pointerWithPrismaUserIDEqualsParam) pointerModel() {} -func (p messageWithPrismaVersionEqualsParam) versionField() {} +func (p pointerWithPrismaUserIDEqualsParam) userIDField() {} -func (messageWithPrismaVersionSetParam) settable() {} -func (messageWithPrismaVersionEqualsParam) equals() {} +func (pointerWithPrismaUserIDSetParam) settable() {} +func (pointerWithPrismaUserIDEqualsParam) equals() {} -type messageWithPrismaVersionEqualsUniqueParam struct { +type pointerWithPrismaUserIDEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaVersionEqualsUniqueParam) field() builder.Field { +func (p pointerWithPrismaUserIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p messageWithPrismaVersionEqualsUniqueParam) getQuery() builder.Query { +func (p pointerWithPrismaUserIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaVersionEqualsUniqueParam) messageModel() {} -func (p messageWithPrismaVersionEqualsUniqueParam) versionField() {} +func (p pointerWithPrismaUserIDEqualsUniqueParam) pointerModel() {} +func (p pointerWithPrismaUserIDEqualsUniqueParam) userIDField() {} -func (messageWithPrismaVersionEqualsUniqueParam) unique() {} -func (messageWithPrismaVersionEqualsUniqueParam) equals() {} +func (pointerWithPrismaUserIDEqualsUniqueParam) unique() {} +func (pointerWithPrismaUserIDEqualsUniqueParam) equals() {} -type MessageWithPrismaContentTypeEqualsSetParam interface { +type PointerWithPrismaTypeEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - messageModel() - contentTypeField() + pointerModel() + typeField() } -type MessageWithPrismaContentTypeSetParam interface { +type PointerWithPrismaTypeSetParam interface { field() builder.Field getQuery() builder.Query - messageModel() - contentTypeField() + pointerModel() + typeField() } -type messageWithPrismaContentTypeSetParam struct { +type pointerWithPrismaTypeSetParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaContentTypeSetParam) field() builder.Field { +func (p pointerWithPrismaTypeSetParam) field() builder.Field { return p.data } -func (p messageWithPrismaContentTypeSetParam) getQuery() builder.Query { +func (p pointerWithPrismaTypeSetParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaContentTypeSetParam) messageModel() {} +func (p pointerWithPrismaTypeSetParam) pointerModel() {} -func (p messageWithPrismaContentTypeSetParam) contentTypeField() {} +func (p pointerWithPrismaTypeSetParam) typeField() {} -type MessageWithPrismaContentTypeWhereParam interface { +type PointerWithPrismaTypeWhereParam interface { field() builder.Field getQuery() builder.Query - messageModel() - contentTypeField() + pointerModel() + typeField() } -type messageWithPrismaContentTypeEqualsParam struct { +type pointerWithPrismaTypeEqualsParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaContentTypeEqualsParam) field() builder.Field { +func (p pointerWithPrismaTypeEqualsParam) field() builder.Field { return p.data } -func (p messageWithPrismaContentTypeEqualsParam) getQuery() builder.Query { +func (p pointerWithPrismaTypeEqualsParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaContentTypeEqualsParam) messageModel() {} +func (p pointerWithPrismaTypeEqualsParam) pointerModel() {} -func (p messageWithPrismaContentTypeEqualsParam) contentTypeField() {} +func (p pointerWithPrismaTypeEqualsParam) typeField() {} -func (messageWithPrismaContentTypeSetParam) settable() {} -func (messageWithPrismaContentTypeEqualsParam) equals() {} +func (pointerWithPrismaTypeSetParam) settable() {} +func (pointerWithPrismaTypeEqualsParam) equals() {} -type messageWithPrismaContentTypeEqualsUniqueParam struct { +type pointerWithPrismaTypeEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaContentTypeEqualsUniqueParam) field() builder.Field { +func (p pointerWithPrismaTypeEqualsUniqueParam) field() builder.Field { return p.data } -func (p messageWithPrismaContentTypeEqualsUniqueParam) getQuery() builder.Query { +func (p pointerWithPrismaTypeEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaContentTypeEqualsUniqueParam) messageModel() {} -func (p messageWithPrismaContentTypeEqualsUniqueParam) contentTypeField() {} +func (p pointerWithPrismaTypeEqualsUniqueParam) pointerModel() {} +func (p pointerWithPrismaTypeEqualsUniqueParam) typeField() {} -func (messageWithPrismaContentTypeEqualsUniqueParam) unique() {} -func (messageWithPrismaContentTypeEqualsUniqueParam) equals() {} +func (pointerWithPrismaTypeEqualsUniqueParam) unique() {} +func (pointerWithPrismaTypeEqualsUniqueParam) equals() {} -type MessageWithPrismaContentEqualsSetParam interface { +type PointerWithPrismaValueEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - messageModel() - contentField() + pointerModel() + valueField() } -type MessageWithPrismaContentSetParam interface { +type PointerWithPrismaValueSetParam interface { field() builder.Field getQuery() builder.Query - messageModel() - contentField() + pointerModel() + valueField() } -type messageWithPrismaContentSetParam struct { +type pointerWithPrismaValueSetParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaContentSetParam) field() builder.Field { +func (p pointerWithPrismaValueSetParam) field() builder.Field { return p.data } -func (p messageWithPrismaContentSetParam) getQuery() builder.Query { +func (p pointerWithPrismaValueSetParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaContentSetParam) messageModel() {} +func (p pointerWithPrismaValueSetParam) pointerModel() {} -func (p messageWithPrismaContentSetParam) contentField() {} +func (p pointerWithPrismaValueSetParam) valueField() {} -type MessageWithPrismaContentWhereParam interface { +type PointerWithPrismaValueWhereParam interface { field() builder.Field getQuery() builder.Query - messageModel() - contentField() + pointerModel() + valueField() } -type messageWithPrismaContentEqualsParam struct { +type pointerWithPrismaValueEqualsParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaContentEqualsParam) field() builder.Field { +func (p pointerWithPrismaValueEqualsParam) field() builder.Field { return p.data } -func (p messageWithPrismaContentEqualsParam) getQuery() builder.Query { +func (p pointerWithPrismaValueEqualsParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaContentEqualsParam) messageModel() {} +func (p pointerWithPrismaValueEqualsParam) pointerModel() {} -func (p messageWithPrismaContentEqualsParam) contentField() {} +func (p pointerWithPrismaValueEqualsParam) valueField() {} -func (messageWithPrismaContentSetParam) settable() {} -func (messageWithPrismaContentEqualsParam) equals() {} +func (pointerWithPrismaValueSetParam) settable() {} +func (pointerWithPrismaValueEqualsParam) equals() {} -type messageWithPrismaContentEqualsUniqueParam struct { +type pointerWithPrismaValueEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaContentEqualsUniqueParam) field() builder.Field { +func (p pointerWithPrismaValueEqualsUniqueParam) field() builder.Field { return p.data } -func (p messageWithPrismaContentEqualsUniqueParam) getQuery() builder.Query { +func (p pointerWithPrismaValueEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaContentEqualsUniqueParam) messageModel() {} -func (p messageWithPrismaContentEqualsUniqueParam) contentField() {} +func (p pointerWithPrismaValueEqualsUniqueParam) pointerModel() {} +func (p pointerWithPrismaValueEqualsUniqueParam) valueField() {} -func (messageWithPrismaContentEqualsUniqueParam) unique() {} -func (messageWithPrismaContentEqualsUniqueParam) equals() {} +func (pointerWithPrismaValueEqualsUniqueParam) unique() {} +func (pointerWithPrismaValueEqualsUniqueParam) equals() {} -type MessageWithPrismaCreatedAtEqualsSetParam interface { +type PointerWithPrismaCreatedAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - messageModel() + pointerModel() createdAtField() } -type MessageWithPrismaCreatedAtSetParam interface { +type PointerWithPrismaCreatedAtSetParam interface { field() builder.Field getQuery() builder.Query - messageModel() + pointerModel() createdAtField() } -type messageWithPrismaCreatedAtSetParam struct { +type pointerWithPrismaCreatedAtSetParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaCreatedAtSetParam) field() builder.Field { +func (p pointerWithPrismaCreatedAtSetParam) field() builder.Field { return p.data } -func (p messageWithPrismaCreatedAtSetParam) getQuery() builder.Query { +func (p pointerWithPrismaCreatedAtSetParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaCreatedAtSetParam) messageModel() {} +func (p pointerWithPrismaCreatedAtSetParam) pointerModel() {} -func (p messageWithPrismaCreatedAtSetParam) createdAtField() {} +func (p pointerWithPrismaCreatedAtSetParam) createdAtField() {} -type MessageWithPrismaCreatedAtWhereParam interface { +type PointerWithPrismaCreatedAtWhereParam interface { field() builder.Field getQuery() builder.Query - messageModel() + pointerModel() createdAtField() } -type messageWithPrismaCreatedAtEqualsParam struct { +type pointerWithPrismaCreatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaCreatedAtEqualsParam) field() builder.Field { +func (p pointerWithPrismaCreatedAtEqualsParam) field() builder.Field { return p.data } -func (p messageWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { +func (p pointerWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaCreatedAtEqualsParam) messageModel() {} +func (p pointerWithPrismaCreatedAtEqualsParam) pointerModel() {} -func (p messageWithPrismaCreatedAtEqualsParam) createdAtField() {} +func (p pointerWithPrismaCreatedAtEqualsParam) createdAtField() {} -func (messageWithPrismaCreatedAtSetParam) settable() {} -func (messageWithPrismaCreatedAtEqualsParam) equals() {} +func (pointerWithPrismaCreatedAtSetParam) settable() {} +func (pointerWithPrismaCreatedAtEqualsParam) equals() {} -type messageWithPrismaCreatedAtEqualsUniqueParam struct { +type pointerWithPrismaCreatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { +func (p pointerWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p messageWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p pointerWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaCreatedAtEqualsUniqueParam) messageModel() {} -func (p messageWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} +func (p pointerWithPrismaCreatedAtEqualsUniqueParam) pointerModel() {} +func (p pointerWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} -func (messageWithPrismaCreatedAtEqualsUniqueParam) unique() {} -func (messageWithPrismaCreatedAtEqualsUniqueParam) equals() {} +func (pointerWithPrismaCreatedAtEqualsUniqueParam) unique() {} +func (pointerWithPrismaCreatedAtEqualsUniqueParam) equals() {} -type MessageWithPrismaUpdatedAtEqualsSetParam interface { +type PointerWithPrismaUpdatedAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - messageModel() + pointerModel() updatedAtField() } -type MessageWithPrismaUpdatedAtSetParam interface { +type PointerWithPrismaUpdatedAtSetParam interface { field() builder.Field getQuery() builder.Query - messageModel() + pointerModel() updatedAtField() } -type messageWithPrismaUpdatedAtSetParam struct { +type pointerWithPrismaUpdatedAtSetParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaUpdatedAtSetParam) field() builder.Field { +func (p pointerWithPrismaUpdatedAtSetParam) field() builder.Field { return p.data } -func (p messageWithPrismaUpdatedAtSetParam) getQuery() builder.Query { +func (p pointerWithPrismaUpdatedAtSetParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaUpdatedAtSetParam) messageModel() {} +func (p pointerWithPrismaUpdatedAtSetParam) pointerModel() {} -func (p messageWithPrismaUpdatedAtSetParam) updatedAtField() {} +func (p pointerWithPrismaUpdatedAtSetParam) updatedAtField() {} -type MessageWithPrismaUpdatedAtWhereParam interface { +type PointerWithPrismaUpdatedAtWhereParam interface { field() builder.Field getQuery() builder.Query - messageModel() + pointerModel() updatedAtField() } -type messageWithPrismaUpdatedAtEqualsParam struct { +type pointerWithPrismaUpdatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaUpdatedAtEqualsParam) field() builder.Field { +func (p pointerWithPrismaUpdatedAtEqualsParam) field() builder.Field { return p.data } -func (p messageWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { +func (p pointerWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaUpdatedAtEqualsParam) messageModel() {} +func (p pointerWithPrismaUpdatedAtEqualsParam) pointerModel() {} -func (p messageWithPrismaUpdatedAtEqualsParam) updatedAtField() {} +func (p pointerWithPrismaUpdatedAtEqualsParam) updatedAtField() {} -func (messageWithPrismaUpdatedAtSetParam) settable() {} -func (messageWithPrismaUpdatedAtEqualsParam) equals() {} +func (pointerWithPrismaUpdatedAtSetParam) settable() {} +func (pointerWithPrismaUpdatedAtEqualsParam) equals() {} -type messageWithPrismaUpdatedAtEqualsUniqueParam struct { +type pointerWithPrismaUpdatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p messageWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { +func (p pointerWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p messageWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p pointerWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p messageWithPrismaUpdatedAtEqualsUniqueParam) messageModel() {} -func (p messageWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} +func (p pointerWithPrismaUpdatedAtEqualsUniqueParam) pointerModel() {} +func (p pointerWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} -func (messageWithPrismaUpdatedAtEqualsUniqueParam) unique() {} -func (messageWithPrismaUpdatedAtEqualsUniqueParam) equals() {} +func (pointerWithPrismaUpdatedAtEqualsUniqueParam) unique() {} +func (pointerWithPrismaUpdatedAtEqualsUniqueParam) equals() {} -type pointerActions struct { +type pushTokenActions struct { // client holds the prisma client client *PrismaClient } -var pointerOutput = []builder.Output{ - {Name: "chatId"}, +var pushTokenOutput = []builder.Output{ {Name: "userId"}, + {Name: "appInstallId"}, + {Name: "token"}, {Name: "type"}, - {Name: "value"}, {Name: "createdAt"}, {Name: "updatedAt"}, } -type PointerRelationWith interface { +type PushTokenRelationWith interface { getQuery() builder.Query with() - pointerRelation() + pushTokenRelation() } -type PointerWhereParam interface { +type PushTokenWhereParam interface { field() builder.Field getQuery() builder.Query - pointerModel() + pushTokenModel() } -type pointerDefaultParam struct { +type pushTokenDefaultParam struct { data builder.Field query builder.Query } -func (p pointerDefaultParam) field() builder.Field { +func (p pushTokenDefaultParam) field() builder.Field { return p.data } -func (p pointerDefaultParam) getQuery() builder.Query { +func (p pushTokenDefaultParam) getQuery() builder.Query { return p.query } -func (p pointerDefaultParam) pointerModel() {} +func (p pushTokenDefaultParam) pushTokenModel() {} -type PointerOrderByParam interface { +type PushTokenOrderByParam interface { field() builder.Field getQuery() builder.Query - pointerModel() + pushTokenModel() } -type pointerOrderByParam struct { +type pushTokenOrderByParam struct { data builder.Field query builder.Query } -func (p pointerOrderByParam) field() builder.Field { +func (p pushTokenOrderByParam) field() builder.Field { return p.data } -func (p pointerOrderByParam) getQuery() builder.Query { +func (p pushTokenOrderByParam) getQuery() builder.Query { return p.query } -func (p pointerOrderByParam) pointerModel() {} +func (p pushTokenOrderByParam) pushTokenModel() {} -type PointerCursorParam interface { +type PushTokenCursorParam interface { field() builder.Field getQuery() builder.Query - pointerModel() + pushTokenModel() isCursor() } -type pointerCursorParam struct { +type pushTokenCursorParam struct { data builder.Field query builder.Query } -func (p pointerCursorParam) field() builder.Field { +func (p pushTokenCursorParam) field() builder.Field { return p.data } -func (p pointerCursorParam) isCursor() {} +func (p pushTokenCursorParam) isCursor() {} -func (p pointerCursorParam) getQuery() builder.Query { +func (p pushTokenCursorParam) getQuery() builder.Query { return p.query } -func (p pointerCursorParam) pointerModel() {} +func (p pushTokenCursorParam) pushTokenModel() {} -type PointerParamUnique interface { +type PushTokenParamUnique interface { field() builder.Field getQuery() builder.Query unique() - pointerModel() + pushTokenModel() } -type pointerParamUnique struct { +type pushTokenParamUnique struct { data builder.Field query builder.Query } -func (p pointerParamUnique) pointerModel() {} +func (p pushTokenParamUnique) pushTokenModel() {} -func (pointerParamUnique) unique() {} +func (pushTokenParamUnique) unique() {} -func (p pointerParamUnique) field() builder.Field { +func (p pushTokenParamUnique) field() builder.Field { return p.data } -func (p pointerParamUnique) getQuery() builder.Query { +func (p pushTokenParamUnique) getQuery() builder.Query { return p.query } -type PointerEqualsWhereParam interface { +type PushTokenEqualsWhereParam interface { field() builder.Field getQuery() builder.Query equals() - pointerModel() + pushTokenModel() } -type pointerEqualsParam struct { +type pushTokenEqualsParam struct { data builder.Field query builder.Query } -func (p pointerEqualsParam) pointerModel() {} +func (p pushTokenEqualsParam) pushTokenModel() {} -func (pointerEqualsParam) equals() {} +func (pushTokenEqualsParam) equals() {} -func (p pointerEqualsParam) field() builder.Field { +func (p pushTokenEqualsParam) field() builder.Field { return p.data } -func (p pointerEqualsParam) getQuery() builder.Query { +func (p pushTokenEqualsParam) getQuery() builder.Query { return p.query } -type PointerEqualsUniqueWhereParam interface { +type PushTokenEqualsUniqueWhereParam interface { field() builder.Field getQuery() builder.Query equals() unique() - pointerModel() + pushTokenModel() } -type pointerEqualsUniqueParam struct { +type pushTokenEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p pointerEqualsUniqueParam) pointerModel() {} +func (p pushTokenEqualsUniqueParam) pushTokenModel() {} -func (pointerEqualsUniqueParam) unique() {} -func (pointerEqualsUniqueParam) equals() {} +func (pushTokenEqualsUniqueParam) unique() {} +func (pushTokenEqualsUniqueParam) equals() {} -func (p pointerEqualsUniqueParam) field() builder.Field { +func (p pushTokenEqualsUniqueParam) field() builder.Field { return p.data } -func (p pointerEqualsUniqueParam) getQuery() builder.Query { +func (p pushTokenEqualsUniqueParam) getQuery() builder.Query { return p.query } -type PointerSetParam interface { +type PushTokenSetParam interface { field() builder.Field settable() - pointerModel() + pushTokenModel() } -type pointerSetParam struct { +type pushTokenSetParam struct { data builder.Field } -func (pointerSetParam) settable() {} +func (pushTokenSetParam) settable() {} -func (p pointerSetParam) field() builder.Field { +func (p pushTokenSetParam) field() builder.Field { return p.data } -func (p pointerSetParam) pointerModel() {} +func (p pushTokenSetParam) pushTokenModel() {} -type PointerWithPrismaChatIDEqualsSetParam interface { +type PushTokenWithPrismaUserIDEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - pointerModel() - chatIDField() + pushTokenModel() + userIDField() } -type PointerWithPrismaChatIDSetParam interface { +type PushTokenWithPrismaUserIDSetParam interface { field() builder.Field getQuery() builder.Query - pointerModel() - chatIDField() + pushTokenModel() + userIDField() } -type pointerWithPrismaChatIDSetParam struct { +type pushTokenWithPrismaUserIDSetParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaChatIDSetParam) field() builder.Field { +func (p pushTokenWithPrismaUserIDSetParam) field() builder.Field { return p.data } -func (p pointerWithPrismaChatIDSetParam) getQuery() builder.Query { +func (p pushTokenWithPrismaUserIDSetParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaChatIDSetParam) pointerModel() {} +func (p pushTokenWithPrismaUserIDSetParam) pushTokenModel() {} -func (p pointerWithPrismaChatIDSetParam) chatIDField() {} +func (p pushTokenWithPrismaUserIDSetParam) userIDField() {} -type PointerWithPrismaChatIDWhereParam interface { +type PushTokenWithPrismaUserIDWhereParam interface { field() builder.Field getQuery() builder.Query - pointerModel() - chatIDField() + pushTokenModel() + userIDField() } -type pointerWithPrismaChatIDEqualsParam struct { +type pushTokenWithPrismaUserIDEqualsParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaChatIDEqualsParam) field() builder.Field { +func (p pushTokenWithPrismaUserIDEqualsParam) field() builder.Field { return p.data } -func (p pointerWithPrismaChatIDEqualsParam) getQuery() builder.Query { +func (p pushTokenWithPrismaUserIDEqualsParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaChatIDEqualsParam) pointerModel() {} +func (p pushTokenWithPrismaUserIDEqualsParam) pushTokenModel() {} -func (p pointerWithPrismaChatIDEqualsParam) chatIDField() {} +func (p pushTokenWithPrismaUserIDEqualsParam) userIDField() {} -func (pointerWithPrismaChatIDSetParam) settable() {} -func (pointerWithPrismaChatIDEqualsParam) equals() {} +func (pushTokenWithPrismaUserIDSetParam) settable() {} +func (pushTokenWithPrismaUserIDEqualsParam) equals() {} -type pointerWithPrismaChatIDEqualsUniqueParam struct { +type pushTokenWithPrismaUserIDEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaChatIDEqualsUniqueParam) field() builder.Field { +func (p pushTokenWithPrismaUserIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p pointerWithPrismaChatIDEqualsUniqueParam) getQuery() builder.Query { +func (p pushTokenWithPrismaUserIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaChatIDEqualsUniqueParam) pointerModel() {} -func (p pointerWithPrismaChatIDEqualsUniqueParam) chatIDField() {} +func (p pushTokenWithPrismaUserIDEqualsUniqueParam) pushTokenModel() {} +func (p pushTokenWithPrismaUserIDEqualsUniqueParam) userIDField() {} -func (pointerWithPrismaChatIDEqualsUniqueParam) unique() {} -func (pointerWithPrismaChatIDEqualsUniqueParam) equals() {} +func (pushTokenWithPrismaUserIDEqualsUniqueParam) unique() {} +func (pushTokenWithPrismaUserIDEqualsUniqueParam) equals() {} -type PointerWithPrismaUserIDEqualsSetParam interface { +type PushTokenWithPrismaAppInstallIDEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - pointerModel() - userIDField() + pushTokenModel() + appInstallIDField() } -type PointerWithPrismaUserIDSetParam interface { +type PushTokenWithPrismaAppInstallIDSetParam interface { field() builder.Field getQuery() builder.Query - pointerModel() - userIDField() + pushTokenModel() + appInstallIDField() } -type pointerWithPrismaUserIDSetParam struct { +type pushTokenWithPrismaAppInstallIDSetParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaUserIDSetParam) field() builder.Field { +func (p pushTokenWithPrismaAppInstallIDSetParam) field() builder.Field { return p.data } -func (p pointerWithPrismaUserIDSetParam) getQuery() builder.Query { +func (p pushTokenWithPrismaAppInstallIDSetParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaUserIDSetParam) pointerModel() {} +func (p pushTokenWithPrismaAppInstallIDSetParam) pushTokenModel() {} -func (p pointerWithPrismaUserIDSetParam) userIDField() {} +func (p pushTokenWithPrismaAppInstallIDSetParam) appInstallIDField() {} -type PointerWithPrismaUserIDWhereParam interface { +type PushTokenWithPrismaAppInstallIDWhereParam interface { field() builder.Field getQuery() builder.Query - pointerModel() - userIDField() + pushTokenModel() + appInstallIDField() } -type pointerWithPrismaUserIDEqualsParam struct { +type pushTokenWithPrismaAppInstallIDEqualsParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaUserIDEqualsParam) field() builder.Field { +func (p pushTokenWithPrismaAppInstallIDEqualsParam) field() builder.Field { return p.data } -func (p pointerWithPrismaUserIDEqualsParam) getQuery() builder.Query { +func (p pushTokenWithPrismaAppInstallIDEqualsParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaUserIDEqualsParam) pointerModel() {} +func (p pushTokenWithPrismaAppInstallIDEqualsParam) pushTokenModel() {} -func (p pointerWithPrismaUserIDEqualsParam) userIDField() {} +func (p pushTokenWithPrismaAppInstallIDEqualsParam) appInstallIDField() {} -func (pointerWithPrismaUserIDSetParam) settable() {} -func (pointerWithPrismaUserIDEqualsParam) equals() {} +func (pushTokenWithPrismaAppInstallIDSetParam) settable() {} +func (pushTokenWithPrismaAppInstallIDEqualsParam) equals() {} -type pointerWithPrismaUserIDEqualsUniqueParam struct { +type pushTokenWithPrismaAppInstallIDEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaUserIDEqualsUniqueParam) field() builder.Field { +func (p pushTokenWithPrismaAppInstallIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p pointerWithPrismaUserIDEqualsUniqueParam) getQuery() builder.Query { +func (p pushTokenWithPrismaAppInstallIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaUserIDEqualsUniqueParam) pointerModel() {} -func (p pointerWithPrismaUserIDEqualsUniqueParam) userIDField() {} +func (p pushTokenWithPrismaAppInstallIDEqualsUniqueParam) pushTokenModel() {} +func (p pushTokenWithPrismaAppInstallIDEqualsUniqueParam) appInstallIDField() {} -func (pointerWithPrismaUserIDEqualsUniqueParam) unique() {} -func (pointerWithPrismaUserIDEqualsUniqueParam) equals() {} +func (pushTokenWithPrismaAppInstallIDEqualsUniqueParam) unique() {} +func (pushTokenWithPrismaAppInstallIDEqualsUniqueParam) equals() {} -type PointerWithPrismaTypeEqualsSetParam interface { +type PushTokenWithPrismaTokenEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - pointerModel() - typeField() + pushTokenModel() + tokenField() } -type PointerWithPrismaTypeSetParam interface { +type PushTokenWithPrismaTokenSetParam interface { field() builder.Field getQuery() builder.Query - pointerModel() - typeField() + pushTokenModel() + tokenField() } -type pointerWithPrismaTypeSetParam struct { +type pushTokenWithPrismaTokenSetParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaTypeSetParam) field() builder.Field { +func (p pushTokenWithPrismaTokenSetParam) field() builder.Field { return p.data } -func (p pointerWithPrismaTypeSetParam) getQuery() builder.Query { +func (p pushTokenWithPrismaTokenSetParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaTypeSetParam) pointerModel() {} +func (p pushTokenWithPrismaTokenSetParam) pushTokenModel() {} -func (p pointerWithPrismaTypeSetParam) typeField() {} +func (p pushTokenWithPrismaTokenSetParam) tokenField() {} -type PointerWithPrismaTypeWhereParam interface { +type PushTokenWithPrismaTokenWhereParam interface { field() builder.Field getQuery() builder.Query - pointerModel() - typeField() + pushTokenModel() + tokenField() } -type pointerWithPrismaTypeEqualsParam struct { +type pushTokenWithPrismaTokenEqualsParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaTypeEqualsParam) field() builder.Field { +func (p pushTokenWithPrismaTokenEqualsParam) field() builder.Field { return p.data } -func (p pointerWithPrismaTypeEqualsParam) getQuery() builder.Query { +func (p pushTokenWithPrismaTokenEqualsParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaTypeEqualsParam) pointerModel() {} +func (p pushTokenWithPrismaTokenEqualsParam) pushTokenModel() {} -func (p pointerWithPrismaTypeEqualsParam) typeField() {} +func (p pushTokenWithPrismaTokenEqualsParam) tokenField() {} -func (pointerWithPrismaTypeSetParam) settable() {} -func (pointerWithPrismaTypeEqualsParam) equals() {} +func (pushTokenWithPrismaTokenSetParam) settable() {} +func (pushTokenWithPrismaTokenEqualsParam) equals() {} -type pointerWithPrismaTypeEqualsUniqueParam struct { +type pushTokenWithPrismaTokenEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaTypeEqualsUniqueParam) field() builder.Field { +func (p pushTokenWithPrismaTokenEqualsUniqueParam) field() builder.Field { return p.data } -func (p pointerWithPrismaTypeEqualsUniqueParam) getQuery() builder.Query { +func (p pushTokenWithPrismaTokenEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaTypeEqualsUniqueParam) pointerModel() {} -func (p pointerWithPrismaTypeEqualsUniqueParam) typeField() {} +func (p pushTokenWithPrismaTokenEqualsUniqueParam) pushTokenModel() {} +func (p pushTokenWithPrismaTokenEqualsUniqueParam) tokenField() {} -func (pointerWithPrismaTypeEqualsUniqueParam) unique() {} -func (pointerWithPrismaTypeEqualsUniqueParam) equals() {} +func (pushTokenWithPrismaTokenEqualsUniqueParam) unique() {} +func (pushTokenWithPrismaTokenEqualsUniqueParam) equals() {} -type PointerWithPrismaValueEqualsSetParam interface { +type PushTokenWithPrismaTypeEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - pointerModel() - valueField() + pushTokenModel() + typeField() } -type PointerWithPrismaValueSetParam interface { +type PushTokenWithPrismaTypeSetParam interface { field() builder.Field getQuery() builder.Query - pointerModel() - valueField() + pushTokenModel() + typeField() } -type pointerWithPrismaValueSetParam struct { +type pushTokenWithPrismaTypeSetParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaValueSetParam) field() builder.Field { +func (p pushTokenWithPrismaTypeSetParam) field() builder.Field { return p.data } -func (p pointerWithPrismaValueSetParam) getQuery() builder.Query { +func (p pushTokenWithPrismaTypeSetParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaValueSetParam) pointerModel() {} +func (p pushTokenWithPrismaTypeSetParam) pushTokenModel() {} -func (p pointerWithPrismaValueSetParam) valueField() {} +func (p pushTokenWithPrismaTypeSetParam) typeField() {} -type PointerWithPrismaValueWhereParam interface { +type PushTokenWithPrismaTypeWhereParam interface { field() builder.Field getQuery() builder.Query - pointerModel() - valueField() + pushTokenModel() + typeField() } -type pointerWithPrismaValueEqualsParam struct { +type pushTokenWithPrismaTypeEqualsParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaValueEqualsParam) field() builder.Field { +func (p pushTokenWithPrismaTypeEqualsParam) field() builder.Field { return p.data } -func (p pointerWithPrismaValueEqualsParam) getQuery() builder.Query { +func (p pushTokenWithPrismaTypeEqualsParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaValueEqualsParam) pointerModel() {} +func (p pushTokenWithPrismaTypeEqualsParam) pushTokenModel() {} -func (p pointerWithPrismaValueEqualsParam) valueField() {} +func (p pushTokenWithPrismaTypeEqualsParam) typeField() {} -func (pointerWithPrismaValueSetParam) settable() {} -func (pointerWithPrismaValueEqualsParam) equals() {} +func (pushTokenWithPrismaTypeSetParam) settable() {} +func (pushTokenWithPrismaTypeEqualsParam) equals() {} -type pointerWithPrismaValueEqualsUniqueParam struct { +type pushTokenWithPrismaTypeEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaValueEqualsUniqueParam) field() builder.Field { +func (p pushTokenWithPrismaTypeEqualsUniqueParam) field() builder.Field { return p.data } -func (p pointerWithPrismaValueEqualsUniqueParam) getQuery() builder.Query { +func (p pushTokenWithPrismaTypeEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaValueEqualsUniqueParam) pointerModel() {} -func (p pointerWithPrismaValueEqualsUniqueParam) valueField() {} +func (p pushTokenWithPrismaTypeEqualsUniqueParam) pushTokenModel() {} +func (p pushTokenWithPrismaTypeEqualsUniqueParam) typeField() {} -func (pointerWithPrismaValueEqualsUniqueParam) unique() {} -func (pointerWithPrismaValueEqualsUniqueParam) equals() {} +func (pushTokenWithPrismaTypeEqualsUniqueParam) unique() {} +func (pushTokenWithPrismaTypeEqualsUniqueParam) equals() {} -type PointerWithPrismaCreatedAtEqualsSetParam interface { +type PushTokenWithPrismaCreatedAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - pointerModel() + pushTokenModel() createdAtField() } -type PointerWithPrismaCreatedAtSetParam interface { +type PushTokenWithPrismaCreatedAtSetParam interface { field() builder.Field getQuery() builder.Query - pointerModel() + pushTokenModel() createdAtField() } -type pointerWithPrismaCreatedAtSetParam struct { +type pushTokenWithPrismaCreatedAtSetParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaCreatedAtSetParam) field() builder.Field { +func (p pushTokenWithPrismaCreatedAtSetParam) field() builder.Field { return p.data } -func (p pointerWithPrismaCreatedAtSetParam) getQuery() builder.Query { +func (p pushTokenWithPrismaCreatedAtSetParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaCreatedAtSetParam) pointerModel() {} +func (p pushTokenWithPrismaCreatedAtSetParam) pushTokenModel() {} -func (p pointerWithPrismaCreatedAtSetParam) createdAtField() {} +func (p pushTokenWithPrismaCreatedAtSetParam) createdAtField() {} -type PointerWithPrismaCreatedAtWhereParam interface { +type PushTokenWithPrismaCreatedAtWhereParam interface { field() builder.Field getQuery() builder.Query - pointerModel() + pushTokenModel() createdAtField() } -type pointerWithPrismaCreatedAtEqualsParam struct { +type pushTokenWithPrismaCreatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaCreatedAtEqualsParam) field() builder.Field { +func (p pushTokenWithPrismaCreatedAtEqualsParam) field() builder.Field { return p.data } -func (p pointerWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { +func (p pushTokenWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaCreatedAtEqualsParam) pointerModel() {} +func (p pushTokenWithPrismaCreatedAtEqualsParam) pushTokenModel() {} -func (p pointerWithPrismaCreatedAtEqualsParam) createdAtField() {} +func (p pushTokenWithPrismaCreatedAtEqualsParam) createdAtField() {} -func (pointerWithPrismaCreatedAtSetParam) settable() {} -func (pointerWithPrismaCreatedAtEqualsParam) equals() {} +func (pushTokenWithPrismaCreatedAtSetParam) settable() {} +func (pushTokenWithPrismaCreatedAtEqualsParam) equals() {} -type pointerWithPrismaCreatedAtEqualsUniqueParam struct { +type pushTokenWithPrismaCreatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { +func (p pushTokenWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p pointerWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p pushTokenWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaCreatedAtEqualsUniqueParam) pointerModel() {} -func (p pointerWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} +func (p pushTokenWithPrismaCreatedAtEqualsUniqueParam) pushTokenModel() {} +func (p pushTokenWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} -func (pointerWithPrismaCreatedAtEqualsUniqueParam) unique() {} -func (pointerWithPrismaCreatedAtEqualsUniqueParam) equals() {} +func (pushTokenWithPrismaCreatedAtEqualsUniqueParam) unique() {} +func (pushTokenWithPrismaCreatedAtEqualsUniqueParam) equals() {} -type PointerWithPrismaUpdatedAtEqualsSetParam interface { +type PushTokenWithPrismaUpdatedAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - pointerModel() + pushTokenModel() updatedAtField() } -type PointerWithPrismaUpdatedAtSetParam interface { +type PushTokenWithPrismaUpdatedAtSetParam interface { field() builder.Field getQuery() builder.Query - pointerModel() + pushTokenModel() updatedAtField() } -type pointerWithPrismaUpdatedAtSetParam struct { +type pushTokenWithPrismaUpdatedAtSetParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaUpdatedAtSetParam) field() builder.Field { +func (p pushTokenWithPrismaUpdatedAtSetParam) field() builder.Field { return p.data } -func (p pointerWithPrismaUpdatedAtSetParam) getQuery() builder.Query { +func (p pushTokenWithPrismaUpdatedAtSetParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaUpdatedAtSetParam) pointerModel() {} +func (p pushTokenWithPrismaUpdatedAtSetParam) pushTokenModel() {} -func (p pointerWithPrismaUpdatedAtSetParam) updatedAtField() {} +func (p pushTokenWithPrismaUpdatedAtSetParam) updatedAtField() {} -type PointerWithPrismaUpdatedAtWhereParam interface { +type PushTokenWithPrismaUpdatedAtWhereParam interface { field() builder.Field getQuery() builder.Query - pointerModel() + pushTokenModel() updatedAtField() } -type pointerWithPrismaUpdatedAtEqualsParam struct { +type pushTokenWithPrismaUpdatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaUpdatedAtEqualsParam) field() builder.Field { +func (p pushTokenWithPrismaUpdatedAtEqualsParam) field() builder.Field { return p.data } -func (p pointerWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { +func (p pushTokenWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaUpdatedAtEqualsParam) pointerModel() {} +func (p pushTokenWithPrismaUpdatedAtEqualsParam) pushTokenModel() {} -func (p pointerWithPrismaUpdatedAtEqualsParam) updatedAtField() {} +func (p pushTokenWithPrismaUpdatedAtEqualsParam) updatedAtField() {} -func (pointerWithPrismaUpdatedAtSetParam) settable() {} -func (pointerWithPrismaUpdatedAtEqualsParam) equals() {} +func (pushTokenWithPrismaUpdatedAtSetParam) settable() {} +func (pushTokenWithPrismaUpdatedAtEqualsParam) equals() {} -type pointerWithPrismaUpdatedAtEqualsUniqueParam struct { +type pushTokenWithPrismaUpdatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p pointerWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { +func (p pushTokenWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p pointerWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p pushTokenWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p pointerWithPrismaUpdatedAtEqualsUniqueParam) pointerModel() {} -func (p pointerWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} +func (p pushTokenWithPrismaUpdatedAtEqualsUniqueParam) pushTokenModel() {} +func (p pushTokenWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} -func (pointerWithPrismaUpdatedAtEqualsUniqueParam) unique() {} -func (pointerWithPrismaUpdatedAtEqualsUniqueParam) equals() {} +func (pushTokenWithPrismaUpdatedAtEqualsUniqueParam) unique() {} +func (pushTokenWithPrismaUpdatedAtEqualsUniqueParam) equals() {} -type pushTokenActions struct { +type iapActions struct { // client holds the prisma client client *PrismaClient } -var pushTokenOutput = []builder.Output{ +var iapOutput = []builder.Output{ + {Name: "receiptId"}, + {Name: "platform"}, {Name: "userId"}, - {Name: "appInstallId"}, - {Name: "token"}, - {Name: "type"}, + {Name: "product"}, + {Name: "state"}, {Name: "createdAt"}, - {Name: "updatedAt"}, } -type PushTokenRelationWith interface { +type IapRelationWith interface { getQuery() builder.Query with() - pushTokenRelation() + iapRelation() } -type PushTokenWhereParam interface { +type IapWhereParam interface { field() builder.Field getQuery() builder.Query - pushTokenModel() + iapModel() } -type pushTokenDefaultParam struct { +type iapDefaultParam struct { data builder.Field query builder.Query } -func (p pushTokenDefaultParam) field() builder.Field { +func (p iapDefaultParam) field() builder.Field { return p.data } -func (p pushTokenDefaultParam) getQuery() builder.Query { +func (p iapDefaultParam) getQuery() builder.Query { return p.query } -func (p pushTokenDefaultParam) pushTokenModel() {} +func (p iapDefaultParam) iapModel() {} -type PushTokenOrderByParam interface { +type IapOrderByParam interface { field() builder.Field getQuery() builder.Query - pushTokenModel() + iapModel() } -type pushTokenOrderByParam struct { +type iapOrderByParam struct { data builder.Field query builder.Query } -func (p pushTokenOrderByParam) field() builder.Field { +func (p iapOrderByParam) field() builder.Field { return p.data } -func (p pushTokenOrderByParam) getQuery() builder.Query { +func (p iapOrderByParam) getQuery() builder.Query { return p.query } -func (p pushTokenOrderByParam) pushTokenModel() {} +func (p iapOrderByParam) iapModel() {} -type PushTokenCursorParam interface { +type IapCursorParam interface { field() builder.Field getQuery() builder.Query - pushTokenModel() + iapModel() isCursor() } -type pushTokenCursorParam struct { +type iapCursorParam struct { data builder.Field query builder.Query } -func (p pushTokenCursorParam) field() builder.Field { +func (p iapCursorParam) field() builder.Field { return p.data } -func (p pushTokenCursorParam) isCursor() {} +func (p iapCursorParam) isCursor() {} -func (p pushTokenCursorParam) getQuery() builder.Query { +func (p iapCursorParam) getQuery() builder.Query { return p.query } -func (p pushTokenCursorParam) pushTokenModel() {} +func (p iapCursorParam) iapModel() {} -type PushTokenParamUnique interface { +type IapParamUnique interface { field() builder.Field getQuery() builder.Query unique() - pushTokenModel() + iapModel() } -type pushTokenParamUnique struct { +type iapParamUnique struct { data builder.Field query builder.Query } -func (p pushTokenParamUnique) pushTokenModel() {} +func (p iapParamUnique) iapModel() {} -func (pushTokenParamUnique) unique() {} +func (iapParamUnique) unique() {} -func (p pushTokenParamUnique) field() builder.Field { +func (p iapParamUnique) field() builder.Field { return p.data } -func (p pushTokenParamUnique) getQuery() builder.Query { +func (p iapParamUnique) getQuery() builder.Query { return p.query } -type PushTokenEqualsWhereParam interface { +type IapEqualsWhereParam interface { field() builder.Field getQuery() builder.Query equals() - pushTokenModel() + iapModel() } -type pushTokenEqualsParam struct { +type iapEqualsParam struct { data builder.Field query builder.Query } -func (p pushTokenEqualsParam) pushTokenModel() {} +func (p iapEqualsParam) iapModel() {} -func (pushTokenEqualsParam) equals() {} +func (iapEqualsParam) equals() {} -func (p pushTokenEqualsParam) field() builder.Field { +func (p iapEqualsParam) field() builder.Field { return p.data } -func (p pushTokenEqualsParam) getQuery() builder.Query { +func (p iapEqualsParam) getQuery() builder.Query { return p.query } -type PushTokenEqualsUniqueWhereParam interface { +type IapEqualsUniqueWhereParam interface { field() builder.Field getQuery() builder.Query equals() unique() - pushTokenModel() + iapModel() } -type pushTokenEqualsUniqueParam struct { +type iapEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p pushTokenEqualsUniqueParam) pushTokenModel() {} +func (p iapEqualsUniqueParam) iapModel() {} -func (pushTokenEqualsUniqueParam) unique() {} -func (pushTokenEqualsUniqueParam) equals() {} +func (iapEqualsUniqueParam) unique() {} +func (iapEqualsUniqueParam) equals() {} -func (p pushTokenEqualsUniqueParam) field() builder.Field { +func (p iapEqualsUniqueParam) field() builder.Field { return p.data } -func (p pushTokenEqualsUniqueParam) getQuery() builder.Query { +func (p iapEqualsUniqueParam) getQuery() builder.Query { return p.query } -type PushTokenSetParam interface { +type IapSetParam interface { field() builder.Field settable() - pushTokenModel() + iapModel() } -type pushTokenSetParam struct { +type iapSetParam struct { data builder.Field } -func (pushTokenSetParam) settable() {} +func (iapSetParam) settable() {} -func (p pushTokenSetParam) field() builder.Field { +func (p iapSetParam) field() builder.Field { return p.data } -func (p pushTokenSetParam) pushTokenModel() {} +func (p iapSetParam) iapModel() {} + +type IapWithPrismaReceiptIDEqualsSetParam interface { + field() builder.Field + getQuery() builder.Query + equals() + iapModel() + receiptIDField() +} + +type IapWithPrismaReceiptIDSetParam interface { + field() builder.Field + getQuery() builder.Query + iapModel() + receiptIDField() +} + +type iapWithPrismaReceiptIDSetParam struct { + data builder.Field + query builder.Query +} + +func (p iapWithPrismaReceiptIDSetParam) field() builder.Field { + return p.data +} + +func (p iapWithPrismaReceiptIDSetParam) getQuery() builder.Query { + return p.query +} + +func (p iapWithPrismaReceiptIDSetParam) iapModel() {} + +func (p iapWithPrismaReceiptIDSetParam) receiptIDField() {} + +type IapWithPrismaReceiptIDWhereParam interface { + field() builder.Field + getQuery() builder.Query + iapModel() + receiptIDField() +} + +type iapWithPrismaReceiptIDEqualsParam struct { + data builder.Field + query builder.Query +} + +func (p iapWithPrismaReceiptIDEqualsParam) field() builder.Field { + return p.data +} + +func (p iapWithPrismaReceiptIDEqualsParam) getQuery() builder.Query { + return p.query +} + +func (p iapWithPrismaReceiptIDEqualsParam) iapModel() {} + +func (p iapWithPrismaReceiptIDEqualsParam) receiptIDField() {} + +func (iapWithPrismaReceiptIDSetParam) settable() {} +func (iapWithPrismaReceiptIDEqualsParam) equals() {} + +type iapWithPrismaReceiptIDEqualsUniqueParam struct { + data builder.Field + query builder.Query +} + +func (p iapWithPrismaReceiptIDEqualsUniqueParam) field() builder.Field { + return p.data +} + +func (p iapWithPrismaReceiptIDEqualsUniqueParam) getQuery() builder.Query { + return p.query +} + +func (p iapWithPrismaReceiptIDEqualsUniqueParam) iapModel() {} +func (p iapWithPrismaReceiptIDEqualsUniqueParam) receiptIDField() {} + +func (iapWithPrismaReceiptIDEqualsUniqueParam) unique() {} +func (iapWithPrismaReceiptIDEqualsUniqueParam) equals() {} + +type IapWithPrismaPlatformEqualsSetParam interface { + field() builder.Field + getQuery() builder.Query + equals() + iapModel() + platformField() +} + +type IapWithPrismaPlatformSetParam interface { + field() builder.Field + getQuery() builder.Query + iapModel() + platformField() +} + +type iapWithPrismaPlatformSetParam struct { + data builder.Field + query builder.Query +} + +func (p iapWithPrismaPlatformSetParam) field() builder.Field { + return p.data +} + +func (p iapWithPrismaPlatformSetParam) getQuery() builder.Query { + return p.query +} + +func (p iapWithPrismaPlatformSetParam) iapModel() {} + +func (p iapWithPrismaPlatformSetParam) platformField() {} + +type IapWithPrismaPlatformWhereParam interface { + field() builder.Field + getQuery() builder.Query + iapModel() + platformField() +} + +type iapWithPrismaPlatformEqualsParam struct { + data builder.Field + query builder.Query +} + +func (p iapWithPrismaPlatformEqualsParam) field() builder.Field { + return p.data +} + +func (p iapWithPrismaPlatformEqualsParam) getQuery() builder.Query { + return p.query +} + +func (p iapWithPrismaPlatformEqualsParam) iapModel() {} + +func (p iapWithPrismaPlatformEqualsParam) platformField() {} + +func (iapWithPrismaPlatformSetParam) settable() {} +func (iapWithPrismaPlatformEqualsParam) equals() {} + +type iapWithPrismaPlatformEqualsUniqueParam struct { + data builder.Field + query builder.Query +} + +func (p iapWithPrismaPlatformEqualsUniqueParam) field() builder.Field { + return p.data +} + +func (p iapWithPrismaPlatformEqualsUniqueParam) getQuery() builder.Query { + return p.query +} + +func (p iapWithPrismaPlatformEqualsUniqueParam) iapModel() {} +func (p iapWithPrismaPlatformEqualsUniqueParam) platformField() {} + +func (iapWithPrismaPlatformEqualsUniqueParam) unique() {} +func (iapWithPrismaPlatformEqualsUniqueParam) equals() {} -type PushTokenWithPrismaUserIDEqualsSetParam interface { +type IapWithPrismaUserIDEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - pushTokenModel() + iapModel() userIDField() } -type PushTokenWithPrismaUserIDSetParam interface { +type IapWithPrismaUserIDSetParam interface { field() builder.Field getQuery() builder.Query - pushTokenModel() + iapModel() userIDField() } -type pushTokenWithPrismaUserIDSetParam struct { +type iapWithPrismaUserIDSetParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaUserIDSetParam) field() builder.Field { +func (p iapWithPrismaUserIDSetParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaUserIDSetParam) getQuery() builder.Query { +func (p iapWithPrismaUserIDSetParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaUserIDSetParam) pushTokenModel() {} +func (p iapWithPrismaUserIDSetParam) iapModel() {} -func (p pushTokenWithPrismaUserIDSetParam) userIDField() {} +func (p iapWithPrismaUserIDSetParam) userIDField() {} -type PushTokenWithPrismaUserIDWhereParam interface { +type IapWithPrismaUserIDWhereParam interface { field() builder.Field getQuery() builder.Query - pushTokenModel() + iapModel() userIDField() } -type pushTokenWithPrismaUserIDEqualsParam struct { +type iapWithPrismaUserIDEqualsParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaUserIDEqualsParam) field() builder.Field { +func (p iapWithPrismaUserIDEqualsParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaUserIDEqualsParam) getQuery() builder.Query { +func (p iapWithPrismaUserIDEqualsParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaUserIDEqualsParam) pushTokenModel() {} +func (p iapWithPrismaUserIDEqualsParam) iapModel() {} -func (p pushTokenWithPrismaUserIDEqualsParam) userIDField() {} +func (p iapWithPrismaUserIDEqualsParam) userIDField() {} -func (pushTokenWithPrismaUserIDSetParam) settable() {} -func (pushTokenWithPrismaUserIDEqualsParam) equals() {} +func (iapWithPrismaUserIDSetParam) settable() {} +func (iapWithPrismaUserIDEqualsParam) equals() {} -type pushTokenWithPrismaUserIDEqualsUniqueParam struct { +type iapWithPrismaUserIDEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaUserIDEqualsUniqueParam) field() builder.Field { +func (p iapWithPrismaUserIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaUserIDEqualsUniqueParam) getQuery() builder.Query { +func (p iapWithPrismaUserIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaUserIDEqualsUniqueParam) pushTokenModel() {} -func (p pushTokenWithPrismaUserIDEqualsUniqueParam) userIDField() {} +func (p iapWithPrismaUserIDEqualsUniqueParam) iapModel() {} +func (p iapWithPrismaUserIDEqualsUniqueParam) userIDField() {} -func (pushTokenWithPrismaUserIDEqualsUniqueParam) unique() {} -func (pushTokenWithPrismaUserIDEqualsUniqueParam) equals() {} +func (iapWithPrismaUserIDEqualsUniqueParam) unique() {} +func (iapWithPrismaUserIDEqualsUniqueParam) equals() {} -type PushTokenWithPrismaAppInstallIDEqualsSetParam interface { +type IapWithPrismaProductEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - pushTokenModel() - appInstallIDField() + iapModel() + productField() } -type PushTokenWithPrismaAppInstallIDSetParam interface { +type IapWithPrismaProductSetParam interface { field() builder.Field getQuery() builder.Query - pushTokenModel() - appInstallIDField() + iapModel() + productField() } -type pushTokenWithPrismaAppInstallIDSetParam struct { +type iapWithPrismaProductSetParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaAppInstallIDSetParam) field() builder.Field { +func (p iapWithPrismaProductSetParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaAppInstallIDSetParam) getQuery() builder.Query { +func (p iapWithPrismaProductSetParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaAppInstallIDSetParam) pushTokenModel() {} +func (p iapWithPrismaProductSetParam) iapModel() {} -func (p pushTokenWithPrismaAppInstallIDSetParam) appInstallIDField() {} +func (p iapWithPrismaProductSetParam) productField() {} -type PushTokenWithPrismaAppInstallIDWhereParam interface { +type IapWithPrismaProductWhereParam interface { field() builder.Field getQuery() builder.Query - pushTokenModel() - appInstallIDField() + iapModel() + productField() } -type pushTokenWithPrismaAppInstallIDEqualsParam struct { +type iapWithPrismaProductEqualsParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaAppInstallIDEqualsParam) field() builder.Field { +func (p iapWithPrismaProductEqualsParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaAppInstallIDEqualsParam) getQuery() builder.Query { +func (p iapWithPrismaProductEqualsParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaAppInstallIDEqualsParam) pushTokenModel() {} +func (p iapWithPrismaProductEqualsParam) iapModel() {} -func (p pushTokenWithPrismaAppInstallIDEqualsParam) appInstallIDField() {} +func (p iapWithPrismaProductEqualsParam) productField() {} -func (pushTokenWithPrismaAppInstallIDSetParam) settable() {} -func (pushTokenWithPrismaAppInstallIDEqualsParam) equals() {} +func (iapWithPrismaProductSetParam) settable() {} +func (iapWithPrismaProductEqualsParam) equals() {} -type pushTokenWithPrismaAppInstallIDEqualsUniqueParam struct { +type iapWithPrismaProductEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaAppInstallIDEqualsUniqueParam) field() builder.Field { +func (p iapWithPrismaProductEqualsUniqueParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaAppInstallIDEqualsUniqueParam) getQuery() builder.Query { +func (p iapWithPrismaProductEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaAppInstallIDEqualsUniqueParam) pushTokenModel() {} -func (p pushTokenWithPrismaAppInstallIDEqualsUniqueParam) appInstallIDField() {} +func (p iapWithPrismaProductEqualsUniqueParam) iapModel() {} +func (p iapWithPrismaProductEqualsUniqueParam) productField() {} -func (pushTokenWithPrismaAppInstallIDEqualsUniqueParam) unique() {} -func (pushTokenWithPrismaAppInstallIDEqualsUniqueParam) equals() {} +func (iapWithPrismaProductEqualsUniqueParam) unique() {} +func (iapWithPrismaProductEqualsUniqueParam) equals() {} -type PushTokenWithPrismaTokenEqualsSetParam interface { +type IapWithPrismaStateEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - pushTokenModel() - tokenField() + iapModel() + stateField() } -type PushTokenWithPrismaTokenSetParam interface { +type IapWithPrismaStateSetParam interface { field() builder.Field getQuery() builder.Query - pushTokenModel() - tokenField() + iapModel() + stateField() } -type pushTokenWithPrismaTokenSetParam struct { +type iapWithPrismaStateSetParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaTokenSetParam) field() builder.Field { +func (p iapWithPrismaStateSetParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaTokenSetParam) getQuery() builder.Query { +func (p iapWithPrismaStateSetParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaTokenSetParam) pushTokenModel() {} +func (p iapWithPrismaStateSetParam) iapModel() {} -func (p pushTokenWithPrismaTokenSetParam) tokenField() {} +func (p iapWithPrismaStateSetParam) stateField() {} -type PushTokenWithPrismaTokenWhereParam interface { +type IapWithPrismaStateWhereParam interface { field() builder.Field getQuery() builder.Query - pushTokenModel() - tokenField() + iapModel() + stateField() } -type pushTokenWithPrismaTokenEqualsParam struct { +type iapWithPrismaStateEqualsParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaTokenEqualsParam) field() builder.Field { +func (p iapWithPrismaStateEqualsParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaTokenEqualsParam) getQuery() builder.Query { +func (p iapWithPrismaStateEqualsParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaTokenEqualsParam) pushTokenModel() {} +func (p iapWithPrismaStateEqualsParam) iapModel() {} -func (p pushTokenWithPrismaTokenEqualsParam) tokenField() {} +func (p iapWithPrismaStateEqualsParam) stateField() {} -func (pushTokenWithPrismaTokenSetParam) settable() {} -func (pushTokenWithPrismaTokenEqualsParam) equals() {} +func (iapWithPrismaStateSetParam) settable() {} +func (iapWithPrismaStateEqualsParam) equals() {} -type pushTokenWithPrismaTokenEqualsUniqueParam struct { +type iapWithPrismaStateEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaTokenEqualsUniqueParam) field() builder.Field { +func (p iapWithPrismaStateEqualsUniqueParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaTokenEqualsUniqueParam) getQuery() builder.Query { +func (p iapWithPrismaStateEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaTokenEqualsUniqueParam) pushTokenModel() {} -func (p pushTokenWithPrismaTokenEqualsUniqueParam) tokenField() {} +func (p iapWithPrismaStateEqualsUniqueParam) iapModel() {} +func (p iapWithPrismaStateEqualsUniqueParam) stateField() {} -func (pushTokenWithPrismaTokenEqualsUniqueParam) unique() {} -func (pushTokenWithPrismaTokenEqualsUniqueParam) equals() {} +func (iapWithPrismaStateEqualsUniqueParam) unique() {} +func (iapWithPrismaStateEqualsUniqueParam) equals() {} -type PushTokenWithPrismaTypeEqualsSetParam interface { +type IapWithPrismaCreatedAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - pushTokenModel() - typeField() + iapModel() + createdAtField() } -type PushTokenWithPrismaTypeSetParam interface { +type IapWithPrismaCreatedAtSetParam interface { field() builder.Field getQuery() builder.Query - pushTokenModel() - typeField() + iapModel() + createdAtField() } -type pushTokenWithPrismaTypeSetParam struct { +type iapWithPrismaCreatedAtSetParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaTypeSetParam) field() builder.Field { +func (p iapWithPrismaCreatedAtSetParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaTypeSetParam) getQuery() builder.Query { +func (p iapWithPrismaCreatedAtSetParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaTypeSetParam) pushTokenModel() {} +func (p iapWithPrismaCreatedAtSetParam) iapModel() {} -func (p pushTokenWithPrismaTypeSetParam) typeField() {} +func (p iapWithPrismaCreatedAtSetParam) createdAtField() {} -type PushTokenWithPrismaTypeWhereParam interface { +type IapWithPrismaCreatedAtWhereParam interface { field() builder.Field getQuery() builder.Query - pushTokenModel() - typeField() + iapModel() + createdAtField() } -type pushTokenWithPrismaTypeEqualsParam struct { +type iapWithPrismaCreatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaTypeEqualsParam) field() builder.Field { +func (p iapWithPrismaCreatedAtEqualsParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaTypeEqualsParam) getQuery() builder.Query { +func (p iapWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaTypeEqualsParam) pushTokenModel() {} +func (p iapWithPrismaCreatedAtEqualsParam) iapModel() {} -func (p pushTokenWithPrismaTypeEqualsParam) typeField() {} +func (p iapWithPrismaCreatedAtEqualsParam) createdAtField() {} -func (pushTokenWithPrismaTypeSetParam) settable() {} -func (pushTokenWithPrismaTypeEqualsParam) equals() {} +func (iapWithPrismaCreatedAtSetParam) settable() {} +func (iapWithPrismaCreatedAtEqualsParam) equals() {} -type pushTokenWithPrismaTypeEqualsUniqueParam struct { +type iapWithPrismaCreatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaTypeEqualsUniqueParam) field() builder.Field { +func (p iapWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaTypeEqualsUniqueParam) getQuery() builder.Query { +func (p iapWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaTypeEqualsUniqueParam) pushTokenModel() {} -func (p pushTokenWithPrismaTypeEqualsUniqueParam) typeField() {} +func (p iapWithPrismaCreatedAtEqualsUniqueParam) iapModel() {} +func (p iapWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} -func (pushTokenWithPrismaTypeEqualsUniqueParam) unique() {} -func (pushTokenWithPrismaTypeEqualsUniqueParam) equals() {} +func (iapWithPrismaCreatedAtEqualsUniqueParam) unique() {} +func (iapWithPrismaCreatedAtEqualsUniqueParam) equals() {} -type PushTokenWithPrismaCreatedAtEqualsSetParam interface { - field() builder.Field +type blobActions struct { + // client holds the prisma client + client *PrismaClient +} + +var blobOutput = []builder.Output{ + {Name: "id"}, + {Name: "userId"}, + {Name: "type"}, + {Name: "s3Url"}, + {Name: "size"}, + {Name: "metadata"}, + {Name: "flagged"}, + {Name: "createdAt"}, +} + +type BlobRelationWith interface { getQuery() builder.Query - equals() - pushTokenModel() - createdAtField() + with() + blobRelation() } -type PushTokenWithPrismaCreatedAtSetParam interface { +type BlobWhereParam interface { field() builder.Field getQuery() builder.Query - pushTokenModel() - createdAtField() + blobModel() } -type pushTokenWithPrismaCreatedAtSetParam struct { +type blobDefaultParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaCreatedAtSetParam) field() builder.Field { +func (p blobDefaultParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaCreatedAtSetParam) getQuery() builder.Query { +func (p blobDefaultParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaCreatedAtSetParam) pushTokenModel() {} - -func (p pushTokenWithPrismaCreatedAtSetParam) createdAtField() {} +func (p blobDefaultParam) blobModel() {} -type PushTokenWithPrismaCreatedAtWhereParam interface { +type BlobOrderByParam interface { field() builder.Field getQuery() builder.Query - pushTokenModel() - createdAtField() + blobModel() } -type pushTokenWithPrismaCreatedAtEqualsParam struct { +type blobOrderByParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaCreatedAtEqualsParam) field() builder.Field { +func (p blobOrderByParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { +func (p blobOrderByParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaCreatedAtEqualsParam) pushTokenModel() {} - -func (p pushTokenWithPrismaCreatedAtEqualsParam) createdAtField() {} +func (p blobOrderByParam) blobModel() {} -func (pushTokenWithPrismaCreatedAtSetParam) settable() {} -func (pushTokenWithPrismaCreatedAtEqualsParam) equals() {} +type BlobCursorParam interface { + field() builder.Field + getQuery() builder.Query + blobModel() + isCursor() +} -type pushTokenWithPrismaCreatedAtEqualsUniqueParam struct { +type blobCursorParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { +func (p blobCursorParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p blobCursorParam) isCursor() {} + +func (p blobCursorParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaCreatedAtEqualsUniqueParam) pushTokenModel() {} -func (p pushTokenWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} - -func (pushTokenWithPrismaCreatedAtEqualsUniqueParam) unique() {} -func (pushTokenWithPrismaCreatedAtEqualsUniqueParam) equals() {} - -type PushTokenWithPrismaUpdatedAtEqualsSetParam interface { - field() builder.Field - getQuery() builder.Query - equals() - pushTokenModel() - updatedAtField() -} +func (p blobCursorParam) blobModel() {} -type PushTokenWithPrismaUpdatedAtSetParam interface { +type BlobParamUnique interface { field() builder.Field getQuery() builder.Query - pushTokenModel() - updatedAtField() + unique() + blobModel() } -type pushTokenWithPrismaUpdatedAtSetParam struct { +type blobParamUnique struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaUpdatedAtSetParam) field() builder.Field { +func (p blobParamUnique) blobModel() {} + +func (blobParamUnique) unique() {} + +func (p blobParamUnique) field() builder.Field { return p.data } -func (p pushTokenWithPrismaUpdatedAtSetParam) getQuery() builder.Query { +func (p blobParamUnique) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaUpdatedAtSetParam) pushTokenModel() {} - -func (p pushTokenWithPrismaUpdatedAtSetParam) updatedAtField() {} - -type PushTokenWithPrismaUpdatedAtWhereParam interface { +type BlobEqualsWhereParam interface { field() builder.Field getQuery() builder.Query - pushTokenModel() - updatedAtField() + equals() + blobModel() } -type pushTokenWithPrismaUpdatedAtEqualsParam struct { +type blobEqualsParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaUpdatedAtEqualsParam) field() builder.Field { +func (p blobEqualsParam) blobModel() {} + +func (blobEqualsParam) equals() {} + +func (p blobEqualsParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaUpdatedAtEqualsParam) getQuery() builder.Query { +func (p blobEqualsParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaUpdatedAtEqualsParam) pushTokenModel() {} - -func (p pushTokenWithPrismaUpdatedAtEqualsParam) updatedAtField() {} - -func (pushTokenWithPrismaUpdatedAtSetParam) settable() {} -func (pushTokenWithPrismaUpdatedAtEqualsParam) equals() {} +type BlobEqualsUniqueWhereParam interface { + field() builder.Field + getQuery() builder.Query + equals() + unique() + blobModel() +} -type pushTokenWithPrismaUpdatedAtEqualsUniqueParam struct { +type blobEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p pushTokenWithPrismaUpdatedAtEqualsUniqueParam) field() builder.Field { +func (p blobEqualsUniqueParam) blobModel() {} + +func (blobEqualsUniqueParam) unique() {} +func (blobEqualsUniqueParam) equals() {} + +func (p blobEqualsUniqueParam) field() builder.Field { return p.data } -func (p pushTokenWithPrismaUpdatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p blobEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p pushTokenWithPrismaUpdatedAtEqualsUniqueParam) pushTokenModel() {} -func (p pushTokenWithPrismaUpdatedAtEqualsUniqueParam) updatedAtField() {} - -func (pushTokenWithPrismaUpdatedAtEqualsUniqueParam) unique() {} -func (pushTokenWithPrismaUpdatedAtEqualsUniqueParam) equals() {} +type BlobSetParam interface { + field() builder.Field + settable() + blobModel() +} -type iapActions struct { - // client holds the prisma client - client *PrismaClient +type blobSetParam struct { + data builder.Field } -var iapOutput = []builder.Output{ - {Name: "receiptId"}, - {Name: "platform"}, - {Name: "userId"}, - {Name: "product"}, - {Name: "state"}, - {Name: "createdAt"}, +func (blobSetParam) settable() {} + +func (p blobSetParam) field() builder.Field { + return p.data } -type IapRelationWith interface { +func (p blobSetParam) blobModel() {} + +type BlobWithPrismaIDEqualsSetParam interface { + field() builder.Field getQuery() builder.Query - with() - iapRelation() + equals() + blobModel() + idField() } -type IapWhereParam interface { +type BlobWithPrismaIDSetParam interface { field() builder.Field getQuery() builder.Query - iapModel() + blobModel() + idField() } -type iapDefaultParam struct { +type blobWithPrismaIDSetParam struct { data builder.Field query builder.Query } -func (p iapDefaultParam) field() builder.Field { +func (p blobWithPrismaIDSetParam) field() builder.Field { return p.data } -func (p iapDefaultParam) getQuery() builder.Query { +func (p blobWithPrismaIDSetParam) getQuery() builder.Query { return p.query } -func (p iapDefaultParam) iapModel() {} +func (p blobWithPrismaIDSetParam) blobModel() {} -type IapOrderByParam interface { +func (p blobWithPrismaIDSetParam) idField() {} + +type BlobWithPrismaIDWhereParam interface { field() builder.Field getQuery() builder.Query - iapModel() + blobModel() + idField() } -type iapOrderByParam struct { +type blobWithPrismaIDEqualsParam struct { data builder.Field query builder.Query } -func (p iapOrderByParam) field() builder.Field { +func (p blobWithPrismaIDEqualsParam) field() builder.Field { return p.data } -func (p iapOrderByParam) getQuery() builder.Query { +func (p blobWithPrismaIDEqualsParam) getQuery() builder.Query { return p.query } -func (p iapOrderByParam) iapModel() {} +func (p blobWithPrismaIDEqualsParam) blobModel() {} -type IapCursorParam interface { - field() builder.Field - getQuery() builder.Query - iapModel() - isCursor() -} +func (p blobWithPrismaIDEqualsParam) idField() {} -type iapCursorParam struct { +func (blobWithPrismaIDSetParam) settable() {} +func (blobWithPrismaIDEqualsParam) equals() {} + +type blobWithPrismaIDEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p iapCursorParam) field() builder.Field { +func (p blobWithPrismaIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p iapCursorParam) isCursor() {} - -func (p iapCursorParam) getQuery() builder.Query { +func (p blobWithPrismaIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p iapCursorParam) iapModel() {} +func (p blobWithPrismaIDEqualsUniqueParam) blobModel() {} +func (p blobWithPrismaIDEqualsUniqueParam) idField() {} -type IapParamUnique interface { +func (blobWithPrismaIDEqualsUniqueParam) unique() {} +func (blobWithPrismaIDEqualsUniqueParam) equals() {} + +type BlobWithPrismaUserIDEqualsSetParam interface { field() builder.Field getQuery() builder.Query - unique() - iapModel() + equals() + blobModel() + userIDField() } -type iapParamUnique struct { +type BlobWithPrismaUserIDSetParam interface { + field() builder.Field + getQuery() builder.Query + blobModel() + userIDField() +} + +type blobWithPrismaUserIDSetParam struct { data builder.Field query builder.Query } -func (p iapParamUnique) iapModel() {} - -func (iapParamUnique) unique() {} - -func (p iapParamUnique) field() builder.Field { +func (p blobWithPrismaUserIDSetParam) field() builder.Field { return p.data } -func (p iapParamUnique) getQuery() builder.Query { +func (p blobWithPrismaUserIDSetParam) getQuery() builder.Query { return p.query } -type IapEqualsWhereParam interface { +func (p blobWithPrismaUserIDSetParam) blobModel() {} + +func (p blobWithPrismaUserIDSetParam) userIDField() {} + +type BlobWithPrismaUserIDWhereParam interface { field() builder.Field getQuery() builder.Query - equals() - iapModel() + blobModel() + userIDField() } -type iapEqualsParam struct { +type blobWithPrismaUserIDEqualsParam struct { data builder.Field query builder.Query } -func (p iapEqualsParam) iapModel() {} - -func (iapEqualsParam) equals() {} - -func (p iapEqualsParam) field() builder.Field { +func (p blobWithPrismaUserIDEqualsParam) field() builder.Field { return p.data } -func (p iapEqualsParam) getQuery() builder.Query { +func (p blobWithPrismaUserIDEqualsParam) getQuery() builder.Query { return p.query } -type IapEqualsUniqueWhereParam interface { - field() builder.Field - getQuery() builder.Query - equals() - unique() - iapModel() -} +func (p blobWithPrismaUserIDEqualsParam) blobModel() {} -type iapEqualsUniqueParam struct { +func (p blobWithPrismaUserIDEqualsParam) userIDField() {} + +func (blobWithPrismaUserIDSetParam) settable() {} +func (blobWithPrismaUserIDEqualsParam) equals() {} + +type blobWithPrismaUserIDEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p iapEqualsUniqueParam) iapModel() {} - -func (iapEqualsUniqueParam) unique() {} -func (iapEqualsUniqueParam) equals() {} - -func (p iapEqualsUniqueParam) field() builder.Field { +func (p blobWithPrismaUserIDEqualsUniqueParam) field() builder.Field { return p.data } -func (p iapEqualsUniqueParam) getQuery() builder.Query { +func (p blobWithPrismaUserIDEqualsUniqueParam) getQuery() builder.Query { return p.query } -type IapSetParam interface { - field() builder.Field - settable() - iapModel() -} - -type iapSetParam struct { - data builder.Field -} - -func (iapSetParam) settable() {} - -func (p iapSetParam) field() builder.Field { - return p.data -} +func (p blobWithPrismaUserIDEqualsUniqueParam) blobModel() {} +func (p blobWithPrismaUserIDEqualsUniqueParam) userIDField() {} -func (p iapSetParam) iapModel() {} +func (blobWithPrismaUserIDEqualsUniqueParam) unique() {} +func (blobWithPrismaUserIDEqualsUniqueParam) equals() {} -type IapWithPrismaReceiptIDEqualsSetParam interface { +type BlobWithPrismaTypeEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - iapModel() - receiptIDField() + blobModel() + typeField() } -type IapWithPrismaReceiptIDSetParam interface { +type BlobWithPrismaTypeSetParam interface { field() builder.Field getQuery() builder.Query - iapModel() - receiptIDField() + blobModel() + typeField() } -type iapWithPrismaReceiptIDSetParam struct { +type blobWithPrismaTypeSetParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaReceiptIDSetParam) field() builder.Field { +func (p blobWithPrismaTypeSetParam) field() builder.Field { return p.data } -func (p iapWithPrismaReceiptIDSetParam) getQuery() builder.Query { +func (p blobWithPrismaTypeSetParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaReceiptIDSetParam) iapModel() {} +func (p blobWithPrismaTypeSetParam) blobModel() {} -func (p iapWithPrismaReceiptIDSetParam) receiptIDField() {} +func (p blobWithPrismaTypeSetParam) typeField() {} -type IapWithPrismaReceiptIDWhereParam interface { +type BlobWithPrismaTypeWhereParam interface { field() builder.Field getQuery() builder.Query - iapModel() - receiptIDField() + blobModel() + typeField() } -type iapWithPrismaReceiptIDEqualsParam struct { +type blobWithPrismaTypeEqualsParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaReceiptIDEqualsParam) field() builder.Field { +func (p blobWithPrismaTypeEqualsParam) field() builder.Field { return p.data } -func (p iapWithPrismaReceiptIDEqualsParam) getQuery() builder.Query { +func (p blobWithPrismaTypeEqualsParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaReceiptIDEqualsParam) iapModel() {} +func (p blobWithPrismaTypeEqualsParam) blobModel() {} -func (p iapWithPrismaReceiptIDEqualsParam) receiptIDField() {} +func (p blobWithPrismaTypeEqualsParam) typeField() {} -func (iapWithPrismaReceiptIDSetParam) settable() {} -func (iapWithPrismaReceiptIDEqualsParam) equals() {} +func (blobWithPrismaTypeSetParam) settable() {} +func (blobWithPrismaTypeEqualsParam) equals() {} -type iapWithPrismaReceiptIDEqualsUniqueParam struct { +type blobWithPrismaTypeEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaReceiptIDEqualsUniqueParam) field() builder.Field { +func (p blobWithPrismaTypeEqualsUniqueParam) field() builder.Field { return p.data } -func (p iapWithPrismaReceiptIDEqualsUniqueParam) getQuery() builder.Query { +func (p blobWithPrismaTypeEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaReceiptIDEqualsUniqueParam) iapModel() {} -func (p iapWithPrismaReceiptIDEqualsUniqueParam) receiptIDField() {} +func (p blobWithPrismaTypeEqualsUniqueParam) blobModel() {} +func (p blobWithPrismaTypeEqualsUniqueParam) typeField() {} -func (iapWithPrismaReceiptIDEqualsUniqueParam) unique() {} -func (iapWithPrismaReceiptIDEqualsUniqueParam) equals() {} +func (blobWithPrismaTypeEqualsUniqueParam) unique() {} +func (blobWithPrismaTypeEqualsUniqueParam) equals() {} -type IapWithPrismaPlatformEqualsSetParam interface { +type BlobWithPrismaS3URLEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - iapModel() - platformField() + blobModel() + s3URLField() } -type IapWithPrismaPlatformSetParam interface { +type BlobWithPrismaS3URLSetParam interface { field() builder.Field getQuery() builder.Query - iapModel() - platformField() + blobModel() + s3URLField() } -type iapWithPrismaPlatformSetParam struct { +type blobWithPrismaS3URLSetParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaPlatformSetParam) field() builder.Field { +func (p blobWithPrismaS3URLSetParam) field() builder.Field { return p.data } -func (p iapWithPrismaPlatformSetParam) getQuery() builder.Query { +func (p blobWithPrismaS3URLSetParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaPlatformSetParam) iapModel() {} +func (p blobWithPrismaS3URLSetParam) blobModel() {} -func (p iapWithPrismaPlatformSetParam) platformField() {} +func (p blobWithPrismaS3URLSetParam) s3URLField() {} -type IapWithPrismaPlatformWhereParam interface { +type BlobWithPrismaS3URLWhereParam interface { field() builder.Field getQuery() builder.Query - iapModel() - platformField() + blobModel() + s3URLField() } -type iapWithPrismaPlatformEqualsParam struct { +type blobWithPrismaS3URLEqualsParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaPlatformEqualsParam) field() builder.Field { +func (p blobWithPrismaS3URLEqualsParam) field() builder.Field { return p.data } -func (p iapWithPrismaPlatformEqualsParam) getQuery() builder.Query { +func (p blobWithPrismaS3URLEqualsParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaPlatformEqualsParam) iapModel() {} +func (p blobWithPrismaS3URLEqualsParam) blobModel() {} -func (p iapWithPrismaPlatformEqualsParam) platformField() {} +func (p blobWithPrismaS3URLEqualsParam) s3URLField() {} -func (iapWithPrismaPlatformSetParam) settable() {} -func (iapWithPrismaPlatformEqualsParam) equals() {} +func (blobWithPrismaS3URLSetParam) settable() {} +func (blobWithPrismaS3URLEqualsParam) equals() {} -type iapWithPrismaPlatformEqualsUniqueParam struct { +type blobWithPrismaS3URLEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaPlatformEqualsUniqueParam) field() builder.Field { +func (p blobWithPrismaS3URLEqualsUniqueParam) field() builder.Field { return p.data } -func (p iapWithPrismaPlatformEqualsUniqueParam) getQuery() builder.Query { +func (p blobWithPrismaS3URLEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaPlatformEqualsUniqueParam) iapModel() {} -func (p iapWithPrismaPlatformEqualsUniqueParam) platformField() {} +func (p blobWithPrismaS3URLEqualsUniqueParam) blobModel() {} +func (p blobWithPrismaS3URLEqualsUniqueParam) s3URLField() {} -func (iapWithPrismaPlatformEqualsUniqueParam) unique() {} -func (iapWithPrismaPlatformEqualsUniqueParam) equals() {} +func (blobWithPrismaS3URLEqualsUniqueParam) unique() {} +func (blobWithPrismaS3URLEqualsUniqueParam) equals() {} -type IapWithPrismaUserIDEqualsSetParam interface { +type BlobWithPrismaSizeEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - iapModel() - userIDField() + blobModel() + sizeField() } -type IapWithPrismaUserIDSetParam interface { +type BlobWithPrismaSizeSetParam interface { field() builder.Field getQuery() builder.Query - iapModel() - userIDField() + blobModel() + sizeField() } -type iapWithPrismaUserIDSetParam struct { +type blobWithPrismaSizeSetParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaUserIDSetParam) field() builder.Field { +func (p blobWithPrismaSizeSetParam) field() builder.Field { return p.data } -func (p iapWithPrismaUserIDSetParam) getQuery() builder.Query { +func (p blobWithPrismaSizeSetParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaUserIDSetParam) iapModel() {} +func (p blobWithPrismaSizeSetParam) blobModel() {} -func (p iapWithPrismaUserIDSetParam) userIDField() {} +func (p blobWithPrismaSizeSetParam) sizeField() {} -type IapWithPrismaUserIDWhereParam interface { +type BlobWithPrismaSizeWhereParam interface { field() builder.Field getQuery() builder.Query - iapModel() - userIDField() + blobModel() + sizeField() } -type iapWithPrismaUserIDEqualsParam struct { +type blobWithPrismaSizeEqualsParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaUserIDEqualsParam) field() builder.Field { +func (p blobWithPrismaSizeEqualsParam) field() builder.Field { return p.data } -func (p iapWithPrismaUserIDEqualsParam) getQuery() builder.Query { +func (p blobWithPrismaSizeEqualsParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaUserIDEqualsParam) iapModel() {} +func (p blobWithPrismaSizeEqualsParam) blobModel() {} -func (p iapWithPrismaUserIDEqualsParam) userIDField() {} +func (p blobWithPrismaSizeEqualsParam) sizeField() {} -func (iapWithPrismaUserIDSetParam) settable() {} -func (iapWithPrismaUserIDEqualsParam) equals() {} +func (blobWithPrismaSizeSetParam) settable() {} +func (blobWithPrismaSizeEqualsParam) equals() {} -type iapWithPrismaUserIDEqualsUniqueParam struct { +type blobWithPrismaSizeEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaUserIDEqualsUniqueParam) field() builder.Field { +func (p blobWithPrismaSizeEqualsUniqueParam) field() builder.Field { return p.data } -func (p iapWithPrismaUserIDEqualsUniqueParam) getQuery() builder.Query { +func (p blobWithPrismaSizeEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaUserIDEqualsUniqueParam) iapModel() {} -func (p iapWithPrismaUserIDEqualsUniqueParam) userIDField() {} +func (p blobWithPrismaSizeEqualsUniqueParam) blobModel() {} +func (p blobWithPrismaSizeEqualsUniqueParam) sizeField() {} -func (iapWithPrismaUserIDEqualsUniqueParam) unique() {} -func (iapWithPrismaUserIDEqualsUniqueParam) equals() {} +func (blobWithPrismaSizeEqualsUniqueParam) unique() {} +func (blobWithPrismaSizeEqualsUniqueParam) equals() {} -type IapWithPrismaProductEqualsSetParam interface { +type BlobWithPrismaMetadataEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - iapModel() - productField() + blobModel() + metadataField() } -type IapWithPrismaProductSetParam interface { +type BlobWithPrismaMetadataSetParam interface { field() builder.Field getQuery() builder.Query - iapModel() - productField() + blobModel() + metadataField() } -type iapWithPrismaProductSetParam struct { +type blobWithPrismaMetadataSetParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaProductSetParam) field() builder.Field { +func (p blobWithPrismaMetadataSetParam) field() builder.Field { return p.data } -func (p iapWithPrismaProductSetParam) getQuery() builder.Query { +func (p blobWithPrismaMetadataSetParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaProductSetParam) iapModel() {} +func (p blobWithPrismaMetadataSetParam) blobModel() {} -func (p iapWithPrismaProductSetParam) productField() {} +func (p blobWithPrismaMetadataSetParam) metadataField() {} -type IapWithPrismaProductWhereParam interface { +type BlobWithPrismaMetadataWhereParam interface { field() builder.Field getQuery() builder.Query - iapModel() - productField() + blobModel() + metadataField() } -type iapWithPrismaProductEqualsParam struct { +type blobWithPrismaMetadataEqualsParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaProductEqualsParam) field() builder.Field { +func (p blobWithPrismaMetadataEqualsParam) field() builder.Field { return p.data } -func (p iapWithPrismaProductEqualsParam) getQuery() builder.Query { +func (p blobWithPrismaMetadataEqualsParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaProductEqualsParam) iapModel() {} +func (p blobWithPrismaMetadataEqualsParam) blobModel() {} -func (p iapWithPrismaProductEqualsParam) productField() {} +func (p blobWithPrismaMetadataEqualsParam) metadataField() {} -func (iapWithPrismaProductSetParam) settable() {} -func (iapWithPrismaProductEqualsParam) equals() {} +func (blobWithPrismaMetadataSetParam) settable() {} +func (blobWithPrismaMetadataEqualsParam) equals() {} -type iapWithPrismaProductEqualsUniqueParam struct { +type blobWithPrismaMetadataEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaProductEqualsUniqueParam) field() builder.Field { +func (p blobWithPrismaMetadataEqualsUniqueParam) field() builder.Field { return p.data } -func (p iapWithPrismaProductEqualsUniqueParam) getQuery() builder.Query { +func (p blobWithPrismaMetadataEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaProductEqualsUniqueParam) iapModel() {} -func (p iapWithPrismaProductEqualsUniqueParam) productField() {} +func (p blobWithPrismaMetadataEqualsUniqueParam) blobModel() {} +func (p blobWithPrismaMetadataEqualsUniqueParam) metadataField() {} -func (iapWithPrismaProductEqualsUniqueParam) unique() {} -func (iapWithPrismaProductEqualsUniqueParam) equals() {} +func (blobWithPrismaMetadataEqualsUniqueParam) unique() {} +func (blobWithPrismaMetadataEqualsUniqueParam) equals() {} -type IapWithPrismaStateEqualsSetParam interface { +type BlobWithPrismaFlaggedEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - iapModel() - stateField() + blobModel() + flaggedField() } -type IapWithPrismaStateSetParam interface { +type BlobWithPrismaFlaggedSetParam interface { field() builder.Field getQuery() builder.Query - iapModel() - stateField() + blobModel() + flaggedField() } -type iapWithPrismaStateSetParam struct { +type blobWithPrismaFlaggedSetParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaStateSetParam) field() builder.Field { +func (p blobWithPrismaFlaggedSetParam) field() builder.Field { return p.data } -func (p iapWithPrismaStateSetParam) getQuery() builder.Query { +func (p blobWithPrismaFlaggedSetParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaStateSetParam) iapModel() {} +func (p blobWithPrismaFlaggedSetParam) blobModel() {} -func (p iapWithPrismaStateSetParam) stateField() {} +func (p blobWithPrismaFlaggedSetParam) flaggedField() {} -type IapWithPrismaStateWhereParam interface { +type BlobWithPrismaFlaggedWhereParam interface { field() builder.Field getQuery() builder.Query - iapModel() - stateField() + blobModel() + flaggedField() } -type iapWithPrismaStateEqualsParam struct { +type blobWithPrismaFlaggedEqualsParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaStateEqualsParam) field() builder.Field { +func (p blobWithPrismaFlaggedEqualsParam) field() builder.Field { return p.data } -func (p iapWithPrismaStateEqualsParam) getQuery() builder.Query { +func (p blobWithPrismaFlaggedEqualsParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaStateEqualsParam) iapModel() {} +func (p blobWithPrismaFlaggedEqualsParam) blobModel() {} -func (p iapWithPrismaStateEqualsParam) stateField() {} +func (p blobWithPrismaFlaggedEqualsParam) flaggedField() {} -func (iapWithPrismaStateSetParam) settable() {} -func (iapWithPrismaStateEqualsParam) equals() {} +func (blobWithPrismaFlaggedSetParam) settable() {} +func (blobWithPrismaFlaggedEqualsParam) equals() {} -type iapWithPrismaStateEqualsUniqueParam struct { +type blobWithPrismaFlaggedEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaStateEqualsUniqueParam) field() builder.Field { +func (p blobWithPrismaFlaggedEqualsUniqueParam) field() builder.Field { return p.data } -func (p iapWithPrismaStateEqualsUniqueParam) getQuery() builder.Query { +func (p blobWithPrismaFlaggedEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaStateEqualsUniqueParam) iapModel() {} -func (p iapWithPrismaStateEqualsUniqueParam) stateField() {} +func (p blobWithPrismaFlaggedEqualsUniqueParam) blobModel() {} +func (p blobWithPrismaFlaggedEqualsUniqueParam) flaggedField() {} -func (iapWithPrismaStateEqualsUniqueParam) unique() {} -func (iapWithPrismaStateEqualsUniqueParam) equals() {} +func (blobWithPrismaFlaggedEqualsUniqueParam) unique() {} +func (blobWithPrismaFlaggedEqualsUniqueParam) equals() {} -type IapWithPrismaCreatedAtEqualsSetParam interface { +type BlobWithPrismaCreatedAtEqualsSetParam interface { field() builder.Field getQuery() builder.Query equals() - iapModel() + blobModel() createdAtField() } -type IapWithPrismaCreatedAtSetParam interface { +type BlobWithPrismaCreatedAtSetParam interface { field() builder.Field getQuery() builder.Query - iapModel() + blobModel() createdAtField() } -type iapWithPrismaCreatedAtSetParam struct { +type blobWithPrismaCreatedAtSetParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaCreatedAtSetParam) field() builder.Field { +func (p blobWithPrismaCreatedAtSetParam) field() builder.Field { return p.data } -func (p iapWithPrismaCreatedAtSetParam) getQuery() builder.Query { +func (p blobWithPrismaCreatedAtSetParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaCreatedAtSetParam) iapModel() {} +func (p blobWithPrismaCreatedAtSetParam) blobModel() {} -func (p iapWithPrismaCreatedAtSetParam) createdAtField() {} +func (p blobWithPrismaCreatedAtSetParam) createdAtField() {} -type IapWithPrismaCreatedAtWhereParam interface { +type BlobWithPrismaCreatedAtWhereParam interface { field() builder.Field getQuery() builder.Query - iapModel() + blobModel() createdAtField() } -type iapWithPrismaCreatedAtEqualsParam struct { +type blobWithPrismaCreatedAtEqualsParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaCreatedAtEqualsParam) field() builder.Field { +func (p blobWithPrismaCreatedAtEqualsParam) field() builder.Field { return p.data } -func (p iapWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { +func (p blobWithPrismaCreatedAtEqualsParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaCreatedAtEqualsParam) iapModel() {} +func (p blobWithPrismaCreatedAtEqualsParam) blobModel() {} -func (p iapWithPrismaCreatedAtEqualsParam) createdAtField() {} +func (p blobWithPrismaCreatedAtEqualsParam) createdAtField() {} -func (iapWithPrismaCreatedAtSetParam) settable() {} -func (iapWithPrismaCreatedAtEqualsParam) equals() {} +func (blobWithPrismaCreatedAtSetParam) settable() {} +func (blobWithPrismaCreatedAtEqualsParam) equals() {} -type iapWithPrismaCreatedAtEqualsUniqueParam struct { +type blobWithPrismaCreatedAtEqualsUniqueParam struct { data builder.Field query builder.Query } -func (p iapWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { +func (p blobWithPrismaCreatedAtEqualsUniqueParam) field() builder.Field { return p.data } -func (p iapWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { +func (p blobWithPrismaCreatedAtEqualsUniqueParam) getQuery() builder.Query { return p.query } -func (p iapWithPrismaCreatedAtEqualsUniqueParam) iapModel() {} -func (p iapWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} +func (p blobWithPrismaCreatedAtEqualsUniqueParam) blobModel() {} +func (p blobWithPrismaCreatedAtEqualsUniqueParam) createdAtField() {} -func (iapWithPrismaCreatedAtEqualsUniqueParam) unique() {} -func (iapWithPrismaCreatedAtEqualsUniqueParam) equals() {} +func (blobWithPrismaCreatedAtEqualsUniqueParam) unique() {} +func (blobWithPrismaCreatedAtEqualsUniqueParam) equals() {} // --- template create.gotpl --- @@ -27433,7 +30604,429 @@ func (r userActions) CreateOne( return v } -func (r userCreateOne) With(params ...UserRelationWith) userCreateOne { +func (r userCreateOne) With(params ...UserRelationWith) userCreateOne { + for _, q := range params { + query := q.getQuery() + r.query.Outputs = append(r.query.Outputs, builder.Output{ + Name: query.Method, + Inputs: query.Inputs, + Outputs: query.Outputs, + }) + } + + return r +} + +type userCreateOne struct { + query builder.Query +} + +func (p userCreateOne) ExtractQuery() builder.Query { + return p.query +} + +func (p userCreateOne) userModel() {} + +func (r userCreateOne) Exec(ctx context.Context) (*UserModel, error) { + var v UserModel + if err := r.query.Exec(ctx, &v); err != nil { + return nil, err + } + return &v, nil +} + +func (r userCreateOne) Tx() UserUniqueTxResult { + v := newUserUniqueTxResult() + v.query = r.query + v.query.TxResult = make(chan []byte, 1) + return v +} + +// Creates a single publicKey. +func (r publicKeyActions) CreateOne( + _key PublicKeyWithPrismaKeySetParam, + _user PublicKeyWithPrismaUserSetParam, + + optional ...PublicKeySetParam, +) publicKeyCreateOne { + var v publicKeyCreateOne + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "mutation" + v.query.Method = "createOne" + v.query.Model = "PublicKey" + v.query.Outputs = publicKeyOutput + + var fields []builder.Field + + fields = append(fields, _key.field()) + fields = append(fields, _user.field()) + + for _, q := range optional { + fields = append(fields, q.field()) + } + + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "data", + Fields: fields, + }) + return v +} + +func (r publicKeyCreateOne) With(params ...PublicKeyRelationWith) publicKeyCreateOne { + for _, q := range params { + query := q.getQuery() + r.query.Outputs = append(r.query.Outputs, builder.Output{ + Name: query.Method, + Inputs: query.Inputs, + Outputs: query.Outputs, + }) + } + + return r +} + +type publicKeyCreateOne struct { + query builder.Query +} + +func (p publicKeyCreateOne) ExtractQuery() builder.Query { + return p.query +} + +func (p publicKeyCreateOne) publicKeyModel() {} + +func (r publicKeyCreateOne) Exec(ctx context.Context) (*PublicKeyModel, error) { + var v PublicKeyModel + if err := r.query.Exec(ctx, &v); err != nil { + return nil, err + } + return &v, nil +} + +func (r publicKeyCreateOne) Tx() PublicKeyUniqueTxResult { + v := newPublicKeyUniqueTxResult() + v.query = r.query + v.query.TxResult = make(chan []byte, 1) + return v +} + +// Creates a single intent. +func (r intentActions) CreateOne( + _id IntentWithPrismaIDSetParam, + _isFulfilled IntentWithPrismaIsFulfilledSetParam, + + optional ...IntentSetParam, +) intentCreateOne { + var v intentCreateOne + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "mutation" + v.query.Method = "createOne" + v.query.Model = "Intent" + v.query.Outputs = intentOutput + + var fields []builder.Field + + fields = append(fields, _id.field()) + fields = append(fields, _isFulfilled.field()) + + for _, q := range optional { + fields = append(fields, q.field()) + } + + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "data", + Fields: fields, + }) + return v +} + +func (r intentCreateOne) With(params ...IntentRelationWith) intentCreateOne { + for _, q := range params { + query := q.getQuery() + r.query.Outputs = append(r.query.Outputs, builder.Output{ + Name: query.Method, + Inputs: query.Inputs, + Outputs: query.Outputs, + }) + } + + return r +} + +type intentCreateOne struct { + query builder.Query +} + +func (p intentCreateOne) ExtractQuery() builder.Query { + return p.query +} + +func (p intentCreateOne) intentModel() {} + +func (r intentCreateOne) Exec(ctx context.Context) (*IntentModel, error) { + var v IntentModel + if err := r.query.Exec(ctx, &v); err != nil { + return nil, err + } + return &v, nil +} + +func (r intentCreateOne) Tx() IntentUniqueTxResult { + v := newIntentUniqueTxResult() + v.query = r.query + v.query.TxResult = make(chan []byte, 1) + return v +} + +// Creates a single chat. +func (r chatActions) CreateOne( + _id ChatWithPrismaIDSetParam, + + optional ...ChatSetParam, +) chatCreateOne { + var v chatCreateOne + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "mutation" + v.query.Method = "createOne" + v.query.Model = "Chat" + v.query.Outputs = chatOutput + + var fields []builder.Field + + fields = append(fields, _id.field()) + + for _, q := range optional { + fields = append(fields, q.field()) + } + + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "data", + Fields: fields, + }) + return v +} + +func (r chatCreateOne) With(params ...ChatRelationWith) chatCreateOne { + for _, q := range params { + query := q.getQuery() + r.query.Outputs = append(r.query.Outputs, builder.Output{ + Name: query.Method, + Inputs: query.Inputs, + Outputs: query.Outputs, + }) + } + + return r +} + +type chatCreateOne struct { + query builder.Query +} + +func (p chatCreateOne) ExtractQuery() builder.Query { + return p.query +} + +func (p chatCreateOne) chatModel() {} + +func (r chatCreateOne) Exec(ctx context.Context) (*ChatModel, error) { + var v ChatModel + if err := r.query.Exec(ctx, &v); err != nil { + return nil, err + } + return &v, nil +} + +func (r chatCreateOne) Tx() ChatUniqueTxResult { + v := newChatUniqueTxResult() + v.query = r.query + v.query.TxResult = make(chan []byte, 1) + return v +} + +// Creates a single member. +func (r memberActions) CreateOne( + _userID MemberWithPrismaUserIDSetParam, + _chat MemberWithPrismaChatSetParam, + + optional ...MemberSetParam, +) memberCreateOne { + var v memberCreateOne + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "mutation" + v.query.Method = "createOne" + v.query.Model = "Member" + v.query.Outputs = memberOutput + + var fields []builder.Field + + fields = append(fields, _userID.field()) + fields = append(fields, _chat.field()) + + for _, q := range optional { + fields = append(fields, q.field()) + } + + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "data", + Fields: fields, + }) + return v +} + +func (r memberCreateOne) With(params ...MemberRelationWith) memberCreateOne { + for _, q := range params { + query := q.getQuery() + r.query.Outputs = append(r.query.Outputs, builder.Output{ + Name: query.Method, + Inputs: query.Inputs, + Outputs: query.Outputs, + }) + } + + return r +} + +type memberCreateOne struct { + query builder.Query +} + +func (p memberCreateOne) ExtractQuery() builder.Query { + return p.query +} + +func (p memberCreateOne) memberModel() {} + +func (r memberCreateOne) Exec(ctx context.Context) (*MemberModel, error) { + var v MemberModel + if err := r.query.Exec(ctx, &v); err != nil { + return nil, err + } + return &v, nil +} + +func (r memberCreateOne) Tx() MemberUniqueTxResult { + v := newMemberUniqueTxResult() + v.query = r.query + v.query.TxResult = make(chan []byte, 1) + return v +} + +// Creates a single message. +func (r messageActions) CreateOne( + _id MessageWithPrismaIDSetParam, + _chatID MessageWithPrismaChatIDSetParam, + _content MessageWithPrismaContentSetParam, + + optional ...MessageSetParam, +) messageCreateOne { + var v messageCreateOne + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "mutation" + v.query.Method = "createOne" + v.query.Model = "Message" + v.query.Outputs = messageOutput + + var fields []builder.Field + + fields = append(fields, _id.field()) + fields = append(fields, _chatID.field()) + fields = append(fields, _content.field()) + + for _, q := range optional { + fields = append(fields, q.field()) + } + + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "data", + Fields: fields, + }) + return v +} + +func (r messageCreateOne) With(params ...MessageRelationWith) messageCreateOne { + for _, q := range params { + query := q.getQuery() + r.query.Outputs = append(r.query.Outputs, builder.Output{ + Name: query.Method, + Inputs: query.Inputs, + Outputs: query.Outputs, + }) + } + + return r +} + +type messageCreateOne struct { + query builder.Query +} + +func (p messageCreateOne) ExtractQuery() builder.Query { + return p.query +} + +func (p messageCreateOne) messageModel() {} + +func (r messageCreateOne) Exec(ctx context.Context) (*MessageModel, error) { + var v MessageModel + if err := r.query.Exec(ctx, &v); err != nil { + return nil, err + } + return &v, nil +} + +func (r messageCreateOne) Tx() MessageUniqueTxResult { + v := newMessageUniqueTxResult() + v.query = r.query + v.query.TxResult = make(chan []byte, 1) + return v +} + +// Creates a single pointer. +func (r pointerActions) CreateOne( + _chatID PointerWithPrismaChatIDSetParam, + _userID PointerWithPrismaUserIDSetParam, + _value PointerWithPrismaValueSetParam, + + optional ...PointerSetParam, +) pointerCreateOne { + var v pointerCreateOne + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "mutation" + v.query.Method = "createOne" + v.query.Model = "Pointer" + v.query.Outputs = pointerOutput + + var fields []builder.Field + + fields = append(fields, _chatID.field()) + fields = append(fields, _userID.field()) + fields = append(fields, _value.field()) + + for _, q := range optional { + fields = append(fields, q.field()) + } + + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "data", + Fields: fields, + }) + return v +} + +func (r pointerCreateOne) With(params ...PointerRelationWith) pointerCreateOne { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -27446,51 +31039,53 @@ func (r userCreateOne) With(params ...UserRelationWith) userCreateOne { return r } -type userCreateOne struct { +type pointerCreateOne struct { query builder.Query } -func (p userCreateOne) ExtractQuery() builder.Query { +func (p pointerCreateOne) ExtractQuery() builder.Query { return p.query } -func (p userCreateOne) userModel() {} +func (p pointerCreateOne) pointerModel() {} -func (r userCreateOne) Exec(ctx context.Context) (*UserModel, error) { - var v UserModel +func (r pointerCreateOne) Exec(ctx context.Context) (*PointerModel, error) { + var v PointerModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r userCreateOne) Tx() UserUniqueTxResult { - v := newUserUniqueTxResult() +func (r pointerCreateOne) Tx() PointerUniqueTxResult { + v := newPointerUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -// Creates a single publicKey. -func (r publicKeyActions) CreateOne( - _key PublicKeyWithPrismaKeySetParam, - _user PublicKeyWithPrismaUserSetParam, +// Creates a single pushToken. +func (r pushTokenActions) CreateOne( + _userID PushTokenWithPrismaUserIDSetParam, + _appInstallID PushTokenWithPrismaAppInstallIDSetParam, + _token PushTokenWithPrismaTokenSetParam, - optional ...PublicKeySetParam, -) publicKeyCreateOne { - var v publicKeyCreateOne + optional ...PushTokenSetParam, +) pushTokenCreateOne { + var v pushTokenCreateOne v.query = builder.NewQuery() v.query.Engine = r.client v.query.Operation = "mutation" v.query.Method = "createOne" - v.query.Model = "PublicKey" - v.query.Outputs = publicKeyOutput + v.query.Model = "PushToken" + v.query.Outputs = pushTokenOutput var fields []builder.Field - fields = append(fields, _key.field()) - fields = append(fields, _user.field()) + fields = append(fields, _userID.field()) + fields = append(fields, _appInstallID.field()) + fields = append(fields, _token.field()) for _, q := range optional { fields = append(fields, q.field()) @@ -27503,7 +31098,7 @@ func (r publicKeyActions) CreateOne( return v } -func (r publicKeyCreateOne) With(params ...PublicKeyRelationWith) publicKeyCreateOne { +func (r pushTokenCreateOne) With(params ...PushTokenRelationWith) pushTokenCreateOne { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -27516,51 +31111,51 @@ func (r publicKeyCreateOne) With(params ...PublicKeyRelationWith) publicKeyCreat return r } -type publicKeyCreateOne struct { +type pushTokenCreateOne struct { query builder.Query } -func (p publicKeyCreateOne) ExtractQuery() builder.Query { +func (p pushTokenCreateOne) ExtractQuery() builder.Query { return p.query } -func (p publicKeyCreateOne) publicKeyModel() {} +func (p pushTokenCreateOne) pushTokenModel() {} -func (r publicKeyCreateOne) Exec(ctx context.Context) (*PublicKeyModel, error) { - var v PublicKeyModel +func (r pushTokenCreateOne) Exec(ctx context.Context) (*PushTokenModel, error) { + var v PushTokenModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r publicKeyCreateOne) Tx() PublicKeyUniqueTxResult { - v := newPublicKeyUniqueTxResult() +func (r pushTokenCreateOne) Tx() PushTokenUniqueTxResult { + v := newPushTokenUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -// Creates a single intent. -func (r intentActions) CreateOne( - _id IntentWithPrismaIDSetParam, - _isFulfilled IntentWithPrismaIsFulfilledSetParam, +// Creates a single iap. +func (r iapActions) CreateOne( + _receiptID IapWithPrismaReceiptIDSetParam, + _userID IapWithPrismaUserIDSetParam, - optional ...IntentSetParam, -) intentCreateOne { - var v intentCreateOne + optional ...IapSetParam, +) iapCreateOne { + var v iapCreateOne v.query = builder.NewQuery() v.query.Engine = r.client v.query.Operation = "mutation" v.query.Method = "createOne" - v.query.Model = "Intent" - v.query.Outputs = intentOutput + v.query.Model = "Iap" + v.query.Outputs = iapOutput var fields []builder.Field - fields = append(fields, _id.field()) - fields = append(fields, _isFulfilled.field()) + fields = append(fields, _receiptID.field()) + fields = append(fields, _userID.field()) for _, q := range optional { fields = append(fields, q.field()) @@ -27573,7 +31168,7 @@ func (r intentActions) CreateOne( return v } -func (r intentCreateOne) With(params ...IntentRelationWith) intentCreateOne { +func (r iapCreateOne) With(params ...IapRelationWith) iapCreateOne { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -27586,49 +31181,59 @@ func (r intentCreateOne) With(params ...IntentRelationWith) intentCreateOne { return r } -type intentCreateOne struct { +type iapCreateOne struct { query builder.Query } -func (p intentCreateOne) ExtractQuery() builder.Query { +func (p iapCreateOne) ExtractQuery() builder.Query { return p.query } -func (p intentCreateOne) intentModel() {} +func (p iapCreateOne) iapModel() {} -func (r intentCreateOne) Exec(ctx context.Context) (*IntentModel, error) { - var v IntentModel +func (r iapCreateOne) Exec(ctx context.Context) (*IapModel, error) { + var v IapModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r intentCreateOne) Tx() IntentUniqueTxResult { - v := newIntentUniqueTxResult() +func (r iapCreateOne) Tx() IapUniqueTxResult { + v := newIapUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -// Creates a single chat. -func (r chatActions) CreateOne( - _id ChatWithPrismaIDSetParam, +// Creates a single blob. +func (r blobActions) CreateOne( + _id BlobWithPrismaIDSetParam, + _userID BlobWithPrismaUserIDSetParam, + _type BlobWithPrismaTypeSetParam, + _s3URL BlobWithPrismaS3URLSetParam, + _size BlobWithPrismaSizeSetParam, + _metadata BlobWithPrismaMetadataSetParam, - optional ...ChatSetParam, -) chatCreateOne { - var v chatCreateOne + optional ...BlobSetParam, +) blobCreateOne { + var v blobCreateOne v.query = builder.NewQuery() v.query.Engine = r.client v.query.Operation = "mutation" v.query.Method = "createOne" - v.query.Model = "Chat" - v.query.Outputs = chatOutput + v.query.Model = "Blob" + v.query.Outputs = blobOutput var fields []builder.Field fields = append(fields, _id.field()) + fields = append(fields, _userID.field()) + fields = append(fields, _type.field()) + fields = append(fields, _s3URL.field()) + fields = append(fields, _size.field()) + fields = append(fields, _metadata.field()) for _, q := range optional { fields = append(fields, q.field()) @@ -27641,7 +31246,7 @@ func (r chatActions) CreateOne( return v } -func (r chatCreateOne) With(params ...ChatRelationWith) chatCreateOne { +func (r blobCreateOne) With(params ...BlobRelationWith) blobCreateOne { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -27654,64 +31259,50 @@ func (r chatCreateOne) With(params ...ChatRelationWith) chatCreateOne { return r } -type chatCreateOne struct { +type blobCreateOne struct { query builder.Query } -func (p chatCreateOne) ExtractQuery() builder.Query { +func (p blobCreateOne) ExtractQuery() builder.Query { return p.query } -func (p chatCreateOne) chatModel() {} +func (p blobCreateOne) blobModel() {} -func (r chatCreateOne) Exec(ctx context.Context) (*ChatModel, error) { - var v ChatModel +func (r blobCreateOne) Exec(ctx context.Context) (*BlobModel, error) { + var v BlobModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r chatCreateOne) Tx() ChatUniqueTxResult { - v := newChatUniqueTxResult() +func (r blobCreateOne) Tx() BlobUniqueTxResult { + v := newBlobUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -// Creates a single member. -func (r memberActions) CreateOne( - _userID MemberWithPrismaUserIDSetParam, - _chat MemberWithPrismaChatSetParam, - - optional ...MemberSetParam, -) memberCreateOne { - var v memberCreateOne - v.query = builder.NewQuery() - v.query.Engine = r.client - - v.query.Operation = "mutation" - v.query.Method = "createOne" - v.query.Model = "Member" - v.query.Outputs = memberOutput - - var fields []builder.Field +// --- template find.gotpl --- - fields = append(fields, _userID.field()) - fields = append(fields, _chat.field()) +type userToPublicKeysFindUnique struct { + query builder.Query +} - for _, q := range optional { - fields = append(fields, q.field()) - } +func (r userToPublicKeysFindUnique) getQuery() builder.Query { + return r.query +} - v.query.Inputs = append(v.query.Inputs, builder.Input{ - Name: "data", - Fields: fields, - }) - return v +func (r userToPublicKeysFindUnique) ExtractQuery() builder.Query { + return r.query } -func (r memberCreateOne) With(params ...MemberRelationWith) memberCreateOne { +func (r userToPublicKeysFindUnique) with() {} +func (r userToPublicKeysFindUnique) userModel() {} +func (r userToPublicKeysFindUnique) userRelation() {} + +func (r userToPublicKeysFindUnique) With(params ...PublicKeyRelationWith) userToPublicKeysFindUnique { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -27724,66 +31315,182 @@ func (r memberCreateOne) With(params ...MemberRelationWith) memberCreateOne { return r } -type memberCreateOne struct { +func (r userToPublicKeysFindUnique) Select(params ...userPrismaFields) userToPublicKeysFindUnique { + var outputs []builder.Output + + for _, param := range params { + outputs = append(outputs, builder.Output{ + Name: string(param), + }) + } + + r.query.Outputs = outputs + + return r +} + +func (r userToPublicKeysFindUnique) Omit(params ...userPrismaFields) userToPublicKeysFindUnique { + var outputs []builder.Output + + var raw []string + for _, param := range params { + raw = append(raw, string(param)) + } + + for _, output := range userOutput { + if !slices.Contains(raw, output.Name) { + outputs = append(outputs, output) + } + } + + r.query.Outputs = outputs + + return r +} + +func (r userToPublicKeysFindUnique) Exec(ctx context.Context) ( + *UserModel, + error, +) { + var v *UserModel + if err := r.query.Exec(ctx, &v); err != nil { + return nil, err + } + + if v == nil { + return nil, ErrNotFound + } + + return v, nil +} + +func (r userToPublicKeysFindUnique) ExecInner(ctx context.Context) ( + *InnerUser, + error, +) { + var v *InnerUser + if err := r.query.Exec(ctx, &v); err != nil { + return nil, err + } + + if v == nil { + return nil, ErrNotFound + } + + return v, nil +} + +func (r userToPublicKeysFindUnique) Update(params ...UserSetParam) userToPublicKeysUpdateUnique { + r.query.Operation = "mutation" + r.query.Method = "updateOne" + r.query.Model = "User" + + var v userToPublicKeysUpdateUnique + v.query = r.query + var fields []builder.Field + for _, q := range params { + + field := q.field() + + _, isJson := field.Value.(types.JSON) + if field.Value != nil && !isJson { + v := field.Value + field.Fields = []builder.Field{ + { + Name: "set", + Value: v, + }, + } + + field.Value = nil + } + + fields = append(fields, field) + } + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "data", + Fields: fields, + }) + return v +} + +type userToPublicKeysUpdateUnique struct { query builder.Query } -func (p memberCreateOne) ExtractQuery() builder.Query { - return p.query +func (r userToPublicKeysUpdateUnique) ExtractQuery() builder.Query { + return r.query } -func (p memberCreateOne) memberModel() {} +func (r userToPublicKeysUpdateUnique) userModel() {} -func (r memberCreateOne) Exec(ctx context.Context) (*MemberModel, error) { - var v MemberModel +func (r userToPublicKeysUpdateUnique) Exec(ctx context.Context) (*UserModel, error) { + var v UserModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r memberCreateOne) Tx() MemberUniqueTxResult { - v := newMemberUniqueTxResult() +func (r userToPublicKeysUpdateUnique) Tx() UserUniqueTxResult { + v := newUserUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -// Creates a single message. -func (r messageActions) CreateOne( - _id MessageWithPrismaIDSetParam, - _chatID MessageWithPrismaChatIDSetParam, - _content MessageWithPrismaContentSetParam, +func (r userToPublicKeysFindUnique) Delete() userToPublicKeysDeleteUnique { + var v userToPublicKeysDeleteUnique + v.query = r.query + v.query.Operation = "mutation" + v.query.Method = "deleteOne" + v.query.Model = "User" - optional ...MessageSetParam, -) messageCreateOne { - var v messageCreateOne - v.query = builder.NewQuery() - v.query.Engine = r.client + return v +} - v.query.Operation = "mutation" - v.query.Method = "createOne" - v.query.Model = "Message" - v.query.Outputs = messageOutput +type userToPublicKeysDeleteUnique struct { + query builder.Query +} - var fields []builder.Field +func (r userToPublicKeysDeleteUnique) ExtractQuery() builder.Query { + return r.query +} - fields = append(fields, _id.field()) - fields = append(fields, _chatID.field()) - fields = append(fields, _content.field()) +func (p userToPublicKeysDeleteUnique) userModel() {} - for _, q := range optional { - fields = append(fields, q.field()) +func (r userToPublicKeysDeleteUnique) Exec(ctx context.Context) (*UserModel, error) { + var v UserModel + if err := r.query.Exec(ctx, &v); err != nil { + return nil, err } + return &v, nil +} - v.query.Inputs = append(v.query.Inputs, builder.Input{ - Name: "data", - Fields: fields, - }) +func (r userToPublicKeysDeleteUnique) Tx() UserUniqueTxResult { + v := newUserUniqueTxResult() + v.query = r.query + v.query.TxResult = make(chan []byte, 1) return v } -func (r messageCreateOne) With(params ...MessageRelationWith) messageCreateOne { +type userToPublicKeysFindFirst struct { + query builder.Query +} + +func (r userToPublicKeysFindFirst) getQuery() builder.Query { + return r.query +} + +func (r userToPublicKeysFindFirst) ExtractQuery() builder.Query { + return r.query +} + +func (r userToPublicKeysFindFirst) with() {} +func (r userToPublicKeysFindFirst) userModel() {} +func (r userToPublicKeysFindFirst) userRelation() {} + +func (r userToPublicKeysFindFirst) With(params ...PublicKeyRelationWith) userToPublicKeysFindFirst { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -27796,130 +31503,274 @@ func (r messageCreateOne) With(params ...MessageRelationWith) messageCreateOne { return r } -type messageCreateOne struct { - query builder.Query +func (r userToPublicKeysFindFirst) Select(params ...userPrismaFields) userToPublicKeysFindFirst { + var outputs []builder.Output + + for _, param := range params { + outputs = append(outputs, builder.Output{ + Name: string(param), + }) + } + + r.query.Outputs = outputs + + return r } -func (p messageCreateOne) ExtractQuery() builder.Query { - return p.query +func (r userToPublicKeysFindFirst) Omit(params ...userPrismaFields) userToPublicKeysFindFirst { + var outputs []builder.Output + + var raw []string + for _, param := range params { + raw = append(raw, string(param)) + } + + for _, output := range userOutput { + if !slices.Contains(raw, output.Name) { + outputs = append(outputs, output) + } + } + + r.query.Outputs = outputs + + return r } -func (p messageCreateOne) messageModel() {} +func (r userToPublicKeysFindFirst) OrderBy(params ...PublicKeyOrderByParam) userToPublicKeysFindFirst { + var fields []builder.Field -func (r messageCreateOne) Exec(ctx context.Context) (*MessageModel, error) { - var v MessageModel + for _, param := range params { + fields = append(fields, builder.Field{ + Name: param.field().Name, + Value: param.field().Value, + Fields: param.field().Fields, + }) + } + + r.query.Inputs = append(r.query.Inputs, builder.Input{ + Name: "orderBy", + Fields: fields, + WrapList: true, + }) + + return r +} + +func (r userToPublicKeysFindFirst) Skip(count int) userToPublicKeysFindFirst { + r.query.Inputs = append(r.query.Inputs, builder.Input{ + Name: "skip", + Value: count, + }) + return r +} + +func (r userToPublicKeysFindFirst) Take(count int) userToPublicKeysFindFirst { + r.query.Inputs = append(r.query.Inputs, builder.Input{ + Name: "take", + Value: count, + }) + return r +} + +func (r userToPublicKeysFindFirst) Cursor(cursor UserCursorParam) userToPublicKeysFindFirst { + r.query.Inputs = append(r.query.Inputs, builder.Input{ + Name: "cursor", + Fields: []builder.Field{cursor.field()}, + }) + return r +} + +func (r userToPublicKeysFindFirst) Exec(ctx context.Context) ( + *UserModel, + error, +) { + var v *UserModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } - return &v, nil + + if v == nil { + return nil, ErrNotFound + } + + return v, nil } -func (r messageCreateOne) Tx() MessageUniqueTxResult { - v := newMessageUniqueTxResult() - v.query = r.query - v.query.TxResult = make(chan []byte, 1) - return v +func (r userToPublicKeysFindFirst) ExecInner(ctx context.Context) ( + *InnerUser, + error, +) { + var v *InnerUser + if err := r.query.Exec(ctx, &v); err != nil { + return nil, err + } + + if v == nil { + return nil, ErrNotFound + } + + return v, nil } -// Creates a single pointer. -func (r pointerActions) CreateOne( - _chatID PointerWithPrismaChatIDSetParam, - _userID PointerWithPrismaUserIDSetParam, - _value PointerWithPrismaValueSetParam, +type userToPublicKeysFindMany struct { + query builder.Query +} - optional ...PointerSetParam, -) pointerCreateOne { - var v pointerCreateOne - v.query = builder.NewQuery() - v.query.Engine = r.client +func (r userToPublicKeysFindMany) getQuery() builder.Query { + return r.query +} - v.query.Operation = "mutation" - v.query.Method = "createOne" - v.query.Model = "Pointer" - v.query.Outputs = pointerOutput +func (r userToPublicKeysFindMany) ExtractQuery() builder.Query { + return r.query +} - var fields []builder.Field +func (r userToPublicKeysFindMany) with() {} +func (r userToPublicKeysFindMany) userModel() {} +func (r userToPublicKeysFindMany) userRelation() {} - fields = append(fields, _chatID.field()) - fields = append(fields, _userID.field()) - fields = append(fields, _value.field()) +func (r userToPublicKeysFindMany) With(params ...PublicKeyRelationWith) userToPublicKeysFindMany { + for _, q := range params { + query := q.getQuery() + r.query.Outputs = append(r.query.Outputs, builder.Output{ + Name: query.Method, + Inputs: query.Inputs, + Outputs: query.Outputs, + }) + } - for _, q := range optional { - fields = append(fields, q.field()) + return r +} + +func (r userToPublicKeysFindMany) Select(params ...userPrismaFields) userToPublicKeysFindMany { + var outputs []builder.Output + + for _, param := range params { + outputs = append(outputs, builder.Output{ + Name: string(param), + }) + } + + r.query.Outputs = outputs + + return r +} + +func (r userToPublicKeysFindMany) Omit(params ...userPrismaFields) userToPublicKeysFindMany { + var outputs []builder.Output + + var raw []string + for _, param := range params { + raw = append(raw, string(param)) + } + + for _, output := range userOutput { + if !slices.Contains(raw, output.Name) { + outputs = append(outputs, output) + } } - v.query.Inputs = append(v.query.Inputs, builder.Input{ - Name: "data", - Fields: fields, - }) - return v + r.query.Outputs = outputs + + return r } -func (r pointerCreateOne) With(params ...PointerRelationWith) pointerCreateOne { - for _, q := range params { - query := q.getQuery() - r.query.Outputs = append(r.query.Outputs, builder.Output{ - Name: query.Method, - Inputs: query.Inputs, - Outputs: query.Outputs, +func (r userToPublicKeysFindMany) OrderBy(params ...PublicKeyOrderByParam) userToPublicKeysFindMany { + var fields []builder.Field + + for _, param := range params { + fields = append(fields, builder.Field{ + Name: param.field().Name, + Value: param.field().Value, + Fields: param.field().Fields, }) } + r.query.Inputs = append(r.query.Inputs, builder.Input{ + Name: "orderBy", + Fields: fields, + WrapList: true, + }) + return r } -type pointerCreateOne struct { - query builder.Query +func (r userToPublicKeysFindMany) Skip(count int) userToPublicKeysFindMany { + r.query.Inputs = append(r.query.Inputs, builder.Input{ + Name: "skip", + Value: count, + }) + return r } -func (p pointerCreateOne) ExtractQuery() builder.Query { - return p.query +func (r userToPublicKeysFindMany) Take(count int) userToPublicKeysFindMany { + r.query.Inputs = append(r.query.Inputs, builder.Input{ + Name: "take", + Value: count, + }) + return r } -func (p pointerCreateOne) pointerModel() {} +func (r userToPublicKeysFindMany) Cursor(cursor UserCursorParam) userToPublicKeysFindMany { + r.query.Inputs = append(r.query.Inputs, builder.Input{ + Name: "cursor", + Fields: []builder.Field{cursor.field()}, + }) + return r +} -func (r pointerCreateOne) Exec(ctx context.Context) (*PointerModel, error) { - var v PointerModel +func (r userToPublicKeysFindMany) Exec(ctx context.Context) ( + []UserModel, + error, +) { + var v []UserModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } - return &v, nil -} -func (r pointerCreateOne) Tx() PointerUniqueTxResult { - v := newPointerUniqueTxResult() - v.query = r.query - v.query.TxResult = make(chan []byte, 1) - return v + return v, nil } -// Creates a single pushToken. -func (r pushTokenActions) CreateOne( - _userID PushTokenWithPrismaUserIDSetParam, - _appInstallID PushTokenWithPrismaAppInstallIDSetParam, - _token PushTokenWithPrismaTokenSetParam, +func (r userToPublicKeysFindMany) ExecInner(ctx context.Context) ( + []InnerUser, + error, +) { + var v []InnerUser + if err := r.query.Exec(ctx, &v); err != nil { + return nil, err + } - optional ...PushTokenSetParam, -) pushTokenCreateOne { - var v pushTokenCreateOne - v.query = builder.NewQuery() - v.query.Engine = r.client + return v, nil +} - v.query.Operation = "mutation" - v.query.Method = "createOne" - v.query.Model = "PushToken" - v.query.Outputs = pushTokenOutput +func (r userToPublicKeysFindMany) Update(params ...UserSetParam) userToPublicKeysUpdateMany { + r.query.Operation = "mutation" + r.query.Method = "updateMany" + r.query.Model = "User" + r.query.Outputs = countOutput + + var v userToPublicKeysUpdateMany + v.query = r.query var fields []builder.Field + for _, q := range params { - fields = append(fields, _userID.field()) - fields = append(fields, _appInstallID.field()) - fields = append(fields, _token.field()) + field := q.field() - for _, q := range optional { - fields = append(fields, q.field()) - } + _, isJson := field.Value.(types.JSON) + if field.Value != nil && !isJson { + v := field.Value + field.Fields = []builder.Field{ + { + Name: "set", + Value: v, + }, + } + + field.Value = nil + } + fields = append(fields, field) + } v.query.Inputs = append(v.query.Inputs, builder.Input{ Name: "data", Fields: fields, @@ -27927,133 +31778,107 @@ func (r pushTokenActions) CreateOne( return v } -func (r pushTokenCreateOne) With(params ...PushTokenRelationWith) pushTokenCreateOne { - for _, q := range params { - query := q.getQuery() - r.query.Outputs = append(r.query.Outputs, builder.Output{ - Name: query.Method, - Inputs: query.Inputs, - Outputs: query.Outputs, - }) - } - - return r -} - -type pushTokenCreateOne struct { +type userToPublicKeysUpdateMany struct { query builder.Query } -func (p pushTokenCreateOne) ExtractQuery() builder.Query { - return p.query +func (r userToPublicKeysUpdateMany) ExtractQuery() builder.Query { + return r.query } -func (p pushTokenCreateOne) pushTokenModel() {} +func (r userToPublicKeysUpdateMany) userModel() {} -func (r pushTokenCreateOne) Exec(ctx context.Context) (*PushTokenModel, error) { - var v PushTokenModel +func (r userToPublicKeysUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { + var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r pushTokenCreateOne) Tx() PushTokenUniqueTxResult { - v := newPushTokenUniqueTxResult() +func (r userToPublicKeysUpdateMany) Tx() UserManyTxResult { + v := newUserManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -// Creates a single iap. -func (r iapActions) CreateOne( - _receiptID IapWithPrismaReceiptIDSetParam, - _userID IapWithPrismaUserIDSetParam, - - optional ...IapSetParam, -) iapCreateOne { - var v iapCreateOne - v.query = builder.NewQuery() - v.query.Engine = r.client - +func (r userToPublicKeysFindMany) Delete() userToPublicKeysDeleteMany { + var v userToPublicKeysDeleteMany + v.query = r.query v.query.Operation = "mutation" - v.query.Method = "createOne" - v.query.Model = "Iap" - v.query.Outputs = iapOutput - - var fields []builder.Field - - fields = append(fields, _receiptID.field()) - fields = append(fields, _userID.field()) + v.query.Method = "deleteMany" + v.query.Model = "User" - for _, q := range optional { - fields = append(fields, q.field()) - } + v.query.Outputs = countOutput - v.query.Inputs = append(v.query.Inputs, builder.Input{ - Name: "data", - Fields: fields, - }) return v } -func (r iapCreateOne) With(params ...IapRelationWith) iapCreateOne { - for _, q := range params { - query := q.getQuery() - r.query.Outputs = append(r.query.Outputs, builder.Output{ - Name: query.Method, - Inputs: query.Inputs, - Outputs: query.Outputs, - }) - } - - return r -} - -type iapCreateOne struct { +type userToPublicKeysDeleteMany struct { query builder.Query } -func (p iapCreateOne) ExtractQuery() builder.Query { - return p.query +func (r userToPublicKeysDeleteMany) ExtractQuery() builder.Query { + return r.query } -func (p iapCreateOne) iapModel() {} +func (p userToPublicKeysDeleteMany) userModel() {} -func (r iapCreateOne) Exec(ctx context.Context) (*IapModel, error) { - var v IapModel +func (r userToPublicKeysDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { + var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r iapCreateOne) Tx() IapUniqueTxResult { - v := newIapUniqueTxResult() +func (r userToPublicKeysDeleteMany) Tx() UserManyTxResult { + v := newUserManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -// --- template find.gotpl --- - -type userToPublicKeysFindUnique struct { +type userFindUnique struct { query builder.Query } -func (r userToPublicKeysFindUnique) getQuery() builder.Query { +func (r userFindUnique) getQuery() builder.Query { return r.query } -func (r userToPublicKeysFindUnique) ExtractQuery() builder.Query { +func (r userFindUnique) ExtractQuery() builder.Query { return r.query } -func (r userToPublicKeysFindUnique) with() {} -func (r userToPublicKeysFindUnique) userModel() {} -func (r userToPublicKeysFindUnique) userRelation() {} +func (r userFindUnique) with() {} +func (r userFindUnique) userModel() {} +func (r userFindUnique) userRelation() {} -func (r userToPublicKeysFindUnique) With(params ...PublicKeyRelationWith) userToPublicKeysFindUnique { +func (r userActions) FindUnique( + params UserEqualsUniqueWhereParam, +) userFindUnique { + var v userFindUnique + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "query" + + v.query.Method = "findUnique" + + v.query.Model = "User" + v.query.Outputs = userOutput + + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "where", + Fields: builder.TransformEquals([]builder.Field{params.field()}), + }) + + return v +} + +func (r userFindUnique) With(params ...UserRelationWith) userFindUnique { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -28066,7 +31891,7 @@ func (r userToPublicKeysFindUnique) With(params ...PublicKeyRelationWith) userTo return r } -func (r userToPublicKeysFindUnique) Select(params ...userPrismaFields) userToPublicKeysFindUnique { +func (r userFindUnique) Select(params ...userPrismaFields) userFindUnique { var outputs []builder.Output for _, param := range params { @@ -28080,7 +31905,7 @@ func (r userToPublicKeysFindUnique) Select(params ...userPrismaFields) userToPub return r } -func (r userToPublicKeysFindUnique) Omit(params ...userPrismaFields) userToPublicKeysFindUnique { +func (r userFindUnique) Omit(params ...userPrismaFields) userFindUnique { var outputs []builder.Output var raw []string @@ -28099,7 +31924,7 @@ func (r userToPublicKeysFindUnique) Omit(params ...userPrismaFields) userToPubli return r } -func (r userToPublicKeysFindUnique) Exec(ctx context.Context) ( +func (r userFindUnique) Exec(ctx context.Context) ( *UserModel, error, ) { @@ -28115,7 +31940,7 @@ func (r userToPublicKeysFindUnique) Exec(ctx context.Context) ( return v, nil } -func (r userToPublicKeysFindUnique) ExecInner(ctx context.Context) ( +func (r userFindUnique) ExecInner(ctx context.Context) ( *InnerUser, error, ) { @@ -28131,12 +31956,12 @@ func (r userToPublicKeysFindUnique) ExecInner(ctx context.Context) ( return v, nil } -func (r userToPublicKeysFindUnique) Update(params ...UserSetParam) userToPublicKeysUpdateUnique { +func (r userFindUnique) Update(params ...UserSetParam) userUpdateUnique { r.query.Operation = "mutation" r.query.Method = "updateOne" r.query.Model = "User" - var v userToPublicKeysUpdateUnique + var v userUpdateUnique v.query = r.query var fields []builder.Field for _, q := range params { @@ -28165,17 +31990,17 @@ func (r userToPublicKeysFindUnique) Update(params ...UserSetParam) userToPublicK return v } -type userToPublicKeysUpdateUnique struct { +type userUpdateUnique struct { query builder.Query } -func (r userToPublicKeysUpdateUnique) ExtractQuery() builder.Query { +func (r userUpdateUnique) ExtractQuery() builder.Query { return r.query } -func (r userToPublicKeysUpdateUnique) userModel() {} +func (r userUpdateUnique) userModel() {} -func (r userToPublicKeysUpdateUnique) Exec(ctx context.Context) (*UserModel, error) { +func (r userUpdateUnique) Exec(ctx context.Context) (*UserModel, error) { var v UserModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -28183,15 +32008,15 @@ func (r userToPublicKeysUpdateUnique) Exec(ctx context.Context) (*UserModel, err return &v, nil } -func (r userToPublicKeysUpdateUnique) Tx() UserUniqueTxResult { +func (r userUpdateUnique) Tx() UserUniqueTxResult { v := newUserUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r userToPublicKeysFindUnique) Delete() userToPublicKeysDeleteUnique { - var v userToPublicKeysDeleteUnique +func (r userFindUnique) Delete() userDeleteUnique { + var v userDeleteUnique v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteOne" @@ -28200,17 +32025,17 @@ func (r userToPublicKeysFindUnique) Delete() userToPublicKeysDeleteUnique { return v } -type userToPublicKeysDeleteUnique struct { +type userDeleteUnique struct { query builder.Query } -func (r userToPublicKeysDeleteUnique) ExtractQuery() builder.Query { +func (r userDeleteUnique) ExtractQuery() builder.Query { return r.query } -func (p userToPublicKeysDeleteUnique) userModel() {} +func (p userDeleteUnique) userModel() {} -func (r userToPublicKeysDeleteUnique) Exec(ctx context.Context) (*UserModel, error) { +func (r userDeleteUnique) Exec(ctx context.Context) (*UserModel, error) { var v UserModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -28218,30 +32043,67 @@ func (r userToPublicKeysDeleteUnique) Exec(ctx context.Context) (*UserModel, err return &v, nil } -func (r userToPublicKeysDeleteUnique) Tx() UserUniqueTxResult { +func (r userDeleteUnique) Tx() UserUniqueTxResult { v := newUserUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type userToPublicKeysFindFirst struct { +type userFindFirst struct { query builder.Query } -func (r userToPublicKeysFindFirst) getQuery() builder.Query { +func (r userFindFirst) getQuery() builder.Query { return r.query } -func (r userToPublicKeysFindFirst) ExtractQuery() builder.Query { +func (r userFindFirst) ExtractQuery() builder.Query { return r.query } -func (r userToPublicKeysFindFirst) with() {} -func (r userToPublicKeysFindFirst) userModel() {} -func (r userToPublicKeysFindFirst) userRelation() {} +func (r userFindFirst) with() {} +func (r userFindFirst) userModel() {} +func (r userFindFirst) userRelation() {} -func (r userToPublicKeysFindFirst) With(params ...PublicKeyRelationWith) userToPublicKeysFindFirst { +func (r userActions) FindFirst( + params ...UserWhereParam, +) userFindFirst { + var v userFindFirst + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "query" + + v.query.Method = "findFirst" + + v.query.Model = "User" + v.query.Outputs = userOutput + + var where []builder.Field + for _, q := range params { + if query := q.getQuery(); query.Operation != "" { + v.query.Outputs = append(v.query.Outputs, builder.Output{ + Name: query.Method, + Inputs: query.Inputs, + Outputs: query.Outputs, + }) + } else { + where = append(where, q.field()) + } + } + + if len(where) > 0 { + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "where", + Fields: where, + }) + } + + return v +} + +func (r userFindFirst) With(params ...UserRelationWith) userFindFirst { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -28254,7 +32116,7 @@ func (r userToPublicKeysFindFirst) With(params ...PublicKeyRelationWith) userToP return r } -func (r userToPublicKeysFindFirst) Select(params ...userPrismaFields) userToPublicKeysFindFirst { +func (r userFindFirst) Select(params ...userPrismaFields) userFindFirst { var outputs []builder.Output for _, param := range params { @@ -28268,7 +32130,7 @@ func (r userToPublicKeysFindFirst) Select(params ...userPrismaFields) userToPubl return r } -func (r userToPublicKeysFindFirst) Omit(params ...userPrismaFields) userToPublicKeysFindFirst { +func (r userFindFirst) Omit(params ...userPrismaFields) userFindFirst { var outputs []builder.Output var raw []string @@ -28287,7 +32149,7 @@ func (r userToPublicKeysFindFirst) Omit(params ...userPrismaFields) userToPublic return r } -func (r userToPublicKeysFindFirst) OrderBy(params ...PublicKeyOrderByParam) userToPublicKeysFindFirst { +func (r userFindFirst) OrderBy(params ...UserOrderByParam) userFindFirst { var fields []builder.Field for _, param := range params { @@ -28307,7 +32169,7 @@ func (r userToPublicKeysFindFirst) OrderBy(params ...PublicKeyOrderByParam) user return r } -func (r userToPublicKeysFindFirst) Skip(count int) userToPublicKeysFindFirst { +func (r userFindFirst) Skip(count int) userFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -28315,7 +32177,7 @@ func (r userToPublicKeysFindFirst) Skip(count int) userToPublicKeysFindFirst { return r } -func (r userToPublicKeysFindFirst) Take(count int) userToPublicKeysFindFirst { +func (r userFindFirst) Take(count int) userFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -28323,7 +32185,7 @@ func (r userToPublicKeysFindFirst) Take(count int) userToPublicKeysFindFirst { return r } -func (r userToPublicKeysFindFirst) Cursor(cursor UserCursorParam) userToPublicKeysFindFirst { +func (r userFindFirst) Cursor(cursor UserCursorParam) userFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -28331,7 +32193,7 @@ func (r userToPublicKeysFindFirst) Cursor(cursor UserCursorParam) userToPublicKe return r } -func (r userToPublicKeysFindFirst) Exec(ctx context.Context) ( +func (r userFindFirst) Exec(ctx context.Context) ( *UserModel, error, ) { @@ -28347,7 +32209,7 @@ func (r userToPublicKeysFindFirst) Exec(ctx context.Context) ( return v, nil } -func (r userToPublicKeysFindFirst) ExecInner(ctx context.Context) ( +func (r userFindFirst) ExecInner(ctx context.Context) ( *InnerUser, error, ) { @@ -28363,23 +32225,60 @@ func (r userToPublicKeysFindFirst) ExecInner(ctx context.Context) ( return v, nil } -type userToPublicKeysFindMany struct { +type userFindMany struct { query builder.Query } -func (r userToPublicKeysFindMany) getQuery() builder.Query { +func (r userFindMany) getQuery() builder.Query { return r.query } -func (r userToPublicKeysFindMany) ExtractQuery() builder.Query { +func (r userFindMany) ExtractQuery() builder.Query { return r.query } -func (r userToPublicKeysFindMany) with() {} -func (r userToPublicKeysFindMany) userModel() {} -func (r userToPublicKeysFindMany) userRelation() {} +func (r userFindMany) with() {} +func (r userFindMany) userModel() {} +func (r userFindMany) userRelation() {} -func (r userToPublicKeysFindMany) With(params ...PublicKeyRelationWith) userToPublicKeysFindMany { +func (r userActions) FindMany( + params ...UserWhereParam, +) userFindMany { + var v userFindMany + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "query" + + v.query.Method = "findMany" + + v.query.Model = "User" + v.query.Outputs = userOutput + + var where []builder.Field + for _, q := range params { + if query := q.getQuery(); query.Operation != "" { + v.query.Outputs = append(v.query.Outputs, builder.Output{ + Name: query.Method, + Inputs: query.Inputs, + Outputs: query.Outputs, + }) + } else { + where = append(where, q.field()) + } + } + + if len(where) > 0 { + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "where", + Fields: where, + }) + } + + return v +} + +func (r userFindMany) With(params ...UserRelationWith) userFindMany { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -28392,7 +32291,7 @@ func (r userToPublicKeysFindMany) With(params ...PublicKeyRelationWith) userToPu return r } -func (r userToPublicKeysFindMany) Select(params ...userPrismaFields) userToPublicKeysFindMany { +func (r userFindMany) Select(params ...userPrismaFields) userFindMany { var outputs []builder.Output for _, param := range params { @@ -28406,7 +32305,7 @@ func (r userToPublicKeysFindMany) Select(params ...userPrismaFields) userToPubli return r } -func (r userToPublicKeysFindMany) Omit(params ...userPrismaFields) userToPublicKeysFindMany { +func (r userFindMany) Omit(params ...userPrismaFields) userFindMany { var outputs []builder.Output var raw []string @@ -28425,7 +32324,7 @@ func (r userToPublicKeysFindMany) Omit(params ...userPrismaFields) userToPublicK return r } -func (r userToPublicKeysFindMany) OrderBy(params ...PublicKeyOrderByParam) userToPublicKeysFindMany { +func (r userFindMany) OrderBy(params ...UserOrderByParam) userFindMany { var fields []builder.Field for _, param := range params { @@ -28445,7 +32344,7 @@ func (r userToPublicKeysFindMany) OrderBy(params ...PublicKeyOrderByParam) userT return r } -func (r userToPublicKeysFindMany) Skip(count int) userToPublicKeysFindMany { +func (r userFindMany) Skip(count int) userFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -28453,7 +32352,7 @@ func (r userToPublicKeysFindMany) Skip(count int) userToPublicKeysFindMany { return r } -func (r userToPublicKeysFindMany) Take(count int) userToPublicKeysFindMany { +func (r userFindMany) Take(count int) userFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -28461,7 +32360,7 @@ func (r userToPublicKeysFindMany) Take(count int) userToPublicKeysFindMany { return r } -func (r userToPublicKeysFindMany) Cursor(cursor UserCursorParam) userToPublicKeysFindMany { +func (r userFindMany) Cursor(cursor UserCursorParam) userFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -28469,7 +32368,7 @@ func (r userToPublicKeysFindMany) Cursor(cursor UserCursorParam) userToPublicKey return r } -func (r userToPublicKeysFindMany) Exec(ctx context.Context) ( +func (r userFindMany) Exec(ctx context.Context) ( []UserModel, error, ) { @@ -28481,7 +32380,7 @@ func (r userToPublicKeysFindMany) Exec(ctx context.Context) ( return v, nil } -func (r userToPublicKeysFindMany) ExecInner(ctx context.Context) ( +func (r userFindMany) ExecInner(ctx context.Context) ( []InnerUser, error, ) { @@ -28493,14 +32392,14 @@ func (r userToPublicKeysFindMany) ExecInner(ctx context.Context) ( return v, nil } -func (r userToPublicKeysFindMany) Update(params ...UserSetParam) userToPublicKeysUpdateMany { +func (r userFindMany) Update(params ...UserSetParam) userUpdateMany { r.query.Operation = "mutation" r.query.Method = "updateMany" r.query.Model = "User" r.query.Outputs = countOutput - var v userToPublicKeysUpdateMany + var v userUpdateMany v.query = r.query var fields []builder.Field for _, q := range params { @@ -28529,17 +32428,17 @@ func (r userToPublicKeysFindMany) Update(params ...UserSetParam) userToPublicKey return v } -type userToPublicKeysUpdateMany struct { +type userUpdateMany struct { query builder.Query } -func (r userToPublicKeysUpdateMany) ExtractQuery() builder.Query { +func (r userUpdateMany) ExtractQuery() builder.Query { return r.query } -func (r userToPublicKeysUpdateMany) userModel() {} +func (r userUpdateMany) userModel() {} -func (r userToPublicKeysUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r userUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -28547,15 +32446,15 @@ func (r userToPublicKeysUpdateMany) Exec(ctx context.Context) (*BatchResult, err return &v, nil } -func (r userToPublicKeysUpdateMany) Tx() UserManyTxResult { +func (r userUpdateMany) Tx() UserManyTxResult { v := newUserManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r userToPublicKeysFindMany) Delete() userToPublicKeysDeleteMany { - var v userToPublicKeysDeleteMany +func (r userFindMany) Delete() userDeleteMany { + var v userDeleteMany v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteMany" @@ -28566,17 +32465,17 @@ func (r userToPublicKeysFindMany) Delete() userToPublicKeysDeleteMany { return v } -type userToPublicKeysDeleteMany struct { +type userDeleteMany struct { query builder.Query } -func (r userToPublicKeysDeleteMany) ExtractQuery() builder.Query { +func (r userDeleteMany) ExtractQuery() builder.Query { return r.query } -func (p userToPublicKeysDeleteMany) userModel() {} +func (p userDeleteMany) userModel() {} -func (r userToPublicKeysDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r userDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -28584,52 +32483,30 @@ func (r userToPublicKeysDeleteMany) Exec(ctx context.Context) (*BatchResult, err return &v, nil } -func (r userToPublicKeysDeleteMany) Tx() UserManyTxResult { +func (r userDeleteMany) Tx() UserManyTxResult { v := newUserManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type userFindUnique struct { +type publicKeyToUserFindUnique struct { query builder.Query } -func (r userFindUnique) getQuery() builder.Query { +func (r publicKeyToUserFindUnique) getQuery() builder.Query { return r.query } -func (r userFindUnique) ExtractQuery() builder.Query { +func (r publicKeyToUserFindUnique) ExtractQuery() builder.Query { return r.query } -func (r userFindUnique) with() {} -func (r userFindUnique) userModel() {} -func (r userFindUnique) userRelation() {} - -func (r userActions) FindUnique( - params UserEqualsUniqueWhereParam, -) userFindUnique { - var v userFindUnique - v.query = builder.NewQuery() - v.query.Engine = r.client - - v.query.Operation = "query" - - v.query.Method = "findUnique" - - v.query.Model = "User" - v.query.Outputs = userOutput - - v.query.Inputs = append(v.query.Inputs, builder.Input{ - Name: "where", - Fields: builder.TransformEquals([]builder.Field{params.field()}), - }) - - return v -} +func (r publicKeyToUserFindUnique) with() {} +func (r publicKeyToUserFindUnique) publicKeyModel() {} +func (r publicKeyToUserFindUnique) publicKeyRelation() {} -func (r userFindUnique) With(params ...UserRelationWith) userFindUnique { +func (r publicKeyToUserFindUnique) With(params ...UserRelationWith) publicKeyToUserFindUnique { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -28642,7 +32519,7 @@ func (r userFindUnique) With(params ...UserRelationWith) userFindUnique { return r } -func (r userFindUnique) Select(params ...userPrismaFields) userFindUnique { +func (r publicKeyToUserFindUnique) Select(params ...publicKeyPrismaFields) publicKeyToUserFindUnique { var outputs []builder.Output for _, param := range params { @@ -28656,7 +32533,7 @@ func (r userFindUnique) Select(params ...userPrismaFields) userFindUnique { return r } -func (r userFindUnique) Omit(params ...userPrismaFields) userFindUnique { +func (r publicKeyToUserFindUnique) Omit(params ...publicKeyPrismaFields) publicKeyToUserFindUnique { var outputs []builder.Output var raw []string @@ -28664,7 +32541,7 @@ func (r userFindUnique) Omit(params ...userPrismaFields) userFindUnique { raw = append(raw, string(param)) } - for _, output := range userOutput { + for _, output := range publicKeyOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -28675,11 +32552,11 @@ func (r userFindUnique) Omit(params ...userPrismaFields) userFindUnique { return r } -func (r userFindUnique) Exec(ctx context.Context) ( - *UserModel, +func (r publicKeyToUserFindUnique) Exec(ctx context.Context) ( + *PublicKeyModel, error, ) { - var v *UserModel + var v *PublicKeyModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -28691,11 +32568,11 @@ func (r userFindUnique) Exec(ctx context.Context) ( return v, nil } -func (r userFindUnique) ExecInner(ctx context.Context) ( - *InnerUser, +func (r publicKeyToUserFindUnique) ExecInner(ctx context.Context) ( + *InnerPublicKey, error, ) { - var v *InnerUser + var v *InnerPublicKey if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -28707,12 +32584,12 @@ func (r userFindUnique) ExecInner(ctx context.Context) ( return v, nil } -func (r userFindUnique) Update(params ...UserSetParam) userUpdateUnique { +func (r publicKeyToUserFindUnique) Update(params ...PublicKeySetParam) publicKeyToUserUpdateUnique { r.query.Operation = "mutation" r.query.Method = "updateOne" - r.query.Model = "User" + r.query.Model = "PublicKey" - var v userUpdateUnique + var v publicKeyToUserUpdateUnique v.query = r.query var fields []builder.Field for _, q := range params { @@ -28741,120 +32618,83 @@ func (r userFindUnique) Update(params ...UserSetParam) userUpdateUnique { return v } -type userUpdateUnique struct { +type publicKeyToUserUpdateUnique struct { query builder.Query } -func (r userUpdateUnique) ExtractQuery() builder.Query { +func (r publicKeyToUserUpdateUnique) ExtractQuery() builder.Query { return r.query } -func (r userUpdateUnique) userModel() {} +func (r publicKeyToUserUpdateUnique) publicKeyModel() {} -func (r userUpdateUnique) Exec(ctx context.Context) (*UserModel, error) { - var v UserModel +func (r publicKeyToUserUpdateUnique) Exec(ctx context.Context) (*PublicKeyModel, error) { + var v PublicKeyModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r userUpdateUnique) Tx() UserUniqueTxResult { - v := newUserUniqueTxResult() +func (r publicKeyToUserUpdateUnique) Tx() PublicKeyUniqueTxResult { + v := newPublicKeyUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r userFindUnique) Delete() userDeleteUnique { - var v userDeleteUnique +func (r publicKeyToUserFindUnique) Delete() publicKeyToUserDeleteUnique { + var v publicKeyToUserDeleteUnique v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteOne" - v.query.Model = "User" + v.query.Model = "PublicKey" return v } -type userDeleteUnique struct { +type publicKeyToUserDeleteUnique struct { query builder.Query } -func (r userDeleteUnique) ExtractQuery() builder.Query { +func (r publicKeyToUserDeleteUnique) ExtractQuery() builder.Query { return r.query } -func (p userDeleteUnique) userModel() {} +func (p publicKeyToUserDeleteUnique) publicKeyModel() {} -func (r userDeleteUnique) Exec(ctx context.Context) (*UserModel, error) { - var v UserModel +func (r publicKeyToUserDeleteUnique) Exec(ctx context.Context) (*PublicKeyModel, error) { + var v PublicKeyModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r userDeleteUnique) Tx() UserUniqueTxResult { - v := newUserUniqueTxResult() +func (r publicKeyToUserDeleteUnique) Tx() PublicKeyUniqueTxResult { + v := newPublicKeyUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type userFindFirst struct { +type publicKeyToUserFindFirst struct { query builder.Query } -func (r userFindFirst) getQuery() builder.Query { +func (r publicKeyToUserFindFirst) getQuery() builder.Query { return r.query } -func (r userFindFirst) ExtractQuery() builder.Query { +func (r publicKeyToUserFindFirst) ExtractQuery() builder.Query { return r.query } -func (r userFindFirst) with() {} -func (r userFindFirst) userModel() {} -func (r userFindFirst) userRelation() {} - -func (r userActions) FindFirst( - params ...UserWhereParam, -) userFindFirst { - var v userFindFirst - v.query = builder.NewQuery() - v.query.Engine = r.client - - v.query.Operation = "query" - - v.query.Method = "findFirst" - - v.query.Model = "User" - v.query.Outputs = userOutput - - var where []builder.Field - for _, q := range params { - if query := q.getQuery(); query.Operation != "" { - v.query.Outputs = append(v.query.Outputs, builder.Output{ - Name: query.Method, - Inputs: query.Inputs, - Outputs: query.Outputs, - }) - } else { - where = append(where, q.field()) - } - } - - if len(where) > 0 { - v.query.Inputs = append(v.query.Inputs, builder.Input{ - Name: "where", - Fields: where, - }) - } - - return v -} +func (r publicKeyToUserFindFirst) with() {} +func (r publicKeyToUserFindFirst) publicKeyModel() {} +func (r publicKeyToUserFindFirst) publicKeyRelation() {} -func (r userFindFirst) With(params ...UserRelationWith) userFindFirst { +func (r publicKeyToUserFindFirst) With(params ...UserRelationWith) publicKeyToUserFindFirst { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -28867,7 +32707,7 @@ func (r userFindFirst) With(params ...UserRelationWith) userFindFirst { return r } -func (r userFindFirst) Select(params ...userPrismaFields) userFindFirst { +func (r publicKeyToUserFindFirst) Select(params ...publicKeyPrismaFields) publicKeyToUserFindFirst { var outputs []builder.Output for _, param := range params { @@ -28881,7 +32721,7 @@ func (r userFindFirst) Select(params ...userPrismaFields) userFindFirst { return r } -func (r userFindFirst) Omit(params ...userPrismaFields) userFindFirst { +func (r publicKeyToUserFindFirst) Omit(params ...publicKeyPrismaFields) publicKeyToUserFindFirst { var outputs []builder.Output var raw []string @@ -28889,7 +32729,7 @@ func (r userFindFirst) Omit(params ...userPrismaFields) userFindFirst { raw = append(raw, string(param)) } - for _, output := range userOutput { + for _, output := range publicKeyOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -28900,7 +32740,7 @@ func (r userFindFirst) Omit(params ...userPrismaFields) userFindFirst { return r } -func (r userFindFirst) OrderBy(params ...UserOrderByParam) userFindFirst { +func (r publicKeyToUserFindFirst) OrderBy(params ...UserOrderByParam) publicKeyToUserFindFirst { var fields []builder.Field for _, param := range params { @@ -28920,7 +32760,7 @@ func (r userFindFirst) OrderBy(params ...UserOrderByParam) userFindFirst { return r } -func (r userFindFirst) Skip(count int) userFindFirst { +func (r publicKeyToUserFindFirst) Skip(count int) publicKeyToUserFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -28928,7 +32768,7 @@ func (r userFindFirst) Skip(count int) userFindFirst { return r } -func (r userFindFirst) Take(count int) userFindFirst { +func (r publicKeyToUserFindFirst) Take(count int) publicKeyToUserFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -28936,7 +32776,7 @@ func (r userFindFirst) Take(count int) userFindFirst { return r } -func (r userFindFirst) Cursor(cursor UserCursorParam) userFindFirst { +func (r publicKeyToUserFindFirst) Cursor(cursor PublicKeyCursorParam) publicKeyToUserFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -28944,11 +32784,11 @@ func (r userFindFirst) Cursor(cursor UserCursorParam) userFindFirst { return r } -func (r userFindFirst) Exec(ctx context.Context) ( - *UserModel, +func (r publicKeyToUserFindFirst) Exec(ctx context.Context) ( + *PublicKeyModel, error, ) { - var v *UserModel + var v *PublicKeyModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -28960,11 +32800,11 @@ func (r userFindFirst) Exec(ctx context.Context) ( return v, nil } -func (r userFindFirst) ExecInner(ctx context.Context) ( - *InnerUser, +func (r publicKeyToUserFindFirst) ExecInner(ctx context.Context) ( + *InnerPublicKey, error, ) { - var v *InnerUser + var v *InnerPublicKey if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -28976,60 +32816,23 @@ func (r userFindFirst) ExecInner(ctx context.Context) ( return v, nil } -type userFindMany struct { +type publicKeyToUserFindMany struct { query builder.Query } -func (r userFindMany) getQuery() builder.Query { +func (r publicKeyToUserFindMany) getQuery() builder.Query { return r.query } -func (r userFindMany) ExtractQuery() builder.Query { +func (r publicKeyToUserFindMany) ExtractQuery() builder.Query { return r.query } -func (r userFindMany) with() {} -func (r userFindMany) userModel() {} -func (r userFindMany) userRelation() {} - -func (r userActions) FindMany( - params ...UserWhereParam, -) userFindMany { - var v userFindMany - v.query = builder.NewQuery() - v.query.Engine = r.client - - v.query.Operation = "query" - - v.query.Method = "findMany" - - v.query.Model = "User" - v.query.Outputs = userOutput - - var where []builder.Field - for _, q := range params { - if query := q.getQuery(); query.Operation != "" { - v.query.Outputs = append(v.query.Outputs, builder.Output{ - Name: query.Method, - Inputs: query.Inputs, - Outputs: query.Outputs, - }) - } else { - where = append(where, q.field()) - } - } - - if len(where) > 0 { - v.query.Inputs = append(v.query.Inputs, builder.Input{ - Name: "where", - Fields: where, - }) - } - - return v -} +func (r publicKeyToUserFindMany) with() {} +func (r publicKeyToUserFindMany) publicKeyModel() {} +func (r publicKeyToUserFindMany) publicKeyRelation() {} -func (r userFindMany) With(params ...UserRelationWith) userFindMany { +func (r publicKeyToUserFindMany) With(params ...UserRelationWith) publicKeyToUserFindMany { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -29042,7 +32845,7 @@ func (r userFindMany) With(params ...UserRelationWith) userFindMany { return r } -func (r userFindMany) Select(params ...userPrismaFields) userFindMany { +func (r publicKeyToUserFindMany) Select(params ...publicKeyPrismaFields) publicKeyToUserFindMany { var outputs []builder.Output for _, param := range params { @@ -29056,7 +32859,7 @@ func (r userFindMany) Select(params ...userPrismaFields) userFindMany { return r } -func (r userFindMany) Omit(params ...userPrismaFields) userFindMany { +func (r publicKeyToUserFindMany) Omit(params ...publicKeyPrismaFields) publicKeyToUserFindMany { var outputs []builder.Output var raw []string @@ -29064,7 +32867,7 @@ func (r userFindMany) Omit(params ...userPrismaFields) userFindMany { raw = append(raw, string(param)) } - for _, output := range userOutput { + for _, output := range publicKeyOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -29075,7 +32878,7 @@ func (r userFindMany) Omit(params ...userPrismaFields) userFindMany { return r } -func (r userFindMany) OrderBy(params ...UserOrderByParam) userFindMany { +func (r publicKeyToUserFindMany) OrderBy(params ...UserOrderByParam) publicKeyToUserFindMany { var fields []builder.Field for _, param := range params { @@ -29095,7 +32898,7 @@ func (r userFindMany) OrderBy(params ...UserOrderByParam) userFindMany { return r } -func (r userFindMany) Skip(count int) userFindMany { +func (r publicKeyToUserFindMany) Skip(count int) publicKeyToUserFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -29103,7 +32906,7 @@ func (r userFindMany) Skip(count int) userFindMany { return r } -func (r userFindMany) Take(count int) userFindMany { +func (r publicKeyToUserFindMany) Take(count int) publicKeyToUserFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -29111,7 +32914,7 @@ func (r userFindMany) Take(count int) userFindMany { return r } -func (r userFindMany) Cursor(cursor UserCursorParam) userFindMany { +func (r publicKeyToUserFindMany) Cursor(cursor PublicKeyCursorParam) publicKeyToUserFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -29119,11 +32922,11 @@ func (r userFindMany) Cursor(cursor UserCursorParam) userFindMany { return r } -func (r userFindMany) Exec(ctx context.Context) ( - []UserModel, +func (r publicKeyToUserFindMany) Exec(ctx context.Context) ( + []PublicKeyModel, error, ) { - var v []UserModel + var v []PublicKeyModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -29131,11 +32934,11 @@ func (r userFindMany) Exec(ctx context.Context) ( return v, nil } -func (r userFindMany) ExecInner(ctx context.Context) ( - []InnerUser, +func (r publicKeyToUserFindMany) ExecInner(ctx context.Context) ( + []InnerPublicKey, error, ) { - var v []InnerUser + var v []InnerPublicKey if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -29143,14 +32946,14 @@ func (r userFindMany) ExecInner(ctx context.Context) ( return v, nil } -func (r userFindMany) Update(params ...UserSetParam) userUpdateMany { +func (r publicKeyToUserFindMany) Update(params ...PublicKeySetParam) publicKeyToUserUpdateMany { r.query.Operation = "mutation" r.query.Method = "updateMany" - r.query.Model = "User" + r.query.Model = "PublicKey" r.query.Outputs = countOutput - var v userUpdateMany + var v publicKeyToUserUpdateMany v.query = r.query var fields []builder.Field for _, q := range params { @@ -29179,17 +32982,17 @@ func (r userFindMany) Update(params ...UserSetParam) userUpdateMany { return v } -type userUpdateMany struct { +type publicKeyToUserUpdateMany struct { query builder.Query } -func (r userUpdateMany) ExtractQuery() builder.Query { +func (r publicKeyToUserUpdateMany) ExtractQuery() builder.Query { return r.query } -func (r userUpdateMany) userModel() {} +func (r publicKeyToUserUpdateMany) publicKeyModel() {} -func (r userUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r publicKeyToUserUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -29197,36 +33000,36 @@ func (r userUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r userUpdateMany) Tx() UserManyTxResult { - v := newUserManyTxResult() +func (r publicKeyToUserUpdateMany) Tx() PublicKeyManyTxResult { + v := newPublicKeyManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r userFindMany) Delete() userDeleteMany { - var v userDeleteMany +func (r publicKeyToUserFindMany) Delete() publicKeyToUserDeleteMany { + var v publicKeyToUserDeleteMany v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteMany" - v.query.Model = "User" + v.query.Model = "PublicKey" v.query.Outputs = countOutput return v } -type userDeleteMany struct { +type publicKeyToUserDeleteMany struct { query builder.Query } -func (r userDeleteMany) ExtractQuery() builder.Query { +func (r publicKeyToUserDeleteMany) ExtractQuery() builder.Query { return r.query } -func (p userDeleteMany) userModel() {} +func (p publicKeyToUserDeleteMany) publicKeyModel() {} -func (r userDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r publicKeyToUserDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -29234,30 +33037,52 @@ func (r userDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r userDeleteMany) Tx() UserManyTxResult { - v := newUserManyTxResult() +func (r publicKeyToUserDeleteMany) Tx() PublicKeyManyTxResult { + v := newPublicKeyManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type publicKeyToUserFindUnique struct { +type publicKeyFindUnique struct { query builder.Query } -func (r publicKeyToUserFindUnique) getQuery() builder.Query { +func (r publicKeyFindUnique) getQuery() builder.Query { return r.query } -func (r publicKeyToUserFindUnique) ExtractQuery() builder.Query { +func (r publicKeyFindUnique) ExtractQuery() builder.Query { return r.query } -func (r publicKeyToUserFindUnique) with() {} -func (r publicKeyToUserFindUnique) publicKeyModel() {} -func (r publicKeyToUserFindUnique) publicKeyRelation() {} +func (r publicKeyFindUnique) with() {} +func (r publicKeyFindUnique) publicKeyModel() {} +func (r publicKeyFindUnique) publicKeyRelation() {} -func (r publicKeyToUserFindUnique) With(params ...UserRelationWith) publicKeyToUserFindUnique { +func (r publicKeyActions) FindUnique( + params PublicKeyEqualsUniqueWhereParam, +) publicKeyFindUnique { + var v publicKeyFindUnique + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "query" + + v.query.Method = "findUnique" + + v.query.Model = "PublicKey" + v.query.Outputs = publicKeyOutput + + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "where", + Fields: builder.TransformEquals([]builder.Field{params.field()}), + }) + + return v +} + +func (r publicKeyFindUnique) With(params ...PublicKeyRelationWith) publicKeyFindUnique { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -29270,7 +33095,7 @@ func (r publicKeyToUserFindUnique) With(params ...UserRelationWith) publicKeyToU return r } -func (r publicKeyToUserFindUnique) Select(params ...publicKeyPrismaFields) publicKeyToUserFindUnique { +func (r publicKeyFindUnique) Select(params ...publicKeyPrismaFields) publicKeyFindUnique { var outputs []builder.Output for _, param := range params { @@ -29284,7 +33109,7 @@ func (r publicKeyToUserFindUnique) Select(params ...publicKeyPrismaFields) publi return r } -func (r publicKeyToUserFindUnique) Omit(params ...publicKeyPrismaFields) publicKeyToUserFindUnique { +func (r publicKeyFindUnique) Omit(params ...publicKeyPrismaFields) publicKeyFindUnique { var outputs []builder.Output var raw []string @@ -29303,7 +33128,7 @@ func (r publicKeyToUserFindUnique) Omit(params ...publicKeyPrismaFields) publicK return r } -func (r publicKeyToUserFindUnique) Exec(ctx context.Context) ( +func (r publicKeyFindUnique) Exec(ctx context.Context) ( *PublicKeyModel, error, ) { @@ -29319,7 +33144,7 @@ func (r publicKeyToUserFindUnique) Exec(ctx context.Context) ( return v, nil } -func (r publicKeyToUserFindUnique) ExecInner(ctx context.Context) ( +func (r publicKeyFindUnique) ExecInner(ctx context.Context) ( *InnerPublicKey, error, ) { @@ -29335,12 +33160,12 @@ func (r publicKeyToUserFindUnique) ExecInner(ctx context.Context) ( return v, nil } -func (r publicKeyToUserFindUnique) Update(params ...PublicKeySetParam) publicKeyToUserUpdateUnique { +func (r publicKeyFindUnique) Update(params ...PublicKeySetParam) publicKeyUpdateUnique { r.query.Operation = "mutation" r.query.Method = "updateOne" r.query.Model = "PublicKey" - var v publicKeyToUserUpdateUnique + var v publicKeyUpdateUnique v.query = r.query var fields []builder.Field for _, q := range params { @@ -29369,17 +33194,17 @@ func (r publicKeyToUserFindUnique) Update(params ...PublicKeySetParam) publicKey return v } -type publicKeyToUserUpdateUnique struct { +type publicKeyUpdateUnique struct { query builder.Query } -func (r publicKeyToUserUpdateUnique) ExtractQuery() builder.Query { +func (r publicKeyUpdateUnique) ExtractQuery() builder.Query { return r.query } -func (r publicKeyToUserUpdateUnique) publicKeyModel() {} +func (r publicKeyUpdateUnique) publicKeyModel() {} -func (r publicKeyToUserUpdateUnique) Exec(ctx context.Context) (*PublicKeyModel, error) { +func (r publicKeyUpdateUnique) Exec(ctx context.Context) (*PublicKeyModel, error) { var v PublicKeyModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -29387,15 +33212,15 @@ func (r publicKeyToUserUpdateUnique) Exec(ctx context.Context) (*PublicKeyModel, return &v, nil } -func (r publicKeyToUserUpdateUnique) Tx() PublicKeyUniqueTxResult { +func (r publicKeyUpdateUnique) Tx() PublicKeyUniqueTxResult { v := newPublicKeyUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r publicKeyToUserFindUnique) Delete() publicKeyToUserDeleteUnique { - var v publicKeyToUserDeleteUnique +func (r publicKeyFindUnique) Delete() publicKeyDeleteUnique { + var v publicKeyDeleteUnique v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteOne" @@ -29404,17 +33229,17 @@ func (r publicKeyToUserFindUnique) Delete() publicKeyToUserDeleteUnique { return v } -type publicKeyToUserDeleteUnique struct { +type publicKeyDeleteUnique struct { query builder.Query } -func (r publicKeyToUserDeleteUnique) ExtractQuery() builder.Query { +func (r publicKeyDeleteUnique) ExtractQuery() builder.Query { return r.query } -func (p publicKeyToUserDeleteUnique) publicKeyModel() {} +func (p publicKeyDeleteUnique) publicKeyModel() {} -func (r publicKeyToUserDeleteUnique) Exec(ctx context.Context) (*PublicKeyModel, error) { +func (r publicKeyDeleteUnique) Exec(ctx context.Context) (*PublicKeyModel, error) { var v PublicKeyModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -29422,30 +33247,67 @@ func (r publicKeyToUserDeleteUnique) Exec(ctx context.Context) (*PublicKeyModel, return &v, nil } -func (r publicKeyToUserDeleteUnique) Tx() PublicKeyUniqueTxResult { +func (r publicKeyDeleteUnique) Tx() PublicKeyUniqueTxResult { v := newPublicKeyUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type publicKeyToUserFindFirst struct { +type publicKeyFindFirst struct { query builder.Query } -func (r publicKeyToUserFindFirst) getQuery() builder.Query { +func (r publicKeyFindFirst) getQuery() builder.Query { return r.query } -func (r publicKeyToUserFindFirst) ExtractQuery() builder.Query { +func (r publicKeyFindFirst) ExtractQuery() builder.Query { return r.query } -func (r publicKeyToUserFindFirst) with() {} -func (r publicKeyToUserFindFirst) publicKeyModel() {} -func (r publicKeyToUserFindFirst) publicKeyRelation() {} +func (r publicKeyFindFirst) with() {} +func (r publicKeyFindFirst) publicKeyModel() {} +func (r publicKeyFindFirst) publicKeyRelation() {} -func (r publicKeyToUserFindFirst) With(params ...UserRelationWith) publicKeyToUserFindFirst { +func (r publicKeyActions) FindFirst( + params ...PublicKeyWhereParam, +) publicKeyFindFirst { + var v publicKeyFindFirst + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "query" + + v.query.Method = "findFirst" + + v.query.Model = "PublicKey" + v.query.Outputs = publicKeyOutput + + var where []builder.Field + for _, q := range params { + if query := q.getQuery(); query.Operation != "" { + v.query.Outputs = append(v.query.Outputs, builder.Output{ + Name: query.Method, + Inputs: query.Inputs, + Outputs: query.Outputs, + }) + } else { + where = append(where, q.field()) + } + } + + if len(where) > 0 { + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "where", + Fields: where, + }) + } + + return v +} + +func (r publicKeyFindFirst) With(params ...PublicKeyRelationWith) publicKeyFindFirst { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -29458,7 +33320,7 @@ func (r publicKeyToUserFindFirst) With(params ...UserRelationWith) publicKeyToUs return r } -func (r publicKeyToUserFindFirst) Select(params ...publicKeyPrismaFields) publicKeyToUserFindFirst { +func (r publicKeyFindFirst) Select(params ...publicKeyPrismaFields) publicKeyFindFirst { var outputs []builder.Output for _, param := range params { @@ -29472,7 +33334,7 @@ func (r publicKeyToUserFindFirst) Select(params ...publicKeyPrismaFields) public return r } -func (r publicKeyToUserFindFirst) Omit(params ...publicKeyPrismaFields) publicKeyToUserFindFirst { +func (r publicKeyFindFirst) Omit(params ...publicKeyPrismaFields) publicKeyFindFirst { var outputs []builder.Output var raw []string @@ -29491,7 +33353,7 @@ func (r publicKeyToUserFindFirst) Omit(params ...publicKeyPrismaFields) publicKe return r } -func (r publicKeyToUserFindFirst) OrderBy(params ...UserOrderByParam) publicKeyToUserFindFirst { +func (r publicKeyFindFirst) OrderBy(params ...PublicKeyOrderByParam) publicKeyFindFirst { var fields []builder.Field for _, param := range params { @@ -29511,7 +33373,7 @@ func (r publicKeyToUserFindFirst) OrderBy(params ...UserOrderByParam) publicKeyT return r } -func (r publicKeyToUserFindFirst) Skip(count int) publicKeyToUserFindFirst { +func (r publicKeyFindFirst) Skip(count int) publicKeyFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -29519,7 +33381,7 @@ func (r publicKeyToUserFindFirst) Skip(count int) publicKeyToUserFindFirst { return r } -func (r publicKeyToUserFindFirst) Take(count int) publicKeyToUserFindFirst { +func (r publicKeyFindFirst) Take(count int) publicKeyFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -29527,7 +33389,7 @@ func (r publicKeyToUserFindFirst) Take(count int) publicKeyToUserFindFirst { return r } -func (r publicKeyToUserFindFirst) Cursor(cursor PublicKeyCursorParam) publicKeyToUserFindFirst { +func (r publicKeyFindFirst) Cursor(cursor PublicKeyCursorParam) publicKeyFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -29535,7 +33397,7 @@ func (r publicKeyToUserFindFirst) Cursor(cursor PublicKeyCursorParam) publicKeyT return r } -func (r publicKeyToUserFindFirst) Exec(ctx context.Context) ( +func (r publicKeyFindFirst) Exec(ctx context.Context) ( *PublicKeyModel, error, ) { @@ -29551,7 +33413,7 @@ func (r publicKeyToUserFindFirst) Exec(ctx context.Context) ( return v, nil } -func (r publicKeyToUserFindFirst) ExecInner(ctx context.Context) ( +func (r publicKeyFindFirst) ExecInner(ctx context.Context) ( *InnerPublicKey, error, ) { @@ -29567,23 +33429,60 @@ func (r publicKeyToUserFindFirst) ExecInner(ctx context.Context) ( return v, nil } -type publicKeyToUserFindMany struct { +type publicKeyFindMany struct { query builder.Query } -func (r publicKeyToUserFindMany) getQuery() builder.Query { +func (r publicKeyFindMany) getQuery() builder.Query { return r.query } -func (r publicKeyToUserFindMany) ExtractQuery() builder.Query { +func (r publicKeyFindMany) ExtractQuery() builder.Query { return r.query } -func (r publicKeyToUserFindMany) with() {} -func (r publicKeyToUserFindMany) publicKeyModel() {} -func (r publicKeyToUserFindMany) publicKeyRelation() {} +func (r publicKeyFindMany) with() {} +func (r publicKeyFindMany) publicKeyModel() {} +func (r publicKeyFindMany) publicKeyRelation() {} -func (r publicKeyToUserFindMany) With(params ...UserRelationWith) publicKeyToUserFindMany { +func (r publicKeyActions) FindMany( + params ...PublicKeyWhereParam, +) publicKeyFindMany { + var v publicKeyFindMany + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "query" + + v.query.Method = "findMany" + + v.query.Model = "PublicKey" + v.query.Outputs = publicKeyOutput + + var where []builder.Field + for _, q := range params { + if query := q.getQuery(); query.Operation != "" { + v.query.Outputs = append(v.query.Outputs, builder.Output{ + Name: query.Method, + Inputs: query.Inputs, + Outputs: query.Outputs, + }) + } else { + where = append(where, q.field()) + } + } + + if len(where) > 0 { + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "where", + Fields: where, + }) + } + + return v +} + +func (r publicKeyFindMany) With(params ...PublicKeyRelationWith) publicKeyFindMany { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -29596,7 +33495,7 @@ func (r publicKeyToUserFindMany) With(params ...UserRelationWith) publicKeyToUse return r } -func (r publicKeyToUserFindMany) Select(params ...publicKeyPrismaFields) publicKeyToUserFindMany { +func (r publicKeyFindMany) Select(params ...publicKeyPrismaFields) publicKeyFindMany { var outputs []builder.Output for _, param := range params { @@ -29610,7 +33509,7 @@ func (r publicKeyToUserFindMany) Select(params ...publicKeyPrismaFields) publicK return r } -func (r publicKeyToUserFindMany) Omit(params ...publicKeyPrismaFields) publicKeyToUserFindMany { +func (r publicKeyFindMany) Omit(params ...publicKeyPrismaFields) publicKeyFindMany { var outputs []builder.Output var raw []string @@ -29629,7 +33528,7 @@ func (r publicKeyToUserFindMany) Omit(params ...publicKeyPrismaFields) publicKey return r } -func (r publicKeyToUserFindMany) OrderBy(params ...UserOrderByParam) publicKeyToUserFindMany { +func (r publicKeyFindMany) OrderBy(params ...PublicKeyOrderByParam) publicKeyFindMany { var fields []builder.Field for _, param := range params { @@ -29649,7 +33548,7 @@ func (r publicKeyToUserFindMany) OrderBy(params ...UserOrderByParam) publicKeyTo return r } -func (r publicKeyToUserFindMany) Skip(count int) publicKeyToUserFindMany { +func (r publicKeyFindMany) Skip(count int) publicKeyFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -29657,7 +33556,7 @@ func (r publicKeyToUserFindMany) Skip(count int) publicKeyToUserFindMany { return r } -func (r publicKeyToUserFindMany) Take(count int) publicKeyToUserFindMany { +func (r publicKeyFindMany) Take(count int) publicKeyFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -29665,7 +33564,7 @@ func (r publicKeyToUserFindMany) Take(count int) publicKeyToUserFindMany { return r } -func (r publicKeyToUserFindMany) Cursor(cursor PublicKeyCursorParam) publicKeyToUserFindMany { +func (r publicKeyFindMany) Cursor(cursor PublicKeyCursorParam) publicKeyFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -29673,7 +33572,7 @@ func (r publicKeyToUserFindMany) Cursor(cursor PublicKeyCursorParam) publicKeyTo return r } -func (r publicKeyToUserFindMany) Exec(ctx context.Context) ( +func (r publicKeyFindMany) Exec(ctx context.Context) ( []PublicKeyModel, error, ) { @@ -29685,7 +33584,7 @@ func (r publicKeyToUserFindMany) Exec(ctx context.Context) ( return v, nil } -func (r publicKeyToUserFindMany) ExecInner(ctx context.Context) ( +func (r publicKeyFindMany) ExecInner(ctx context.Context) ( []InnerPublicKey, error, ) { @@ -29697,14 +33596,14 @@ func (r publicKeyToUserFindMany) ExecInner(ctx context.Context) ( return v, nil } -func (r publicKeyToUserFindMany) Update(params ...PublicKeySetParam) publicKeyToUserUpdateMany { +func (r publicKeyFindMany) Update(params ...PublicKeySetParam) publicKeyUpdateMany { r.query.Operation = "mutation" r.query.Method = "updateMany" r.query.Model = "PublicKey" r.query.Outputs = countOutput - var v publicKeyToUserUpdateMany + var v publicKeyUpdateMany v.query = r.query var fields []builder.Field for _, q := range params { @@ -29733,17 +33632,17 @@ func (r publicKeyToUserFindMany) Update(params ...PublicKeySetParam) publicKeyTo return v } -type publicKeyToUserUpdateMany struct { +type publicKeyUpdateMany struct { query builder.Query } -func (r publicKeyToUserUpdateMany) ExtractQuery() builder.Query { +func (r publicKeyUpdateMany) ExtractQuery() builder.Query { return r.query } -func (r publicKeyToUserUpdateMany) publicKeyModel() {} +func (r publicKeyUpdateMany) publicKeyModel() {} -func (r publicKeyToUserUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r publicKeyUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -29751,15 +33650,15 @@ func (r publicKeyToUserUpdateMany) Exec(ctx context.Context) (*BatchResult, erro return &v, nil } -func (r publicKeyToUserUpdateMany) Tx() PublicKeyManyTxResult { +func (r publicKeyUpdateMany) Tx() PublicKeyManyTxResult { v := newPublicKeyManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r publicKeyToUserFindMany) Delete() publicKeyToUserDeleteMany { - var v publicKeyToUserDeleteMany +func (r publicKeyFindMany) Delete() publicKeyDeleteMany { + var v publicKeyDeleteMany v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteMany" @@ -29770,17 +33669,17 @@ func (r publicKeyToUserFindMany) Delete() publicKeyToUserDeleteMany { return v } -type publicKeyToUserDeleteMany struct { +type publicKeyDeleteMany struct { query builder.Query } -func (r publicKeyToUserDeleteMany) ExtractQuery() builder.Query { +func (r publicKeyDeleteMany) ExtractQuery() builder.Query { return r.query } -func (p publicKeyToUserDeleteMany) publicKeyModel() {} +func (p publicKeyDeleteMany) publicKeyModel() {} -func (r publicKeyToUserDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r publicKeyDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -29788,33 +33687,33 @@ func (r publicKeyToUserDeleteMany) Exec(ctx context.Context) (*BatchResult, erro return &v, nil } -func (r publicKeyToUserDeleteMany) Tx() PublicKeyManyTxResult { +func (r publicKeyDeleteMany) Tx() PublicKeyManyTxResult { v := newPublicKeyManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type publicKeyFindUnique struct { +type intentFindUnique struct { query builder.Query } -func (r publicKeyFindUnique) getQuery() builder.Query { +func (r intentFindUnique) getQuery() builder.Query { return r.query } -func (r publicKeyFindUnique) ExtractQuery() builder.Query { +func (r intentFindUnique) ExtractQuery() builder.Query { return r.query } -func (r publicKeyFindUnique) with() {} -func (r publicKeyFindUnique) publicKeyModel() {} -func (r publicKeyFindUnique) publicKeyRelation() {} +func (r intentFindUnique) with() {} +func (r intentFindUnique) intentModel() {} +func (r intentFindUnique) intentRelation() {} -func (r publicKeyActions) FindUnique( - params PublicKeyEqualsUniqueWhereParam, -) publicKeyFindUnique { - var v publicKeyFindUnique +func (r intentActions) FindUnique( + params IntentEqualsUniqueWhereParam, +) intentFindUnique { + var v intentFindUnique v.query = builder.NewQuery() v.query.Engine = r.client @@ -29822,8 +33721,8 @@ func (r publicKeyActions) FindUnique( v.query.Method = "findUnique" - v.query.Model = "PublicKey" - v.query.Outputs = publicKeyOutput + v.query.Model = "Intent" + v.query.Outputs = intentOutput v.query.Inputs = append(v.query.Inputs, builder.Input{ Name: "where", @@ -29833,7 +33732,7 @@ func (r publicKeyActions) FindUnique( return v } -func (r publicKeyFindUnique) With(params ...PublicKeyRelationWith) publicKeyFindUnique { +func (r intentFindUnique) With(params ...IntentRelationWith) intentFindUnique { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -29846,7 +33745,7 @@ func (r publicKeyFindUnique) With(params ...PublicKeyRelationWith) publicKeyFind return r } -func (r publicKeyFindUnique) Select(params ...publicKeyPrismaFields) publicKeyFindUnique { +func (r intentFindUnique) Select(params ...intentPrismaFields) intentFindUnique { var outputs []builder.Output for _, param := range params { @@ -29860,7 +33759,7 @@ func (r publicKeyFindUnique) Select(params ...publicKeyPrismaFields) publicKeyFi return r } -func (r publicKeyFindUnique) Omit(params ...publicKeyPrismaFields) publicKeyFindUnique { +func (r intentFindUnique) Omit(params ...intentPrismaFields) intentFindUnique { var outputs []builder.Output var raw []string @@ -29868,7 +33767,7 @@ func (r publicKeyFindUnique) Omit(params ...publicKeyPrismaFields) publicKeyFind raw = append(raw, string(param)) } - for _, output := range publicKeyOutput { + for _, output := range intentOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -29879,11 +33778,11 @@ func (r publicKeyFindUnique) Omit(params ...publicKeyPrismaFields) publicKeyFind return r } -func (r publicKeyFindUnique) Exec(ctx context.Context) ( - *PublicKeyModel, +func (r intentFindUnique) Exec(ctx context.Context) ( + *IntentModel, error, ) { - var v *PublicKeyModel + var v *IntentModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -29895,11 +33794,11 @@ func (r publicKeyFindUnique) Exec(ctx context.Context) ( return v, nil } -func (r publicKeyFindUnique) ExecInner(ctx context.Context) ( - *InnerPublicKey, +func (r intentFindUnique) ExecInner(ctx context.Context) ( + *InnerIntent, error, ) { - var v *InnerPublicKey + var v *InnerIntent if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -29911,12 +33810,12 @@ func (r publicKeyFindUnique) ExecInner(ctx context.Context) ( return v, nil } -func (r publicKeyFindUnique) Update(params ...PublicKeySetParam) publicKeyUpdateUnique { +func (r intentFindUnique) Update(params ...IntentSetParam) intentUpdateUnique { r.query.Operation = "mutation" r.query.Method = "updateOne" - r.query.Model = "PublicKey" + r.query.Model = "Intent" - var v publicKeyUpdateUnique + var v intentUpdateUnique v.query = r.query var fields []builder.Field for _, q := range params { @@ -29945,86 +33844,86 @@ func (r publicKeyFindUnique) Update(params ...PublicKeySetParam) publicKeyUpdate return v } -type publicKeyUpdateUnique struct { +type intentUpdateUnique struct { query builder.Query } -func (r publicKeyUpdateUnique) ExtractQuery() builder.Query { +func (r intentUpdateUnique) ExtractQuery() builder.Query { return r.query } -func (r publicKeyUpdateUnique) publicKeyModel() {} +func (r intentUpdateUnique) intentModel() {} -func (r publicKeyUpdateUnique) Exec(ctx context.Context) (*PublicKeyModel, error) { - var v PublicKeyModel +func (r intentUpdateUnique) Exec(ctx context.Context) (*IntentModel, error) { + var v IntentModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r publicKeyUpdateUnique) Tx() PublicKeyUniqueTxResult { - v := newPublicKeyUniqueTxResult() +func (r intentUpdateUnique) Tx() IntentUniqueTxResult { + v := newIntentUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r publicKeyFindUnique) Delete() publicKeyDeleteUnique { - var v publicKeyDeleteUnique +func (r intentFindUnique) Delete() intentDeleteUnique { + var v intentDeleteUnique v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteOne" - v.query.Model = "PublicKey" + v.query.Model = "Intent" return v } -type publicKeyDeleteUnique struct { +type intentDeleteUnique struct { query builder.Query } -func (r publicKeyDeleteUnique) ExtractQuery() builder.Query { +func (r intentDeleteUnique) ExtractQuery() builder.Query { return r.query } -func (p publicKeyDeleteUnique) publicKeyModel() {} +func (p intentDeleteUnique) intentModel() {} -func (r publicKeyDeleteUnique) Exec(ctx context.Context) (*PublicKeyModel, error) { - var v PublicKeyModel +func (r intentDeleteUnique) Exec(ctx context.Context) (*IntentModel, error) { + var v IntentModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r publicKeyDeleteUnique) Tx() PublicKeyUniqueTxResult { - v := newPublicKeyUniqueTxResult() +func (r intentDeleteUnique) Tx() IntentUniqueTxResult { + v := newIntentUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type publicKeyFindFirst struct { +type intentFindFirst struct { query builder.Query } -func (r publicKeyFindFirst) getQuery() builder.Query { +func (r intentFindFirst) getQuery() builder.Query { return r.query } -func (r publicKeyFindFirst) ExtractQuery() builder.Query { +func (r intentFindFirst) ExtractQuery() builder.Query { return r.query } -func (r publicKeyFindFirst) with() {} -func (r publicKeyFindFirst) publicKeyModel() {} -func (r publicKeyFindFirst) publicKeyRelation() {} +func (r intentFindFirst) with() {} +func (r intentFindFirst) intentModel() {} +func (r intentFindFirst) intentRelation() {} -func (r publicKeyActions) FindFirst( - params ...PublicKeyWhereParam, -) publicKeyFindFirst { - var v publicKeyFindFirst +func (r intentActions) FindFirst( + params ...IntentWhereParam, +) intentFindFirst { + var v intentFindFirst v.query = builder.NewQuery() v.query.Engine = r.client @@ -30032,8 +33931,8 @@ func (r publicKeyActions) FindFirst( v.query.Method = "findFirst" - v.query.Model = "PublicKey" - v.query.Outputs = publicKeyOutput + v.query.Model = "Intent" + v.query.Outputs = intentOutput var where []builder.Field for _, q := range params { @@ -30058,7 +33957,7 @@ func (r publicKeyActions) FindFirst( return v } -func (r publicKeyFindFirst) With(params ...PublicKeyRelationWith) publicKeyFindFirst { +func (r intentFindFirst) With(params ...IntentRelationWith) intentFindFirst { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -30071,7 +33970,7 @@ func (r publicKeyFindFirst) With(params ...PublicKeyRelationWith) publicKeyFindF return r } -func (r publicKeyFindFirst) Select(params ...publicKeyPrismaFields) publicKeyFindFirst { +func (r intentFindFirst) Select(params ...intentPrismaFields) intentFindFirst { var outputs []builder.Output for _, param := range params { @@ -30085,7 +33984,7 @@ func (r publicKeyFindFirst) Select(params ...publicKeyPrismaFields) publicKeyFin return r } -func (r publicKeyFindFirst) Omit(params ...publicKeyPrismaFields) publicKeyFindFirst { +func (r intentFindFirst) Omit(params ...intentPrismaFields) intentFindFirst { var outputs []builder.Output var raw []string @@ -30093,7 +33992,7 @@ func (r publicKeyFindFirst) Omit(params ...publicKeyPrismaFields) publicKeyFindF raw = append(raw, string(param)) } - for _, output := range publicKeyOutput { + for _, output := range intentOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -30104,7 +34003,7 @@ func (r publicKeyFindFirst) Omit(params ...publicKeyPrismaFields) publicKeyFindF return r } -func (r publicKeyFindFirst) OrderBy(params ...PublicKeyOrderByParam) publicKeyFindFirst { +func (r intentFindFirst) OrderBy(params ...IntentOrderByParam) intentFindFirst { var fields []builder.Field for _, param := range params { @@ -30124,7 +34023,7 @@ func (r publicKeyFindFirst) OrderBy(params ...PublicKeyOrderByParam) publicKeyFi return r } -func (r publicKeyFindFirst) Skip(count int) publicKeyFindFirst { +func (r intentFindFirst) Skip(count int) intentFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -30132,7 +34031,7 @@ func (r publicKeyFindFirst) Skip(count int) publicKeyFindFirst { return r } -func (r publicKeyFindFirst) Take(count int) publicKeyFindFirst { +func (r intentFindFirst) Take(count int) intentFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -30140,7 +34039,7 @@ func (r publicKeyFindFirst) Take(count int) publicKeyFindFirst { return r } -func (r publicKeyFindFirst) Cursor(cursor PublicKeyCursorParam) publicKeyFindFirst { +func (r intentFindFirst) Cursor(cursor IntentCursorParam) intentFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -30148,11 +34047,11 @@ func (r publicKeyFindFirst) Cursor(cursor PublicKeyCursorParam) publicKeyFindFir return r } -func (r publicKeyFindFirst) Exec(ctx context.Context) ( - *PublicKeyModel, +func (r intentFindFirst) Exec(ctx context.Context) ( + *IntentModel, error, ) { - var v *PublicKeyModel + var v *IntentModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -30164,11 +34063,11 @@ func (r publicKeyFindFirst) Exec(ctx context.Context) ( return v, nil } -func (r publicKeyFindFirst) ExecInner(ctx context.Context) ( - *InnerPublicKey, +func (r intentFindFirst) ExecInner(ctx context.Context) ( + *InnerIntent, error, ) { - var v *InnerPublicKey + var v *InnerIntent if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -30180,26 +34079,26 @@ func (r publicKeyFindFirst) ExecInner(ctx context.Context) ( return v, nil } -type publicKeyFindMany struct { +type intentFindMany struct { query builder.Query } -func (r publicKeyFindMany) getQuery() builder.Query { +func (r intentFindMany) getQuery() builder.Query { return r.query } -func (r publicKeyFindMany) ExtractQuery() builder.Query { +func (r intentFindMany) ExtractQuery() builder.Query { return r.query } -func (r publicKeyFindMany) with() {} -func (r publicKeyFindMany) publicKeyModel() {} -func (r publicKeyFindMany) publicKeyRelation() {} +func (r intentFindMany) with() {} +func (r intentFindMany) intentModel() {} +func (r intentFindMany) intentRelation() {} -func (r publicKeyActions) FindMany( - params ...PublicKeyWhereParam, -) publicKeyFindMany { - var v publicKeyFindMany +func (r intentActions) FindMany( + params ...IntentWhereParam, +) intentFindMany { + var v intentFindMany v.query = builder.NewQuery() v.query.Engine = r.client @@ -30207,8 +34106,8 @@ func (r publicKeyActions) FindMany( v.query.Method = "findMany" - v.query.Model = "PublicKey" - v.query.Outputs = publicKeyOutput + v.query.Model = "Intent" + v.query.Outputs = intentOutput var where []builder.Field for _, q := range params { @@ -30233,7 +34132,7 @@ func (r publicKeyActions) FindMany( return v } -func (r publicKeyFindMany) With(params ...PublicKeyRelationWith) publicKeyFindMany { +func (r intentFindMany) With(params ...IntentRelationWith) intentFindMany { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -30246,7 +34145,7 @@ func (r publicKeyFindMany) With(params ...PublicKeyRelationWith) publicKeyFindMa return r } -func (r publicKeyFindMany) Select(params ...publicKeyPrismaFields) publicKeyFindMany { +func (r intentFindMany) Select(params ...intentPrismaFields) intentFindMany { var outputs []builder.Output for _, param := range params { @@ -30260,7 +34159,7 @@ func (r publicKeyFindMany) Select(params ...publicKeyPrismaFields) publicKeyFind return r } -func (r publicKeyFindMany) Omit(params ...publicKeyPrismaFields) publicKeyFindMany { +func (r intentFindMany) Omit(params ...intentPrismaFields) intentFindMany { var outputs []builder.Output var raw []string @@ -30268,7 +34167,7 @@ func (r publicKeyFindMany) Omit(params ...publicKeyPrismaFields) publicKeyFindMa raw = append(raw, string(param)) } - for _, output := range publicKeyOutput { + for _, output := range intentOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -30279,7 +34178,7 @@ func (r publicKeyFindMany) Omit(params ...publicKeyPrismaFields) publicKeyFindMa return r } -func (r publicKeyFindMany) OrderBy(params ...PublicKeyOrderByParam) publicKeyFindMany { +func (r intentFindMany) OrderBy(params ...IntentOrderByParam) intentFindMany { var fields []builder.Field for _, param := range params { @@ -30299,7 +34198,7 @@ func (r publicKeyFindMany) OrderBy(params ...PublicKeyOrderByParam) publicKeyFin return r } -func (r publicKeyFindMany) Skip(count int) publicKeyFindMany { +func (r intentFindMany) Skip(count int) intentFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -30307,7 +34206,7 @@ func (r publicKeyFindMany) Skip(count int) publicKeyFindMany { return r } -func (r publicKeyFindMany) Take(count int) publicKeyFindMany { +func (r intentFindMany) Take(count int) intentFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -30315,7 +34214,7 @@ func (r publicKeyFindMany) Take(count int) publicKeyFindMany { return r } -func (r publicKeyFindMany) Cursor(cursor PublicKeyCursorParam) publicKeyFindMany { +func (r intentFindMany) Cursor(cursor IntentCursorParam) intentFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -30323,11 +34222,11 @@ func (r publicKeyFindMany) Cursor(cursor PublicKeyCursorParam) publicKeyFindMany return r } -func (r publicKeyFindMany) Exec(ctx context.Context) ( - []PublicKeyModel, +func (r intentFindMany) Exec(ctx context.Context) ( + []IntentModel, error, ) { - var v []PublicKeyModel + var v []IntentModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -30335,11 +34234,11 @@ func (r publicKeyFindMany) Exec(ctx context.Context) ( return v, nil } -func (r publicKeyFindMany) ExecInner(ctx context.Context) ( - []InnerPublicKey, +func (r intentFindMany) ExecInner(ctx context.Context) ( + []InnerIntent, error, ) { - var v []InnerPublicKey + var v []InnerIntent if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -30347,14 +34246,14 @@ func (r publicKeyFindMany) ExecInner(ctx context.Context) ( return v, nil } -func (r publicKeyFindMany) Update(params ...PublicKeySetParam) publicKeyUpdateMany { +func (r intentFindMany) Update(params ...IntentSetParam) intentUpdateMany { r.query.Operation = "mutation" r.query.Method = "updateMany" - r.query.Model = "PublicKey" + r.query.Model = "Intent" r.query.Outputs = countOutput - var v publicKeyUpdateMany + var v intentUpdateMany v.query = r.query var fields []builder.Field for _, q := range params { @@ -30383,17 +34282,17 @@ func (r publicKeyFindMany) Update(params ...PublicKeySetParam) publicKeyUpdateMa return v } -type publicKeyUpdateMany struct { +type intentUpdateMany struct { query builder.Query } -func (r publicKeyUpdateMany) ExtractQuery() builder.Query { +func (r intentUpdateMany) ExtractQuery() builder.Query { return r.query } -func (r publicKeyUpdateMany) publicKeyModel() {} +func (r intentUpdateMany) intentModel() {} -func (r publicKeyUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r intentUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -30401,36 +34300,36 @@ func (r publicKeyUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r publicKeyUpdateMany) Tx() PublicKeyManyTxResult { - v := newPublicKeyManyTxResult() +func (r intentUpdateMany) Tx() IntentManyTxResult { + v := newIntentManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r publicKeyFindMany) Delete() publicKeyDeleteMany { - var v publicKeyDeleteMany +func (r intentFindMany) Delete() intentDeleteMany { + var v intentDeleteMany v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteMany" - v.query.Model = "PublicKey" + v.query.Model = "Intent" v.query.Outputs = countOutput return v } -type publicKeyDeleteMany struct { +type intentDeleteMany struct { query builder.Query } -func (r publicKeyDeleteMany) ExtractQuery() builder.Query { +func (r intentDeleteMany) ExtractQuery() builder.Query { return r.query } -func (p publicKeyDeleteMany) publicKeyModel() {} +func (p intentDeleteMany) intentModel() {} -func (r publicKeyDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r intentDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -30438,52 +34337,30 @@ func (r publicKeyDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r publicKeyDeleteMany) Tx() PublicKeyManyTxResult { - v := newPublicKeyManyTxResult() +func (r intentDeleteMany) Tx() IntentManyTxResult { + v := newIntentManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type intentFindUnique struct { +type chatToMembersFindUnique struct { query builder.Query } -func (r intentFindUnique) getQuery() builder.Query { +func (r chatToMembersFindUnique) getQuery() builder.Query { return r.query } -func (r intentFindUnique) ExtractQuery() builder.Query { +func (r chatToMembersFindUnique) ExtractQuery() builder.Query { return r.query } -func (r intentFindUnique) with() {} -func (r intentFindUnique) intentModel() {} -func (r intentFindUnique) intentRelation() {} - -func (r intentActions) FindUnique( - params IntentEqualsUniqueWhereParam, -) intentFindUnique { - var v intentFindUnique - v.query = builder.NewQuery() - v.query.Engine = r.client - - v.query.Operation = "query" - - v.query.Method = "findUnique" - - v.query.Model = "Intent" - v.query.Outputs = intentOutput - - v.query.Inputs = append(v.query.Inputs, builder.Input{ - Name: "where", - Fields: builder.TransformEquals([]builder.Field{params.field()}), - }) - - return v -} +func (r chatToMembersFindUnique) with() {} +func (r chatToMembersFindUnique) chatModel() {} +func (r chatToMembersFindUnique) chatRelation() {} -func (r intentFindUnique) With(params ...IntentRelationWith) intentFindUnique { +func (r chatToMembersFindUnique) With(params ...MemberRelationWith) chatToMembersFindUnique { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -30496,7 +34373,7 @@ func (r intentFindUnique) With(params ...IntentRelationWith) intentFindUnique { return r } -func (r intentFindUnique) Select(params ...intentPrismaFields) intentFindUnique { +func (r chatToMembersFindUnique) Select(params ...chatPrismaFields) chatToMembersFindUnique { var outputs []builder.Output for _, param := range params { @@ -30510,7 +34387,7 @@ func (r intentFindUnique) Select(params ...intentPrismaFields) intentFindUnique return r } -func (r intentFindUnique) Omit(params ...intentPrismaFields) intentFindUnique { +func (r chatToMembersFindUnique) Omit(params ...chatPrismaFields) chatToMembersFindUnique { var outputs []builder.Output var raw []string @@ -30518,7 +34395,7 @@ func (r intentFindUnique) Omit(params ...intentPrismaFields) intentFindUnique { raw = append(raw, string(param)) } - for _, output := range intentOutput { + for _, output := range chatOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -30529,11 +34406,11 @@ func (r intentFindUnique) Omit(params ...intentPrismaFields) intentFindUnique { return r } -func (r intentFindUnique) Exec(ctx context.Context) ( - *IntentModel, +func (r chatToMembersFindUnique) Exec(ctx context.Context) ( + *ChatModel, error, ) { - var v *IntentModel + var v *ChatModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -30545,11 +34422,11 @@ func (r intentFindUnique) Exec(ctx context.Context) ( return v, nil } -func (r intentFindUnique) ExecInner(ctx context.Context) ( - *InnerIntent, +func (r chatToMembersFindUnique) ExecInner(ctx context.Context) ( + *InnerChat, error, ) { - var v *InnerIntent + var v *InnerChat if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -30561,12 +34438,12 @@ func (r intentFindUnique) ExecInner(ctx context.Context) ( return v, nil } -func (r intentFindUnique) Update(params ...IntentSetParam) intentUpdateUnique { +func (r chatToMembersFindUnique) Update(params ...ChatSetParam) chatToMembersUpdateUnique { r.query.Operation = "mutation" r.query.Method = "updateOne" - r.query.Model = "Intent" + r.query.Model = "Chat" - var v intentUpdateUnique + var v chatToMembersUpdateUnique v.query = r.query var fields []builder.Field for _, q := range params { @@ -30595,120 +34472,83 @@ func (r intentFindUnique) Update(params ...IntentSetParam) intentUpdateUnique { return v } -type intentUpdateUnique struct { +type chatToMembersUpdateUnique struct { query builder.Query } -func (r intentUpdateUnique) ExtractQuery() builder.Query { +func (r chatToMembersUpdateUnique) ExtractQuery() builder.Query { return r.query } -func (r intentUpdateUnique) intentModel() {} +func (r chatToMembersUpdateUnique) chatModel() {} -func (r intentUpdateUnique) Exec(ctx context.Context) (*IntentModel, error) { - var v IntentModel +func (r chatToMembersUpdateUnique) Exec(ctx context.Context) (*ChatModel, error) { + var v ChatModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r intentUpdateUnique) Tx() IntentUniqueTxResult { - v := newIntentUniqueTxResult() +func (r chatToMembersUpdateUnique) Tx() ChatUniqueTxResult { + v := newChatUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r intentFindUnique) Delete() intentDeleteUnique { - var v intentDeleteUnique +func (r chatToMembersFindUnique) Delete() chatToMembersDeleteUnique { + var v chatToMembersDeleteUnique v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteOne" - v.query.Model = "Intent" + v.query.Model = "Chat" return v } -type intentDeleteUnique struct { +type chatToMembersDeleteUnique struct { query builder.Query } -func (r intentDeleteUnique) ExtractQuery() builder.Query { +func (r chatToMembersDeleteUnique) ExtractQuery() builder.Query { return r.query } -func (p intentDeleteUnique) intentModel() {} +func (p chatToMembersDeleteUnique) chatModel() {} -func (r intentDeleteUnique) Exec(ctx context.Context) (*IntentModel, error) { - var v IntentModel +func (r chatToMembersDeleteUnique) Exec(ctx context.Context) (*ChatModel, error) { + var v ChatModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r intentDeleteUnique) Tx() IntentUniqueTxResult { - v := newIntentUniqueTxResult() +func (r chatToMembersDeleteUnique) Tx() ChatUniqueTxResult { + v := newChatUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type intentFindFirst struct { +type chatToMembersFindFirst struct { query builder.Query } -func (r intentFindFirst) getQuery() builder.Query { +func (r chatToMembersFindFirst) getQuery() builder.Query { return r.query } -func (r intentFindFirst) ExtractQuery() builder.Query { +func (r chatToMembersFindFirst) ExtractQuery() builder.Query { return r.query } -func (r intentFindFirst) with() {} -func (r intentFindFirst) intentModel() {} -func (r intentFindFirst) intentRelation() {} - -func (r intentActions) FindFirst( - params ...IntentWhereParam, -) intentFindFirst { - var v intentFindFirst - v.query = builder.NewQuery() - v.query.Engine = r.client - - v.query.Operation = "query" - - v.query.Method = "findFirst" - - v.query.Model = "Intent" - v.query.Outputs = intentOutput - - var where []builder.Field - for _, q := range params { - if query := q.getQuery(); query.Operation != "" { - v.query.Outputs = append(v.query.Outputs, builder.Output{ - Name: query.Method, - Inputs: query.Inputs, - Outputs: query.Outputs, - }) - } else { - where = append(where, q.field()) - } - } - - if len(where) > 0 { - v.query.Inputs = append(v.query.Inputs, builder.Input{ - Name: "where", - Fields: where, - }) - } - - return v -} +func (r chatToMembersFindFirst) with() {} +func (r chatToMembersFindFirst) chatModel() {} +func (r chatToMembersFindFirst) chatRelation() {} -func (r intentFindFirst) With(params ...IntentRelationWith) intentFindFirst { +func (r chatToMembersFindFirst) With(params ...MemberRelationWith) chatToMembersFindFirst { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -30721,7 +34561,7 @@ func (r intentFindFirst) With(params ...IntentRelationWith) intentFindFirst { return r } -func (r intentFindFirst) Select(params ...intentPrismaFields) intentFindFirst { +func (r chatToMembersFindFirst) Select(params ...chatPrismaFields) chatToMembersFindFirst { var outputs []builder.Output for _, param := range params { @@ -30735,7 +34575,7 @@ func (r intentFindFirst) Select(params ...intentPrismaFields) intentFindFirst { return r } -func (r intentFindFirst) Omit(params ...intentPrismaFields) intentFindFirst { +func (r chatToMembersFindFirst) Omit(params ...chatPrismaFields) chatToMembersFindFirst { var outputs []builder.Output var raw []string @@ -30743,7 +34583,7 @@ func (r intentFindFirst) Omit(params ...intentPrismaFields) intentFindFirst { raw = append(raw, string(param)) } - for _, output := range intentOutput { + for _, output := range chatOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -30754,7 +34594,7 @@ func (r intentFindFirst) Omit(params ...intentPrismaFields) intentFindFirst { return r } -func (r intentFindFirst) OrderBy(params ...IntentOrderByParam) intentFindFirst { +func (r chatToMembersFindFirst) OrderBy(params ...MemberOrderByParam) chatToMembersFindFirst { var fields []builder.Field for _, param := range params { @@ -30774,7 +34614,7 @@ func (r intentFindFirst) OrderBy(params ...IntentOrderByParam) intentFindFirst { return r } -func (r intentFindFirst) Skip(count int) intentFindFirst { +func (r chatToMembersFindFirst) Skip(count int) chatToMembersFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -30782,7 +34622,7 @@ func (r intentFindFirst) Skip(count int) intentFindFirst { return r } -func (r intentFindFirst) Take(count int) intentFindFirst { +func (r chatToMembersFindFirst) Take(count int) chatToMembersFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -30790,7 +34630,7 @@ func (r intentFindFirst) Take(count int) intentFindFirst { return r } -func (r intentFindFirst) Cursor(cursor IntentCursorParam) intentFindFirst { +func (r chatToMembersFindFirst) Cursor(cursor ChatCursorParam) chatToMembersFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -30798,11 +34638,11 @@ func (r intentFindFirst) Cursor(cursor IntentCursorParam) intentFindFirst { return r } -func (r intentFindFirst) Exec(ctx context.Context) ( - *IntentModel, +func (r chatToMembersFindFirst) Exec(ctx context.Context) ( + *ChatModel, error, ) { - var v *IntentModel + var v *ChatModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -30814,11 +34654,11 @@ func (r intentFindFirst) Exec(ctx context.Context) ( return v, nil } -func (r intentFindFirst) ExecInner(ctx context.Context) ( - *InnerIntent, +func (r chatToMembersFindFirst) ExecInner(ctx context.Context) ( + *InnerChat, error, ) { - var v *InnerIntent + var v *InnerChat if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -30830,60 +34670,23 @@ func (r intentFindFirst) ExecInner(ctx context.Context) ( return v, nil } -type intentFindMany struct { +type chatToMembersFindMany struct { query builder.Query } -func (r intentFindMany) getQuery() builder.Query { +func (r chatToMembersFindMany) getQuery() builder.Query { return r.query } -func (r intentFindMany) ExtractQuery() builder.Query { +func (r chatToMembersFindMany) ExtractQuery() builder.Query { return r.query } -func (r intentFindMany) with() {} -func (r intentFindMany) intentModel() {} -func (r intentFindMany) intentRelation() {} - -func (r intentActions) FindMany( - params ...IntentWhereParam, -) intentFindMany { - var v intentFindMany - v.query = builder.NewQuery() - v.query.Engine = r.client - - v.query.Operation = "query" - - v.query.Method = "findMany" - - v.query.Model = "Intent" - v.query.Outputs = intentOutput - - var where []builder.Field - for _, q := range params { - if query := q.getQuery(); query.Operation != "" { - v.query.Outputs = append(v.query.Outputs, builder.Output{ - Name: query.Method, - Inputs: query.Inputs, - Outputs: query.Outputs, - }) - } else { - where = append(where, q.field()) - } - } - - if len(where) > 0 { - v.query.Inputs = append(v.query.Inputs, builder.Input{ - Name: "where", - Fields: where, - }) - } - - return v -} +func (r chatToMembersFindMany) with() {} +func (r chatToMembersFindMany) chatModel() {} +func (r chatToMembersFindMany) chatRelation() {} -func (r intentFindMany) With(params ...IntentRelationWith) intentFindMany { +func (r chatToMembersFindMany) With(params ...MemberRelationWith) chatToMembersFindMany { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -30896,7 +34699,7 @@ func (r intentFindMany) With(params ...IntentRelationWith) intentFindMany { return r } -func (r intentFindMany) Select(params ...intentPrismaFields) intentFindMany { +func (r chatToMembersFindMany) Select(params ...chatPrismaFields) chatToMembersFindMany { var outputs []builder.Output for _, param := range params { @@ -30910,7 +34713,7 @@ func (r intentFindMany) Select(params ...intentPrismaFields) intentFindMany { return r } -func (r intentFindMany) Omit(params ...intentPrismaFields) intentFindMany { +func (r chatToMembersFindMany) Omit(params ...chatPrismaFields) chatToMembersFindMany { var outputs []builder.Output var raw []string @@ -30918,7 +34721,7 @@ func (r intentFindMany) Omit(params ...intentPrismaFields) intentFindMany { raw = append(raw, string(param)) } - for _, output := range intentOutput { + for _, output := range chatOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -30929,7 +34732,7 @@ func (r intentFindMany) Omit(params ...intentPrismaFields) intentFindMany { return r } -func (r intentFindMany) OrderBy(params ...IntentOrderByParam) intentFindMany { +func (r chatToMembersFindMany) OrderBy(params ...MemberOrderByParam) chatToMembersFindMany { var fields []builder.Field for _, param := range params { @@ -30949,7 +34752,7 @@ func (r intentFindMany) OrderBy(params ...IntentOrderByParam) intentFindMany { return r } -func (r intentFindMany) Skip(count int) intentFindMany { +func (r chatToMembersFindMany) Skip(count int) chatToMembersFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -30957,7 +34760,7 @@ func (r intentFindMany) Skip(count int) intentFindMany { return r } -func (r intentFindMany) Take(count int) intentFindMany { +func (r chatToMembersFindMany) Take(count int) chatToMembersFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -30965,7 +34768,7 @@ func (r intentFindMany) Take(count int) intentFindMany { return r } -func (r intentFindMany) Cursor(cursor IntentCursorParam) intentFindMany { +func (r chatToMembersFindMany) Cursor(cursor ChatCursorParam) chatToMembersFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -30973,11 +34776,11 @@ func (r intentFindMany) Cursor(cursor IntentCursorParam) intentFindMany { return r } -func (r intentFindMany) Exec(ctx context.Context) ( - []IntentModel, +func (r chatToMembersFindMany) Exec(ctx context.Context) ( + []ChatModel, error, ) { - var v []IntentModel + var v []ChatModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -30985,11 +34788,11 @@ func (r intentFindMany) Exec(ctx context.Context) ( return v, nil } -func (r intentFindMany) ExecInner(ctx context.Context) ( - []InnerIntent, +func (r chatToMembersFindMany) ExecInner(ctx context.Context) ( + []InnerChat, error, ) { - var v []InnerIntent + var v []InnerChat if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -30997,14 +34800,14 @@ func (r intentFindMany) ExecInner(ctx context.Context) ( return v, nil } -func (r intentFindMany) Update(params ...IntentSetParam) intentUpdateMany { +func (r chatToMembersFindMany) Update(params ...ChatSetParam) chatToMembersUpdateMany { r.query.Operation = "mutation" r.query.Method = "updateMany" - r.query.Model = "Intent" + r.query.Model = "Chat" r.query.Outputs = countOutput - var v intentUpdateMany + var v chatToMembersUpdateMany v.query = r.query var fields []builder.Field for _, q := range params { @@ -31033,17 +34836,17 @@ func (r intentFindMany) Update(params ...IntentSetParam) intentUpdateMany { return v } -type intentUpdateMany struct { +type chatToMembersUpdateMany struct { query builder.Query } -func (r intentUpdateMany) ExtractQuery() builder.Query { +func (r chatToMembersUpdateMany) ExtractQuery() builder.Query { return r.query } -func (r intentUpdateMany) intentModel() {} +func (r chatToMembersUpdateMany) chatModel() {} -func (r intentUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r chatToMembersUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -31051,36 +34854,36 @@ func (r intentUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r intentUpdateMany) Tx() IntentManyTxResult { - v := newIntentManyTxResult() +func (r chatToMembersUpdateMany) Tx() ChatManyTxResult { + v := newChatManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r intentFindMany) Delete() intentDeleteMany { - var v intentDeleteMany +func (r chatToMembersFindMany) Delete() chatToMembersDeleteMany { + var v chatToMembersDeleteMany v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteMany" - v.query.Model = "Intent" + v.query.Model = "Chat" v.query.Outputs = countOutput return v } -type intentDeleteMany struct { +type chatToMembersDeleteMany struct { query builder.Query } -func (r intentDeleteMany) ExtractQuery() builder.Query { +func (r chatToMembersDeleteMany) ExtractQuery() builder.Query { return r.query } -func (p intentDeleteMany) intentModel() {} +func (p chatToMembersDeleteMany) chatModel() {} -func (r intentDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r chatToMembersDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -31088,30 +34891,52 @@ func (r intentDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r intentDeleteMany) Tx() IntentManyTxResult { - v := newIntentManyTxResult() +func (r chatToMembersDeleteMany) Tx() ChatManyTxResult { + v := newChatManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type chatToMembersFindUnique struct { +type chatFindUnique struct { query builder.Query } -func (r chatToMembersFindUnique) getQuery() builder.Query { +func (r chatFindUnique) getQuery() builder.Query { return r.query } -func (r chatToMembersFindUnique) ExtractQuery() builder.Query { +func (r chatFindUnique) ExtractQuery() builder.Query { return r.query } -func (r chatToMembersFindUnique) with() {} -func (r chatToMembersFindUnique) chatModel() {} -func (r chatToMembersFindUnique) chatRelation() {} +func (r chatFindUnique) with() {} +func (r chatFindUnique) chatModel() {} +func (r chatFindUnique) chatRelation() {} -func (r chatToMembersFindUnique) With(params ...MemberRelationWith) chatToMembersFindUnique { +func (r chatActions) FindUnique( + params ChatEqualsUniqueWhereParam, +) chatFindUnique { + var v chatFindUnique + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "query" + + v.query.Method = "findUnique" + + v.query.Model = "Chat" + v.query.Outputs = chatOutput + + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "where", + Fields: builder.TransformEquals([]builder.Field{params.field()}), + }) + + return v +} + +func (r chatFindUnique) With(params ...ChatRelationWith) chatFindUnique { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -31124,7 +34949,7 @@ func (r chatToMembersFindUnique) With(params ...MemberRelationWith) chatToMember return r } -func (r chatToMembersFindUnique) Select(params ...chatPrismaFields) chatToMembersFindUnique { +func (r chatFindUnique) Select(params ...chatPrismaFields) chatFindUnique { var outputs []builder.Output for _, param := range params { @@ -31138,7 +34963,7 @@ func (r chatToMembersFindUnique) Select(params ...chatPrismaFields) chatToMember return r } -func (r chatToMembersFindUnique) Omit(params ...chatPrismaFields) chatToMembersFindUnique { +func (r chatFindUnique) Omit(params ...chatPrismaFields) chatFindUnique { var outputs []builder.Output var raw []string @@ -31157,7 +34982,7 @@ func (r chatToMembersFindUnique) Omit(params ...chatPrismaFields) chatToMembersF return r } -func (r chatToMembersFindUnique) Exec(ctx context.Context) ( +func (r chatFindUnique) Exec(ctx context.Context) ( *ChatModel, error, ) { @@ -31173,7 +34998,7 @@ func (r chatToMembersFindUnique) Exec(ctx context.Context) ( return v, nil } -func (r chatToMembersFindUnique) ExecInner(ctx context.Context) ( +func (r chatFindUnique) ExecInner(ctx context.Context) ( *InnerChat, error, ) { @@ -31189,12 +35014,12 @@ func (r chatToMembersFindUnique) ExecInner(ctx context.Context) ( return v, nil } -func (r chatToMembersFindUnique) Update(params ...ChatSetParam) chatToMembersUpdateUnique { +func (r chatFindUnique) Update(params ...ChatSetParam) chatUpdateUnique { r.query.Operation = "mutation" r.query.Method = "updateOne" r.query.Model = "Chat" - var v chatToMembersUpdateUnique + var v chatUpdateUnique v.query = r.query var fields []builder.Field for _, q := range params { @@ -31223,17 +35048,17 @@ func (r chatToMembersFindUnique) Update(params ...ChatSetParam) chatToMembersUpd return v } -type chatToMembersUpdateUnique struct { +type chatUpdateUnique struct { query builder.Query } -func (r chatToMembersUpdateUnique) ExtractQuery() builder.Query { +func (r chatUpdateUnique) ExtractQuery() builder.Query { return r.query } -func (r chatToMembersUpdateUnique) chatModel() {} +func (r chatUpdateUnique) chatModel() {} -func (r chatToMembersUpdateUnique) Exec(ctx context.Context) (*ChatModel, error) { +func (r chatUpdateUnique) Exec(ctx context.Context) (*ChatModel, error) { var v ChatModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -31241,15 +35066,15 @@ func (r chatToMembersUpdateUnique) Exec(ctx context.Context) (*ChatModel, error) return &v, nil } -func (r chatToMembersUpdateUnique) Tx() ChatUniqueTxResult { +func (r chatUpdateUnique) Tx() ChatUniqueTxResult { v := newChatUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r chatToMembersFindUnique) Delete() chatToMembersDeleteUnique { - var v chatToMembersDeleteUnique +func (r chatFindUnique) Delete() chatDeleteUnique { + var v chatDeleteUnique v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteOne" @@ -31258,17 +35083,17 @@ func (r chatToMembersFindUnique) Delete() chatToMembersDeleteUnique { return v } -type chatToMembersDeleteUnique struct { +type chatDeleteUnique struct { query builder.Query } -func (r chatToMembersDeleteUnique) ExtractQuery() builder.Query { +func (r chatDeleteUnique) ExtractQuery() builder.Query { return r.query } -func (p chatToMembersDeleteUnique) chatModel() {} +func (p chatDeleteUnique) chatModel() {} -func (r chatToMembersDeleteUnique) Exec(ctx context.Context) (*ChatModel, error) { +func (r chatDeleteUnique) Exec(ctx context.Context) (*ChatModel, error) { var v ChatModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -31276,30 +35101,67 @@ func (r chatToMembersDeleteUnique) Exec(ctx context.Context) (*ChatModel, error) return &v, nil } -func (r chatToMembersDeleteUnique) Tx() ChatUniqueTxResult { +func (r chatDeleteUnique) Tx() ChatUniqueTxResult { v := newChatUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type chatToMembersFindFirst struct { +type chatFindFirst struct { query builder.Query } -func (r chatToMembersFindFirst) getQuery() builder.Query { +func (r chatFindFirst) getQuery() builder.Query { return r.query } -func (r chatToMembersFindFirst) ExtractQuery() builder.Query { +func (r chatFindFirst) ExtractQuery() builder.Query { return r.query } -func (r chatToMembersFindFirst) with() {} -func (r chatToMembersFindFirst) chatModel() {} -func (r chatToMembersFindFirst) chatRelation() {} +func (r chatFindFirst) with() {} +func (r chatFindFirst) chatModel() {} +func (r chatFindFirst) chatRelation() {} -func (r chatToMembersFindFirst) With(params ...MemberRelationWith) chatToMembersFindFirst { +func (r chatActions) FindFirst( + params ...ChatWhereParam, +) chatFindFirst { + var v chatFindFirst + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "query" + + v.query.Method = "findFirst" + + v.query.Model = "Chat" + v.query.Outputs = chatOutput + + var where []builder.Field + for _, q := range params { + if query := q.getQuery(); query.Operation != "" { + v.query.Outputs = append(v.query.Outputs, builder.Output{ + Name: query.Method, + Inputs: query.Inputs, + Outputs: query.Outputs, + }) + } else { + where = append(where, q.field()) + } + } + + if len(where) > 0 { + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "where", + Fields: where, + }) + } + + return v +} + +func (r chatFindFirst) With(params ...ChatRelationWith) chatFindFirst { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -31312,7 +35174,7 @@ func (r chatToMembersFindFirst) With(params ...MemberRelationWith) chatToMembers return r } -func (r chatToMembersFindFirst) Select(params ...chatPrismaFields) chatToMembersFindFirst { +func (r chatFindFirst) Select(params ...chatPrismaFields) chatFindFirst { var outputs []builder.Output for _, param := range params { @@ -31326,7 +35188,7 @@ func (r chatToMembersFindFirst) Select(params ...chatPrismaFields) chatToMembers return r } -func (r chatToMembersFindFirst) Omit(params ...chatPrismaFields) chatToMembersFindFirst { +func (r chatFindFirst) Omit(params ...chatPrismaFields) chatFindFirst { var outputs []builder.Output var raw []string @@ -31345,7 +35207,7 @@ func (r chatToMembersFindFirst) Omit(params ...chatPrismaFields) chatToMembersFi return r } -func (r chatToMembersFindFirst) OrderBy(params ...MemberOrderByParam) chatToMembersFindFirst { +func (r chatFindFirst) OrderBy(params ...ChatOrderByParam) chatFindFirst { var fields []builder.Field for _, param := range params { @@ -31365,7 +35227,7 @@ func (r chatToMembersFindFirst) OrderBy(params ...MemberOrderByParam) chatToMemb return r } -func (r chatToMembersFindFirst) Skip(count int) chatToMembersFindFirst { +func (r chatFindFirst) Skip(count int) chatFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -31373,7 +35235,7 @@ func (r chatToMembersFindFirst) Skip(count int) chatToMembersFindFirst { return r } -func (r chatToMembersFindFirst) Take(count int) chatToMembersFindFirst { +func (r chatFindFirst) Take(count int) chatFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -31381,7 +35243,7 @@ func (r chatToMembersFindFirst) Take(count int) chatToMembersFindFirst { return r } -func (r chatToMembersFindFirst) Cursor(cursor ChatCursorParam) chatToMembersFindFirst { +func (r chatFindFirst) Cursor(cursor ChatCursorParam) chatFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -31389,7 +35251,7 @@ func (r chatToMembersFindFirst) Cursor(cursor ChatCursorParam) chatToMembersFind return r } -func (r chatToMembersFindFirst) Exec(ctx context.Context) ( +func (r chatFindFirst) Exec(ctx context.Context) ( *ChatModel, error, ) { @@ -31405,7 +35267,7 @@ func (r chatToMembersFindFirst) Exec(ctx context.Context) ( return v, nil } -func (r chatToMembersFindFirst) ExecInner(ctx context.Context) ( +func (r chatFindFirst) ExecInner(ctx context.Context) ( *InnerChat, error, ) { @@ -31421,23 +35283,60 @@ func (r chatToMembersFindFirst) ExecInner(ctx context.Context) ( return v, nil } -type chatToMembersFindMany struct { +type chatFindMany struct { query builder.Query } -func (r chatToMembersFindMany) getQuery() builder.Query { +func (r chatFindMany) getQuery() builder.Query { return r.query } -func (r chatToMembersFindMany) ExtractQuery() builder.Query { +func (r chatFindMany) ExtractQuery() builder.Query { return r.query } -func (r chatToMembersFindMany) with() {} -func (r chatToMembersFindMany) chatModel() {} -func (r chatToMembersFindMany) chatRelation() {} +func (r chatFindMany) with() {} +func (r chatFindMany) chatModel() {} +func (r chatFindMany) chatRelation() {} -func (r chatToMembersFindMany) With(params ...MemberRelationWith) chatToMembersFindMany { +func (r chatActions) FindMany( + params ...ChatWhereParam, +) chatFindMany { + var v chatFindMany + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "query" + + v.query.Method = "findMany" + + v.query.Model = "Chat" + v.query.Outputs = chatOutput + + var where []builder.Field + for _, q := range params { + if query := q.getQuery(); query.Operation != "" { + v.query.Outputs = append(v.query.Outputs, builder.Output{ + Name: query.Method, + Inputs: query.Inputs, + Outputs: query.Outputs, + }) + } else { + where = append(where, q.field()) + } + } + + if len(where) > 0 { + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "where", + Fields: where, + }) + } + + return v +} + +func (r chatFindMany) With(params ...ChatRelationWith) chatFindMany { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -31450,7 +35349,7 @@ func (r chatToMembersFindMany) With(params ...MemberRelationWith) chatToMembersF return r } -func (r chatToMembersFindMany) Select(params ...chatPrismaFields) chatToMembersFindMany { +func (r chatFindMany) Select(params ...chatPrismaFields) chatFindMany { var outputs []builder.Output for _, param := range params { @@ -31464,7 +35363,7 @@ func (r chatToMembersFindMany) Select(params ...chatPrismaFields) chatToMembersF return r } -func (r chatToMembersFindMany) Omit(params ...chatPrismaFields) chatToMembersFindMany { +func (r chatFindMany) Omit(params ...chatPrismaFields) chatFindMany { var outputs []builder.Output var raw []string @@ -31483,7 +35382,7 @@ func (r chatToMembersFindMany) Omit(params ...chatPrismaFields) chatToMembersFin return r } -func (r chatToMembersFindMany) OrderBy(params ...MemberOrderByParam) chatToMembersFindMany { +func (r chatFindMany) OrderBy(params ...ChatOrderByParam) chatFindMany { var fields []builder.Field for _, param := range params { @@ -31503,7 +35402,7 @@ func (r chatToMembersFindMany) OrderBy(params ...MemberOrderByParam) chatToMembe return r } -func (r chatToMembersFindMany) Skip(count int) chatToMembersFindMany { +func (r chatFindMany) Skip(count int) chatFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -31511,7 +35410,7 @@ func (r chatToMembersFindMany) Skip(count int) chatToMembersFindMany { return r } -func (r chatToMembersFindMany) Take(count int) chatToMembersFindMany { +func (r chatFindMany) Take(count int) chatFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -31519,7 +35418,7 @@ func (r chatToMembersFindMany) Take(count int) chatToMembersFindMany { return r } -func (r chatToMembersFindMany) Cursor(cursor ChatCursorParam) chatToMembersFindMany { +func (r chatFindMany) Cursor(cursor ChatCursorParam) chatFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -31527,7 +35426,7 @@ func (r chatToMembersFindMany) Cursor(cursor ChatCursorParam) chatToMembersFindM return r } -func (r chatToMembersFindMany) Exec(ctx context.Context) ( +func (r chatFindMany) Exec(ctx context.Context) ( []ChatModel, error, ) { @@ -31539,7 +35438,7 @@ func (r chatToMembersFindMany) Exec(ctx context.Context) ( return v, nil } -func (r chatToMembersFindMany) ExecInner(ctx context.Context) ( +func (r chatFindMany) ExecInner(ctx context.Context) ( []InnerChat, error, ) { @@ -31551,14 +35450,14 @@ func (r chatToMembersFindMany) ExecInner(ctx context.Context) ( return v, nil } -func (r chatToMembersFindMany) Update(params ...ChatSetParam) chatToMembersUpdateMany { +func (r chatFindMany) Update(params ...ChatSetParam) chatUpdateMany { r.query.Operation = "mutation" r.query.Method = "updateMany" r.query.Model = "Chat" r.query.Outputs = countOutput - var v chatToMembersUpdateMany + var v chatUpdateMany v.query = r.query var fields []builder.Field for _, q := range params { @@ -31587,17 +35486,17 @@ func (r chatToMembersFindMany) Update(params ...ChatSetParam) chatToMembersUpdat return v } -type chatToMembersUpdateMany struct { +type chatUpdateMany struct { query builder.Query } -func (r chatToMembersUpdateMany) ExtractQuery() builder.Query { +func (r chatUpdateMany) ExtractQuery() builder.Query { return r.query } -func (r chatToMembersUpdateMany) chatModel() {} +func (r chatUpdateMany) chatModel() {} -func (r chatToMembersUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r chatUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -31605,15 +35504,15 @@ func (r chatToMembersUpdateMany) Exec(ctx context.Context) (*BatchResult, error) return &v, nil } -func (r chatToMembersUpdateMany) Tx() ChatManyTxResult { +func (r chatUpdateMany) Tx() ChatManyTxResult { v := newChatManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r chatToMembersFindMany) Delete() chatToMembersDeleteMany { - var v chatToMembersDeleteMany +func (r chatFindMany) Delete() chatDeleteMany { + var v chatDeleteMany v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteMany" @@ -31624,17 +35523,17 @@ func (r chatToMembersFindMany) Delete() chatToMembersDeleteMany { return v } -type chatToMembersDeleteMany struct { +type chatDeleteMany struct { query builder.Query } -func (r chatToMembersDeleteMany) ExtractQuery() builder.Query { +func (r chatDeleteMany) ExtractQuery() builder.Query { return r.query } -func (p chatToMembersDeleteMany) chatModel() {} +func (p chatDeleteMany) chatModel() {} -func (r chatToMembersDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r chatDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -31642,52 +35541,30 @@ func (r chatToMembersDeleteMany) Exec(ctx context.Context) (*BatchResult, error) return &v, nil } -func (r chatToMembersDeleteMany) Tx() ChatManyTxResult { +func (r chatDeleteMany) Tx() ChatManyTxResult { v := newChatManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type chatFindUnique struct { +type memberToChatFindUnique struct { query builder.Query } -func (r chatFindUnique) getQuery() builder.Query { +func (r memberToChatFindUnique) getQuery() builder.Query { return r.query } -func (r chatFindUnique) ExtractQuery() builder.Query { +func (r memberToChatFindUnique) ExtractQuery() builder.Query { return r.query } -func (r chatFindUnique) with() {} -func (r chatFindUnique) chatModel() {} -func (r chatFindUnique) chatRelation() {} - -func (r chatActions) FindUnique( - params ChatEqualsUniqueWhereParam, -) chatFindUnique { - var v chatFindUnique - v.query = builder.NewQuery() - v.query.Engine = r.client - - v.query.Operation = "query" - - v.query.Method = "findUnique" - - v.query.Model = "Chat" - v.query.Outputs = chatOutput - - v.query.Inputs = append(v.query.Inputs, builder.Input{ - Name: "where", - Fields: builder.TransformEquals([]builder.Field{params.field()}), - }) - - return v -} +func (r memberToChatFindUnique) with() {} +func (r memberToChatFindUnique) memberModel() {} +func (r memberToChatFindUnique) memberRelation() {} -func (r chatFindUnique) With(params ...ChatRelationWith) chatFindUnique { +func (r memberToChatFindUnique) With(params ...ChatRelationWith) memberToChatFindUnique { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -31700,7 +35577,7 @@ func (r chatFindUnique) With(params ...ChatRelationWith) chatFindUnique { return r } -func (r chatFindUnique) Select(params ...chatPrismaFields) chatFindUnique { +func (r memberToChatFindUnique) Select(params ...memberPrismaFields) memberToChatFindUnique { var outputs []builder.Output for _, param := range params { @@ -31714,7 +35591,7 @@ func (r chatFindUnique) Select(params ...chatPrismaFields) chatFindUnique { return r } -func (r chatFindUnique) Omit(params ...chatPrismaFields) chatFindUnique { +func (r memberToChatFindUnique) Omit(params ...memberPrismaFields) memberToChatFindUnique { var outputs []builder.Output var raw []string @@ -31722,7 +35599,7 @@ func (r chatFindUnique) Omit(params ...chatPrismaFields) chatFindUnique { raw = append(raw, string(param)) } - for _, output := range chatOutput { + for _, output := range memberOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -31733,11 +35610,11 @@ func (r chatFindUnique) Omit(params ...chatPrismaFields) chatFindUnique { return r } -func (r chatFindUnique) Exec(ctx context.Context) ( - *ChatModel, +func (r memberToChatFindUnique) Exec(ctx context.Context) ( + *MemberModel, error, ) { - var v *ChatModel + var v *MemberModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -31749,11 +35626,11 @@ func (r chatFindUnique) Exec(ctx context.Context) ( return v, nil } -func (r chatFindUnique) ExecInner(ctx context.Context) ( - *InnerChat, +func (r memberToChatFindUnique) ExecInner(ctx context.Context) ( + *InnerMember, error, ) { - var v *InnerChat + var v *InnerMember if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -31765,12 +35642,12 @@ func (r chatFindUnique) ExecInner(ctx context.Context) ( return v, nil } -func (r chatFindUnique) Update(params ...ChatSetParam) chatUpdateUnique { +func (r memberToChatFindUnique) Update(params ...MemberSetParam) memberToChatUpdateUnique { r.query.Operation = "mutation" r.query.Method = "updateOne" - r.query.Model = "Chat" + r.query.Model = "Member" - var v chatUpdateUnique + var v memberToChatUpdateUnique v.query = r.query var fields []builder.Field for _, q := range params { @@ -31799,120 +35676,83 @@ func (r chatFindUnique) Update(params ...ChatSetParam) chatUpdateUnique { return v } -type chatUpdateUnique struct { +type memberToChatUpdateUnique struct { query builder.Query } -func (r chatUpdateUnique) ExtractQuery() builder.Query { +func (r memberToChatUpdateUnique) ExtractQuery() builder.Query { return r.query } -func (r chatUpdateUnique) chatModel() {} +func (r memberToChatUpdateUnique) memberModel() {} -func (r chatUpdateUnique) Exec(ctx context.Context) (*ChatModel, error) { - var v ChatModel +func (r memberToChatUpdateUnique) Exec(ctx context.Context) (*MemberModel, error) { + var v MemberModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r chatUpdateUnique) Tx() ChatUniqueTxResult { - v := newChatUniqueTxResult() +func (r memberToChatUpdateUnique) Tx() MemberUniqueTxResult { + v := newMemberUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r chatFindUnique) Delete() chatDeleteUnique { - var v chatDeleteUnique +func (r memberToChatFindUnique) Delete() memberToChatDeleteUnique { + var v memberToChatDeleteUnique v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteOne" - v.query.Model = "Chat" + v.query.Model = "Member" return v } -type chatDeleteUnique struct { +type memberToChatDeleteUnique struct { query builder.Query } -func (r chatDeleteUnique) ExtractQuery() builder.Query { +func (r memberToChatDeleteUnique) ExtractQuery() builder.Query { return r.query } -func (p chatDeleteUnique) chatModel() {} +func (p memberToChatDeleteUnique) memberModel() {} -func (r chatDeleteUnique) Exec(ctx context.Context) (*ChatModel, error) { - var v ChatModel +func (r memberToChatDeleteUnique) Exec(ctx context.Context) (*MemberModel, error) { + var v MemberModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r chatDeleteUnique) Tx() ChatUniqueTxResult { - v := newChatUniqueTxResult() +func (r memberToChatDeleteUnique) Tx() MemberUniqueTxResult { + v := newMemberUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type chatFindFirst struct { +type memberToChatFindFirst struct { query builder.Query } -func (r chatFindFirst) getQuery() builder.Query { +func (r memberToChatFindFirst) getQuery() builder.Query { return r.query } -func (r chatFindFirst) ExtractQuery() builder.Query { +func (r memberToChatFindFirst) ExtractQuery() builder.Query { return r.query } -func (r chatFindFirst) with() {} -func (r chatFindFirst) chatModel() {} -func (r chatFindFirst) chatRelation() {} - -func (r chatActions) FindFirst( - params ...ChatWhereParam, -) chatFindFirst { - var v chatFindFirst - v.query = builder.NewQuery() - v.query.Engine = r.client - - v.query.Operation = "query" - - v.query.Method = "findFirst" - - v.query.Model = "Chat" - v.query.Outputs = chatOutput - - var where []builder.Field - for _, q := range params { - if query := q.getQuery(); query.Operation != "" { - v.query.Outputs = append(v.query.Outputs, builder.Output{ - Name: query.Method, - Inputs: query.Inputs, - Outputs: query.Outputs, - }) - } else { - where = append(where, q.field()) - } - } - - if len(where) > 0 { - v.query.Inputs = append(v.query.Inputs, builder.Input{ - Name: "where", - Fields: where, - }) - } - - return v -} +func (r memberToChatFindFirst) with() {} +func (r memberToChatFindFirst) memberModel() {} +func (r memberToChatFindFirst) memberRelation() {} -func (r chatFindFirst) With(params ...ChatRelationWith) chatFindFirst { +func (r memberToChatFindFirst) With(params ...ChatRelationWith) memberToChatFindFirst { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -31925,7 +35765,7 @@ func (r chatFindFirst) With(params ...ChatRelationWith) chatFindFirst { return r } -func (r chatFindFirst) Select(params ...chatPrismaFields) chatFindFirst { +func (r memberToChatFindFirst) Select(params ...memberPrismaFields) memberToChatFindFirst { var outputs []builder.Output for _, param := range params { @@ -31939,7 +35779,7 @@ func (r chatFindFirst) Select(params ...chatPrismaFields) chatFindFirst { return r } -func (r chatFindFirst) Omit(params ...chatPrismaFields) chatFindFirst { +func (r memberToChatFindFirst) Omit(params ...memberPrismaFields) memberToChatFindFirst { var outputs []builder.Output var raw []string @@ -31947,7 +35787,7 @@ func (r chatFindFirst) Omit(params ...chatPrismaFields) chatFindFirst { raw = append(raw, string(param)) } - for _, output := range chatOutput { + for _, output := range memberOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -31958,7 +35798,7 @@ func (r chatFindFirst) Omit(params ...chatPrismaFields) chatFindFirst { return r } -func (r chatFindFirst) OrderBy(params ...ChatOrderByParam) chatFindFirst { +func (r memberToChatFindFirst) OrderBy(params ...ChatOrderByParam) memberToChatFindFirst { var fields []builder.Field for _, param := range params { @@ -31978,7 +35818,7 @@ func (r chatFindFirst) OrderBy(params ...ChatOrderByParam) chatFindFirst { return r } -func (r chatFindFirst) Skip(count int) chatFindFirst { +func (r memberToChatFindFirst) Skip(count int) memberToChatFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -31986,7 +35826,7 @@ func (r chatFindFirst) Skip(count int) chatFindFirst { return r } -func (r chatFindFirst) Take(count int) chatFindFirst { +func (r memberToChatFindFirst) Take(count int) memberToChatFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -31994,7 +35834,7 @@ func (r chatFindFirst) Take(count int) chatFindFirst { return r } -func (r chatFindFirst) Cursor(cursor ChatCursorParam) chatFindFirst { +func (r memberToChatFindFirst) Cursor(cursor MemberCursorParam) memberToChatFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -32002,11 +35842,11 @@ func (r chatFindFirst) Cursor(cursor ChatCursorParam) chatFindFirst { return r } -func (r chatFindFirst) Exec(ctx context.Context) ( - *ChatModel, +func (r memberToChatFindFirst) Exec(ctx context.Context) ( + *MemberModel, error, ) { - var v *ChatModel + var v *MemberModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -32018,11 +35858,11 @@ func (r chatFindFirst) Exec(ctx context.Context) ( return v, nil } -func (r chatFindFirst) ExecInner(ctx context.Context) ( - *InnerChat, +func (r memberToChatFindFirst) ExecInner(ctx context.Context) ( + *InnerMember, error, ) { - var v *InnerChat + var v *InnerMember if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -32034,60 +35874,23 @@ func (r chatFindFirst) ExecInner(ctx context.Context) ( return v, nil } -type chatFindMany struct { +type memberToChatFindMany struct { query builder.Query } -func (r chatFindMany) getQuery() builder.Query { +func (r memberToChatFindMany) getQuery() builder.Query { return r.query } -func (r chatFindMany) ExtractQuery() builder.Query { +func (r memberToChatFindMany) ExtractQuery() builder.Query { return r.query } -func (r chatFindMany) with() {} -func (r chatFindMany) chatModel() {} -func (r chatFindMany) chatRelation() {} - -func (r chatActions) FindMany( - params ...ChatWhereParam, -) chatFindMany { - var v chatFindMany - v.query = builder.NewQuery() - v.query.Engine = r.client - - v.query.Operation = "query" - - v.query.Method = "findMany" - - v.query.Model = "Chat" - v.query.Outputs = chatOutput - - var where []builder.Field - for _, q := range params { - if query := q.getQuery(); query.Operation != "" { - v.query.Outputs = append(v.query.Outputs, builder.Output{ - Name: query.Method, - Inputs: query.Inputs, - Outputs: query.Outputs, - }) - } else { - where = append(where, q.field()) - } - } - - if len(where) > 0 { - v.query.Inputs = append(v.query.Inputs, builder.Input{ - Name: "where", - Fields: where, - }) - } - - return v -} +func (r memberToChatFindMany) with() {} +func (r memberToChatFindMany) memberModel() {} +func (r memberToChatFindMany) memberRelation() {} -func (r chatFindMany) With(params ...ChatRelationWith) chatFindMany { +func (r memberToChatFindMany) With(params ...ChatRelationWith) memberToChatFindMany { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -32100,7 +35903,7 @@ func (r chatFindMany) With(params ...ChatRelationWith) chatFindMany { return r } -func (r chatFindMany) Select(params ...chatPrismaFields) chatFindMany { +func (r memberToChatFindMany) Select(params ...memberPrismaFields) memberToChatFindMany { var outputs []builder.Output for _, param := range params { @@ -32114,7 +35917,7 @@ func (r chatFindMany) Select(params ...chatPrismaFields) chatFindMany { return r } -func (r chatFindMany) Omit(params ...chatPrismaFields) chatFindMany { +func (r memberToChatFindMany) Omit(params ...memberPrismaFields) memberToChatFindMany { var outputs []builder.Output var raw []string @@ -32122,7 +35925,7 @@ func (r chatFindMany) Omit(params ...chatPrismaFields) chatFindMany { raw = append(raw, string(param)) } - for _, output := range chatOutput { + for _, output := range memberOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -32133,7 +35936,7 @@ func (r chatFindMany) Omit(params ...chatPrismaFields) chatFindMany { return r } -func (r chatFindMany) OrderBy(params ...ChatOrderByParam) chatFindMany { +func (r memberToChatFindMany) OrderBy(params ...ChatOrderByParam) memberToChatFindMany { var fields []builder.Field for _, param := range params { @@ -32153,7 +35956,7 @@ func (r chatFindMany) OrderBy(params ...ChatOrderByParam) chatFindMany { return r } -func (r chatFindMany) Skip(count int) chatFindMany { +func (r memberToChatFindMany) Skip(count int) memberToChatFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -32161,7 +35964,7 @@ func (r chatFindMany) Skip(count int) chatFindMany { return r } -func (r chatFindMany) Take(count int) chatFindMany { +func (r memberToChatFindMany) Take(count int) memberToChatFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -32169,7 +35972,7 @@ func (r chatFindMany) Take(count int) chatFindMany { return r } -func (r chatFindMany) Cursor(cursor ChatCursorParam) chatFindMany { +func (r memberToChatFindMany) Cursor(cursor MemberCursorParam) memberToChatFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -32177,11 +35980,11 @@ func (r chatFindMany) Cursor(cursor ChatCursorParam) chatFindMany { return r } -func (r chatFindMany) Exec(ctx context.Context) ( - []ChatModel, +func (r memberToChatFindMany) Exec(ctx context.Context) ( + []MemberModel, error, ) { - var v []ChatModel + var v []MemberModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -32189,11 +35992,11 @@ func (r chatFindMany) Exec(ctx context.Context) ( return v, nil } -func (r chatFindMany) ExecInner(ctx context.Context) ( - []InnerChat, +func (r memberToChatFindMany) ExecInner(ctx context.Context) ( + []InnerMember, error, ) { - var v []InnerChat + var v []InnerMember if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -32201,14 +36004,14 @@ func (r chatFindMany) ExecInner(ctx context.Context) ( return v, nil } -func (r chatFindMany) Update(params ...ChatSetParam) chatUpdateMany { +func (r memberToChatFindMany) Update(params ...MemberSetParam) memberToChatUpdateMany { r.query.Operation = "mutation" r.query.Method = "updateMany" - r.query.Model = "Chat" + r.query.Model = "Member" r.query.Outputs = countOutput - var v chatUpdateMany + var v memberToChatUpdateMany v.query = r.query var fields []builder.Field for _, q := range params { @@ -32237,17 +36040,17 @@ func (r chatFindMany) Update(params ...ChatSetParam) chatUpdateMany { return v } -type chatUpdateMany struct { +type memberToChatUpdateMany struct { query builder.Query } -func (r chatUpdateMany) ExtractQuery() builder.Query { +func (r memberToChatUpdateMany) ExtractQuery() builder.Query { return r.query } -func (r chatUpdateMany) chatModel() {} +func (r memberToChatUpdateMany) memberModel() {} -func (r chatUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r memberToChatUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -32255,36 +36058,36 @@ func (r chatUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r chatUpdateMany) Tx() ChatManyTxResult { - v := newChatManyTxResult() +func (r memberToChatUpdateMany) Tx() MemberManyTxResult { + v := newMemberManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r chatFindMany) Delete() chatDeleteMany { - var v chatDeleteMany +func (r memberToChatFindMany) Delete() memberToChatDeleteMany { + var v memberToChatDeleteMany v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteMany" - v.query.Model = "Chat" + v.query.Model = "Member" v.query.Outputs = countOutput return v } -type chatDeleteMany struct { +type memberToChatDeleteMany struct { query builder.Query } -func (r chatDeleteMany) ExtractQuery() builder.Query { +func (r memberToChatDeleteMany) ExtractQuery() builder.Query { return r.query } -func (p chatDeleteMany) chatModel() {} +func (p memberToChatDeleteMany) memberModel() {} -func (r chatDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r memberToChatDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -32292,30 +36095,52 @@ func (r chatDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r chatDeleteMany) Tx() ChatManyTxResult { - v := newChatManyTxResult() +func (r memberToChatDeleteMany) Tx() MemberManyTxResult { + v := newMemberManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type memberToChatFindUnique struct { +type memberFindUnique struct { query builder.Query } -func (r memberToChatFindUnique) getQuery() builder.Query { +func (r memberFindUnique) getQuery() builder.Query { return r.query } -func (r memberToChatFindUnique) ExtractQuery() builder.Query { +func (r memberFindUnique) ExtractQuery() builder.Query { return r.query } -func (r memberToChatFindUnique) with() {} -func (r memberToChatFindUnique) memberModel() {} -func (r memberToChatFindUnique) memberRelation() {} +func (r memberFindUnique) with() {} +func (r memberFindUnique) memberModel() {} +func (r memberFindUnique) memberRelation() {} -func (r memberToChatFindUnique) With(params ...ChatRelationWith) memberToChatFindUnique { +func (r memberActions) FindUnique( + params MemberEqualsUniqueWhereParam, +) memberFindUnique { + var v memberFindUnique + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "query" + + v.query.Method = "findUnique" + + v.query.Model = "Member" + v.query.Outputs = memberOutput + + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "where", + Fields: builder.TransformEquals([]builder.Field{params.field()}), + }) + + return v +} + +func (r memberFindUnique) With(params ...MemberRelationWith) memberFindUnique { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -32328,7 +36153,7 @@ func (r memberToChatFindUnique) With(params ...ChatRelationWith) memberToChatFin return r } -func (r memberToChatFindUnique) Select(params ...memberPrismaFields) memberToChatFindUnique { +func (r memberFindUnique) Select(params ...memberPrismaFields) memberFindUnique { var outputs []builder.Output for _, param := range params { @@ -32342,7 +36167,7 @@ func (r memberToChatFindUnique) Select(params ...memberPrismaFields) memberToCha return r } -func (r memberToChatFindUnique) Omit(params ...memberPrismaFields) memberToChatFindUnique { +func (r memberFindUnique) Omit(params ...memberPrismaFields) memberFindUnique { var outputs []builder.Output var raw []string @@ -32361,7 +36186,7 @@ func (r memberToChatFindUnique) Omit(params ...memberPrismaFields) memberToChatF return r } -func (r memberToChatFindUnique) Exec(ctx context.Context) ( +func (r memberFindUnique) Exec(ctx context.Context) ( *MemberModel, error, ) { @@ -32377,7 +36202,7 @@ func (r memberToChatFindUnique) Exec(ctx context.Context) ( return v, nil } -func (r memberToChatFindUnique) ExecInner(ctx context.Context) ( +func (r memberFindUnique) ExecInner(ctx context.Context) ( *InnerMember, error, ) { @@ -32393,12 +36218,12 @@ func (r memberToChatFindUnique) ExecInner(ctx context.Context) ( return v, nil } -func (r memberToChatFindUnique) Update(params ...MemberSetParam) memberToChatUpdateUnique { +func (r memberFindUnique) Update(params ...MemberSetParam) memberUpdateUnique { r.query.Operation = "mutation" r.query.Method = "updateOne" r.query.Model = "Member" - var v memberToChatUpdateUnique + var v memberUpdateUnique v.query = r.query var fields []builder.Field for _, q := range params { @@ -32427,17 +36252,17 @@ func (r memberToChatFindUnique) Update(params ...MemberSetParam) memberToChatUpd return v } -type memberToChatUpdateUnique struct { +type memberUpdateUnique struct { query builder.Query } -func (r memberToChatUpdateUnique) ExtractQuery() builder.Query { +func (r memberUpdateUnique) ExtractQuery() builder.Query { return r.query } -func (r memberToChatUpdateUnique) memberModel() {} +func (r memberUpdateUnique) memberModel() {} -func (r memberToChatUpdateUnique) Exec(ctx context.Context) (*MemberModel, error) { +func (r memberUpdateUnique) Exec(ctx context.Context) (*MemberModel, error) { var v MemberModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -32445,15 +36270,15 @@ func (r memberToChatUpdateUnique) Exec(ctx context.Context) (*MemberModel, error return &v, nil } -func (r memberToChatUpdateUnique) Tx() MemberUniqueTxResult { +func (r memberUpdateUnique) Tx() MemberUniqueTxResult { v := newMemberUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r memberToChatFindUnique) Delete() memberToChatDeleteUnique { - var v memberToChatDeleteUnique +func (r memberFindUnique) Delete() memberDeleteUnique { + var v memberDeleteUnique v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteOne" @@ -32462,17 +36287,17 @@ func (r memberToChatFindUnique) Delete() memberToChatDeleteUnique { return v } -type memberToChatDeleteUnique struct { +type memberDeleteUnique struct { query builder.Query } -func (r memberToChatDeleteUnique) ExtractQuery() builder.Query { +func (r memberDeleteUnique) ExtractQuery() builder.Query { return r.query } -func (p memberToChatDeleteUnique) memberModel() {} +func (p memberDeleteUnique) memberModel() {} -func (r memberToChatDeleteUnique) Exec(ctx context.Context) (*MemberModel, error) { +func (r memberDeleteUnique) Exec(ctx context.Context) (*MemberModel, error) { var v MemberModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -32480,30 +36305,67 @@ func (r memberToChatDeleteUnique) Exec(ctx context.Context) (*MemberModel, error return &v, nil } -func (r memberToChatDeleteUnique) Tx() MemberUniqueTxResult { +func (r memberDeleteUnique) Tx() MemberUniqueTxResult { v := newMemberUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type memberToChatFindFirst struct { +type memberFindFirst struct { query builder.Query } -func (r memberToChatFindFirst) getQuery() builder.Query { +func (r memberFindFirst) getQuery() builder.Query { return r.query } -func (r memberToChatFindFirst) ExtractQuery() builder.Query { +func (r memberFindFirst) ExtractQuery() builder.Query { return r.query } -func (r memberToChatFindFirst) with() {} -func (r memberToChatFindFirst) memberModel() {} -func (r memberToChatFindFirst) memberRelation() {} +func (r memberFindFirst) with() {} +func (r memberFindFirst) memberModel() {} +func (r memberFindFirst) memberRelation() {} -func (r memberToChatFindFirst) With(params ...ChatRelationWith) memberToChatFindFirst { +func (r memberActions) FindFirst( + params ...MemberWhereParam, +) memberFindFirst { + var v memberFindFirst + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "query" + + v.query.Method = "findFirst" + + v.query.Model = "Member" + v.query.Outputs = memberOutput + + var where []builder.Field + for _, q := range params { + if query := q.getQuery(); query.Operation != "" { + v.query.Outputs = append(v.query.Outputs, builder.Output{ + Name: query.Method, + Inputs: query.Inputs, + Outputs: query.Outputs, + }) + } else { + where = append(where, q.field()) + } + } + + if len(where) > 0 { + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "where", + Fields: where, + }) + } + + return v +} + +func (r memberFindFirst) With(params ...MemberRelationWith) memberFindFirst { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -32516,7 +36378,7 @@ func (r memberToChatFindFirst) With(params ...ChatRelationWith) memberToChatFind return r } -func (r memberToChatFindFirst) Select(params ...memberPrismaFields) memberToChatFindFirst { +func (r memberFindFirst) Select(params ...memberPrismaFields) memberFindFirst { var outputs []builder.Output for _, param := range params { @@ -32530,7 +36392,7 @@ func (r memberToChatFindFirst) Select(params ...memberPrismaFields) memberToChat return r } -func (r memberToChatFindFirst) Omit(params ...memberPrismaFields) memberToChatFindFirst { +func (r memberFindFirst) Omit(params ...memberPrismaFields) memberFindFirst { var outputs []builder.Output var raw []string @@ -32549,7 +36411,7 @@ func (r memberToChatFindFirst) Omit(params ...memberPrismaFields) memberToChatFi return r } -func (r memberToChatFindFirst) OrderBy(params ...ChatOrderByParam) memberToChatFindFirst { +func (r memberFindFirst) OrderBy(params ...MemberOrderByParam) memberFindFirst { var fields []builder.Field for _, param := range params { @@ -32569,7 +36431,7 @@ func (r memberToChatFindFirst) OrderBy(params ...ChatOrderByParam) memberToChatF return r } -func (r memberToChatFindFirst) Skip(count int) memberToChatFindFirst { +func (r memberFindFirst) Skip(count int) memberFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -32577,7 +36439,7 @@ func (r memberToChatFindFirst) Skip(count int) memberToChatFindFirst { return r } -func (r memberToChatFindFirst) Take(count int) memberToChatFindFirst { +func (r memberFindFirst) Take(count int) memberFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -32585,7 +36447,7 @@ func (r memberToChatFindFirst) Take(count int) memberToChatFindFirst { return r } -func (r memberToChatFindFirst) Cursor(cursor MemberCursorParam) memberToChatFindFirst { +func (r memberFindFirst) Cursor(cursor MemberCursorParam) memberFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -32593,7 +36455,7 @@ func (r memberToChatFindFirst) Cursor(cursor MemberCursorParam) memberToChatFind return r } -func (r memberToChatFindFirst) Exec(ctx context.Context) ( +func (r memberFindFirst) Exec(ctx context.Context) ( *MemberModel, error, ) { @@ -32609,7 +36471,7 @@ func (r memberToChatFindFirst) Exec(ctx context.Context) ( return v, nil } -func (r memberToChatFindFirst) ExecInner(ctx context.Context) ( +func (r memberFindFirst) ExecInner(ctx context.Context) ( *InnerMember, error, ) { @@ -32625,23 +36487,60 @@ func (r memberToChatFindFirst) ExecInner(ctx context.Context) ( return v, nil } -type memberToChatFindMany struct { +type memberFindMany struct { query builder.Query } -func (r memberToChatFindMany) getQuery() builder.Query { +func (r memberFindMany) getQuery() builder.Query { return r.query } -func (r memberToChatFindMany) ExtractQuery() builder.Query { +func (r memberFindMany) ExtractQuery() builder.Query { return r.query } -func (r memberToChatFindMany) with() {} -func (r memberToChatFindMany) memberModel() {} -func (r memberToChatFindMany) memberRelation() {} +func (r memberFindMany) with() {} +func (r memberFindMany) memberModel() {} +func (r memberFindMany) memberRelation() {} -func (r memberToChatFindMany) With(params ...ChatRelationWith) memberToChatFindMany { +func (r memberActions) FindMany( + params ...MemberWhereParam, +) memberFindMany { + var v memberFindMany + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "query" + + v.query.Method = "findMany" + + v.query.Model = "Member" + v.query.Outputs = memberOutput + + var where []builder.Field + for _, q := range params { + if query := q.getQuery(); query.Operation != "" { + v.query.Outputs = append(v.query.Outputs, builder.Output{ + Name: query.Method, + Inputs: query.Inputs, + Outputs: query.Outputs, + }) + } else { + where = append(where, q.field()) + } + } + + if len(where) > 0 { + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "where", + Fields: where, + }) + } + + return v +} + +func (r memberFindMany) With(params ...MemberRelationWith) memberFindMany { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -32654,7 +36553,7 @@ func (r memberToChatFindMany) With(params ...ChatRelationWith) memberToChatFindM return r } -func (r memberToChatFindMany) Select(params ...memberPrismaFields) memberToChatFindMany { +func (r memberFindMany) Select(params ...memberPrismaFields) memberFindMany { var outputs []builder.Output for _, param := range params { @@ -32668,7 +36567,7 @@ func (r memberToChatFindMany) Select(params ...memberPrismaFields) memberToChatF return r } -func (r memberToChatFindMany) Omit(params ...memberPrismaFields) memberToChatFindMany { +func (r memberFindMany) Omit(params ...memberPrismaFields) memberFindMany { var outputs []builder.Output var raw []string @@ -32687,7 +36586,7 @@ func (r memberToChatFindMany) Omit(params ...memberPrismaFields) memberToChatFin return r } -func (r memberToChatFindMany) OrderBy(params ...ChatOrderByParam) memberToChatFindMany { +func (r memberFindMany) OrderBy(params ...MemberOrderByParam) memberFindMany { var fields []builder.Field for _, param := range params { @@ -32707,7 +36606,7 @@ func (r memberToChatFindMany) OrderBy(params ...ChatOrderByParam) memberToChatFi return r } -func (r memberToChatFindMany) Skip(count int) memberToChatFindMany { +func (r memberFindMany) Skip(count int) memberFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -32715,7 +36614,7 @@ func (r memberToChatFindMany) Skip(count int) memberToChatFindMany { return r } -func (r memberToChatFindMany) Take(count int) memberToChatFindMany { +func (r memberFindMany) Take(count int) memberFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -32723,7 +36622,7 @@ func (r memberToChatFindMany) Take(count int) memberToChatFindMany { return r } -func (r memberToChatFindMany) Cursor(cursor MemberCursorParam) memberToChatFindMany { +func (r memberFindMany) Cursor(cursor MemberCursorParam) memberFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -32731,7 +36630,7 @@ func (r memberToChatFindMany) Cursor(cursor MemberCursorParam) memberToChatFindM return r } -func (r memberToChatFindMany) Exec(ctx context.Context) ( +func (r memberFindMany) Exec(ctx context.Context) ( []MemberModel, error, ) { @@ -32743,7 +36642,7 @@ func (r memberToChatFindMany) Exec(ctx context.Context) ( return v, nil } -func (r memberToChatFindMany) ExecInner(ctx context.Context) ( +func (r memberFindMany) ExecInner(ctx context.Context) ( []InnerMember, error, ) { @@ -32755,14 +36654,14 @@ func (r memberToChatFindMany) ExecInner(ctx context.Context) ( return v, nil } -func (r memberToChatFindMany) Update(params ...MemberSetParam) memberToChatUpdateMany { +func (r memberFindMany) Update(params ...MemberSetParam) memberUpdateMany { r.query.Operation = "mutation" r.query.Method = "updateMany" r.query.Model = "Member" r.query.Outputs = countOutput - var v memberToChatUpdateMany + var v memberUpdateMany v.query = r.query var fields []builder.Field for _, q := range params { @@ -32791,17 +36690,17 @@ func (r memberToChatFindMany) Update(params ...MemberSetParam) memberToChatUpdat return v } -type memberToChatUpdateMany struct { +type memberUpdateMany struct { query builder.Query } -func (r memberToChatUpdateMany) ExtractQuery() builder.Query { +func (r memberUpdateMany) ExtractQuery() builder.Query { return r.query } -func (r memberToChatUpdateMany) memberModel() {} +func (r memberUpdateMany) memberModel() {} -func (r memberToChatUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r memberUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -32809,15 +36708,15 @@ func (r memberToChatUpdateMany) Exec(ctx context.Context) (*BatchResult, error) return &v, nil } -func (r memberToChatUpdateMany) Tx() MemberManyTxResult { +func (r memberUpdateMany) Tx() MemberManyTxResult { v := newMemberManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r memberToChatFindMany) Delete() memberToChatDeleteMany { - var v memberToChatDeleteMany +func (r memberFindMany) Delete() memberDeleteMany { + var v memberDeleteMany v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteMany" @@ -32828,17 +36727,17 @@ func (r memberToChatFindMany) Delete() memberToChatDeleteMany { return v } -type memberToChatDeleteMany struct { +type memberDeleteMany struct { query builder.Query } -func (r memberToChatDeleteMany) ExtractQuery() builder.Query { +func (r memberDeleteMany) ExtractQuery() builder.Query { return r.query } -func (p memberToChatDeleteMany) memberModel() {} +func (p memberDeleteMany) memberModel() {} -func (r memberToChatDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r memberDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -32846,33 +36745,33 @@ func (r memberToChatDeleteMany) Exec(ctx context.Context) (*BatchResult, error) return &v, nil } -func (r memberToChatDeleteMany) Tx() MemberManyTxResult { +func (r memberDeleteMany) Tx() MemberManyTxResult { v := newMemberManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type memberFindUnique struct { +type messageFindUnique struct { query builder.Query } -func (r memberFindUnique) getQuery() builder.Query { +func (r messageFindUnique) getQuery() builder.Query { return r.query } -func (r memberFindUnique) ExtractQuery() builder.Query { +func (r messageFindUnique) ExtractQuery() builder.Query { return r.query } -func (r memberFindUnique) with() {} -func (r memberFindUnique) memberModel() {} -func (r memberFindUnique) memberRelation() {} +func (r messageFindUnique) with() {} +func (r messageFindUnique) messageModel() {} +func (r messageFindUnique) messageRelation() {} -func (r memberActions) FindUnique( - params MemberEqualsUniqueWhereParam, -) memberFindUnique { - var v memberFindUnique +func (r messageActions) FindUnique( + params MessageEqualsUniqueWhereParam, +) messageFindUnique { + var v messageFindUnique v.query = builder.NewQuery() v.query.Engine = r.client @@ -32880,8 +36779,8 @@ func (r memberActions) FindUnique( v.query.Method = "findUnique" - v.query.Model = "Member" - v.query.Outputs = memberOutput + v.query.Model = "Message" + v.query.Outputs = messageOutput v.query.Inputs = append(v.query.Inputs, builder.Input{ Name: "where", @@ -32891,7 +36790,7 @@ func (r memberActions) FindUnique( return v } -func (r memberFindUnique) With(params ...MemberRelationWith) memberFindUnique { +func (r messageFindUnique) With(params ...MessageRelationWith) messageFindUnique { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -32904,7 +36803,7 @@ func (r memberFindUnique) With(params ...MemberRelationWith) memberFindUnique { return r } -func (r memberFindUnique) Select(params ...memberPrismaFields) memberFindUnique { +func (r messageFindUnique) Select(params ...messagePrismaFields) messageFindUnique { var outputs []builder.Output for _, param := range params { @@ -32918,7 +36817,7 @@ func (r memberFindUnique) Select(params ...memberPrismaFields) memberFindUnique return r } -func (r memberFindUnique) Omit(params ...memberPrismaFields) memberFindUnique { +func (r messageFindUnique) Omit(params ...messagePrismaFields) messageFindUnique { var outputs []builder.Output var raw []string @@ -32926,7 +36825,7 @@ func (r memberFindUnique) Omit(params ...memberPrismaFields) memberFindUnique { raw = append(raw, string(param)) } - for _, output := range memberOutput { + for _, output := range messageOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -32937,11 +36836,11 @@ func (r memberFindUnique) Omit(params ...memberPrismaFields) memberFindUnique { return r } -func (r memberFindUnique) Exec(ctx context.Context) ( - *MemberModel, +func (r messageFindUnique) Exec(ctx context.Context) ( + *MessageModel, error, ) { - var v *MemberModel + var v *MessageModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -32953,11 +36852,11 @@ func (r memberFindUnique) Exec(ctx context.Context) ( return v, nil } -func (r memberFindUnique) ExecInner(ctx context.Context) ( - *InnerMember, +func (r messageFindUnique) ExecInner(ctx context.Context) ( + *InnerMessage, error, ) { - var v *InnerMember + var v *InnerMessage if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -32969,12 +36868,12 @@ func (r memberFindUnique) ExecInner(ctx context.Context) ( return v, nil } -func (r memberFindUnique) Update(params ...MemberSetParam) memberUpdateUnique { +func (r messageFindUnique) Update(params ...MessageSetParam) messageUpdateUnique { r.query.Operation = "mutation" r.query.Method = "updateOne" - r.query.Model = "Member" + r.query.Model = "Message" - var v memberUpdateUnique + var v messageUpdateUnique v.query = r.query var fields []builder.Field for _, q := range params { @@ -33003,86 +36902,86 @@ func (r memberFindUnique) Update(params ...MemberSetParam) memberUpdateUnique { return v } -type memberUpdateUnique struct { +type messageUpdateUnique struct { query builder.Query } -func (r memberUpdateUnique) ExtractQuery() builder.Query { +func (r messageUpdateUnique) ExtractQuery() builder.Query { return r.query } -func (r memberUpdateUnique) memberModel() {} +func (r messageUpdateUnique) messageModel() {} -func (r memberUpdateUnique) Exec(ctx context.Context) (*MemberModel, error) { - var v MemberModel +func (r messageUpdateUnique) Exec(ctx context.Context) (*MessageModel, error) { + var v MessageModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r memberUpdateUnique) Tx() MemberUniqueTxResult { - v := newMemberUniqueTxResult() +func (r messageUpdateUnique) Tx() MessageUniqueTxResult { + v := newMessageUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r memberFindUnique) Delete() memberDeleteUnique { - var v memberDeleteUnique +func (r messageFindUnique) Delete() messageDeleteUnique { + var v messageDeleteUnique v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteOne" - v.query.Model = "Member" + v.query.Model = "Message" return v } -type memberDeleteUnique struct { +type messageDeleteUnique struct { query builder.Query } -func (r memberDeleteUnique) ExtractQuery() builder.Query { +func (r messageDeleteUnique) ExtractQuery() builder.Query { return r.query } -func (p memberDeleteUnique) memberModel() {} +func (p messageDeleteUnique) messageModel() {} -func (r memberDeleteUnique) Exec(ctx context.Context) (*MemberModel, error) { - var v MemberModel +func (r messageDeleteUnique) Exec(ctx context.Context) (*MessageModel, error) { + var v MessageModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r memberDeleteUnique) Tx() MemberUniqueTxResult { - v := newMemberUniqueTxResult() +func (r messageDeleteUnique) Tx() MessageUniqueTxResult { + v := newMessageUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type memberFindFirst struct { +type messageFindFirst struct { query builder.Query } -func (r memberFindFirst) getQuery() builder.Query { +func (r messageFindFirst) getQuery() builder.Query { return r.query } -func (r memberFindFirst) ExtractQuery() builder.Query { +func (r messageFindFirst) ExtractQuery() builder.Query { return r.query } -func (r memberFindFirst) with() {} -func (r memberFindFirst) memberModel() {} -func (r memberFindFirst) memberRelation() {} +func (r messageFindFirst) with() {} +func (r messageFindFirst) messageModel() {} +func (r messageFindFirst) messageRelation() {} -func (r memberActions) FindFirst( - params ...MemberWhereParam, -) memberFindFirst { - var v memberFindFirst +func (r messageActions) FindFirst( + params ...MessageWhereParam, +) messageFindFirst { + var v messageFindFirst v.query = builder.NewQuery() v.query.Engine = r.client @@ -33090,8 +36989,8 @@ func (r memberActions) FindFirst( v.query.Method = "findFirst" - v.query.Model = "Member" - v.query.Outputs = memberOutput + v.query.Model = "Message" + v.query.Outputs = messageOutput var where []builder.Field for _, q := range params { @@ -33116,7 +37015,7 @@ func (r memberActions) FindFirst( return v } -func (r memberFindFirst) With(params ...MemberRelationWith) memberFindFirst { +func (r messageFindFirst) With(params ...MessageRelationWith) messageFindFirst { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -33129,7 +37028,7 @@ func (r memberFindFirst) With(params ...MemberRelationWith) memberFindFirst { return r } -func (r memberFindFirst) Select(params ...memberPrismaFields) memberFindFirst { +func (r messageFindFirst) Select(params ...messagePrismaFields) messageFindFirst { var outputs []builder.Output for _, param := range params { @@ -33143,7 +37042,7 @@ func (r memberFindFirst) Select(params ...memberPrismaFields) memberFindFirst { return r } -func (r memberFindFirst) Omit(params ...memberPrismaFields) memberFindFirst { +func (r messageFindFirst) Omit(params ...messagePrismaFields) messageFindFirst { var outputs []builder.Output var raw []string @@ -33151,7 +37050,7 @@ func (r memberFindFirst) Omit(params ...memberPrismaFields) memberFindFirst { raw = append(raw, string(param)) } - for _, output := range memberOutput { + for _, output := range messageOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -33162,7 +37061,7 @@ func (r memberFindFirst) Omit(params ...memberPrismaFields) memberFindFirst { return r } -func (r memberFindFirst) OrderBy(params ...MemberOrderByParam) memberFindFirst { +func (r messageFindFirst) OrderBy(params ...MessageOrderByParam) messageFindFirst { var fields []builder.Field for _, param := range params { @@ -33182,7 +37081,7 @@ func (r memberFindFirst) OrderBy(params ...MemberOrderByParam) memberFindFirst { return r } -func (r memberFindFirst) Skip(count int) memberFindFirst { +func (r messageFindFirst) Skip(count int) messageFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -33190,7 +37089,7 @@ func (r memberFindFirst) Skip(count int) memberFindFirst { return r } -func (r memberFindFirst) Take(count int) memberFindFirst { +func (r messageFindFirst) Take(count int) messageFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -33198,7 +37097,7 @@ func (r memberFindFirst) Take(count int) memberFindFirst { return r } -func (r memberFindFirst) Cursor(cursor MemberCursorParam) memberFindFirst { +func (r messageFindFirst) Cursor(cursor MessageCursorParam) messageFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -33206,11 +37105,11 @@ func (r memberFindFirst) Cursor(cursor MemberCursorParam) memberFindFirst { return r } -func (r memberFindFirst) Exec(ctx context.Context) ( - *MemberModel, +func (r messageFindFirst) Exec(ctx context.Context) ( + *MessageModel, error, ) { - var v *MemberModel + var v *MessageModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -33222,11 +37121,11 @@ func (r memberFindFirst) Exec(ctx context.Context) ( return v, nil } -func (r memberFindFirst) ExecInner(ctx context.Context) ( - *InnerMember, +func (r messageFindFirst) ExecInner(ctx context.Context) ( + *InnerMessage, error, ) { - var v *InnerMember + var v *InnerMessage if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -33238,26 +37137,26 @@ func (r memberFindFirst) ExecInner(ctx context.Context) ( return v, nil } -type memberFindMany struct { +type messageFindMany struct { query builder.Query } -func (r memberFindMany) getQuery() builder.Query { +func (r messageFindMany) getQuery() builder.Query { return r.query } -func (r memberFindMany) ExtractQuery() builder.Query { +func (r messageFindMany) ExtractQuery() builder.Query { return r.query } -func (r memberFindMany) with() {} -func (r memberFindMany) memberModel() {} -func (r memberFindMany) memberRelation() {} +func (r messageFindMany) with() {} +func (r messageFindMany) messageModel() {} +func (r messageFindMany) messageRelation() {} -func (r memberActions) FindMany( - params ...MemberWhereParam, -) memberFindMany { - var v memberFindMany +func (r messageActions) FindMany( + params ...MessageWhereParam, +) messageFindMany { + var v messageFindMany v.query = builder.NewQuery() v.query.Engine = r.client @@ -33265,8 +37164,8 @@ func (r memberActions) FindMany( v.query.Method = "findMany" - v.query.Model = "Member" - v.query.Outputs = memberOutput + v.query.Model = "Message" + v.query.Outputs = messageOutput var where []builder.Field for _, q := range params { @@ -33291,7 +37190,7 @@ func (r memberActions) FindMany( return v } -func (r memberFindMany) With(params ...MemberRelationWith) memberFindMany { +func (r messageFindMany) With(params ...MessageRelationWith) messageFindMany { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -33304,7 +37203,7 @@ func (r memberFindMany) With(params ...MemberRelationWith) memberFindMany { return r } -func (r memberFindMany) Select(params ...memberPrismaFields) memberFindMany { +func (r messageFindMany) Select(params ...messagePrismaFields) messageFindMany { var outputs []builder.Output for _, param := range params { @@ -33318,7 +37217,7 @@ func (r memberFindMany) Select(params ...memberPrismaFields) memberFindMany { return r } -func (r memberFindMany) Omit(params ...memberPrismaFields) memberFindMany { +func (r messageFindMany) Omit(params ...messagePrismaFields) messageFindMany { var outputs []builder.Output var raw []string @@ -33326,7 +37225,7 @@ func (r memberFindMany) Omit(params ...memberPrismaFields) memberFindMany { raw = append(raw, string(param)) } - for _, output := range memberOutput { + for _, output := range messageOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -33337,7 +37236,7 @@ func (r memberFindMany) Omit(params ...memberPrismaFields) memberFindMany { return r } -func (r memberFindMany) OrderBy(params ...MemberOrderByParam) memberFindMany { +func (r messageFindMany) OrderBy(params ...MessageOrderByParam) messageFindMany { var fields []builder.Field for _, param := range params { @@ -33357,7 +37256,7 @@ func (r memberFindMany) OrderBy(params ...MemberOrderByParam) memberFindMany { return r } -func (r memberFindMany) Skip(count int) memberFindMany { +func (r messageFindMany) Skip(count int) messageFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -33365,7 +37264,7 @@ func (r memberFindMany) Skip(count int) memberFindMany { return r } -func (r memberFindMany) Take(count int) memberFindMany { +func (r messageFindMany) Take(count int) messageFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -33373,7 +37272,7 @@ func (r memberFindMany) Take(count int) memberFindMany { return r } -func (r memberFindMany) Cursor(cursor MemberCursorParam) memberFindMany { +func (r messageFindMany) Cursor(cursor MessageCursorParam) messageFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -33381,11 +37280,11 @@ func (r memberFindMany) Cursor(cursor MemberCursorParam) memberFindMany { return r } -func (r memberFindMany) Exec(ctx context.Context) ( - []MemberModel, +func (r messageFindMany) Exec(ctx context.Context) ( + []MessageModel, error, ) { - var v []MemberModel + var v []MessageModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -33393,11 +37292,11 @@ func (r memberFindMany) Exec(ctx context.Context) ( return v, nil } -func (r memberFindMany) ExecInner(ctx context.Context) ( - []InnerMember, +func (r messageFindMany) ExecInner(ctx context.Context) ( + []InnerMessage, error, ) { - var v []InnerMember + var v []InnerMessage if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -33405,14 +37304,14 @@ func (r memberFindMany) ExecInner(ctx context.Context) ( return v, nil } -func (r memberFindMany) Update(params ...MemberSetParam) memberUpdateMany { +func (r messageFindMany) Update(params ...MessageSetParam) messageUpdateMany { r.query.Operation = "mutation" r.query.Method = "updateMany" - r.query.Model = "Member" + r.query.Model = "Message" r.query.Outputs = countOutput - var v memberUpdateMany + var v messageUpdateMany v.query = r.query var fields []builder.Field for _, q := range params { @@ -33441,17 +37340,17 @@ func (r memberFindMany) Update(params ...MemberSetParam) memberUpdateMany { return v } -type memberUpdateMany struct { +type messageUpdateMany struct { query builder.Query } -func (r memberUpdateMany) ExtractQuery() builder.Query { +func (r messageUpdateMany) ExtractQuery() builder.Query { return r.query } -func (r memberUpdateMany) memberModel() {} +func (r messageUpdateMany) messageModel() {} -func (r memberUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r messageUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -33459,36 +37358,36 @@ func (r memberUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r memberUpdateMany) Tx() MemberManyTxResult { - v := newMemberManyTxResult() +func (r messageUpdateMany) Tx() MessageManyTxResult { + v := newMessageManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r memberFindMany) Delete() memberDeleteMany { - var v memberDeleteMany +func (r messageFindMany) Delete() messageDeleteMany { + var v messageDeleteMany v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteMany" - v.query.Model = "Member" + v.query.Model = "Message" v.query.Outputs = countOutput return v } -type memberDeleteMany struct { +type messageDeleteMany struct { query builder.Query } -func (r memberDeleteMany) ExtractQuery() builder.Query { +func (r messageDeleteMany) ExtractQuery() builder.Query { return r.query } -func (p memberDeleteMany) memberModel() {} +func (p messageDeleteMany) messageModel() {} -func (r memberDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r messageDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -33496,33 +37395,33 @@ func (r memberDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r memberDeleteMany) Tx() MemberManyTxResult { - v := newMemberManyTxResult() +func (r messageDeleteMany) Tx() MessageManyTxResult { + v := newMessageManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type messageFindUnique struct { +type pointerFindUnique struct { query builder.Query } -func (r messageFindUnique) getQuery() builder.Query { +func (r pointerFindUnique) getQuery() builder.Query { return r.query } -func (r messageFindUnique) ExtractQuery() builder.Query { +func (r pointerFindUnique) ExtractQuery() builder.Query { return r.query } -func (r messageFindUnique) with() {} -func (r messageFindUnique) messageModel() {} -func (r messageFindUnique) messageRelation() {} +func (r pointerFindUnique) with() {} +func (r pointerFindUnique) pointerModel() {} +func (r pointerFindUnique) pointerRelation() {} -func (r messageActions) FindUnique( - params MessageEqualsUniqueWhereParam, -) messageFindUnique { - var v messageFindUnique +func (r pointerActions) FindUnique( + params PointerEqualsUniqueWhereParam, +) pointerFindUnique { + var v pointerFindUnique v.query = builder.NewQuery() v.query.Engine = r.client @@ -33530,8 +37429,8 @@ func (r messageActions) FindUnique( v.query.Method = "findUnique" - v.query.Model = "Message" - v.query.Outputs = messageOutput + v.query.Model = "Pointer" + v.query.Outputs = pointerOutput v.query.Inputs = append(v.query.Inputs, builder.Input{ Name: "where", @@ -33541,7 +37440,7 @@ func (r messageActions) FindUnique( return v } -func (r messageFindUnique) With(params ...MessageRelationWith) messageFindUnique { +func (r pointerFindUnique) With(params ...PointerRelationWith) pointerFindUnique { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -33554,7 +37453,7 @@ func (r messageFindUnique) With(params ...MessageRelationWith) messageFindUnique return r } -func (r messageFindUnique) Select(params ...messagePrismaFields) messageFindUnique { +func (r pointerFindUnique) Select(params ...pointerPrismaFields) pointerFindUnique { var outputs []builder.Output for _, param := range params { @@ -33568,7 +37467,7 @@ func (r messageFindUnique) Select(params ...messagePrismaFields) messageFindUniq return r } -func (r messageFindUnique) Omit(params ...messagePrismaFields) messageFindUnique { +func (r pointerFindUnique) Omit(params ...pointerPrismaFields) pointerFindUnique { var outputs []builder.Output var raw []string @@ -33576,7 +37475,7 @@ func (r messageFindUnique) Omit(params ...messagePrismaFields) messageFindUnique raw = append(raw, string(param)) } - for _, output := range messageOutput { + for _, output := range pointerOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -33587,11 +37486,11 @@ func (r messageFindUnique) Omit(params ...messagePrismaFields) messageFindUnique return r } -func (r messageFindUnique) Exec(ctx context.Context) ( - *MessageModel, +func (r pointerFindUnique) Exec(ctx context.Context) ( + *PointerModel, error, ) { - var v *MessageModel + var v *PointerModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -33603,11 +37502,11 @@ func (r messageFindUnique) Exec(ctx context.Context) ( return v, nil } -func (r messageFindUnique) ExecInner(ctx context.Context) ( - *InnerMessage, +func (r pointerFindUnique) ExecInner(ctx context.Context) ( + *InnerPointer, error, ) { - var v *InnerMessage + var v *InnerPointer if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -33619,12 +37518,12 @@ func (r messageFindUnique) ExecInner(ctx context.Context) ( return v, nil } -func (r messageFindUnique) Update(params ...MessageSetParam) messageUpdateUnique { +func (r pointerFindUnique) Update(params ...PointerSetParam) pointerUpdateUnique { r.query.Operation = "mutation" r.query.Method = "updateOne" - r.query.Model = "Message" + r.query.Model = "Pointer" - var v messageUpdateUnique + var v pointerUpdateUnique v.query = r.query var fields []builder.Field for _, q := range params { @@ -33653,86 +37552,86 @@ func (r messageFindUnique) Update(params ...MessageSetParam) messageUpdateUnique return v } -type messageUpdateUnique struct { +type pointerUpdateUnique struct { query builder.Query } -func (r messageUpdateUnique) ExtractQuery() builder.Query { +func (r pointerUpdateUnique) ExtractQuery() builder.Query { return r.query } -func (r messageUpdateUnique) messageModel() {} +func (r pointerUpdateUnique) pointerModel() {} -func (r messageUpdateUnique) Exec(ctx context.Context) (*MessageModel, error) { - var v MessageModel +func (r pointerUpdateUnique) Exec(ctx context.Context) (*PointerModel, error) { + var v PointerModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r messageUpdateUnique) Tx() MessageUniqueTxResult { - v := newMessageUniqueTxResult() +func (r pointerUpdateUnique) Tx() PointerUniqueTxResult { + v := newPointerUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r messageFindUnique) Delete() messageDeleteUnique { - var v messageDeleteUnique +func (r pointerFindUnique) Delete() pointerDeleteUnique { + var v pointerDeleteUnique v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteOne" - v.query.Model = "Message" + v.query.Model = "Pointer" return v } -type messageDeleteUnique struct { +type pointerDeleteUnique struct { query builder.Query } -func (r messageDeleteUnique) ExtractQuery() builder.Query { +func (r pointerDeleteUnique) ExtractQuery() builder.Query { return r.query } -func (p messageDeleteUnique) messageModel() {} +func (p pointerDeleteUnique) pointerModel() {} -func (r messageDeleteUnique) Exec(ctx context.Context) (*MessageModel, error) { - var v MessageModel +func (r pointerDeleteUnique) Exec(ctx context.Context) (*PointerModel, error) { + var v PointerModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r messageDeleteUnique) Tx() MessageUniqueTxResult { - v := newMessageUniqueTxResult() +func (r pointerDeleteUnique) Tx() PointerUniqueTxResult { + v := newPointerUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type messageFindFirst struct { +type pointerFindFirst struct { query builder.Query } -func (r messageFindFirst) getQuery() builder.Query { +func (r pointerFindFirst) getQuery() builder.Query { return r.query } -func (r messageFindFirst) ExtractQuery() builder.Query { +func (r pointerFindFirst) ExtractQuery() builder.Query { return r.query } -func (r messageFindFirst) with() {} -func (r messageFindFirst) messageModel() {} -func (r messageFindFirst) messageRelation() {} +func (r pointerFindFirst) with() {} +func (r pointerFindFirst) pointerModel() {} +func (r pointerFindFirst) pointerRelation() {} -func (r messageActions) FindFirst( - params ...MessageWhereParam, -) messageFindFirst { - var v messageFindFirst +func (r pointerActions) FindFirst( + params ...PointerWhereParam, +) pointerFindFirst { + var v pointerFindFirst v.query = builder.NewQuery() v.query.Engine = r.client @@ -33740,8 +37639,8 @@ func (r messageActions) FindFirst( v.query.Method = "findFirst" - v.query.Model = "Message" - v.query.Outputs = messageOutput + v.query.Model = "Pointer" + v.query.Outputs = pointerOutput var where []builder.Field for _, q := range params { @@ -33766,7 +37665,7 @@ func (r messageActions) FindFirst( return v } -func (r messageFindFirst) With(params ...MessageRelationWith) messageFindFirst { +func (r pointerFindFirst) With(params ...PointerRelationWith) pointerFindFirst { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -33779,7 +37678,7 @@ func (r messageFindFirst) With(params ...MessageRelationWith) messageFindFirst { return r } -func (r messageFindFirst) Select(params ...messagePrismaFields) messageFindFirst { +func (r pointerFindFirst) Select(params ...pointerPrismaFields) pointerFindFirst { var outputs []builder.Output for _, param := range params { @@ -33793,7 +37692,7 @@ func (r messageFindFirst) Select(params ...messagePrismaFields) messageFindFirst return r } -func (r messageFindFirst) Omit(params ...messagePrismaFields) messageFindFirst { +func (r pointerFindFirst) Omit(params ...pointerPrismaFields) pointerFindFirst { var outputs []builder.Output var raw []string @@ -33801,7 +37700,7 @@ func (r messageFindFirst) Omit(params ...messagePrismaFields) messageFindFirst { raw = append(raw, string(param)) } - for _, output := range messageOutput { + for _, output := range pointerOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -33812,7 +37711,7 @@ func (r messageFindFirst) Omit(params ...messagePrismaFields) messageFindFirst { return r } -func (r messageFindFirst) OrderBy(params ...MessageOrderByParam) messageFindFirst { +func (r pointerFindFirst) OrderBy(params ...PointerOrderByParam) pointerFindFirst { var fields []builder.Field for _, param := range params { @@ -33832,7 +37731,7 @@ func (r messageFindFirst) OrderBy(params ...MessageOrderByParam) messageFindFirs return r } -func (r messageFindFirst) Skip(count int) messageFindFirst { +func (r pointerFindFirst) Skip(count int) pointerFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -33840,7 +37739,7 @@ func (r messageFindFirst) Skip(count int) messageFindFirst { return r } -func (r messageFindFirst) Take(count int) messageFindFirst { +func (r pointerFindFirst) Take(count int) pointerFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -33848,7 +37747,7 @@ func (r messageFindFirst) Take(count int) messageFindFirst { return r } -func (r messageFindFirst) Cursor(cursor MessageCursorParam) messageFindFirst { +func (r pointerFindFirst) Cursor(cursor PointerCursorParam) pointerFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -33856,11 +37755,11 @@ func (r messageFindFirst) Cursor(cursor MessageCursorParam) messageFindFirst { return r } -func (r messageFindFirst) Exec(ctx context.Context) ( - *MessageModel, +func (r pointerFindFirst) Exec(ctx context.Context) ( + *PointerModel, error, ) { - var v *MessageModel + var v *PointerModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -33872,11 +37771,11 @@ func (r messageFindFirst) Exec(ctx context.Context) ( return v, nil } -func (r messageFindFirst) ExecInner(ctx context.Context) ( - *InnerMessage, +func (r pointerFindFirst) ExecInner(ctx context.Context) ( + *InnerPointer, error, ) { - var v *InnerMessage + var v *InnerPointer if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -33888,26 +37787,26 @@ func (r messageFindFirst) ExecInner(ctx context.Context) ( return v, nil } -type messageFindMany struct { +type pointerFindMany struct { query builder.Query } -func (r messageFindMany) getQuery() builder.Query { +func (r pointerFindMany) getQuery() builder.Query { return r.query } -func (r messageFindMany) ExtractQuery() builder.Query { +func (r pointerFindMany) ExtractQuery() builder.Query { return r.query } -func (r messageFindMany) with() {} -func (r messageFindMany) messageModel() {} -func (r messageFindMany) messageRelation() {} +func (r pointerFindMany) with() {} +func (r pointerFindMany) pointerModel() {} +func (r pointerFindMany) pointerRelation() {} -func (r messageActions) FindMany( - params ...MessageWhereParam, -) messageFindMany { - var v messageFindMany +func (r pointerActions) FindMany( + params ...PointerWhereParam, +) pointerFindMany { + var v pointerFindMany v.query = builder.NewQuery() v.query.Engine = r.client @@ -33915,8 +37814,8 @@ func (r messageActions) FindMany( v.query.Method = "findMany" - v.query.Model = "Message" - v.query.Outputs = messageOutput + v.query.Model = "Pointer" + v.query.Outputs = pointerOutput var where []builder.Field for _, q := range params { @@ -33941,7 +37840,7 @@ func (r messageActions) FindMany( return v } -func (r messageFindMany) With(params ...MessageRelationWith) messageFindMany { +func (r pointerFindMany) With(params ...PointerRelationWith) pointerFindMany { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -33954,7 +37853,7 @@ func (r messageFindMany) With(params ...MessageRelationWith) messageFindMany { return r } -func (r messageFindMany) Select(params ...messagePrismaFields) messageFindMany { +func (r pointerFindMany) Select(params ...pointerPrismaFields) pointerFindMany { var outputs []builder.Output for _, param := range params { @@ -33968,7 +37867,7 @@ func (r messageFindMany) Select(params ...messagePrismaFields) messageFindMany { return r } -func (r messageFindMany) Omit(params ...messagePrismaFields) messageFindMany { +func (r pointerFindMany) Omit(params ...pointerPrismaFields) pointerFindMany { var outputs []builder.Output var raw []string @@ -33976,7 +37875,7 @@ func (r messageFindMany) Omit(params ...messagePrismaFields) messageFindMany { raw = append(raw, string(param)) } - for _, output := range messageOutput { + for _, output := range pointerOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -33987,7 +37886,7 @@ func (r messageFindMany) Omit(params ...messagePrismaFields) messageFindMany { return r } -func (r messageFindMany) OrderBy(params ...MessageOrderByParam) messageFindMany { +func (r pointerFindMany) OrderBy(params ...PointerOrderByParam) pointerFindMany { var fields []builder.Field for _, param := range params { @@ -34007,7 +37906,7 @@ func (r messageFindMany) OrderBy(params ...MessageOrderByParam) messageFindMany return r } -func (r messageFindMany) Skip(count int) messageFindMany { +func (r pointerFindMany) Skip(count int) pointerFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -34015,7 +37914,7 @@ func (r messageFindMany) Skip(count int) messageFindMany { return r } -func (r messageFindMany) Take(count int) messageFindMany { +func (r pointerFindMany) Take(count int) pointerFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -34023,7 +37922,7 @@ func (r messageFindMany) Take(count int) messageFindMany { return r } -func (r messageFindMany) Cursor(cursor MessageCursorParam) messageFindMany { +func (r pointerFindMany) Cursor(cursor PointerCursorParam) pointerFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -34031,11 +37930,11 @@ func (r messageFindMany) Cursor(cursor MessageCursorParam) messageFindMany { return r } -func (r messageFindMany) Exec(ctx context.Context) ( - []MessageModel, +func (r pointerFindMany) Exec(ctx context.Context) ( + []PointerModel, error, ) { - var v []MessageModel + var v []PointerModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -34043,11 +37942,11 @@ func (r messageFindMany) Exec(ctx context.Context) ( return v, nil } -func (r messageFindMany) ExecInner(ctx context.Context) ( - []InnerMessage, +func (r pointerFindMany) ExecInner(ctx context.Context) ( + []InnerPointer, error, ) { - var v []InnerMessage + var v []InnerPointer if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -34055,14 +37954,14 @@ func (r messageFindMany) ExecInner(ctx context.Context) ( return v, nil } -func (r messageFindMany) Update(params ...MessageSetParam) messageUpdateMany { +func (r pointerFindMany) Update(params ...PointerSetParam) pointerUpdateMany { r.query.Operation = "mutation" r.query.Method = "updateMany" - r.query.Model = "Message" + r.query.Model = "Pointer" r.query.Outputs = countOutput - var v messageUpdateMany + var v pointerUpdateMany v.query = r.query var fields []builder.Field for _, q := range params { @@ -34091,17 +37990,17 @@ func (r messageFindMany) Update(params ...MessageSetParam) messageUpdateMany { return v } -type messageUpdateMany struct { +type pointerUpdateMany struct { query builder.Query } -func (r messageUpdateMany) ExtractQuery() builder.Query { +func (r pointerUpdateMany) ExtractQuery() builder.Query { return r.query } -func (r messageUpdateMany) messageModel() {} +func (r pointerUpdateMany) pointerModel() {} -func (r messageUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r pointerUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -34109,36 +38008,36 @@ func (r messageUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r messageUpdateMany) Tx() MessageManyTxResult { - v := newMessageManyTxResult() +func (r pointerUpdateMany) Tx() PointerManyTxResult { + v := newPointerManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r messageFindMany) Delete() messageDeleteMany { - var v messageDeleteMany +func (r pointerFindMany) Delete() pointerDeleteMany { + var v pointerDeleteMany v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteMany" - v.query.Model = "Message" + v.query.Model = "Pointer" v.query.Outputs = countOutput return v } -type messageDeleteMany struct { +type pointerDeleteMany struct { query builder.Query } -func (r messageDeleteMany) ExtractQuery() builder.Query { +func (r pointerDeleteMany) ExtractQuery() builder.Query { return r.query } -func (p messageDeleteMany) messageModel() {} +func (p pointerDeleteMany) pointerModel() {} -func (r messageDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r pointerDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -34146,33 +38045,33 @@ func (r messageDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r messageDeleteMany) Tx() MessageManyTxResult { - v := newMessageManyTxResult() +func (r pointerDeleteMany) Tx() PointerManyTxResult { + v := newPointerManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type pointerFindUnique struct { +type pushTokenFindUnique struct { query builder.Query } -func (r pointerFindUnique) getQuery() builder.Query { +func (r pushTokenFindUnique) getQuery() builder.Query { return r.query } -func (r pointerFindUnique) ExtractQuery() builder.Query { +func (r pushTokenFindUnique) ExtractQuery() builder.Query { return r.query } -func (r pointerFindUnique) with() {} -func (r pointerFindUnique) pointerModel() {} -func (r pointerFindUnique) pointerRelation() {} +func (r pushTokenFindUnique) with() {} +func (r pushTokenFindUnique) pushTokenModel() {} +func (r pushTokenFindUnique) pushTokenRelation() {} -func (r pointerActions) FindUnique( - params PointerEqualsUniqueWhereParam, -) pointerFindUnique { - var v pointerFindUnique +func (r pushTokenActions) FindUnique( + params PushTokenEqualsUniqueWhereParam, +) pushTokenFindUnique { + var v pushTokenFindUnique v.query = builder.NewQuery() v.query.Engine = r.client @@ -34180,8 +38079,8 @@ func (r pointerActions) FindUnique( v.query.Method = "findUnique" - v.query.Model = "Pointer" - v.query.Outputs = pointerOutput + v.query.Model = "PushToken" + v.query.Outputs = pushTokenOutput v.query.Inputs = append(v.query.Inputs, builder.Input{ Name: "where", @@ -34191,7 +38090,7 @@ func (r pointerActions) FindUnique( return v } -func (r pointerFindUnique) With(params ...PointerRelationWith) pointerFindUnique { +func (r pushTokenFindUnique) With(params ...PushTokenRelationWith) pushTokenFindUnique { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -34204,7 +38103,7 @@ func (r pointerFindUnique) With(params ...PointerRelationWith) pointerFindUnique return r } -func (r pointerFindUnique) Select(params ...pointerPrismaFields) pointerFindUnique { +func (r pushTokenFindUnique) Select(params ...pushTokenPrismaFields) pushTokenFindUnique { var outputs []builder.Output for _, param := range params { @@ -34218,7 +38117,7 @@ func (r pointerFindUnique) Select(params ...pointerPrismaFields) pointerFindUniq return r } -func (r pointerFindUnique) Omit(params ...pointerPrismaFields) pointerFindUnique { +func (r pushTokenFindUnique) Omit(params ...pushTokenPrismaFields) pushTokenFindUnique { var outputs []builder.Output var raw []string @@ -34226,7 +38125,7 @@ func (r pointerFindUnique) Omit(params ...pointerPrismaFields) pointerFindUnique raw = append(raw, string(param)) } - for _, output := range pointerOutput { + for _, output := range pushTokenOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -34237,11 +38136,11 @@ func (r pointerFindUnique) Omit(params ...pointerPrismaFields) pointerFindUnique return r } -func (r pointerFindUnique) Exec(ctx context.Context) ( - *PointerModel, +func (r pushTokenFindUnique) Exec(ctx context.Context) ( + *PushTokenModel, error, ) { - var v *PointerModel + var v *PushTokenModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -34253,11 +38152,11 @@ func (r pointerFindUnique) Exec(ctx context.Context) ( return v, nil } -func (r pointerFindUnique) ExecInner(ctx context.Context) ( - *InnerPointer, +func (r pushTokenFindUnique) ExecInner(ctx context.Context) ( + *InnerPushToken, error, ) { - var v *InnerPointer + var v *InnerPushToken if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -34269,12 +38168,12 @@ func (r pointerFindUnique) ExecInner(ctx context.Context) ( return v, nil } -func (r pointerFindUnique) Update(params ...PointerSetParam) pointerUpdateUnique { +func (r pushTokenFindUnique) Update(params ...PushTokenSetParam) pushTokenUpdateUnique { r.query.Operation = "mutation" r.query.Method = "updateOne" - r.query.Model = "Pointer" + r.query.Model = "PushToken" - var v pointerUpdateUnique + var v pushTokenUpdateUnique v.query = r.query var fields []builder.Field for _, q := range params { @@ -34303,86 +38202,86 @@ func (r pointerFindUnique) Update(params ...PointerSetParam) pointerUpdateUnique return v } -type pointerUpdateUnique struct { +type pushTokenUpdateUnique struct { query builder.Query } -func (r pointerUpdateUnique) ExtractQuery() builder.Query { +func (r pushTokenUpdateUnique) ExtractQuery() builder.Query { return r.query } -func (r pointerUpdateUnique) pointerModel() {} +func (r pushTokenUpdateUnique) pushTokenModel() {} -func (r pointerUpdateUnique) Exec(ctx context.Context) (*PointerModel, error) { - var v PointerModel +func (r pushTokenUpdateUnique) Exec(ctx context.Context) (*PushTokenModel, error) { + var v PushTokenModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r pointerUpdateUnique) Tx() PointerUniqueTxResult { - v := newPointerUniqueTxResult() +func (r pushTokenUpdateUnique) Tx() PushTokenUniqueTxResult { + v := newPushTokenUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r pointerFindUnique) Delete() pointerDeleteUnique { - var v pointerDeleteUnique +func (r pushTokenFindUnique) Delete() pushTokenDeleteUnique { + var v pushTokenDeleteUnique v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteOne" - v.query.Model = "Pointer" + v.query.Model = "PushToken" return v } -type pointerDeleteUnique struct { +type pushTokenDeleteUnique struct { query builder.Query } -func (r pointerDeleteUnique) ExtractQuery() builder.Query { +func (r pushTokenDeleteUnique) ExtractQuery() builder.Query { return r.query } -func (p pointerDeleteUnique) pointerModel() {} +func (p pushTokenDeleteUnique) pushTokenModel() {} -func (r pointerDeleteUnique) Exec(ctx context.Context) (*PointerModel, error) { - var v PointerModel +func (r pushTokenDeleteUnique) Exec(ctx context.Context) (*PushTokenModel, error) { + var v PushTokenModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r pointerDeleteUnique) Tx() PointerUniqueTxResult { - v := newPointerUniqueTxResult() +func (r pushTokenDeleteUnique) Tx() PushTokenUniqueTxResult { + v := newPushTokenUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type pointerFindFirst struct { +type pushTokenFindFirst struct { query builder.Query } -func (r pointerFindFirst) getQuery() builder.Query { +func (r pushTokenFindFirst) getQuery() builder.Query { return r.query } -func (r pointerFindFirst) ExtractQuery() builder.Query { +func (r pushTokenFindFirst) ExtractQuery() builder.Query { return r.query } -func (r pointerFindFirst) with() {} -func (r pointerFindFirst) pointerModel() {} -func (r pointerFindFirst) pointerRelation() {} +func (r pushTokenFindFirst) with() {} +func (r pushTokenFindFirst) pushTokenModel() {} +func (r pushTokenFindFirst) pushTokenRelation() {} -func (r pointerActions) FindFirst( - params ...PointerWhereParam, -) pointerFindFirst { - var v pointerFindFirst +func (r pushTokenActions) FindFirst( + params ...PushTokenWhereParam, +) pushTokenFindFirst { + var v pushTokenFindFirst v.query = builder.NewQuery() v.query.Engine = r.client @@ -34390,8 +38289,8 @@ func (r pointerActions) FindFirst( v.query.Method = "findFirst" - v.query.Model = "Pointer" - v.query.Outputs = pointerOutput + v.query.Model = "PushToken" + v.query.Outputs = pushTokenOutput var where []builder.Field for _, q := range params { @@ -34416,7 +38315,7 @@ func (r pointerActions) FindFirst( return v } -func (r pointerFindFirst) With(params ...PointerRelationWith) pointerFindFirst { +func (r pushTokenFindFirst) With(params ...PushTokenRelationWith) pushTokenFindFirst { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -34429,7 +38328,7 @@ func (r pointerFindFirst) With(params ...PointerRelationWith) pointerFindFirst { return r } -func (r pointerFindFirst) Select(params ...pointerPrismaFields) pointerFindFirst { +func (r pushTokenFindFirst) Select(params ...pushTokenPrismaFields) pushTokenFindFirst { var outputs []builder.Output for _, param := range params { @@ -34443,7 +38342,7 @@ func (r pointerFindFirst) Select(params ...pointerPrismaFields) pointerFindFirst return r } -func (r pointerFindFirst) Omit(params ...pointerPrismaFields) pointerFindFirst { +func (r pushTokenFindFirst) Omit(params ...pushTokenPrismaFields) pushTokenFindFirst { var outputs []builder.Output var raw []string @@ -34451,7 +38350,7 @@ func (r pointerFindFirst) Omit(params ...pointerPrismaFields) pointerFindFirst { raw = append(raw, string(param)) } - for _, output := range pointerOutput { + for _, output := range pushTokenOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -34462,7 +38361,7 @@ func (r pointerFindFirst) Omit(params ...pointerPrismaFields) pointerFindFirst { return r } -func (r pointerFindFirst) OrderBy(params ...PointerOrderByParam) pointerFindFirst { +func (r pushTokenFindFirst) OrderBy(params ...PushTokenOrderByParam) pushTokenFindFirst { var fields []builder.Field for _, param := range params { @@ -34482,7 +38381,7 @@ func (r pointerFindFirst) OrderBy(params ...PointerOrderByParam) pointerFindFirs return r } -func (r pointerFindFirst) Skip(count int) pointerFindFirst { +func (r pushTokenFindFirst) Skip(count int) pushTokenFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -34490,7 +38389,7 @@ func (r pointerFindFirst) Skip(count int) pointerFindFirst { return r } -func (r pointerFindFirst) Take(count int) pointerFindFirst { +func (r pushTokenFindFirst) Take(count int) pushTokenFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -34498,7 +38397,7 @@ func (r pointerFindFirst) Take(count int) pointerFindFirst { return r } -func (r pointerFindFirst) Cursor(cursor PointerCursorParam) pointerFindFirst { +func (r pushTokenFindFirst) Cursor(cursor PushTokenCursorParam) pushTokenFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -34506,11 +38405,11 @@ func (r pointerFindFirst) Cursor(cursor PointerCursorParam) pointerFindFirst { return r } -func (r pointerFindFirst) Exec(ctx context.Context) ( - *PointerModel, +func (r pushTokenFindFirst) Exec(ctx context.Context) ( + *PushTokenModel, error, ) { - var v *PointerModel + var v *PushTokenModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -34522,11 +38421,11 @@ func (r pointerFindFirst) Exec(ctx context.Context) ( return v, nil } -func (r pointerFindFirst) ExecInner(ctx context.Context) ( - *InnerPointer, +func (r pushTokenFindFirst) ExecInner(ctx context.Context) ( + *InnerPushToken, error, ) { - var v *InnerPointer + var v *InnerPushToken if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -34538,26 +38437,26 @@ func (r pointerFindFirst) ExecInner(ctx context.Context) ( return v, nil } -type pointerFindMany struct { +type pushTokenFindMany struct { query builder.Query } -func (r pointerFindMany) getQuery() builder.Query { +func (r pushTokenFindMany) getQuery() builder.Query { return r.query } -func (r pointerFindMany) ExtractQuery() builder.Query { +func (r pushTokenFindMany) ExtractQuery() builder.Query { return r.query } -func (r pointerFindMany) with() {} -func (r pointerFindMany) pointerModel() {} -func (r pointerFindMany) pointerRelation() {} +func (r pushTokenFindMany) with() {} +func (r pushTokenFindMany) pushTokenModel() {} +func (r pushTokenFindMany) pushTokenRelation() {} -func (r pointerActions) FindMany( - params ...PointerWhereParam, -) pointerFindMany { - var v pointerFindMany +func (r pushTokenActions) FindMany( + params ...PushTokenWhereParam, +) pushTokenFindMany { + var v pushTokenFindMany v.query = builder.NewQuery() v.query.Engine = r.client @@ -34565,8 +38464,8 @@ func (r pointerActions) FindMany( v.query.Method = "findMany" - v.query.Model = "Pointer" - v.query.Outputs = pointerOutput + v.query.Model = "PushToken" + v.query.Outputs = pushTokenOutput var where []builder.Field for _, q := range params { @@ -34591,7 +38490,7 @@ func (r pointerActions) FindMany( return v } -func (r pointerFindMany) With(params ...PointerRelationWith) pointerFindMany { +func (r pushTokenFindMany) With(params ...PushTokenRelationWith) pushTokenFindMany { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -34604,7 +38503,7 @@ func (r pointerFindMany) With(params ...PointerRelationWith) pointerFindMany { return r } -func (r pointerFindMany) Select(params ...pointerPrismaFields) pointerFindMany { +func (r pushTokenFindMany) Select(params ...pushTokenPrismaFields) pushTokenFindMany { var outputs []builder.Output for _, param := range params { @@ -34618,7 +38517,7 @@ func (r pointerFindMany) Select(params ...pointerPrismaFields) pointerFindMany { return r } -func (r pointerFindMany) Omit(params ...pointerPrismaFields) pointerFindMany { +func (r pushTokenFindMany) Omit(params ...pushTokenPrismaFields) pushTokenFindMany { var outputs []builder.Output var raw []string @@ -34626,7 +38525,7 @@ func (r pointerFindMany) Omit(params ...pointerPrismaFields) pointerFindMany { raw = append(raw, string(param)) } - for _, output := range pointerOutput { + for _, output := range pushTokenOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -34637,7 +38536,7 @@ func (r pointerFindMany) Omit(params ...pointerPrismaFields) pointerFindMany { return r } -func (r pointerFindMany) OrderBy(params ...PointerOrderByParam) pointerFindMany { +func (r pushTokenFindMany) OrderBy(params ...PushTokenOrderByParam) pushTokenFindMany { var fields []builder.Field for _, param := range params { @@ -34657,7 +38556,7 @@ func (r pointerFindMany) OrderBy(params ...PointerOrderByParam) pointerFindMany return r } -func (r pointerFindMany) Skip(count int) pointerFindMany { +func (r pushTokenFindMany) Skip(count int) pushTokenFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -34665,7 +38564,7 @@ func (r pointerFindMany) Skip(count int) pointerFindMany { return r } -func (r pointerFindMany) Take(count int) pointerFindMany { +func (r pushTokenFindMany) Take(count int) pushTokenFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -34673,7 +38572,7 @@ func (r pointerFindMany) Take(count int) pointerFindMany { return r } -func (r pointerFindMany) Cursor(cursor PointerCursorParam) pointerFindMany { +func (r pushTokenFindMany) Cursor(cursor PushTokenCursorParam) pushTokenFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -34681,11 +38580,11 @@ func (r pointerFindMany) Cursor(cursor PointerCursorParam) pointerFindMany { return r } -func (r pointerFindMany) Exec(ctx context.Context) ( - []PointerModel, +func (r pushTokenFindMany) Exec(ctx context.Context) ( + []PushTokenModel, error, ) { - var v []PointerModel + var v []PushTokenModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -34693,11 +38592,11 @@ func (r pointerFindMany) Exec(ctx context.Context) ( return v, nil } -func (r pointerFindMany) ExecInner(ctx context.Context) ( - []InnerPointer, +func (r pushTokenFindMany) ExecInner(ctx context.Context) ( + []InnerPushToken, error, ) { - var v []InnerPointer + var v []InnerPushToken if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -34705,14 +38604,14 @@ func (r pointerFindMany) ExecInner(ctx context.Context) ( return v, nil } -func (r pointerFindMany) Update(params ...PointerSetParam) pointerUpdateMany { +func (r pushTokenFindMany) Update(params ...PushTokenSetParam) pushTokenUpdateMany { r.query.Operation = "mutation" r.query.Method = "updateMany" - r.query.Model = "Pointer" + r.query.Model = "PushToken" r.query.Outputs = countOutput - var v pointerUpdateMany + var v pushTokenUpdateMany v.query = r.query var fields []builder.Field for _, q := range params { @@ -34741,17 +38640,17 @@ func (r pointerFindMany) Update(params ...PointerSetParam) pointerUpdateMany { return v } -type pointerUpdateMany struct { +type pushTokenUpdateMany struct { query builder.Query } -func (r pointerUpdateMany) ExtractQuery() builder.Query { +func (r pushTokenUpdateMany) ExtractQuery() builder.Query { return r.query } -func (r pointerUpdateMany) pointerModel() {} +func (r pushTokenUpdateMany) pushTokenModel() {} -func (r pointerUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r pushTokenUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -34759,36 +38658,36 @@ func (r pointerUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r pointerUpdateMany) Tx() PointerManyTxResult { - v := newPointerManyTxResult() +func (r pushTokenUpdateMany) Tx() PushTokenManyTxResult { + v := newPushTokenManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r pointerFindMany) Delete() pointerDeleteMany { - var v pointerDeleteMany +func (r pushTokenFindMany) Delete() pushTokenDeleteMany { + var v pushTokenDeleteMany v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteMany" - v.query.Model = "Pointer" + v.query.Model = "PushToken" v.query.Outputs = countOutput return v } -type pointerDeleteMany struct { +type pushTokenDeleteMany struct { query builder.Query } -func (r pointerDeleteMany) ExtractQuery() builder.Query { +func (r pushTokenDeleteMany) ExtractQuery() builder.Query { return r.query } -func (p pointerDeleteMany) pointerModel() {} +func (p pushTokenDeleteMany) pushTokenModel() {} -func (r pointerDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r pushTokenDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -34796,33 +38695,33 @@ func (r pointerDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r pointerDeleteMany) Tx() PointerManyTxResult { - v := newPointerManyTxResult() +func (r pushTokenDeleteMany) Tx() PushTokenManyTxResult { + v := newPushTokenManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type pushTokenFindUnique struct { +type iapFindUnique struct { query builder.Query } -func (r pushTokenFindUnique) getQuery() builder.Query { +func (r iapFindUnique) getQuery() builder.Query { return r.query } -func (r pushTokenFindUnique) ExtractQuery() builder.Query { +func (r iapFindUnique) ExtractQuery() builder.Query { return r.query } -func (r pushTokenFindUnique) with() {} -func (r pushTokenFindUnique) pushTokenModel() {} -func (r pushTokenFindUnique) pushTokenRelation() {} +func (r iapFindUnique) with() {} +func (r iapFindUnique) iapModel() {} +func (r iapFindUnique) iapRelation() {} -func (r pushTokenActions) FindUnique( - params PushTokenEqualsUniqueWhereParam, -) pushTokenFindUnique { - var v pushTokenFindUnique +func (r iapActions) FindUnique( + params IapEqualsUniqueWhereParam, +) iapFindUnique { + var v iapFindUnique v.query = builder.NewQuery() v.query.Engine = r.client @@ -34830,8 +38729,8 @@ func (r pushTokenActions) FindUnique( v.query.Method = "findUnique" - v.query.Model = "PushToken" - v.query.Outputs = pushTokenOutput + v.query.Model = "Iap" + v.query.Outputs = iapOutput v.query.Inputs = append(v.query.Inputs, builder.Input{ Name: "where", @@ -34841,7 +38740,7 @@ func (r pushTokenActions) FindUnique( return v } -func (r pushTokenFindUnique) With(params ...PushTokenRelationWith) pushTokenFindUnique { +func (r iapFindUnique) With(params ...IapRelationWith) iapFindUnique { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -34854,7 +38753,7 @@ func (r pushTokenFindUnique) With(params ...PushTokenRelationWith) pushTokenFind return r } -func (r pushTokenFindUnique) Select(params ...pushTokenPrismaFields) pushTokenFindUnique { +func (r iapFindUnique) Select(params ...iapPrismaFields) iapFindUnique { var outputs []builder.Output for _, param := range params { @@ -34868,7 +38767,7 @@ func (r pushTokenFindUnique) Select(params ...pushTokenPrismaFields) pushTokenFi return r } -func (r pushTokenFindUnique) Omit(params ...pushTokenPrismaFields) pushTokenFindUnique { +func (r iapFindUnique) Omit(params ...iapPrismaFields) iapFindUnique { var outputs []builder.Output var raw []string @@ -34876,7 +38775,7 @@ func (r pushTokenFindUnique) Omit(params ...pushTokenPrismaFields) pushTokenFind raw = append(raw, string(param)) } - for _, output := range pushTokenOutput { + for _, output := range iapOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -34887,11 +38786,11 @@ func (r pushTokenFindUnique) Omit(params ...pushTokenPrismaFields) pushTokenFind return r } -func (r pushTokenFindUnique) Exec(ctx context.Context) ( - *PushTokenModel, +func (r iapFindUnique) Exec(ctx context.Context) ( + *IapModel, error, ) { - var v *PushTokenModel + var v *IapModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -34903,11 +38802,11 @@ func (r pushTokenFindUnique) Exec(ctx context.Context) ( return v, nil } -func (r pushTokenFindUnique) ExecInner(ctx context.Context) ( - *InnerPushToken, +func (r iapFindUnique) ExecInner(ctx context.Context) ( + *InnerIap, error, ) { - var v *InnerPushToken + var v *InnerIap if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -34919,12 +38818,12 @@ func (r pushTokenFindUnique) ExecInner(ctx context.Context) ( return v, nil } -func (r pushTokenFindUnique) Update(params ...PushTokenSetParam) pushTokenUpdateUnique { +func (r iapFindUnique) Update(params ...IapSetParam) iapUpdateUnique { r.query.Operation = "mutation" r.query.Method = "updateOne" - r.query.Model = "PushToken" + r.query.Model = "Iap" - var v pushTokenUpdateUnique + var v iapUpdateUnique v.query = r.query var fields []builder.Field for _, q := range params { @@ -34953,86 +38852,86 @@ func (r pushTokenFindUnique) Update(params ...PushTokenSetParam) pushTokenUpdate return v } -type pushTokenUpdateUnique struct { +type iapUpdateUnique struct { query builder.Query } -func (r pushTokenUpdateUnique) ExtractQuery() builder.Query { +func (r iapUpdateUnique) ExtractQuery() builder.Query { return r.query } -func (r pushTokenUpdateUnique) pushTokenModel() {} +func (r iapUpdateUnique) iapModel() {} -func (r pushTokenUpdateUnique) Exec(ctx context.Context) (*PushTokenModel, error) { - var v PushTokenModel +func (r iapUpdateUnique) Exec(ctx context.Context) (*IapModel, error) { + var v IapModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r pushTokenUpdateUnique) Tx() PushTokenUniqueTxResult { - v := newPushTokenUniqueTxResult() +func (r iapUpdateUnique) Tx() IapUniqueTxResult { + v := newIapUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r pushTokenFindUnique) Delete() pushTokenDeleteUnique { - var v pushTokenDeleteUnique +func (r iapFindUnique) Delete() iapDeleteUnique { + var v iapDeleteUnique v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteOne" - v.query.Model = "PushToken" + v.query.Model = "Iap" return v } -type pushTokenDeleteUnique struct { +type iapDeleteUnique struct { query builder.Query } -func (r pushTokenDeleteUnique) ExtractQuery() builder.Query { +func (r iapDeleteUnique) ExtractQuery() builder.Query { return r.query } -func (p pushTokenDeleteUnique) pushTokenModel() {} +func (p iapDeleteUnique) iapModel() {} -func (r pushTokenDeleteUnique) Exec(ctx context.Context) (*PushTokenModel, error) { - var v PushTokenModel +func (r iapDeleteUnique) Exec(ctx context.Context) (*IapModel, error) { + var v IapModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r pushTokenDeleteUnique) Tx() PushTokenUniqueTxResult { - v := newPushTokenUniqueTxResult() +func (r iapDeleteUnique) Tx() IapUniqueTxResult { + v := newIapUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type pushTokenFindFirst struct { +type iapFindFirst struct { query builder.Query } -func (r pushTokenFindFirst) getQuery() builder.Query { +func (r iapFindFirst) getQuery() builder.Query { return r.query } -func (r pushTokenFindFirst) ExtractQuery() builder.Query { +func (r iapFindFirst) ExtractQuery() builder.Query { return r.query } -func (r pushTokenFindFirst) with() {} -func (r pushTokenFindFirst) pushTokenModel() {} -func (r pushTokenFindFirst) pushTokenRelation() {} +func (r iapFindFirst) with() {} +func (r iapFindFirst) iapModel() {} +func (r iapFindFirst) iapRelation() {} -func (r pushTokenActions) FindFirst( - params ...PushTokenWhereParam, -) pushTokenFindFirst { - var v pushTokenFindFirst +func (r iapActions) FindFirst( + params ...IapWhereParam, +) iapFindFirst { + var v iapFindFirst v.query = builder.NewQuery() v.query.Engine = r.client @@ -35040,8 +38939,8 @@ func (r pushTokenActions) FindFirst( v.query.Method = "findFirst" - v.query.Model = "PushToken" - v.query.Outputs = pushTokenOutput + v.query.Model = "Iap" + v.query.Outputs = iapOutput var where []builder.Field for _, q := range params { @@ -35066,7 +38965,7 @@ func (r pushTokenActions) FindFirst( return v } -func (r pushTokenFindFirst) With(params ...PushTokenRelationWith) pushTokenFindFirst { +func (r iapFindFirst) With(params ...IapRelationWith) iapFindFirst { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -35079,7 +38978,7 @@ func (r pushTokenFindFirst) With(params ...PushTokenRelationWith) pushTokenFindF return r } -func (r pushTokenFindFirst) Select(params ...pushTokenPrismaFields) pushTokenFindFirst { +func (r iapFindFirst) Select(params ...iapPrismaFields) iapFindFirst { var outputs []builder.Output for _, param := range params { @@ -35093,7 +38992,7 @@ func (r pushTokenFindFirst) Select(params ...pushTokenPrismaFields) pushTokenFin return r } -func (r pushTokenFindFirst) Omit(params ...pushTokenPrismaFields) pushTokenFindFirst { +func (r iapFindFirst) Omit(params ...iapPrismaFields) iapFindFirst { var outputs []builder.Output var raw []string @@ -35101,7 +39000,7 @@ func (r pushTokenFindFirst) Omit(params ...pushTokenPrismaFields) pushTokenFindF raw = append(raw, string(param)) } - for _, output := range pushTokenOutput { + for _, output := range iapOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -35112,7 +39011,7 @@ func (r pushTokenFindFirst) Omit(params ...pushTokenPrismaFields) pushTokenFindF return r } -func (r pushTokenFindFirst) OrderBy(params ...PushTokenOrderByParam) pushTokenFindFirst { +func (r iapFindFirst) OrderBy(params ...IapOrderByParam) iapFindFirst { var fields []builder.Field for _, param := range params { @@ -35132,7 +39031,7 @@ func (r pushTokenFindFirst) OrderBy(params ...PushTokenOrderByParam) pushTokenFi return r } -func (r pushTokenFindFirst) Skip(count int) pushTokenFindFirst { +func (r iapFindFirst) Skip(count int) iapFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -35140,7 +39039,7 @@ func (r pushTokenFindFirst) Skip(count int) pushTokenFindFirst { return r } -func (r pushTokenFindFirst) Take(count int) pushTokenFindFirst { +func (r iapFindFirst) Take(count int) iapFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -35148,7 +39047,7 @@ func (r pushTokenFindFirst) Take(count int) pushTokenFindFirst { return r } -func (r pushTokenFindFirst) Cursor(cursor PushTokenCursorParam) pushTokenFindFirst { +func (r iapFindFirst) Cursor(cursor IapCursorParam) iapFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -35156,11 +39055,11 @@ func (r pushTokenFindFirst) Cursor(cursor PushTokenCursorParam) pushTokenFindFir return r } -func (r pushTokenFindFirst) Exec(ctx context.Context) ( - *PushTokenModel, +func (r iapFindFirst) Exec(ctx context.Context) ( + *IapModel, error, ) { - var v *PushTokenModel + var v *IapModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -35172,11 +39071,11 @@ func (r pushTokenFindFirst) Exec(ctx context.Context) ( return v, nil } -func (r pushTokenFindFirst) ExecInner(ctx context.Context) ( - *InnerPushToken, +func (r iapFindFirst) ExecInner(ctx context.Context) ( + *InnerIap, error, ) { - var v *InnerPushToken + var v *InnerIap if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -35188,26 +39087,26 @@ func (r pushTokenFindFirst) ExecInner(ctx context.Context) ( return v, nil } -type pushTokenFindMany struct { +type iapFindMany struct { query builder.Query } -func (r pushTokenFindMany) getQuery() builder.Query { +func (r iapFindMany) getQuery() builder.Query { return r.query } -func (r pushTokenFindMany) ExtractQuery() builder.Query { +func (r iapFindMany) ExtractQuery() builder.Query { return r.query } -func (r pushTokenFindMany) with() {} -func (r pushTokenFindMany) pushTokenModel() {} -func (r pushTokenFindMany) pushTokenRelation() {} +func (r iapFindMany) with() {} +func (r iapFindMany) iapModel() {} +func (r iapFindMany) iapRelation() {} -func (r pushTokenActions) FindMany( - params ...PushTokenWhereParam, -) pushTokenFindMany { - var v pushTokenFindMany +func (r iapActions) FindMany( + params ...IapWhereParam, +) iapFindMany { + var v iapFindMany v.query = builder.NewQuery() v.query.Engine = r.client @@ -35215,8 +39114,8 @@ func (r pushTokenActions) FindMany( v.query.Method = "findMany" - v.query.Model = "PushToken" - v.query.Outputs = pushTokenOutput + v.query.Model = "Iap" + v.query.Outputs = iapOutput var where []builder.Field for _, q := range params { @@ -35241,7 +39140,7 @@ func (r pushTokenActions) FindMany( return v } -func (r pushTokenFindMany) With(params ...PushTokenRelationWith) pushTokenFindMany { +func (r iapFindMany) With(params ...IapRelationWith) iapFindMany { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -35254,7 +39153,7 @@ func (r pushTokenFindMany) With(params ...PushTokenRelationWith) pushTokenFindMa return r } -func (r pushTokenFindMany) Select(params ...pushTokenPrismaFields) pushTokenFindMany { +func (r iapFindMany) Select(params ...iapPrismaFields) iapFindMany { var outputs []builder.Output for _, param := range params { @@ -35268,7 +39167,7 @@ func (r pushTokenFindMany) Select(params ...pushTokenPrismaFields) pushTokenFind return r } -func (r pushTokenFindMany) Omit(params ...pushTokenPrismaFields) pushTokenFindMany { +func (r iapFindMany) Omit(params ...iapPrismaFields) iapFindMany { var outputs []builder.Output var raw []string @@ -35276,7 +39175,7 @@ func (r pushTokenFindMany) Omit(params ...pushTokenPrismaFields) pushTokenFindMa raw = append(raw, string(param)) } - for _, output := range pushTokenOutput { + for _, output := range iapOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -35287,7 +39186,7 @@ func (r pushTokenFindMany) Omit(params ...pushTokenPrismaFields) pushTokenFindMa return r } -func (r pushTokenFindMany) OrderBy(params ...PushTokenOrderByParam) pushTokenFindMany { +func (r iapFindMany) OrderBy(params ...IapOrderByParam) iapFindMany { var fields []builder.Field for _, param := range params { @@ -35307,7 +39206,7 @@ func (r pushTokenFindMany) OrderBy(params ...PushTokenOrderByParam) pushTokenFin return r } -func (r pushTokenFindMany) Skip(count int) pushTokenFindMany { +func (r iapFindMany) Skip(count int) iapFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -35315,7 +39214,7 @@ func (r pushTokenFindMany) Skip(count int) pushTokenFindMany { return r } -func (r pushTokenFindMany) Take(count int) pushTokenFindMany { +func (r iapFindMany) Take(count int) iapFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -35323,7 +39222,7 @@ func (r pushTokenFindMany) Take(count int) pushTokenFindMany { return r } -func (r pushTokenFindMany) Cursor(cursor PushTokenCursorParam) pushTokenFindMany { +func (r iapFindMany) Cursor(cursor IapCursorParam) iapFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -35331,11 +39230,11 @@ func (r pushTokenFindMany) Cursor(cursor PushTokenCursorParam) pushTokenFindMany return r } -func (r pushTokenFindMany) Exec(ctx context.Context) ( - []PushTokenModel, +func (r iapFindMany) Exec(ctx context.Context) ( + []IapModel, error, ) { - var v []PushTokenModel + var v []IapModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -35343,11 +39242,11 @@ func (r pushTokenFindMany) Exec(ctx context.Context) ( return v, nil } -func (r pushTokenFindMany) ExecInner(ctx context.Context) ( - []InnerPushToken, +func (r iapFindMany) ExecInner(ctx context.Context) ( + []InnerIap, error, ) { - var v []InnerPushToken + var v []InnerIap if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -35355,14 +39254,14 @@ func (r pushTokenFindMany) ExecInner(ctx context.Context) ( return v, nil } -func (r pushTokenFindMany) Update(params ...PushTokenSetParam) pushTokenUpdateMany { +func (r iapFindMany) Update(params ...IapSetParam) iapUpdateMany { r.query.Operation = "mutation" r.query.Method = "updateMany" - r.query.Model = "PushToken" + r.query.Model = "Iap" r.query.Outputs = countOutput - var v pushTokenUpdateMany + var v iapUpdateMany v.query = r.query var fields []builder.Field for _, q := range params { @@ -35391,17 +39290,17 @@ func (r pushTokenFindMany) Update(params ...PushTokenSetParam) pushTokenUpdateMa return v } -type pushTokenUpdateMany struct { +type iapUpdateMany struct { query builder.Query } -func (r pushTokenUpdateMany) ExtractQuery() builder.Query { +func (r iapUpdateMany) ExtractQuery() builder.Query { return r.query } -func (r pushTokenUpdateMany) pushTokenModel() {} +func (r iapUpdateMany) iapModel() {} -func (r pushTokenUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r iapUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -35409,36 +39308,36 @@ func (r pushTokenUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r pushTokenUpdateMany) Tx() PushTokenManyTxResult { - v := newPushTokenManyTxResult() +func (r iapUpdateMany) Tx() IapManyTxResult { + v := newIapManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r pushTokenFindMany) Delete() pushTokenDeleteMany { - var v pushTokenDeleteMany +func (r iapFindMany) Delete() iapDeleteMany { + var v iapDeleteMany v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteMany" - v.query.Model = "PushToken" + v.query.Model = "Iap" v.query.Outputs = countOutput return v } -type pushTokenDeleteMany struct { +type iapDeleteMany struct { query builder.Query } -func (r pushTokenDeleteMany) ExtractQuery() builder.Query { +func (r iapDeleteMany) ExtractQuery() builder.Query { return r.query } -func (p pushTokenDeleteMany) pushTokenModel() {} +func (p iapDeleteMany) iapModel() {} -func (r pushTokenDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r iapDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -35446,33 +39345,33 @@ func (r pushTokenDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r pushTokenDeleteMany) Tx() PushTokenManyTxResult { - v := newPushTokenManyTxResult() +func (r iapDeleteMany) Tx() IapManyTxResult { + v := newIapManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type iapFindUnique struct { +type blobFindUnique struct { query builder.Query } -func (r iapFindUnique) getQuery() builder.Query { +func (r blobFindUnique) getQuery() builder.Query { return r.query } -func (r iapFindUnique) ExtractQuery() builder.Query { +func (r blobFindUnique) ExtractQuery() builder.Query { return r.query } -func (r iapFindUnique) with() {} -func (r iapFindUnique) iapModel() {} -func (r iapFindUnique) iapRelation() {} +func (r blobFindUnique) with() {} +func (r blobFindUnique) blobModel() {} +func (r blobFindUnique) blobRelation() {} -func (r iapActions) FindUnique( - params IapEqualsUniqueWhereParam, -) iapFindUnique { - var v iapFindUnique +func (r blobActions) FindUnique( + params BlobEqualsUniqueWhereParam, +) blobFindUnique { + var v blobFindUnique v.query = builder.NewQuery() v.query.Engine = r.client @@ -35480,8 +39379,8 @@ func (r iapActions) FindUnique( v.query.Method = "findUnique" - v.query.Model = "Iap" - v.query.Outputs = iapOutput + v.query.Model = "Blob" + v.query.Outputs = blobOutput v.query.Inputs = append(v.query.Inputs, builder.Input{ Name: "where", @@ -35491,7 +39390,7 @@ func (r iapActions) FindUnique( return v } -func (r iapFindUnique) With(params ...IapRelationWith) iapFindUnique { +func (r blobFindUnique) With(params ...BlobRelationWith) blobFindUnique { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -35504,7 +39403,7 @@ func (r iapFindUnique) With(params ...IapRelationWith) iapFindUnique { return r } -func (r iapFindUnique) Select(params ...iapPrismaFields) iapFindUnique { +func (r blobFindUnique) Select(params ...blobPrismaFields) blobFindUnique { var outputs []builder.Output for _, param := range params { @@ -35518,7 +39417,7 @@ func (r iapFindUnique) Select(params ...iapPrismaFields) iapFindUnique { return r } -func (r iapFindUnique) Omit(params ...iapPrismaFields) iapFindUnique { +func (r blobFindUnique) Omit(params ...blobPrismaFields) blobFindUnique { var outputs []builder.Output var raw []string @@ -35526,7 +39425,7 @@ func (r iapFindUnique) Omit(params ...iapPrismaFields) iapFindUnique { raw = append(raw, string(param)) } - for _, output := range iapOutput { + for _, output := range blobOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -35537,11 +39436,11 @@ func (r iapFindUnique) Omit(params ...iapPrismaFields) iapFindUnique { return r } -func (r iapFindUnique) Exec(ctx context.Context) ( - *IapModel, +func (r blobFindUnique) Exec(ctx context.Context) ( + *BlobModel, error, ) { - var v *IapModel + var v *BlobModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -35553,11 +39452,11 @@ func (r iapFindUnique) Exec(ctx context.Context) ( return v, nil } -func (r iapFindUnique) ExecInner(ctx context.Context) ( - *InnerIap, +func (r blobFindUnique) ExecInner(ctx context.Context) ( + *InnerBlob, error, ) { - var v *InnerIap + var v *InnerBlob if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -35569,12 +39468,12 @@ func (r iapFindUnique) ExecInner(ctx context.Context) ( return v, nil } -func (r iapFindUnique) Update(params ...IapSetParam) iapUpdateUnique { +func (r blobFindUnique) Update(params ...BlobSetParam) blobUpdateUnique { r.query.Operation = "mutation" r.query.Method = "updateOne" - r.query.Model = "Iap" + r.query.Model = "Blob" - var v iapUpdateUnique + var v blobUpdateUnique v.query = r.query var fields []builder.Field for _, q := range params { @@ -35603,86 +39502,86 @@ func (r iapFindUnique) Update(params ...IapSetParam) iapUpdateUnique { return v } -type iapUpdateUnique struct { +type blobUpdateUnique struct { query builder.Query } -func (r iapUpdateUnique) ExtractQuery() builder.Query { +func (r blobUpdateUnique) ExtractQuery() builder.Query { return r.query } -func (r iapUpdateUnique) iapModel() {} +func (r blobUpdateUnique) blobModel() {} -func (r iapUpdateUnique) Exec(ctx context.Context) (*IapModel, error) { - var v IapModel +func (r blobUpdateUnique) Exec(ctx context.Context) (*BlobModel, error) { + var v BlobModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r iapUpdateUnique) Tx() IapUniqueTxResult { - v := newIapUniqueTxResult() +func (r blobUpdateUnique) Tx() BlobUniqueTxResult { + v := newBlobUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r iapFindUnique) Delete() iapDeleteUnique { - var v iapDeleteUnique +func (r blobFindUnique) Delete() blobDeleteUnique { + var v blobDeleteUnique v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteOne" - v.query.Model = "Iap" + v.query.Model = "Blob" return v } -type iapDeleteUnique struct { +type blobDeleteUnique struct { query builder.Query } -func (r iapDeleteUnique) ExtractQuery() builder.Query { +func (r blobDeleteUnique) ExtractQuery() builder.Query { return r.query } -func (p iapDeleteUnique) iapModel() {} +func (p blobDeleteUnique) blobModel() {} -func (r iapDeleteUnique) Exec(ctx context.Context) (*IapModel, error) { - var v IapModel +func (r blobDeleteUnique) Exec(ctx context.Context) (*BlobModel, error) { + var v BlobModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } return &v, nil } -func (r iapDeleteUnique) Tx() IapUniqueTxResult { - v := newIapUniqueTxResult() +func (r blobDeleteUnique) Tx() BlobUniqueTxResult { + v := newBlobUniqueTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -type iapFindFirst struct { +type blobFindFirst struct { query builder.Query } -func (r iapFindFirst) getQuery() builder.Query { +func (r blobFindFirst) getQuery() builder.Query { return r.query } -func (r iapFindFirst) ExtractQuery() builder.Query { +func (r blobFindFirst) ExtractQuery() builder.Query { return r.query } -func (r iapFindFirst) with() {} -func (r iapFindFirst) iapModel() {} -func (r iapFindFirst) iapRelation() {} +func (r blobFindFirst) with() {} +func (r blobFindFirst) blobModel() {} +func (r blobFindFirst) blobRelation() {} -func (r iapActions) FindFirst( - params ...IapWhereParam, -) iapFindFirst { - var v iapFindFirst +func (r blobActions) FindFirst( + params ...BlobWhereParam, +) blobFindFirst { + var v blobFindFirst v.query = builder.NewQuery() v.query.Engine = r.client @@ -35690,8 +39589,8 @@ func (r iapActions) FindFirst( v.query.Method = "findFirst" - v.query.Model = "Iap" - v.query.Outputs = iapOutput + v.query.Model = "Blob" + v.query.Outputs = blobOutput var where []builder.Field for _, q := range params { @@ -35716,7 +39615,7 @@ func (r iapActions) FindFirst( return v } -func (r iapFindFirst) With(params ...IapRelationWith) iapFindFirst { +func (r blobFindFirst) With(params ...BlobRelationWith) blobFindFirst { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -35729,7 +39628,7 @@ func (r iapFindFirst) With(params ...IapRelationWith) iapFindFirst { return r } -func (r iapFindFirst) Select(params ...iapPrismaFields) iapFindFirst { +func (r blobFindFirst) Select(params ...blobPrismaFields) blobFindFirst { var outputs []builder.Output for _, param := range params { @@ -35743,7 +39642,7 @@ func (r iapFindFirst) Select(params ...iapPrismaFields) iapFindFirst { return r } -func (r iapFindFirst) Omit(params ...iapPrismaFields) iapFindFirst { +func (r blobFindFirst) Omit(params ...blobPrismaFields) blobFindFirst { var outputs []builder.Output var raw []string @@ -35751,7 +39650,7 @@ func (r iapFindFirst) Omit(params ...iapPrismaFields) iapFindFirst { raw = append(raw, string(param)) } - for _, output := range iapOutput { + for _, output := range blobOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -35762,7 +39661,7 @@ func (r iapFindFirst) Omit(params ...iapPrismaFields) iapFindFirst { return r } -func (r iapFindFirst) OrderBy(params ...IapOrderByParam) iapFindFirst { +func (r blobFindFirst) OrderBy(params ...BlobOrderByParam) blobFindFirst { var fields []builder.Field for _, param := range params { @@ -35782,7 +39681,7 @@ func (r iapFindFirst) OrderBy(params ...IapOrderByParam) iapFindFirst { return r } -func (r iapFindFirst) Skip(count int) iapFindFirst { +func (r blobFindFirst) Skip(count int) blobFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -35790,7 +39689,7 @@ func (r iapFindFirst) Skip(count int) iapFindFirst { return r } -func (r iapFindFirst) Take(count int) iapFindFirst { +func (r blobFindFirst) Take(count int) blobFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -35798,7 +39697,7 @@ func (r iapFindFirst) Take(count int) iapFindFirst { return r } -func (r iapFindFirst) Cursor(cursor IapCursorParam) iapFindFirst { +func (r blobFindFirst) Cursor(cursor BlobCursorParam) blobFindFirst { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -35806,11 +39705,11 @@ func (r iapFindFirst) Cursor(cursor IapCursorParam) iapFindFirst { return r } -func (r iapFindFirst) Exec(ctx context.Context) ( - *IapModel, +func (r blobFindFirst) Exec(ctx context.Context) ( + *BlobModel, error, ) { - var v *IapModel + var v *BlobModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -35822,11 +39721,11 @@ func (r iapFindFirst) Exec(ctx context.Context) ( return v, nil } -func (r iapFindFirst) ExecInner(ctx context.Context) ( - *InnerIap, +func (r blobFindFirst) ExecInner(ctx context.Context) ( + *InnerBlob, error, ) { - var v *InnerIap + var v *InnerBlob if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -35838,26 +39737,26 @@ func (r iapFindFirst) ExecInner(ctx context.Context) ( return v, nil } -type iapFindMany struct { +type blobFindMany struct { query builder.Query } -func (r iapFindMany) getQuery() builder.Query { +func (r blobFindMany) getQuery() builder.Query { return r.query } -func (r iapFindMany) ExtractQuery() builder.Query { +func (r blobFindMany) ExtractQuery() builder.Query { return r.query } -func (r iapFindMany) with() {} -func (r iapFindMany) iapModel() {} -func (r iapFindMany) iapRelation() {} +func (r blobFindMany) with() {} +func (r blobFindMany) blobModel() {} +func (r blobFindMany) blobRelation() {} -func (r iapActions) FindMany( - params ...IapWhereParam, -) iapFindMany { - var v iapFindMany +func (r blobActions) FindMany( + params ...BlobWhereParam, +) blobFindMany { + var v blobFindMany v.query = builder.NewQuery() v.query.Engine = r.client @@ -35865,8 +39764,8 @@ func (r iapActions) FindMany( v.query.Method = "findMany" - v.query.Model = "Iap" - v.query.Outputs = iapOutput + v.query.Model = "Blob" + v.query.Outputs = blobOutput var where []builder.Field for _, q := range params { @@ -35891,7 +39790,7 @@ func (r iapActions) FindMany( return v } -func (r iapFindMany) With(params ...IapRelationWith) iapFindMany { +func (r blobFindMany) With(params ...BlobRelationWith) blobFindMany { for _, q := range params { query := q.getQuery() r.query.Outputs = append(r.query.Outputs, builder.Output{ @@ -35904,7 +39803,7 @@ func (r iapFindMany) With(params ...IapRelationWith) iapFindMany { return r } -func (r iapFindMany) Select(params ...iapPrismaFields) iapFindMany { +func (r blobFindMany) Select(params ...blobPrismaFields) blobFindMany { var outputs []builder.Output for _, param := range params { @@ -35918,7 +39817,7 @@ func (r iapFindMany) Select(params ...iapPrismaFields) iapFindMany { return r } -func (r iapFindMany) Omit(params ...iapPrismaFields) iapFindMany { +func (r blobFindMany) Omit(params ...blobPrismaFields) blobFindMany { var outputs []builder.Output var raw []string @@ -35926,7 +39825,7 @@ func (r iapFindMany) Omit(params ...iapPrismaFields) iapFindMany { raw = append(raw, string(param)) } - for _, output := range iapOutput { + for _, output := range blobOutput { if !slices.Contains(raw, output.Name) { outputs = append(outputs, output) } @@ -35937,7 +39836,7 @@ func (r iapFindMany) Omit(params ...iapPrismaFields) iapFindMany { return r } -func (r iapFindMany) OrderBy(params ...IapOrderByParam) iapFindMany { +func (r blobFindMany) OrderBy(params ...BlobOrderByParam) blobFindMany { var fields []builder.Field for _, param := range params { @@ -35957,7 +39856,7 @@ func (r iapFindMany) OrderBy(params ...IapOrderByParam) iapFindMany { return r } -func (r iapFindMany) Skip(count int) iapFindMany { +func (r blobFindMany) Skip(count int) blobFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "skip", Value: count, @@ -35965,7 +39864,7 @@ func (r iapFindMany) Skip(count int) iapFindMany { return r } -func (r iapFindMany) Take(count int) iapFindMany { +func (r blobFindMany) Take(count int) blobFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "take", Value: count, @@ -35973,7 +39872,7 @@ func (r iapFindMany) Take(count int) iapFindMany { return r } -func (r iapFindMany) Cursor(cursor IapCursorParam) iapFindMany { +func (r blobFindMany) Cursor(cursor BlobCursorParam) blobFindMany { r.query.Inputs = append(r.query.Inputs, builder.Input{ Name: "cursor", Fields: []builder.Field{cursor.field()}, @@ -35981,11 +39880,11 @@ func (r iapFindMany) Cursor(cursor IapCursorParam) iapFindMany { return r } -func (r iapFindMany) Exec(ctx context.Context) ( - []IapModel, +func (r blobFindMany) Exec(ctx context.Context) ( + []BlobModel, error, ) { - var v []IapModel + var v []BlobModel if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -35993,11 +39892,11 @@ func (r iapFindMany) Exec(ctx context.Context) ( return v, nil } -func (r iapFindMany) ExecInner(ctx context.Context) ( - []InnerIap, +func (r blobFindMany) ExecInner(ctx context.Context) ( + []InnerBlob, error, ) { - var v []InnerIap + var v []InnerBlob if err := r.query.Exec(ctx, &v); err != nil { return nil, err } @@ -36005,14 +39904,14 @@ func (r iapFindMany) ExecInner(ctx context.Context) ( return v, nil } -func (r iapFindMany) Update(params ...IapSetParam) iapUpdateMany { +func (r blobFindMany) Update(params ...BlobSetParam) blobUpdateMany { r.query.Operation = "mutation" r.query.Method = "updateMany" - r.query.Model = "Iap" + r.query.Model = "Blob" r.query.Outputs = countOutput - var v iapUpdateMany + var v blobUpdateMany v.query = r.query var fields []builder.Field for _, q := range params { @@ -36041,17 +39940,17 @@ func (r iapFindMany) Update(params ...IapSetParam) iapUpdateMany { return v } -type iapUpdateMany struct { +type blobUpdateMany struct { query builder.Query } -func (r iapUpdateMany) ExtractQuery() builder.Query { +func (r blobUpdateMany) ExtractQuery() builder.Query { return r.query } -func (r iapUpdateMany) iapModel() {} +func (r blobUpdateMany) blobModel() {} -func (r iapUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r blobUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -36059,36 +39958,36 @@ func (r iapUpdateMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r iapUpdateMany) Tx() IapManyTxResult { - v := newIapManyTxResult() +func (r blobUpdateMany) Tx() BlobManyTxResult { + v := newBlobManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v } -func (r iapFindMany) Delete() iapDeleteMany { - var v iapDeleteMany +func (r blobFindMany) Delete() blobDeleteMany { + var v blobDeleteMany v.query = r.query v.query.Operation = "mutation" v.query.Method = "deleteMany" - v.query.Model = "Iap" + v.query.Model = "Blob" v.query.Outputs = countOutput return v } -type iapDeleteMany struct { +type blobDeleteMany struct { query builder.Query } -func (r iapDeleteMany) ExtractQuery() builder.Query { +func (r blobDeleteMany) ExtractQuery() builder.Query { return r.query } -func (p iapDeleteMany) iapModel() {} +func (p blobDeleteMany) blobModel() {} -func (r iapDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { +func (r blobDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { var v BatchResult if err := r.query.Exec(ctx, &v); err != nil { return nil, err @@ -36096,8 +39995,8 @@ func (r iapDeleteMany) Exec(ctx context.Context) (*BatchResult, error) { return &v, nil } -func (r iapDeleteMany) Tx() IapManyTxResult { - v := newIapManyTxResult() +func (r blobDeleteMany) Tx() BlobManyTxResult { + v := newBlobManyTxResult() v.query = r.query v.query.TxResult = make(chan []byte, 1) return v @@ -36537,6 +40436,54 @@ func (r IapManyTxResult) Result() (v *BatchResult) { return v } +func newBlobUniqueTxResult() BlobUniqueTxResult { + return BlobUniqueTxResult{ + result: &transaction.Result{}, + } +} + +type BlobUniqueTxResult struct { + query builder.Query + result *transaction.Result +} + +func (p BlobUniqueTxResult) ExtractQuery() builder.Query { + return p.query +} + +func (p BlobUniqueTxResult) IsTx() {} + +func (r BlobUniqueTxResult) Result() (v *BlobModel) { + if err := r.result.Get(r.query.TxResult, &v); err != nil { + panic(err) + } + return v +} + +func newBlobManyTxResult() BlobManyTxResult { + return BlobManyTxResult{ + result: &transaction.Result{}, + } +} + +type BlobManyTxResult struct { + query builder.Query + result *transaction.Result +} + +func (p BlobManyTxResult) ExtractQuery() builder.Query { + return p.query +} + +func (p BlobManyTxResult) IsTx() {} + +func (r BlobManyTxResult) Result() (v *BatchResult) { + if err := r.result.Get(r.query.TxResult, &v); err != nil { + panic(err) + } + return v +} + // --- template upsert.gotpl --- type userUpsertOne struct { @@ -37548,3 +41495,123 @@ func (r iapUpsertOne) Tx() IapUniqueTxResult { v.query.TxResult = make(chan []byte, 1) return v } + +type blobUpsertOne struct { + query builder.Query +} + +func (r blobUpsertOne) getQuery() builder.Query { + return r.query +} + +func (r blobUpsertOne) ExtractQuery() builder.Query { + return r.query +} + +func (r blobUpsertOne) with() {} +func (r blobUpsertOne) blobModel() {} +func (r blobUpsertOne) blobRelation() {} + +func (r blobActions) UpsertOne( + params BlobEqualsUniqueWhereParam, +) blobUpsertOne { + var v blobUpsertOne + v.query = builder.NewQuery() + v.query.Engine = r.client + + v.query.Operation = "mutation" + v.query.Method = "upsertOne" + v.query.Model = "Blob" + v.query.Outputs = blobOutput + + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "where", + Fields: builder.TransformEquals([]builder.Field{params.field()}), + }) + + return v +} + +func (r blobUpsertOne) Create( + + _id BlobWithPrismaIDSetParam, + _userID BlobWithPrismaUserIDSetParam, + _type BlobWithPrismaTypeSetParam, + _s3URL BlobWithPrismaS3URLSetParam, + _size BlobWithPrismaSizeSetParam, + _metadata BlobWithPrismaMetadataSetParam, + + optional ...BlobSetParam, +) blobUpsertOne { + var v blobUpsertOne + v.query = r.query + + var fields []builder.Field + fields = append(fields, _id.field()) + fields = append(fields, _userID.field()) + fields = append(fields, _type.field()) + fields = append(fields, _s3URL.field()) + fields = append(fields, _size.field()) + fields = append(fields, _metadata.field()) + + for _, q := range optional { + fields = append(fields, q.field()) + } + + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "create", + Fields: fields, + }) + + return v +} + +func (r blobUpsertOne) Update( + params ...BlobSetParam, +) blobUpsertOne { + var v blobUpsertOne + v.query = r.query + + var fields []builder.Field + for _, q := range params { + + field := q.field() + + _, isJson := field.Value.(types.JSON) + if field.Value != nil && !isJson { + v := field.Value + field.Fields = []builder.Field{ + { + Name: "set", + Value: v, + }, + } + + field.Value = nil + } + + fields = append(fields, field) + } + + v.query.Inputs = append(v.query.Inputs, builder.Input{ + Name: "update", + Fields: fields, + }) + + return v +} + +func (r blobUpsertOne) Exec(ctx context.Context) (*BlobModel, error) { + var v BlobModel + if err := r.query.Exec(ctx, &v); err != nil { + return nil, err + } + return &v, nil +} + +func (r blobUpsertOne) Tx() BlobUniqueTxResult { + v := newBlobUniqueTxResult() + v.query = r.query + v.query.TxResult = make(chan []byte, 1) + return v +} diff --git a/database/prisma/schema.prisma b/database/prisma/schema.prisma index 1bcc84b..b30678b 100644 --- a/database/prisma/schema.prisma +++ b/database/prisma/schema.prisma @@ -196,3 +196,23 @@ model Iap { @@map("flipchat_iap") } + +model Blob { + // Fields + id Bytes @id + + userId String + type Int @db.SmallInt + s3Url String + size Int + metadata Bytes + flagged Boolean @default(false) + + createdAt DateTime @default(now()) + + // Relations + + // Constraints + + @@map("flipchat_blob") +} From 2e344f353a772c35889bfdbe1d54ff6f1f95ae53 Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Tue, 21 Jan 2025 17:49:44 -0500 Subject: [PATCH 02/14] blob: updated id types --- blob/memory/store.go | 9 ++++-- blob/postgres/store.go | 64 ++++++++++++++++++++++++++++++++++++++++++ blob/store.go | 16 +++++------ blob/tests/store.go | 28 ++++++++++-------- go.mod | 2 ++ model/blob.go | 31 ++++++++++++++++++++ 6 files changed, 128 insertions(+), 22 deletions(-) create mode 100644 blob/postgres/store.go create mode 100644 model/blob.go diff --git a/blob/memory/store.go b/blob/memory/store.go index 7165b62..718324d 100644 --- a/blob/memory/store.go +++ b/blob/memory/store.go @@ -4,7 +4,10 @@ import ( "context" "sync" + commonpb "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" + "github.com/code-payments/flipchat-server/blob" + "github.com/code-payments/flipchat-server/model" ) type store struct { @@ -22,7 +25,7 @@ func (s *store) CreateBlob(ctx context.Context, b *blob.Blob) error { s.mu.Lock() defer s.mu.Unlock() - key := string(b.ID) + key := model.BlobIDString(b.ID) if _, found := s.data[key]; found { return blob.ErrExists } @@ -30,11 +33,11 @@ func (s *store) CreateBlob(ctx context.Context, b *blob.Blob) error { return nil } -func (s *store) GetBlob(ctx context.Context, id []byte) (*blob.Blob, error) { +func (s *store) GetBlob(ctx context.Context, id *commonpb.BlobId) (*blob.Blob, error) { s.mu.RLock() defer s.mu.RUnlock() - key := string(id) + key := model.BlobIDString(id) bl, found := s.data[key] if !found { return nil, blob.ErrNotFound diff --git a/blob/postgres/store.go b/blob/postgres/store.go new file mode 100644 index 0000000..91ed108 --- /dev/null +++ b/blob/postgres/store.go @@ -0,0 +1,64 @@ +package postgres + +/*package postgres + +import ( + "context" + "fmt" + + "github.com/code-payments/flipchat-server/blob" + "github.com/code-payments/flipchat-server/database/prisma/db" +) + +type store struct { + client *db.PrismaClient +} + +func NewPostgresStore(client *db.PrismaClient) blob.Store { + return &store{ + client: client, + } +} + +func (s *store) CreateBlob(ctx context.Context, b *blob.Blob) error { + found, err := s.client.Blob.FindUnique( + db.Blob.ID.Equals(b.ID), + ).Exec(ctx) + if err == nil && found != nil { + return blob.ErrExists + } + _, err = s.client.Blob.CreateOne( + db.Blob.ID.Set(b.ID), + db.Blob.UserID.Set(b.UserID), + db.Blob.Type.Set(int(b.Type)), + db.Blob.S3URL.Set(b.S3URL), + db.Blob.Size.Set(int(b.Size)), + db.Blob.Metadata.Set(b.Metadata), + db.Blob.Flagged.Set(b.Flagged), + db.Blob.CreatedAt.Set(b.CreatedAt), + ).Exec(ctx) + if err != nil { + return fmt.Errorf("failed to create blob: %w", err) + } + return nil +} + +func (s *store) GetBlob(ctx context.Context, id []byte) (*blob.Blob, error) { + row, err := s.client.Blob.FindUnique( + db.Blob.ID.Equals(id), + ).Exec(ctx) + if err != nil || row == nil { + return nil, blob.ErrNotFound + } + return &blob.Blob{ + ID: row.ID, + Owner: row.UserID, + Type: blob.BlobType(row.Type), + S3URL: row.S3URL, + Size: int64(row.Size), + Metadata: row.Metadata, + Flagged: row.Flagged, + CreatedAt: row.CreatedAt, + }, nil +} +*/ diff --git a/blob/store.go b/blob/store.go index 45656de..0f9a5f1 100644 --- a/blob/store.go +++ b/blob/store.go @@ -4,6 +4,8 @@ import ( "context" "errors" "time" + + commonpb "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" ) var ( @@ -17,13 +19,13 @@ const ( BlobTypeUnknown BlobType = iota BlobTypeImage BlobTypeVideo - BlobTypeAudio + BlobTypeAudio ) // Blob holds blob info type Blob struct { - ID []byte - Owner string + ID *commonpb.BlobId + UserID *commonpb.UserId Type BlobType S3URL string Size int64 @@ -34,14 +36,12 @@ type Blob struct { // Clone creates a deep copy func (b *Blob) Clone() *Blob { - idCopy := make([]byte, len(b.ID)) - copy(idCopy, b.ID) metadataCopy := make([]byte, len(b.Metadata)) copy(metadataCopy, b.Metadata) return &Blob{ - ID: idCopy, - Owner: b.Owner, + ID: b.ID, + UserID: b.UserID, Type: b.Type, S3URL: b.S3URL, Size: b.Size, @@ -54,5 +54,5 @@ func (b *Blob) Clone() *Blob { // Store is an interface for blob operations type Store interface { CreateBlob(ctx context.Context, blob *Blob) error - GetBlob(ctx context.Context, id []byte) (*Blob, error) + GetBlob(ctx context.Context, id *commonpb.BlobId) (*Blob, error) } diff --git a/blob/tests/store.go b/blob/tests/store.go index b90c025..a6c930f 100644 --- a/blob/tests/store.go +++ b/blob/tests/store.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/code-payments/flipchat-server/blob" + "github.com/code-payments/flipchat-server/model" ) func RunStoreTests(t *testing.T, s blob.Store, teardown func()) { @@ -23,15 +24,18 @@ func RunStoreTests(t *testing.T, s blob.Store, teardown func()) { func testCreateAndGet(t *testing.T, s blob.Store) { ctx := context.Background() + blobID := model.MustGenerateBlobID() + userID := model.MustGenerateUserID() + // Attempt to retrieve a non-existent blob - _, err := s.GetBlob(ctx, []byte{0x01, 0x02}) + _, err := s.GetBlob(ctx, blobID) require.ErrorIs(t, err, blob.ErrNotFound) // Create a new blob now := time.Now() testBlob := &blob.Blob{ - ID: []byte{0x05, 0x06}, - Owner: "test-owner", + ID: blobID, + UserID: userID, Type: blob.BlobTypeImage, S3URL: "s3://test-bucket/test-key", Size: 12345, @@ -42,10 +46,10 @@ func testCreateAndGet(t *testing.T, s blob.Store) { require.NoError(t, s.CreateBlob(ctx, testBlob)) // Retrieve and verify - got, err := s.GetBlob(ctx, testBlob.ID) + got, err := s.GetBlob(ctx, blobID) require.NoError(t, err) require.NotNil(t, got) - require.Equal(t, testBlob.Owner, got.Owner) + require.Equal(t, testBlob.UserID, got.UserID) require.Equal(t, testBlob.Size, got.Size) require.Equal(t, testBlob.Type, got.Type) require.Equal(t, testBlob.S3URL, got.S3URL) @@ -57,14 +61,16 @@ func testCreateAndGet(t *testing.T, s blob.Store) { func testCreateDuplicate(t *testing.T, s blob.Store) { ctx := context.Background() + blobID := model.MustGenerateBlobID() + userID := model.MustGenerateUserID() + // Create an initial blob - blobID := []byte{0x09, 0x0A} testBlob := &blob.Blob{ - ID: blobID, - Owner: "duplicate-owner", - Type: blob.BlobTypeAudio, - S3URL: "s3://audio-bucket/audio-key", - Size: 999, + ID: blobID, + UserID: userID, + Type: blob.BlobTypeAudio, + S3URL: "s3://audio-bucket/audio-key", + Size: 999, } require.NoError(t, s.CreateBlob(ctx, testBlob)) diff --git a/go.mod b/go.mod index 47d7a2f..4dd32d4 100644 --- a/go.mod +++ b/go.mod @@ -102,3 +102,5 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/code-payments/flipchat-protobuf-api => ../flipchat-protobuf-api \ No newline at end of file diff --git a/model/blob.go b/model/blob.go new file mode 100644 index 0000000..4ce3c1f --- /dev/null +++ b/model/blob.go @@ -0,0 +1,31 @@ +package model + +import ( + "fmt" + + "github.com/mr-tron/base58" + + commonpb "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" +) + +func MustGenerateBlobID() *commonpb.BlobId { + id, err := GenerateBlobID() + if err != nil { + panic(fmt.Sprintf("failed to generate blob id: %v", err)) + } + + return id +} + +func GenerateBlobID() (*commonpb.BlobId, error) { + kp, err := GenerateKeyPair() + if err != nil { + return nil, err + } + + return &commonpb.BlobId{Value: kp.Public()}, nil +} + +func BlobIDString(blob *commonpb.BlobId) string { + return base58.Encode(blob.Value) +} From fdf7554d95e64b37f69d55bfaf3a108d65ecd8cc Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Wed, 22 Jan 2025 11:15:32 -0500 Subject: [PATCH 03/14] initial postgres implementation --- blob/postgres/common_test.go | 34 ++++++++++++++ blob/postgres/store.go | 46 ++++++++++++++----- blob/postgres/store_test.go | 24 ++++++++++ blob/tests/store.go | 11 +++-- .../20250122160001_blob/migration.sql | 13 ++++++ push/postgres/common_test.go | 1 + 6 files changed, 112 insertions(+), 17 deletions(-) create mode 100644 blob/postgres/common_test.go create mode 100644 blob/postgres/store_test.go create mode 100644 database/prisma/migrations/20250122160001_blob/migration.sql diff --git a/blob/postgres/common_test.go b/blob/postgres/common_test.go new file mode 100644 index 0000000..c1efb8c --- /dev/null +++ b/blob/postgres/common_test.go @@ -0,0 +1,34 @@ +//go:build integration + +package postgres + +import ( + "os" + "testing" + + "github.com/sirupsen/logrus" + + prismatest "github.com/code-payments/flipchat-server/database/prisma/test" + + _ "github.com/jackc/pgx/v4/stdlib" +) + +var testEnv *prismatest.TestEnv + +func TestMain(m *testing.M) { + log := logrus.StandardLogger() + + // Create a new test environment + env, err := prismatest.NewTestEnv() + if err != nil { + log.WithError(err).Error("Error creating test environment") + os.Exit(1) + } + + // Set the test environment + testEnv = env + + // Run tests + code := m.Run() + os.Exit(code) +} diff --git a/blob/postgres/store.go b/blob/postgres/store.go index 91ed108..fc66559 100644 --- a/blob/postgres/store.go +++ b/blob/postgres/store.go @@ -1,11 +1,12 @@ package postgres -/*package postgres - import ( "context" "fmt" + commonpb "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" + pg "github.com/code-payments/flipchat-server/database/postgres" + "github.com/code-payments/flipchat-server/blob" "github.com/code-payments/flipchat-server/database/prisma/db" ) @@ -14,22 +15,36 @@ type store struct { client *db.PrismaClient } -func NewPostgresStore(client *db.PrismaClient) blob.Store { +func NewInPostgres(client *db.PrismaClient) blob.Store { return &store{ - client: client, + client, + } +} + +func (s *store) reset() { + ctx := context.Background() + + blobs := s.client.Blob.FindMany().Delete().Tx() + err := s.client.Prisma.Transaction(blobs).Exec(ctx) + if err != nil { + panic(err) } } func (s *store) CreateBlob(ctx context.Context, b *blob.Blob) error { found, err := s.client.Blob.FindUnique( - db.Blob.ID.Equals(b.ID), + db.Blob.ID.Equals(b.ID.Value), ).Exec(ctx) + if err == nil && found != nil { return blob.ErrExists } + + encodedUserId := pg.Encode(b.UserID.Value) + _, err = s.client.Blob.CreateOne( - db.Blob.ID.Set(b.ID), - db.Blob.UserID.Set(b.UserID), + db.Blob.ID.Set(b.ID.Value), + db.Blob.UserID.Set(encodedUserId), db.Blob.Type.Set(int(b.Type)), db.Blob.S3URL.Set(b.S3URL), db.Blob.Size.Set(int(b.Size)), @@ -37,22 +52,30 @@ func (s *store) CreateBlob(ctx context.Context, b *blob.Blob) error { db.Blob.Flagged.Set(b.Flagged), db.Blob.CreatedAt.Set(b.CreatedAt), ).Exec(ctx) + if err != nil { return fmt.Errorf("failed to create blob: %w", err) } return nil } -func (s *store) GetBlob(ctx context.Context, id []byte) (*blob.Blob, error) { +func (s *store) GetBlob(ctx context.Context, id *commonpb.BlobId) (*blob.Blob, error) { row, err := s.client.Blob.FindUnique( - db.Blob.ID.Equals(id), + db.Blob.ID.Equals(id.Value), ).Exec(ctx) + if err != nil || row == nil { return nil, blob.ErrNotFound } + + userID, err := pg.Decode(row.UserID) + if err != nil { + return nil, err + } + return &blob.Blob{ - ID: row.ID, - Owner: row.UserID, + ID: id, + UserID: &commonpb.UserId{Value: userID}, Type: blob.BlobType(row.Type), S3URL: row.S3URL, Size: int64(row.Size), @@ -61,4 +84,3 @@ func (s *store) GetBlob(ctx context.Context, id []byte) (*blob.Blob, error) { CreatedAt: row.CreatedAt, }, nil } -*/ diff --git a/blob/postgres/store_test.go b/blob/postgres/store_test.go new file mode 100644 index 0000000..a1be781 --- /dev/null +++ b/blob/postgres/store_test.go @@ -0,0 +1,24 @@ +//go:build integration + +package postgres + +import ( + "testing" + + prismatest "github.com/code-payments/flipchat-server/database/prisma/test" + + "github.com/code-payments/flipchat-server/blob/tests" + + _ "github.com/jackc/pgx/v4/stdlib" +) + +func TestBlob_PostgresStore(t *testing.T) { + client, disconnect := prismatest.NewTestClient(testEnv.DatabaseUrl, t) + defer disconnect() + + testStore := NewInPostgres(client) + teardown := func() { + testStore.(*store).reset() + } + tests.RunStoreTests(t, testStore, teardown) +} diff --git a/blob/tests/store.go b/blob/tests/store.go index a6c930f..1559763 100644 --- a/blob/tests/store.go +++ b/blob/tests/store.go @@ -66,11 +66,12 @@ func testCreateDuplicate(t *testing.T, s blob.Store) { // Create an initial blob testBlob := &blob.Blob{ - ID: blobID, - UserID: userID, - Type: blob.BlobTypeAudio, - S3URL: "s3://audio-bucket/audio-key", - Size: 999, + ID: blobID, + UserID: userID, + Type: blob.BlobTypeAudio, + Metadata: []byte("some metadata"), + S3URL: "s3://audio-bucket/audio-key", + Size: 999, } require.NoError(t, s.CreateBlob(ctx, testBlob)) diff --git a/database/prisma/migrations/20250122160001_blob/migration.sql b/database/prisma/migrations/20250122160001_blob/migration.sql new file mode 100644 index 0000000..56d1991 --- /dev/null +++ b/database/prisma/migrations/20250122160001_blob/migration.sql @@ -0,0 +1,13 @@ +-- CreateTable +CREATE TABLE "flipchat_blob" ( + "id" BYTEA NOT NULL, + "userId" TEXT NOT NULL, + "type" SMALLINT NOT NULL, + "s3Url" TEXT NOT NULL, + "size" INTEGER NOT NULL, + "metadata" BYTEA NOT NULL, + "flagged" BOOLEAN NOT NULL DEFAULT false, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "flipchat_blob_pkey" PRIMARY KEY ("id") +); diff --git a/push/postgres/common_test.go b/push/postgres/common_test.go index fd7a98e..ab28055 100644 --- a/push/postgres/common_test.go +++ b/push/postgres/common_test.go @@ -1,3 +1,4 @@ +//go:build integration package postgres import ( From 034b48b9b88d479f41fae6a0f700bd7aa1aa296d Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Wed, 22 Jan 2025 14:07:50 -0500 Subject: [PATCH 04/14] blob: work in progress on server/s3 packages --- blob/helpers.go | 92 ++++++++++++++++++++++++++++++++ blob/metadata.go | 68 ++++++++++++++++++++++++ blob/server.go | 136 +++++++++++++++++++++++++++++++++++++++++++++++ s3/store.go | 17 ++++++ 4 files changed, 313 insertions(+) create mode 100644 blob/helpers.go create mode 100644 blob/metadata.go create mode 100644 blob/server.go create mode 100644 s3/store.go diff --git a/blob/helpers.go b/blob/helpers.go new file mode 100644 index 0000000..7a8445c --- /dev/null +++ b/blob/helpers.go @@ -0,0 +1,92 @@ +package blob + +import ( + "errors" + + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" + + blobpb "github.com/code-payments/flipchat-protobuf-api/generated/go/blob/v1" + commonpb "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" + + "github.com/code-payments/flipchat-server/model" +) + +// Generates a unique BlobId +func generateBlobID() *commonpb.BlobId { + return model.MustGenerateBlobID() +} + +// Converts protobuf BlobType to internal BlobType +func fromProtoBlobType(protoType blobpb.BlobType) (BlobType, error) { + switch protoType { + case blobpb.BlobType_BLOB_TYPE_IMAGE: + return BlobTypeImage, nil + case blobpb.BlobType_BLOB_TYPE_VIDEO: + return BlobTypeVideo, nil + case blobpb.BlobType_BLOB_TYPE_AUDIO: + return BlobTypeAudio, nil + default: + return BlobTypeUnknown, errors.New("unknown blob type") + } +} + +// toProtoBlobType converts internal BlobType to protobuf BlobType +func toProtoBlobType(internalType BlobType) blobpb.BlobType { + switch internalType { + case BlobTypeImage: + return blobpb.BlobType_BLOB_TYPE_IMAGE + case BlobTypeVideo: + return blobpb.BlobType_BLOB_TYPE_VIDEO + case BlobTypeAudio: + return blobpb.BlobType_BLOB_TYPE_AUDIO + default: + return blobpb.BlobType_BLOB_TYPE_UNKNOWN + } +} + +// Converts internal Blob to protobuf Blob, including unmarshaling metadata. +func toProtoBlob(blob *Blob) (*blobpb.Blob, error) { + protoBlob := &blobpb.Blob{ + BlobId: blob.ID, + BlobType: toProtoBlobType(blob.Type), + OwnerId: blob.UserID, + S3Url: blob.S3URL, + CreatedAt: timestamppb.New(blob.CreatedAt), + //Size: blob.Size, + //Flagged: blob.Flagged, + } + + // Unmarshal metadata based on BlobType + switch blob.Type { + case BlobTypeImage: + var imgMeta blobpb.ImageMetadata + if err := proto.Unmarshal(blob.Metadata, &imgMeta); err != nil { + return nil, errors.New("failed to unmarshal image metadata") + } + protoBlob.Metadata = &blobpb.Blob_ImageMetadata{ + ImageMetadata: &imgMeta, + } + case BlobTypeVideo: + var vidMeta blobpb.VideoMetadata + if err := proto.Unmarshal(blob.Metadata, &vidMeta); err != nil { + return nil, errors.New("failed to unmarshal video metadata") + } + protoBlob.Metadata = &blobpb.Blob_VideoMetadata{ + VideoMetadata: &vidMeta, + } + case BlobTypeAudio: + var audMeta blobpb.AudioMetadata + if err := proto.Unmarshal(blob.Metadata, &audMeta); err != nil { + return nil, errors.New("failed to unmarshal audio metadata") + } + protoBlob.Metadata = &blobpb.Blob_AudioMetadata{ + AudioMetadata: &audMeta, + } + default: + // BlobTypeUnknown or unhandled type + return nil, errors.New("failed to unmarshal metadata") + } + + return protoBlob, nil +} diff --git a/blob/metadata.go b/blob/metadata.go new file mode 100644 index 0000000..f11f47b --- /dev/null +++ b/blob/metadata.go @@ -0,0 +1,68 @@ +package blob + +import ( + "errors" + + "google.golang.org/protobuf/proto" + + blobpb "github.com/code-payments/flipchat-protobuf-api/generated/go/blob/v1" +) + +func newMetadata(blobType BlobType) ([]byte, error) { + var metadataBytes []byte + var err error + + switch blobType { + case BlobTypeImage: + imgMeta := &blobpb.ImageMetadata{ + Version: 0, + + /* + // Example metadata, replace with actual data + Width: 800, + Height: 600, + Format: blobpb.ImageMetadata_IMAGE_FORMAT_PNG, + */ + } + metadataBytes, err = proto.Marshal(imgMeta) + if err != nil { + return nil, errors.New("failed to marshal image metadata: " + err.Error()) + } + case BlobTypeVideo: + vidMeta := &blobpb.VideoMetadata{ + Version: 0, + + /* + // Example metadata, replace with actual data + Width: 1920, + Height: 1080, + DurationSeconds: 120, + FrameRate: 30.0, + Codec: "H.264", + */ + } + metadataBytes, err = proto.Marshal(vidMeta) + if err != nil { + return nil, errors.New("failed to marshal video metadata: " + err.Error()) + } + case BlobTypeAudio: + audMeta := &blobpb.AudioMetadata{ + Version: 0, + + /* + // Example metadata, replace with actual data + DurationSeconds: 180, + Codec: "AAC", + */ + } + metadataBytes, err = proto.Marshal(audMeta) + if err != nil { + return nil, errors.New("failed to marshal audio metadata: " + err.Error()) + } + default: + // BlobTypeUnknown + return nil, errors.New("failed to process metadata: unknown blob type") + } + + return metadataBytes, nil +} diff --git a/blob/server.go b/blob/server.go new file mode 100644 index 0000000..bdad21a --- /dev/null +++ b/blob/server.go @@ -0,0 +1,136 @@ +package blob + +import ( + "bytes" + "context" + "errors" + "io" + "time" + + "go.uber.org/zap" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + blobpb "github.com/code-payments/flipchat-protobuf-api/generated/go/blob/v1" + commonpb "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" + + codecommon "github.com/code-payments/code-server/pkg/code/common" + "github.com/code-payments/flipchat-server/auth" + "github.com/code-payments/flipchat-server/flags" + "github.com/code-payments/flipchat-server/model" + + // Import the s3 package + "github.com/code-payments/flipchat-server/s3" +) + +const loginWindow = 2 * time.Minute + +type Server struct { + log *zap.Logger + store Store + s3Store s3.Store + + blobpb.UnimplementedBlobServiceServer +} + +func NewServer(log *zap.Logger, store Store, s3Store s3.S3Store) *Server { + return &Server{ + log: log, + store: store, + s3Store: s3Store, + } +} + +func (s *Server) Upload(ctx context.Context, req *blobpb.UploadRequest) (*blobpb.UploadResponse, error) { + // Validate the request + if req.GetOwnerId() == nil { + return nil, status.Error(codes.InvalidArgument, "owner_id is required") + } + if req.GetBlobType() == blobpb.BlobType_BLOB_TYPE_UNKNOWN { + return nil, status.Error(codes.InvalidArgument, "blob_type is required") + } + if len(req.GetRawData()) == 0 { + return nil, status.Error(codes.InvalidArgument, "raw_data is required") + } + + blobId := generateBlobID() + + // Convert BlobType from protobuf to internal type + blobType, err := fromProtoBlobType(req.GetBlobType()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid blob_type") + } + + // Serialize metadata based on BlobType + // TODO: do something more useful here + metadataBytes, err := newMetadata(blobType) + if err != nil { + return nil, err + } + + // Upload raw_data to S3 + s3URL, err := s.s3Store.UploadBlob(ctx, req.GetOwnerId(), blobId, req.GetRawData()) + if err != nil { + s.log.Error("Failed to upload blob to S3", zap.Error(err)) + return nil, status.Error(codes.Internal, "failed to upload blob") + } + + // Create the Blob record + blob := &Blob{ + ID: blobId, + UserID: req.GetOwnerId(), + Type: blobType, + S3URL: s3URL, + Size: int64(len(req.GetRawData())), + Metadata: metadataBytes, + Flagged: false, + CreatedAt: time.Now(), + } + + if err := s.store.CreateBlob(ctx, blob); err != nil { + if errors.Is(err, ErrExists) { + return nil, status.Error(codes.AlreadyExists, "blob already exists") + } + s.log.Error("Failed to store blob metadata", zap.Error(err)) + return nil, status.Error(codes.Internal, "failed to store blob metadata") + } + + // Prepare response + responseBlob, err := toProtoBlob(blob) + if err != nil { + s.log.Error("Failed to convert Blob to proto", zap.Error(err)) + return nil, status.Error(codes.Internal, "failed to prepare response") + } + + return &blobpb.UploadResponse{ + Blob: responseBlob, + }, nil +} + +func (s *Server) GetInfo(ctx context.Context, req *blobpb.GetInfoRequest) (*blobpb.GetInfoResponse, error) { + // Validate the request + if req.GetBlobId() == nil { + return nil, status.Error(codes.InvalidArgument, "blob_id is required") + } + + // Retrieve Blob from the store + blob, err := s.store.GetBlob(ctx, req.GetBlobId()) + if err != nil { + if errors.Is(err, ErrNotFound) { + return nil, status.Error(codes.NotFound, "blob not found") + } + s.log.Error("Failed to get blob from store", zap.Error(err)) + return nil, status.Errorf(codes.Internal, "failed to retrieve blob: %v", err) + } + + // Convert Blob to blobpb.Blob + blobPB, err := toProtoBlob(blob) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to marshal blob: %v", err) + } + + return &blobpb.GetInfoResponse{ + Blob: blobPB, + }, nil +} diff --git a/s3/store.go b/s3/store.go new file mode 100644 index 0000000..9b3554c --- /dev/null +++ b/s3/store.go @@ -0,0 +1,17 @@ +package s3 + +import ( + "context" + + commonpb "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" +) + +// Defines the interface for uploading and managing blob data in S3. +type Store interface { + + // Uploads the blob data to S3 and returns the S3 URL. + UploadBlob(ctx context.Context, ownerID *commonpb.UserId, blobID *commonpb.BlobId, data []byte) (string, error) + + // Uploads the blob data to S3 using a stream and returns the S3 URL. + UploadBlobStream(ctx context.Context, ownerID *commonpb.UserId, blobID *commonpb.BlobId, reader io.Reader) (string, error) +} From a742c97394c587f68ea8e8f28efa1fbe6a5ff3ba Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Wed, 22 Jan 2025 14:46:00 -0500 Subject: [PATCH 05/14] blob: wip on s3 and blob services --- blob/helpers.go | 35 ------------------------ blob/metadata.go | 68 ---------------------------------------------- blob/server.go | 34 ++++++++--------------- go.mod | 2 +- go.sum | 2 -- s3/aws/store.go | 0 s3/helpers.go | 35 ++++++++++++++++++++++++ s3/memory/store.go | 0 s3/store.go | 10 ++----- 9 files changed, 49 insertions(+), 137 deletions(-) delete mode 100644 blob/metadata.go create mode 100644 s3/aws/store.go create mode 100644 s3/helpers.go create mode 100644 s3/memory/store.go diff --git a/blob/helpers.go b/blob/helpers.go index 7a8445c..6120b38 100644 --- a/blob/helpers.go +++ b/blob/helpers.go @@ -3,7 +3,6 @@ package blob import ( "errors" - "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/timestamppb" blobpb "github.com/code-payments/flipchat-protobuf-api/generated/go/blob/v1" @@ -53,40 +52,6 @@ func toProtoBlob(blob *Blob) (*blobpb.Blob, error) { OwnerId: blob.UserID, S3Url: blob.S3URL, CreatedAt: timestamppb.New(blob.CreatedAt), - //Size: blob.Size, - //Flagged: blob.Flagged, } - - // Unmarshal metadata based on BlobType - switch blob.Type { - case BlobTypeImage: - var imgMeta blobpb.ImageMetadata - if err := proto.Unmarshal(blob.Metadata, &imgMeta); err != nil { - return nil, errors.New("failed to unmarshal image metadata") - } - protoBlob.Metadata = &blobpb.Blob_ImageMetadata{ - ImageMetadata: &imgMeta, - } - case BlobTypeVideo: - var vidMeta blobpb.VideoMetadata - if err := proto.Unmarshal(blob.Metadata, &vidMeta); err != nil { - return nil, errors.New("failed to unmarshal video metadata") - } - protoBlob.Metadata = &blobpb.Blob_VideoMetadata{ - VideoMetadata: &vidMeta, - } - case BlobTypeAudio: - var audMeta blobpb.AudioMetadata - if err := proto.Unmarshal(blob.Metadata, &audMeta); err != nil { - return nil, errors.New("failed to unmarshal audio metadata") - } - protoBlob.Metadata = &blobpb.Blob_AudioMetadata{ - AudioMetadata: &audMeta, - } - default: - // BlobTypeUnknown or unhandled type - return nil, errors.New("failed to unmarshal metadata") - } - return protoBlob, nil } diff --git a/blob/metadata.go b/blob/metadata.go deleted file mode 100644 index f11f47b..0000000 --- a/blob/metadata.go +++ /dev/null @@ -1,68 +0,0 @@ -package blob - -import ( - "errors" - - "google.golang.org/protobuf/proto" - - blobpb "github.com/code-payments/flipchat-protobuf-api/generated/go/blob/v1" -) - -func newMetadata(blobType BlobType) ([]byte, error) { - var metadataBytes []byte - var err error - - switch blobType { - case BlobTypeImage: - imgMeta := &blobpb.ImageMetadata{ - Version: 0, - - /* - // Example metadata, replace with actual data - Width: 800, - Height: 600, - Format: blobpb.ImageMetadata_IMAGE_FORMAT_PNG, - */ - } - metadataBytes, err = proto.Marshal(imgMeta) - if err != nil { - return nil, errors.New("failed to marshal image metadata: " + err.Error()) - } - case BlobTypeVideo: - vidMeta := &blobpb.VideoMetadata{ - Version: 0, - - /* - // Example metadata, replace with actual data - Width: 1920, - Height: 1080, - DurationSeconds: 120, - FrameRate: 30.0, - Codec: "H.264", - */ - } - metadataBytes, err = proto.Marshal(vidMeta) - if err != nil { - return nil, errors.New("failed to marshal video metadata: " + err.Error()) - } - case BlobTypeAudio: - audMeta := &blobpb.AudioMetadata{ - Version: 0, - - /* - // Example metadata, replace with actual data - DurationSeconds: 180, - Codec: "AAC", - */ - } - metadataBytes, err = proto.Marshal(audMeta) - if err != nil { - return nil, errors.New("failed to marshal audio metadata: " + err.Error()) - } - default: - // BlobTypeUnknown - return nil, errors.New("failed to process metadata: unknown blob type") - } - - return metadataBytes, nil -} diff --git a/blob/server.go b/blob/server.go index bdad21a..514d5ba 100644 --- a/blob/server.go +++ b/blob/server.go @@ -1,26 +1,16 @@ package blob import ( - "bytes" "context" "errors" - "io" "time" "go.uber.org/zap" - "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" blobpb "github.com/code-payments/flipchat-protobuf-api/generated/go/blob/v1" - commonpb "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" - codecommon "github.com/code-payments/code-server/pkg/code/common" - "github.com/code-payments/flipchat-server/auth" - "github.com/code-payments/flipchat-server/flags" - "github.com/code-payments/flipchat-server/model" - - // Import the s3 package "github.com/code-payments/flipchat-server/s3" ) @@ -34,7 +24,7 @@ type Server struct { blobpb.UnimplementedBlobServiceServer } -func NewServer(log *zap.Logger, store Store, s3Store s3.S3Store) *Server { +func NewServer(log *zap.Logger, store Store, s3Store s3.Store) *Server { return &Server{ log: log, store: store, @@ -42,7 +32,7 @@ func NewServer(log *zap.Logger, store Store, s3Store s3.S3Store) *Server { } } -func (s *Server) Upload(ctx context.Context, req *blobpb.UploadRequest) (*blobpb.UploadResponse, error) { +func (s *Server) Upload(ctx context.Context, req *blobpb.UploadBlobRequest) (*blobpb.UploadBlobResponse, error) { // Validate the request if req.GetOwnerId() == nil { return nil, status.Error(codes.InvalidArgument, "owner_id is required") @@ -62,15 +52,13 @@ func (s *Server) Upload(ctx context.Context, req *blobpb.UploadRequest) (*blobpb return nil, status.Error(codes.InvalidArgument, "invalid blob_type") } - // Serialize metadata based on BlobType - // TODO: do something more useful here - metadataBytes, err := newMetadata(blobType) + // Upload raw_data to S3 + s3Url, err := s3.GenerateS3URLPathForBlob(blobId) if err != nil { - return nil, err + return nil, status.Error(codes.Internal, "failed to generate s3 url") } - // Upload raw_data to S3 - s3URL, err := s.s3Store.UploadBlob(ctx, req.GetOwnerId(), blobId, req.GetRawData()) + err = s.s3Store.Upload(ctx, s3Url, req.GetRawData()) if err != nil { s.log.Error("Failed to upload blob to S3", zap.Error(err)) return nil, status.Error(codes.Internal, "failed to upload blob") @@ -81,9 +69,9 @@ func (s *Server) Upload(ctx context.Context, req *blobpb.UploadRequest) (*blobpb ID: blobId, UserID: req.GetOwnerId(), Type: blobType, - S3URL: s3URL, + S3URL: s3Url, Size: int64(len(req.GetRawData())), - Metadata: metadataBytes, + Metadata: []byte("version_0: empty"), Flagged: false, CreatedAt: time.Now(), } @@ -103,12 +91,12 @@ func (s *Server) Upload(ctx context.Context, req *blobpb.UploadRequest) (*blobpb return nil, status.Error(codes.Internal, "failed to prepare response") } - return &blobpb.UploadResponse{ + return &blobpb.UploadBlobResponse{ Blob: responseBlob, }, nil } -func (s *Server) GetInfo(ctx context.Context, req *blobpb.GetInfoRequest) (*blobpb.GetInfoResponse, error) { +func (s *Server) GetInfo(ctx context.Context, req *blobpb.GetBlobInfoRequest) (*blobpb.GetBlobInfoResponse, error) { // Validate the request if req.GetBlobId() == nil { return nil, status.Error(codes.InvalidArgument, "blob_id is required") @@ -130,7 +118,7 @@ func (s *Server) GetInfo(ctx context.Context, req *blobpb.GetInfoRequest) (*blob return nil, status.Errorf(codes.Internal, "failed to marshal blob: %v", err) } - return &blobpb.GetInfoResponse{ + return &blobpb.GetBlobInfoResponse{ Blob: blobPB, }, nil } diff --git a/go.mod b/go.mod index 4dd32d4..8a706e0 100644 --- a/go.mod +++ b/go.mod @@ -103,4 +103,4 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/code-payments/flipchat-protobuf-api => ../flipchat-protobuf-api \ No newline at end of file +replace github.com/code-payments/flipchat-protobuf-api => ../flipchat-protobuf-api diff --git a/go.sum b/go.sum index 991dfe0..137ebcf 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,6 @@ github.com/code-payments/code-protobuf-api v1.18.1-0.20241113145645-72417e3e3c84 github.com/code-payments/code-protobuf-api v1.18.1-0.20241113145645-72417e3e3c84/go.mod h1:4ZB8HDgE0YEGkjb00v7qfg9lWIQWTmhbbOYkuEOzaa8= github.com/code-payments/code-server v1.10.20-0.20241113221941-16bb545e1277 h1:iJY0t+RFR6FSAjijW2kAGNZpx0Vp3b89xuzvynVRPNQ= github.com/code-payments/code-server v1.10.20-0.20241113221941-16bb545e1277/go.mod h1:IJicFt33QIZiAIUvcD8LGIx1ocX5EIu++F+dr8YOIxo= -github.com/code-payments/flipchat-protobuf-api v0.0.0-20250110190306-bcbdc39585ad h1:cq3h4V/71nwmAudFwXqEJ7e+JKpC9Al7PWoteJ91jGY= -github.com/code-payments/flipchat-protobuf-api v0.0.0-20250110190306-bcbdc39585ad/go.mod h1:UvfwYdQalPa0FCfJVSuhMg2N+RXtmR6dUqbArayKP8U= github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8= github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= diff --git a/s3/aws/store.go b/s3/aws/store.go new file mode 100644 index 0000000..e69de29 diff --git a/s3/helpers.go b/s3/helpers.go new file mode 100644 index 0000000..2146f9e --- /dev/null +++ b/s3/helpers.go @@ -0,0 +1,35 @@ +package s3 + +import ( + "encoding/hex" + "fmt" + "net/url" + + commonpb "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" +) + +// TODO: load these from environment variables or a config file. +const ( + S3Region = "us-east-1" + S3Bucket = "bucket-name" + S3BaseURL = "https://%s.s3.%s.amazonaws.com/" + BlobPathPrefix = "blobs/" +) + +// Generates a full S3 URL for a given blobId. +// It encodes the blobId as a hexadecimal string to ensure it's URL-safe. +func GenerateS3URLPathForBlob(blobId *commonpb.BlobId) (string, error) { + if blobId == nil { + return "", fmt.Errorf("blobId cannot be nil") + } + + // Encode blobId to a hex string + encodedBlobId := hex.EncodeToString(blobId.Value) + objectKey := fmt.Sprintf("%s%s", BlobPathPrefix, encodedBlobId) + encodedObjectKey := url.PathEscape(objectKey) + + // Construct the full S3 URL + s3URL := fmt.Sprintf(S3BaseURL, S3Bucket, S3Region) + encodedObjectKey + + return s3URL, nil +} diff --git a/s3/memory/store.go b/s3/memory/store.go new file mode 100644 index 0000000..e69de29 diff --git a/s3/store.go b/s3/store.go index 9b3554c..43cc2c8 100644 --- a/s3/store.go +++ b/s3/store.go @@ -2,16 +2,10 @@ package s3 import ( "context" - - commonpb "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" ) // Defines the interface for uploading and managing blob data in S3. type Store interface { - - // Uploads the blob data to S3 and returns the S3 URL. - UploadBlob(ctx context.Context, ownerID *commonpb.UserId, blobID *commonpb.BlobId, data []byte) (string, error) - - // Uploads the blob data to S3 using a stream and returns the S3 URL. - UploadBlobStream(ctx context.Context, ownerID *commonpb.UserId, blobID *commonpb.BlobId, reader io.Reader) (string, error) + // Uploads the data to S3 and returns the S3 URL. + Upload(ctx context.Context, key string, data []byte) error } From 38f605ae76857a86efd6165043bcac8abbff366b Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Wed, 22 Jan 2025 15:04:50 -0500 Subject: [PATCH 06/14] s3: initial memory implementation --- s3/memory/store.go | 53 +++++++++++++++++++++++++++++++ s3/memory/store_test.go | 15 +++++++++ s3/store.go | 7 +++-- s3/tests/store.go | 69 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 142 insertions(+), 2 deletions(-) create mode 100644 s3/memory/store_test.go create mode 100644 s3/tests/store.go diff --git a/s3/memory/store.go b/s3/memory/store.go index e69de29..9563444 100644 --- a/s3/memory/store.go +++ b/s3/memory/store.go @@ -0,0 +1,53 @@ +package memory + +import ( + "context" + "errors" + "sync" + + "github.com/code-payments/flipchat-server/s3" +) + +// ErrNotFound is returned when a key does not exist in the store. +var ErrNotFound = errors.New("key not found") + +// store is an in-memory implementation of the s3.Store interface. +type store struct { + mu sync.RWMutex + data map[string][]byte +} + +// NewInMemoryStore creates and returns a new in-memory Store. +func NewInMemoryStore() s3.Store { + return &store{ + data: make(map[string][]byte), + } +} + +// Upload stores the data under the specified key. +func (s *store) Upload(ctx context.Context, key string, data []byte) error { + s.mu.Lock() + defer s.mu.Unlock() + + // Store a copy of the data to prevent external modifications + dataCopy := make([]byte, len(data)) + copy(dataCopy, data) + s.data[key] = dataCopy + return nil +} + +// Download retrieves the data stored under the specified key. +func (s *store) Download(ctx context.Context, key string) ([]byte, error) { + s.mu.RLock() + defer s.mu.RUnlock() + + data, exists := s.data[key] + if !exists { + return nil, ErrNotFound + } + + // Return a copy of the data to prevent external modifications + dataCopy := make([]byte, len(data)) + copy(dataCopy, data) + return dataCopy, nil +} diff --git a/s3/memory/store_test.go b/s3/memory/store_test.go new file mode 100644 index 0000000..a748b1c --- /dev/null +++ b/s3/memory/store_test.go @@ -0,0 +1,15 @@ +package memory + +import ( + "testing" + + "github.com/code-payments/flipchat-server/s3/tests" +) + +func TestS3_MemoryStore(t *testing.T) { + testStore := NewInMemory() + teardown := func() { + // testStore.(*memory).reset() + } + tests.RunStoreTests(t, testStore, teardown) +} diff --git a/s3/store.go b/s3/store.go index 43cc2c8..c746f0e 100644 --- a/s3/store.go +++ b/s3/store.go @@ -4,8 +4,11 @@ import ( "context" ) -// Defines the interface for uploading and managing blob data in S3. +// Defines the interface for managing data in S3. type Store interface { - // Uploads the data to S3 and returns the S3 URL. + // Uploads the data to S3 Upload(ctx context.Context, key string, data []byte) error + + // Download the data at a given path from S3 + Download(ctx context.Context, key string) ([]byte, error) } diff --git a/s3/tests/store.go b/s3/tests/store.go new file mode 100644 index 0000000..128e60d --- /dev/null +++ b/s3/tests/store.go @@ -0,0 +1,69 @@ +package tests + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/code-payments/flipchat-server/s3" +) + +func RunStoreTests(t *testing.T, s s3.Store, teardown func()) { + for _, tf := range []func(t *testing.T, s s3.Store){ + testUploadAndDownload, + testDownloadNonExistentKey, + testOverwriteUpload, + } { + tf(t, s) + teardown() + } +} + +func testUploadAndDownload(t *testing.T, s s3.Store) { + ctx := context.Background() + + key := "testKey" + data := []byte("testData") + + // Upload data + err := s.Upload(ctx, key, data) + require.NoError(t, err, "Upload should not return an error") + + // Download data + retrievedData, err := s.Download(ctx, key) + require.NoError(t, err, "Download should not return an error") + require.Equal(t, data, retrievedData, "Downloaded data should match uploaded data") +} + +func testDownloadNonExistentKey(t *testing.T, s s3.Store) { + ctx := context.Background() + + nonExistentKey := "nonExistentKey" + + // Attempt to download data for a non-existent key + data, err := s.Download(ctx, nonExistentKey) + require.Error(t, err, "Download should return an error for non-existent key") + require.Nil(t, data, "Downloaded data should be nil for non-existent key") +} + +func testOverwriteUpload(t *testing.T, s s3.Store) { + ctx := context.Background() + + key := "overwriteKey" + initialData := []byte("initialData") + newData := []byte("newData") + + // Upload initial data + err := s.Upload(ctx, key, initialData) + require.NoError(t, err, "Initial upload should not return an error") + + // Overwrite with new data + err = s.Upload(ctx, key, newData) + require.NoError(t, err, "Overwrite upload should not return an error") + + // Download data and verify it's the new data + retrievedData, err := s.Download(ctx, key) + require.NoError(t, err, "Download after overwrite should not return an error") + require.Equal(t, newData, retrievedData, "Downloaded data should match the new uploaded data") +} From 0ee6b0d58c893ed880854c0d3c0597895703faad Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Wed, 22 Jan 2025 15:08:24 -0500 Subject: [PATCH 07/14] s3: minor bug fixes --- s3/aws/store.go | 1 + s3/memory/store.go | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/s3/aws/store.go b/s3/aws/store.go index e69de29..a1f9c0e 100644 --- a/s3/aws/store.go +++ b/s3/aws/store.go @@ -0,0 +1 @@ +package aws diff --git a/s3/memory/store.go b/s3/memory/store.go index 9563444..94e1b91 100644 --- a/s3/memory/store.go +++ b/s3/memory/store.go @@ -8,23 +8,19 @@ import ( "github.com/code-payments/flipchat-server/s3" ) -// ErrNotFound is returned when a key does not exist in the store. var ErrNotFound = errors.New("key not found") -// store is an in-memory implementation of the s3.Store interface. type store struct { mu sync.RWMutex data map[string][]byte } -// NewInMemoryStore creates and returns a new in-memory Store. -func NewInMemoryStore() s3.Store { +func NewInMemory() s3.Store { return &store{ data: make(map[string][]byte), } } -// Upload stores the data under the specified key. func (s *store) Upload(ctx context.Context, key string, data []byte) error { s.mu.Lock() defer s.mu.Unlock() @@ -36,7 +32,6 @@ func (s *store) Upload(ctx context.Context, key string, data []byte) error { return nil } -// Download retrieves the data stored under the specified key. func (s *store) Download(ctx context.Context, key string) ([]byte, error) { s.mu.RLock() defer s.mu.RUnlock() From 2b36c0d0dae22a40a9d462f2d7a0f492fc90170c Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Wed, 22 Jan 2025 16:17:32 -0500 Subject: [PATCH 08/14] s3: aws wall hit... can't find a way to use v0.17.0 and point it at a custom Endpoint. --- s3/aws/store.go | 108 ++++++++++++++++++++++++++++++++++++++++ s3/aws/store_test.go | 26 ++++++++++ s3/aws/test/util.go | 115 +++++++++++++++++++++++++++++++++++++++++++ s3/helpers.go | 8 --- s3/memory/store.go | 5 +- s3/store.go | 11 +++++ s3/tests/store.go | 8 ++- 7 files changed, 267 insertions(+), 14 deletions(-) create mode 100644 s3/aws/store_test.go create mode 100644 s3/aws/test/util.go diff --git a/s3/aws/store.go b/s3/aws/store.go index a1f9c0e..6f5ad2c 100644 --- a/s3/aws/store.go +++ b/s3/aws/store.go @@ -1 +1,109 @@ +// File: s3/aws/store.go package aws + +import ( + "bytes" + "context" + "fmt" + "io/ioutil" + + "github.com/aws/aws-sdk-go-v2/aws" + aws_s3 "github.com/aws/aws-sdk-go-v2/service/s3" + "github.com/pkg/errors" + log "github.com/sirupsen/logrus" + + "github.com/code-payments/flipchat-server/s3" +) + +// AWSStore is the AWS S3 implementation of the s3.Store interface. +type AWSStore struct { + client *aws_s3.Client + bucket string +} + +// NewAWSStore initializes and returns a new AWSStore. +// It manually sets up the AWS configuration without using config.LoadDefaultConfig or aws/credentials. +func NewAWSStore(endpoint, region, bucket string) (*AWSStore, error) { + // Define AWS credentials manually + // Replace "accesskey" and "secretkey" with your actual credentials or use environment variables + creds := aws.NewStaticCredentialsProvider("accesskey", "secretkey", "") + + // Define AWS configuration + cfg := aws.Config{ + Region: region, + Credentials: creds, + } + + // If a custom endpoint is provided (e.g., LocalStack), set it + if endpoint != "" { + cfg.Endpoint = endpoint + } + + // Create an S3 client + client := aws_s3.New(&cfg) + + return &AWSStore{ + client: client, + bucket: bucket, + }, nil +} + +// Upload uploads the data to S3 at the specified key. +func (a *AWSStore) Upload(ctx context.Context, key string, data []byte) error { + if key == "" { + return fmt.Errorf("key cannot be empty") + } + if data == nil { + return fmt.Errorf("data cannot be nil") + } + + // Prepare the PutObject input + input := &aws_s3.PutObjectInput{ + Bucket: aws.String(a.bucket), + Key: aws.String(key), + Body: bytes.NewReader(data), + ContentLength: aws.Int64(int64(len(data))), + } + + // Upload the object to S3 + _, err := a.client.PutObject(ctx, input) + if err != nil { + return errors.Wrap(err, "failed to upload object to S3") + } + + log.Infof("Uploaded data to s3://%s/%s", a.bucket, key) + return nil +} + +// Download retrieves the data from S3 at the specified key. +func (a *AWSStore) Download(ctx context.Context, key string) ([]byte, error) { + if key == "" { + return nil, fmt.Errorf("key cannot be empty") + } + + // Prepare the GetObject input + input := &aws_s3.GetObjectInput{ + Bucket: aws.String(a.bucket), + Key: aws.String(key), + } + + // Retrieve the object from S3 + output, err := a.client.GetObject(ctx, input) + if err != nil { + // Check if the error is due to the object not existing + if aerr, ok := err.(*s3.NoSuchKey); ok && aerr != nil { + return nil, s3.ErrNotFound + } + return nil, errors.Wrap(err, "failed to download object from S3") + } + defer output.Body.Close() + + // Read the object's data + data, err := ioutil.ReadAll(output.Body) + if err != nil { + return nil, errors.Wrap(err, "failed to read object data") + } + + log.Infof("Downloaded data from s3://%s/%s", a.bucket, key) + return data, nil +} diff --git a/s3/aws/store_test.go b/s3/aws/store_test.go new file mode 100644 index 0000000..be91a80 --- /dev/null +++ b/s3/aws/store_test.go @@ -0,0 +1,26 @@ +package aws + +import ( + "testing" + + "github.com/stretchr/testify/require" + + awstest "github.com/code-payments/flipchat-server/s3/aws/test" + "github.com/code-payments/flipchat-server/s3/tests" +) + +func TestAWSStore(t *testing.T) { + // Start the S3 mock + endpoint, cleanup, err := awstest.StartS3Mock() + require.NoError(t, err, "Failed to start S3 mock") + defer cleanup() + + // Initialize the AWSStore with the mock endpoint + store, err := NewAWSStoreWithEndpoint(endpoint) + require.NoError(t, err, "Failed to initialize AWSStore with mock endpoint") + + // Run the store tests + tests.RunStoreTests(t, store, func() { + // No additional teardown needed as cleanup is handled by the defer statement + }) +} diff --git a/s3/aws/test/util.go b/s3/aws/test/util.go new file mode 100644 index 0000000..c76443e --- /dev/null +++ b/s3/aws/test/util.go @@ -0,0 +1,115 @@ +package test + +import ( + "fmt" + "net/http" + "time" + + "github.com/ory/dockertest/v3" + "github.com/ory/dockertest/v3/docker" + "github.com/pkg/errors" + + "github.com/code-payments/code-server/pkg/retry" + "github.com/code-payments/code-server/pkg/retry/backoff" +) + +const ( + containerName = "localstack" + containerVersion = "latest" + containerAutoKill = 120 // seconds + + port = 4566 // LocalStack Edge Port + services = "s3" + accessKey = "test" + secretKey = "test" + region = "us-east-1" +) + +// StartLocalStackS3 starts a LocalStack container with S3 enabled. +// It returns the endpoint URL, a cleanup function, and any error encountered. +func StartLocalStackS3(pool *dockertest.Pool) (endpoint string, cleanup func(), err error) { + // Run the LocalStack container with S3 service + resource, err := pool.RunWithOptions(&dockertest.RunOptions{ + Repository: "localstack/localstack", + Tag: containerVersion, + Env: []string{ + "SERVICES=" + services, + "DEFAULT_REGION=" + region, + "AWS_ACCESS_KEY_ID=" + accessKey, + "AWS_SECRET_ACCESS_KEY=" + secretKey, + }, + ExposedPorts: []string{fmt.Sprintf("%d/tcp", port)}, + }, func(config *docker.HostConfig) { + // Enable AutoRemove and disable Restart + config.AutoRemove = true + config.RestartPolicy = docker.RestartPolicy{Name: "no"} + }) + + if err != nil { + return "", nil, errors.Wrap(err, "could not start LocalStack container") + } + + // Set a timeout to automatically kill the container + resource.Expire(containerAutoKill) + + // Get the host and port to construct the endpoint URL + hostAndPort := resource.GetHostPort(fmt.Sprintf("%d/tcp", port)) + endpoint = fmt.Sprintf("http://%s", hostAndPort) + + // Define the cleanup function + cleanup = func() { + if err := pool.Purge(resource); err != nil { + fmt.Printf("Could not purge resource: %s\n", err) + } + } + + return endpoint, cleanup, nil +} + +// WaitForS3Connection waits until the S3 endpoint is reachable. +// It retries the connection attempt with exponential backoff. +func WaitForS3Connection(endpoint string) error { + _, err := retry.Retry( + func() error { + resp, err := http.Head(endpoint) + if err != nil { + return err + } + // LocalStack returns 404 for HEAD requests on S3 root + // Consider 200, 404 as successful responses + if resp.StatusCode >= 200 && resp.StatusCode < 400 { + return nil + } + return fmt.Errorf("unexpected status code: %d", resp.StatusCode) + }, + retry.Limit(50), + retry.Backoff(backoff.Constant(500*time.Millisecond), 500*time.Second), + ) + + return err +} + +// StartS3Mock initializes the LocalStack S3 mock and ensures it's ready. +// It returns the endpoint URL, a cleanup function, and any error encountered. +func StartS3Mock() (endpoint string, cleanup func(), err error) { + // Initialize a new Dockertest pool + pool, err := dockertest.NewPool("") + if err != nil { + return "", nil, errors.Wrap(err, "could not connect to docker") + } + + // Start the LocalStack container + endpoint, cleanup, err = StartLocalStackS3(pool) + if err != nil { + return "", nil, err + } + + // Wait for the S3 service to be ready + err = WaitForS3Connection(endpoint) + if err != nil { + cleanup() + return "", nil, err + } + + return endpoint, cleanup, nil +} diff --git a/s3/helpers.go b/s3/helpers.go index 2146f9e..dbab3cb 100644 --- a/s3/helpers.go +++ b/s3/helpers.go @@ -8,14 +8,6 @@ import ( commonpb "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" ) -// TODO: load these from environment variables or a config file. -const ( - S3Region = "us-east-1" - S3Bucket = "bucket-name" - S3BaseURL = "https://%s.s3.%s.amazonaws.com/" - BlobPathPrefix = "blobs/" -) - // Generates a full S3 URL for a given blobId. // It encodes the blobId as a hexadecimal string to ensure it's URL-safe. func GenerateS3URLPathForBlob(blobId *commonpb.BlobId) (string, error) { diff --git a/s3/memory/store.go b/s3/memory/store.go index 94e1b91..3daa58b 100644 --- a/s3/memory/store.go +++ b/s3/memory/store.go @@ -2,14 +2,11 @@ package memory import ( "context" - "errors" "sync" "github.com/code-payments/flipchat-server/s3" ) -var ErrNotFound = errors.New("key not found") - type store struct { mu sync.RWMutex data map[string][]byte @@ -38,7 +35,7 @@ func (s *store) Download(ctx context.Context, key string) ([]byte, error) { data, exists := s.data[key] if !exists { - return nil, ErrNotFound + return nil, s3.ErrNotFound } // Return a copy of the data to prevent external modifications diff --git a/s3/store.go b/s3/store.go index c746f0e..3d43ced 100644 --- a/s3/store.go +++ b/s3/store.go @@ -2,8 +2,19 @@ package s3 import ( "context" + "errors" ) +// TODO: load these from environment variables or a config file. +const ( + S3Region = "us-east-1" + S3Bucket = "bucket-name" + S3BaseURL = "https://%s.s3.%s.amazonaws.com/" + BlobPathPrefix = "blobs/" +) + +var ErrNotFound = errors.New("key not found") + // Defines the interface for managing data in S3. type Store interface { // Uploads the data to S3 diff --git a/s3/tests/store.go b/s3/tests/store.go index 128e60d..f34a832 100644 --- a/s3/tests/store.go +++ b/s3/tests/store.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" + "github.com/code-payments/flipchat-server/model" "github.com/code-payments/flipchat-server/s3" ) @@ -23,11 +24,14 @@ func RunStoreTests(t *testing.T, s s3.Store, teardown func()) { func testUploadAndDownload(t *testing.T, s s3.Store) { ctx := context.Background() - key := "testKey" + blobId := model.MustGenerateBlobID() data := []byte("testData") + key, err := s3.GenerateS3URLPathForBlob(blobId) + require.NoError(t, err, "Failed to generate path using blobId") + // Upload data - err := s.Upload(ctx, key, data) + err = s.Upload(ctx, key, data) require.NoError(t, err, "Upload should not return an error") // Download data From 10ee6486a6b0e05e845e8c124cc9d68204e83869 Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Thu, 23 Jan 2025 13:55:28 -0500 Subject: [PATCH 09/14] s3: delete all the stuff that doesn't work with aws 0.17.0 --- blob/server.go | 4 +- s3/aws/store.go | 83 ++++++++++--------------------- s3/aws/store_test.go | 26 ---------- s3/aws/test/util.go | 115 ------------------------------------------- s3/helpers.go | 32 ++++++------ s3/memory/store.go | 10 +++- s3/store.go | 15 +++--- s3/tests/store.go | 9 ++-- 8 files changed, 66 insertions(+), 228 deletions(-) delete mode 100644 s3/aws/store_test.go delete mode 100644 s3/aws/test/util.go diff --git a/blob/server.go b/blob/server.go index 514d5ba..194b2e6 100644 --- a/blob/server.go +++ b/blob/server.go @@ -53,12 +53,12 @@ func (s *Server) Upload(ctx context.Context, req *blobpb.UploadBlobRequest) (*bl } // Upload raw_data to S3 - s3Url, err := s3.GenerateS3URLPathForBlob(blobId) + key, err := s3.ToS3Key(blobId.Value) if err != nil { return nil, status.Error(codes.Internal, "failed to generate s3 url") } - err = s.s3Store.Upload(ctx, s3Url, req.GetRawData()) + s3Url, err := s.s3Store.Upload(ctx, key, req.GetRawData()) if err != nil { s.log.Error("Failed to upload blob to S3", zap.Error(err)) return nil, status.Error(codes.Internal, "failed to upload blob") diff --git a/s3/aws/store.go b/s3/aws/store.go index 6f5ad2c..03c9fbf 100644 --- a/s3/aws/store.go +++ b/s3/aws/store.go @@ -1,109 +1,78 @@ -// File: s3/aws/store.go package aws import ( "bytes" "context" "fmt" - "io/ioutil" + "io" "github.com/aws/aws-sdk-go-v2/aws" - aws_s3 "github.com/aws/aws-sdk-go-v2/service/s3" - "github.com/pkg/errors" - log "github.com/sirupsen/logrus" + "github.com/aws/aws-sdk-go-v2/service/s3" + "github.com/aws/aws-sdk-go-v2/service/s3/s3iface" - "github.com/code-payments/flipchat-server/s3" + fc_s3 "github.com/code-payments/flipchat-server/s3" ) -// AWSStore is the AWS S3 implementation of the s3.Store interface. -type AWSStore struct { - client *aws_s3.Client +type store struct { + client s3iface.ClientAPI bucket string } -// NewAWSStore initializes and returns a new AWSStore. -// It manually sets up the AWS configuration without using config.LoadDefaultConfig or aws/credentials. -func NewAWSStore(endpoint, region, bucket string) (*AWSStore, error) { - // Define AWS credentials manually - // Replace "accesskey" and "secretkey" with your actual credentials or use environment variables - creds := aws.NewStaticCredentialsProvider("accesskey", "secretkey", "") - - // Define AWS configuration - cfg := aws.Config{ - Region: region, - Credentials: creds, - } - - // If a custom endpoint is provided (e.g., LocalStack), set it - if endpoint != "" { - cfg.Endpoint = endpoint - } - - // Create an S3 client - client := aws_s3.New(&cfg) - - return &AWSStore{ +func NewAWSStore(client s3iface.ClientAPI, bucket string) fc_s3.Store { + return &store{ client: client, bucket: bucket, - }, nil + } } // Upload uploads the data to S3 at the specified key. -func (a *AWSStore) Upload(ctx context.Context, key string, data []byte) error { +// Returns the URL path to the uploaded data. +func (s *store) Upload(ctx context.Context, key string, data []byte) (string, error) { if key == "" { - return fmt.Errorf("key cannot be empty") + return "", fmt.Errorf("key cannot be empty") } if data == nil { - return fmt.Errorf("data cannot be nil") + return "", fmt.Errorf("data cannot be nil") } - // Prepare the PutObject input - input := &aws_s3.PutObjectInput{ - Bucket: aws.String(a.bucket), + req := s3.PutObjectInput{ + Bucket: aws.String(s.bucket), Key: aws.String(key), Body: bytes.NewReader(data), ContentLength: aws.Int64(int64(len(data))), } // Upload the object to S3 - _, err := a.client.PutObject(ctx, input) + _, err := s.client.PutObjectRequest(&req).Send(ctx) if err != nil { - return errors.Wrap(err, "failed to upload object to S3") + return "", err } - log.Infof("Uploaded data to s3://%s/%s", a.bucket, key) - return nil + return fc_s3.GenerateS3URLPathForByteId(key, s.bucket) } // Download retrieves the data from S3 at the specified key. -func (a *AWSStore) Download(ctx context.Context, key string) ([]byte, error) { +func (a *store) Download(ctx context.Context, key string) ([]byte, error) { if key == "" { return nil, fmt.Errorf("key cannot be empty") } - // Prepare the GetObject input - input := &aws_s3.GetObjectInput{ + req := s3.GetObjectInput{ Bucket: aws.String(a.bucket), Key: aws.String(key), } - // Retrieve the object from S3 - output, err := a.client.GetObject(ctx, input) + // Download the object from s3iface + resp, err := a.client.GetObjectRequest(&req).Send(ctx) if err != nil { - // Check if the error is due to the object not existing - if aerr, ok := err.(*s3.NoSuchKey); ok && aerr != nil { - return nil, s3.ErrNotFound - } - return nil, errors.Wrap(err, "failed to download object from S3") + return nil, err } - defer output.Body.Close() - // Read the object's data - data, err := ioutil.ReadAll(output.Body) + // Read the data from the response + data, err := io.ReadAll(resp.Body) if err != nil { - return nil, errors.Wrap(err, "failed to read object data") + return nil, err } - log.Infof("Downloaded data from s3://%s/%s", a.bucket, key) return data, nil } diff --git a/s3/aws/store_test.go b/s3/aws/store_test.go deleted file mode 100644 index be91a80..0000000 --- a/s3/aws/store_test.go +++ /dev/null @@ -1,26 +0,0 @@ -package aws - -import ( - "testing" - - "github.com/stretchr/testify/require" - - awstest "github.com/code-payments/flipchat-server/s3/aws/test" - "github.com/code-payments/flipchat-server/s3/tests" -) - -func TestAWSStore(t *testing.T) { - // Start the S3 mock - endpoint, cleanup, err := awstest.StartS3Mock() - require.NoError(t, err, "Failed to start S3 mock") - defer cleanup() - - // Initialize the AWSStore with the mock endpoint - store, err := NewAWSStoreWithEndpoint(endpoint) - require.NoError(t, err, "Failed to initialize AWSStore with mock endpoint") - - // Run the store tests - tests.RunStoreTests(t, store, func() { - // No additional teardown needed as cleanup is handled by the defer statement - }) -} diff --git a/s3/aws/test/util.go b/s3/aws/test/util.go deleted file mode 100644 index c76443e..0000000 --- a/s3/aws/test/util.go +++ /dev/null @@ -1,115 +0,0 @@ -package test - -import ( - "fmt" - "net/http" - "time" - - "github.com/ory/dockertest/v3" - "github.com/ory/dockertest/v3/docker" - "github.com/pkg/errors" - - "github.com/code-payments/code-server/pkg/retry" - "github.com/code-payments/code-server/pkg/retry/backoff" -) - -const ( - containerName = "localstack" - containerVersion = "latest" - containerAutoKill = 120 // seconds - - port = 4566 // LocalStack Edge Port - services = "s3" - accessKey = "test" - secretKey = "test" - region = "us-east-1" -) - -// StartLocalStackS3 starts a LocalStack container with S3 enabled. -// It returns the endpoint URL, a cleanup function, and any error encountered. -func StartLocalStackS3(pool *dockertest.Pool) (endpoint string, cleanup func(), err error) { - // Run the LocalStack container with S3 service - resource, err := pool.RunWithOptions(&dockertest.RunOptions{ - Repository: "localstack/localstack", - Tag: containerVersion, - Env: []string{ - "SERVICES=" + services, - "DEFAULT_REGION=" + region, - "AWS_ACCESS_KEY_ID=" + accessKey, - "AWS_SECRET_ACCESS_KEY=" + secretKey, - }, - ExposedPorts: []string{fmt.Sprintf("%d/tcp", port)}, - }, func(config *docker.HostConfig) { - // Enable AutoRemove and disable Restart - config.AutoRemove = true - config.RestartPolicy = docker.RestartPolicy{Name: "no"} - }) - - if err != nil { - return "", nil, errors.Wrap(err, "could not start LocalStack container") - } - - // Set a timeout to automatically kill the container - resource.Expire(containerAutoKill) - - // Get the host and port to construct the endpoint URL - hostAndPort := resource.GetHostPort(fmt.Sprintf("%d/tcp", port)) - endpoint = fmt.Sprintf("http://%s", hostAndPort) - - // Define the cleanup function - cleanup = func() { - if err := pool.Purge(resource); err != nil { - fmt.Printf("Could not purge resource: %s\n", err) - } - } - - return endpoint, cleanup, nil -} - -// WaitForS3Connection waits until the S3 endpoint is reachable. -// It retries the connection attempt with exponential backoff. -func WaitForS3Connection(endpoint string) error { - _, err := retry.Retry( - func() error { - resp, err := http.Head(endpoint) - if err != nil { - return err - } - // LocalStack returns 404 for HEAD requests on S3 root - // Consider 200, 404 as successful responses - if resp.StatusCode >= 200 && resp.StatusCode < 400 { - return nil - } - return fmt.Errorf("unexpected status code: %d", resp.StatusCode) - }, - retry.Limit(50), - retry.Backoff(backoff.Constant(500*time.Millisecond), 500*time.Second), - ) - - return err -} - -// StartS3Mock initializes the LocalStack S3 mock and ensures it's ready. -// It returns the endpoint URL, a cleanup function, and any error encountered. -func StartS3Mock() (endpoint string, cleanup func(), err error) { - // Initialize a new Dockertest pool - pool, err := dockertest.NewPool("") - if err != nil { - return "", nil, errors.Wrap(err, "could not connect to docker") - } - - // Start the LocalStack container - endpoint, cleanup, err = StartLocalStackS3(pool) - if err != nil { - return "", nil, err - } - - // Wait for the S3 service to be ready - err = WaitForS3Connection(endpoint) - if err != nil { - cleanup() - return "", nil, err - } - - return endpoint, cleanup, nil -} diff --git a/s3/helpers.go b/s3/helpers.go index dbab3cb..3cddec4 100644 --- a/s3/helpers.go +++ b/s3/helpers.go @@ -3,25 +3,27 @@ package s3 import ( "encoding/hex" "fmt" - "net/url" - - commonpb "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" ) -// Generates a full S3 URL for a given blobId. -// It encodes the blobId as a hexadecimal string to ensure it's URL-safe. -func GenerateS3URLPathForBlob(blobId *commonpb.BlobId) (string, error) { - if blobId == nil { - return "", fmt.Errorf("blobId cannot be nil") +// Encodes the byte id as a hexadecimal string to ensure it's URL-safe. +func ToS3Key(byteId []byte) (string, error) { + if byteId == nil { + return "", fmt.Errorf("byteId cannot be nil") } - // Encode blobId to a hex string - encodedBlobId := hex.EncodeToString(blobId.Value) - objectKey := fmt.Sprintf("%s%s", BlobPathPrefix, encodedBlobId) - encodedObjectKey := url.PathEscape(objectKey) + return hex.EncodeToString(byteId), nil +} + +// Returns the S3 URL path for the given key, bucket, and region. +func GenerateS3URLPathForByteId(key string, bucket string) (string, error) { + if key == "" { + return "", fmt.Errorf("key cannot be empty") + } + if bucket == "" { + return "", fmt.Errorf("bucket cannot be empty") + } - // Construct the full S3 URL - s3URL := fmt.Sprintf(S3BaseURL, S3Bucket, S3Region) + encodedObjectKey + url := fmt.Sprintf(S3_BaseURL, bucket, S3_Region, key) - return s3URL, nil + return url, nil } diff --git a/s3/memory/store.go b/s3/memory/store.go index 3daa58b..b65f7a6 100644 --- a/s3/memory/store.go +++ b/s3/memory/store.go @@ -18,7 +18,7 @@ func NewInMemory() s3.Store { } } -func (s *store) Upload(ctx context.Context, key string, data []byte) error { +func (s *store) Upload(ctx context.Context, key string, data []byte) (string, error) { s.mu.Lock() defer s.mu.Unlock() @@ -26,7 +26,13 @@ func (s *store) Upload(ctx context.Context, key string, data []byte) error { dataCopy := make([]byte, len(data)) copy(dataCopy, data) s.data[key] = dataCopy - return nil + + url, err := s3.GenerateS3URLPathForByteId(key, "test-bucket") + if err != nil { + return "", err + } + + return url, nil } func (s *store) Download(ctx context.Context, key string) ([]byte, error) { diff --git a/s3/store.go b/s3/store.go index 3d43ced..fd4a3eb 100644 --- a/s3/store.go +++ b/s3/store.go @@ -5,20 +5,21 @@ import ( "errors" ) -// TODO: load these from environment variables or a config file. const ( - S3Region = "us-east-1" - S3Bucket = "bucket-name" - S3BaseURL = "https://%s.s3.%s.amazonaws.com/" - BlobPathPrefix = "blobs/" + // Cannot be changed using 0.17.0 aws-sdk-go-v2 + S3_Region = "us-east-1" + + // S3_BaseURL is the base URL for S3 objects. + S3_BaseURL = "https://%s.s3.%s.amazonaws.com/%s" ) var ErrNotFound = errors.New("key not found") // Defines the interface for managing data in S3. type Store interface { - // Uploads the data to S3 - Upload(ctx context.Context, key string, data []byte) error + // Uploads the data to S3 at the specified key and returns the URL path to + // the uploaded data. + Upload(ctx context.Context, key string, data []byte) (string, error) // Download the data at a given path from S3 Download(ctx context.Context, key string) ([]byte, error) diff --git a/s3/tests/store.go b/s3/tests/store.go index f34a832..fe3b6c1 100644 --- a/s3/tests/store.go +++ b/s3/tests/store.go @@ -27,11 +27,12 @@ func testUploadAndDownload(t *testing.T, s s3.Store) { blobId := model.MustGenerateBlobID() data := []byte("testData") - key, err := s3.GenerateS3URLPathForBlob(blobId) + // Generate key + key, err := s3.ToS3Key(blobId.Value) require.NoError(t, err, "Failed to generate path using blobId") // Upload data - err = s.Upload(ctx, key, data) + _, err = s.Upload(ctx, key, data) require.NoError(t, err, "Upload should not return an error") // Download data @@ -59,11 +60,11 @@ func testOverwriteUpload(t *testing.T, s s3.Store) { newData := []byte("newData") // Upload initial data - err := s.Upload(ctx, key, initialData) + _, err := s.Upload(ctx, key, initialData) require.NoError(t, err, "Initial upload should not return an error") // Overwrite with new data - err = s.Upload(ctx, key, newData) + _, err = s.Upload(ctx, key, newData) require.NoError(t, err, "Overwrite upload should not return an error") // Download data and verify it's the new data From 79d4556abb914a6a15ca6ac2b267d7307cdd643d Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Thu, 23 Jan 2025 15:06:53 -0500 Subject: [PATCH 10/14] blob: added initial server test --- blob/memory/server_test.go | 17 +++++++ blob/memory/store.go | 7 +++ blob/tests/server.go | 95 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+) create mode 100644 blob/memory/server_test.go create mode 100644 blob/tests/server.go diff --git a/blob/memory/server_test.go b/blob/memory/server_test.go new file mode 100644 index 0000000..4af05e6 --- /dev/null +++ b/blob/memory/server_test.go @@ -0,0 +1,17 @@ +package memory + +import ( + "testing" + + "github.com/code-payments/flipchat-server/blob/tests" + s3 "github.com/code-payments/flipchat-server/s3/memory" +) + +func TestBlob_MemoryServer(t *testing.T) { + testS3Store := s3.NewInMemory() + testStore := NewInMemory() + teardown := func() { + testStore.(*store).reset() + } + tests.RunBlobServerTests(t, testStore, testS3Store, teardown) +} diff --git a/blob/memory/store.go b/blob/memory/store.go index 718324d..4d4ee9a 100644 --- a/blob/memory/store.go +++ b/blob/memory/store.go @@ -21,6 +21,13 @@ func NewInMemory() blob.Store { } } +func (s *store) reset() { + s.mu.Lock() + defer s.mu.Unlock() + + s.data = make(map[string]*blob.Blob) +} + func (s *store) CreateBlob(ctx context.Context, b *blob.Blob) error { s.mu.Lock() defer s.mu.Unlock() diff --git a/blob/tests/server.go b/blob/tests/server.go new file mode 100644 index 0000000..b891537 --- /dev/null +++ b/blob/tests/server.go @@ -0,0 +1,95 @@ +package tests + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.uber.org/zap" + "google.golang.org/grpc" + + blobpb "github.com/code-payments/flipchat-protobuf-api/generated/go/blob/v1" + commonpb "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" + + "github.com/code-payments/flipchat-server/blob" + "github.com/code-payments/flipchat-server/model" + "github.com/code-payments/flipchat-server/s3" + "github.com/code-payments/flipchat-server/testutil" +) + +func RunBlobServerTests(t *testing.T, blobStore blob.Store, s3Store s3.Store, teardown func()) { + for _, tf := range []func(t *testing.T, blobStore blob.Store, s3Store s3.Store){ + testServer, + } { + tf(t, blobStore, s3Store) + teardown() + } +} + +func testServer(t *testing.T, blobStore blob.Store, s3Store s3.Store) { + server := blob.NewServer( + zap.Must(zap.NewDevelopment()), + blobStore, + s3Store, + ) + + cc := testutil.RunGRPCServer(t, testutil.WithService(func(s *grpc.Server) { + blobpb.RegisterBlobServiceServer(s, server) + })) + + ctx := context.Background() + client := blobpb.NewBlobServiceClient(cc) + + userId := model.MustGenerateUserID() + var blobId *commonpb.BlobId + + t.Run("Upload", func(t *testing.T) { + // Upload the blob to the server + rawData := []byte("hello world") + resp, err := client.Upload(ctx, &blobpb.UploadBlobRequest{ + OwnerId: userId, + BlobType: blobpb.BlobType_BLOB_TYPE_IMAGE, + RawData: rawData, + }) + + // Check the blob response + require.NoError(t, err) + require.NotNil(t, resp) + require.NotEmpty(t, resp.Blob.BlobId) + require.Equal(t, userId.Value, resp.Blob.OwnerId.Value) + require.Equal(t, blobpb.BlobType_BLOB_TYPE_IMAGE, resp.Blob.BlobType) + require.NotEmpty(t, resp.Blob.S3Url) + + // Check that the blob was stored in the store + storedBlob, err := blobStore.GetBlob(ctx, resp.Blob.BlobId) + require.NoError(t, err) + require.NotNil(t, storedBlob) + require.Equal(t, resp.Blob.BlobId.Value, storedBlob.ID.Value) + require.Equal(t, userId.Value, storedBlob.UserID.Value) + require.Equal(t, blob.BlobTypeImage, storedBlob.Type) + require.NotEmpty(t, storedBlob.S3URL) + + // Check that the blob was stored in the S3 store + key, err := s3.ToS3Key(resp.Blob.BlobId.Value) + require.NoError(t, err) + data, err := s3Store.Download(ctx, key) + require.NoError(t, err) + require.Equal(t, rawData, data) + + blobId = resp.Blob.BlobId + }) + + t.Run("GetInfo", func(t *testing.T) { + // Get the blob info back from the testServer + resp, err := client.GetInfo(ctx, &blobpb.GetBlobInfoRequest{ + BlobId: blobId, + }) + + require.NoError(t, err) + require.NotNil(t, resp) + require.Equal(t, blobId.Value, resp.Blob.BlobId.Value) + require.Equal(t, userId.Value, resp.Blob.OwnerId.Value) + require.Equal(t, blobpb.BlobType_BLOB_TYPE_IMAGE, resp.Blob.BlobType) + require.NotEmpty(t, resp.Blob.S3Url) + }) +} From 8b485a8a4989c56b1e176840bdcc4c31d73a0f99 Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Thu, 23 Jan 2025 15:32:46 -0500 Subject: [PATCH 11/14] blob: updated test cases --- blob/helpers.go | 10 ++-- blob/server.go | 8 +-- blob/tests/server.go | 126 ++++++++++++++++++++++++++++++++++--------- 3 files changed, 110 insertions(+), 34 deletions(-) diff --git a/blob/helpers.go b/blob/helpers.go index 6120b38..b046ed5 100644 --- a/blob/helpers.go +++ b/blob/helpers.go @@ -12,12 +12,12 @@ import ( ) // Generates a unique BlobId -func generateBlobID() *commonpb.BlobId { +func GenerateBlobID() *commonpb.BlobId { return model.MustGenerateBlobID() } // Converts protobuf BlobType to internal BlobType -func fromProtoBlobType(protoType blobpb.BlobType) (BlobType, error) { +func FromProtoBlobType(protoType blobpb.BlobType) (BlobType, error) { switch protoType { case blobpb.BlobType_BLOB_TYPE_IMAGE: return BlobTypeImage, nil @@ -31,7 +31,7 @@ func fromProtoBlobType(protoType blobpb.BlobType) (BlobType, error) { } // toProtoBlobType converts internal BlobType to protobuf BlobType -func toProtoBlobType(internalType BlobType) blobpb.BlobType { +func ToProtoBlobType(internalType BlobType) blobpb.BlobType { switch internalType { case BlobTypeImage: return blobpb.BlobType_BLOB_TYPE_IMAGE @@ -45,10 +45,10 @@ func toProtoBlobType(internalType BlobType) blobpb.BlobType { } // Converts internal Blob to protobuf Blob, including unmarshaling metadata. -func toProtoBlob(blob *Blob) (*blobpb.Blob, error) { +func ToProtoBlob(blob *Blob) (*blobpb.Blob, error) { protoBlob := &blobpb.Blob{ BlobId: blob.ID, - BlobType: toProtoBlobType(blob.Type), + BlobType: ToProtoBlobType(blob.Type), OwnerId: blob.UserID, S3Url: blob.S3URL, CreatedAt: timestamppb.New(blob.CreatedAt), diff --git a/blob/server.go b/blob/server.go index 194b2e6..87ce02f 100644 --- a/blob/server.go +++ b/blob/server.go @@ -44,10 +44,10 @@ func (s *Server) Upload(ctx context.Context, req *blobpb.UploadBlobRequest) (*bl return nil, status.Error(codes.InvalidArgument, "raw_data is required") } - blobId := generateBlobID() + blobId := GenerateBlobID() // Convert BlobType from protobuf to internal type - blobType, err := fromProtoBlobType(req.GetBlobType()) + blobType, err := FromProtoBlobType(req.GetBlobType()) if err != nil { return nil, status.Error(codes.InvalidArgument, "invalid blob_type") } @@ -85,7 +85,7 @@ func (s *Server) Upload(ctx context.Context, req *blobpb.UploadBlobRequest) (*bl } // Prepare response - responseBlob, err := toProtoBlob(blob) + responseBlob, err := ToProtoBlob(blob) if err != nil { s.log.Error("Failed to convert Blob to proto", zap.Error(err)) return nil, status.Error(codes.Internal, "failed to prepare response") @@ -113,7 +113,7 @@ func (s *Server) GetInfo(ctx context.Context, req *blobpb.GetBlobInfoRequest) (* } // Convert Blob to blobpb.Blob - blobPB, err := toProtoBlob(blob) + blobPB, err := ToProtoBlob(blob) if err != nil { return nil, status.Errorf(codes.Internal, "failed to marshal blob: %v", err) } diff --git a/blob/tests/server.go b/blob/tests/server.go index b891537..e48b022 100644 --- a/blob/tests/server.go +++ b/blob/tests/server.go @@ -1,3 +1,4 @@ +// blob/tests/server_extended_test.go package tests import ( @@ -19,7 +20,7 @@ import ( func RunBlobServerTests(t *testing.T, blobStore blob.Store, s3Store s3.Store, teardown func()) { for _, tf := range []func(t *testing.T, blobStore blob.Store, s3Store s3.Store){ - testServer, + testServer, // If you'd like, rename to testServerExtended } { tf(t, blobStore, s3Store) teardown() @@ -43,53 +44,128 @@ func testServer(t *testing.T, blobStore blob.Store, s3Store s3.Store) { userId := model.MustGenerateUserID() var blobId *commonpb.BlobId - t.Run("Upload", func(t *testing.T) { - // Upload the blob to the server + t.Run("Upload_Success", func(t *testing.T) { rawData := []byte("hello world") resp, err := client.Upload(ctx, &blobpb.UploadBlobRequest{ OwnerId: userId, BlobType: blobpb.BlobType_BLOB_TYPE_IMAGE, RawData: rawData, }) + require.NoError(t, err, "Upload should succeed") + require.NotNil(t, resp, "Upload response should not be nil") - // Check the blob response - require.NoError(t, err) - require.NotNil(t, resp) - require.NotEmpty(t, resp.Blob.BlobId) + // Basic checks + require.NotNil(t, resp.Blob) + require.NotNil(t, resp.Blob.BlobId) + require.NotEmpty(t, resp.Blob.BlobId.Value) require.Equal(t, userId.Value, resp.Blob.OwnerId.Value) require.Equal(t, blobpb.BlobType_BLOB_TYPE_IMAGE, resp.Blob.BlobType) require.NotEmpty(t, resp.Blob.S3Url) - // Check that the blob was stored in the store - storedBlob, err := blobStore.GetBlob(ctx, resp.Blob.BlobId) - require.NoError(t, err) - require.NotNil(t, storedBlob) - require.Equal(t, resp.Blob.BlobId.Value, storedBlob.ID.Value) - require.Equal(t, userId.Value, storedBlob.UserID.Value) - require.Equal(t, blob.BlobTypeImage, storedBlob.Type) - require.NotEmpty(t, storedBlob.S3URL) - - // Check that the blob was stored in the S3 store - key, err := s3.ToS3Key(resp.Blob.BlobId.Value) + blobId = resp.Blob.BlobId // Store the generated ID for later tests + + // Check store + storedBlob, err := blobStore.GetBlob(ctx, blobId) + require.NoError(t, err, "blob should exist in the store after upload") + require.NotNil(t, storedBlob, "stored blob should not be nil") + + // Compare store blob to returned proto blob + requireProtoAndStoreBlobsEqual(t, resp.Blob, storedBlob) + + // Verify S3 content + key, err := s3.ToS3Key(blobId.Value) require.NoError(t, err) data, err := s3Store.Download(ctx, key) require.NoError(t, err) - require.Equal(t, rawData, data) - - blobId = resp.Blob.BlobId + require.Equal(t, rawData, data, "S3 content must match uploaded bytes") }) - t.Run("GetInfo", func(t *testing.T) { - // Get the blob info back from the testServer + t.Run("GetInfo_Success", func(t *testing.T) { + require.NotNil(t, blobId, "Upload_Success must run first to set blobId") + resp, err := client.GetInfo(ctx, &blobpb.GetBlobInfoRequest{ BlobId: blobId, }) - - require.NoError(t, err) + require.NoError(t, err, "GetInfo should succeed for an existing blob") require.NotNil(t, resp) + require.NotNil(t, resp.Blob) + require.Equal(t, blobId.Value, resp.Blob.BlobId.Value) require.Equal(t, userId.Value, resp.Blob.OwnerId.Value) require.Equal(t, blobpb.BlobType_BLOB_TYPE_IMAGE, resp.Blob.BlobType) require.NotEmpty(t, resp.Blob.S3Url) }) + + t.Run("Upload_Error_NoOwnerID", func(t *testing.T) { + _, err := client.Upload(ctx, &blobpb.UploadBlobRequest{ + OwnerId: nil, // Missing + BlobType: blobpb.BlobType_BLOB_TYPE_IMAGE, + RawData: []byte("xyz"), + }) + require.Error(t, err, "Upload must fail if owner_id is missing") + }) + + t.Run("Upload_Error_UnknownBlobType", func(t *testing.T) { + _, err := client.Upload(ctx, &blobpb.UploadBlobRequest{ + OwnerId: userId, + BlobType: blobpb.BlobType_BLOB_TYPE_UNKNOWN, // invalid type + RawData: []byte("abc"), + }) + require.Error(t, err, "Upload must fail if blob_type = UNKNOWN") + }) + + t.Run("Upload_Error_NoRawData", func(t *testing.T) { + _, err := client.Upload(ctx, &blobpb.UploadBlobRequest{ + OwnerId: userId, + BlobType: blobpb.BlobType_BLOB_TYPE_VIDEO, + RawData: nil, // no data + }) + require.Error(t, err, "Upload must fail if raw_data is missing/empty") + }) + + t.Run("GetInfo_Error_NoBlobID", func(t *testing.T) { + _, err := client.GetInfo(ctx, &blobpb.GetBlobInfoRequest{ + BlobId: nil, // missing + }) + require.Error(t, err, "GetInfo must fail if blob_id is nil") + }) + + t.Run("GetInfo_Error_NotFound", func(t *testing.T) { + randomBlobID := model.MustGenerateBlobID() + _, err := client.GetInfo(ctx, &blobpb.GetBlobInfoRequest{ + BlobId: randomBlobID, // not stored + }) + require.Error(t, err, "GetInfo must fail if the blob does not exist") + }) +} + +func requireProtoAndStoreBlobsEqual(t *testing.T, protoBlob *blobpb.Blob, storeBlob *blob.Blob) { + require.NotNil(t, protoBlob, "protoBlob must not be nil") + require.NotNil(t, storeBlob, "storeBlob must not be nil") + + storeBlobAsProto, err := blob.ToProtoBlob(storeBlob) + require.NoError(t, err, "converting store blob to proto should not fail") + + requireProtoBlobsEqual(t, protoBlob, storeBlobAsProto) +} + +func requireProtoBlobsEqual(t *testing.T, expected, actual *blobpb.Blob) { + require.NotNil(t, expected, "expected proto blob must not be nil") + require.NotNil(t, actual, "actual proto blob must not be nil") + + require.Equal(t, expected.BlobId.GetValue(), actual.BlobId.GetValue(), "blob_id mismatch") + require.Equal(t, expected.OwnerId.GetValue(), actual.OwnerId.GetValue(), "owner_id mismatch") + require.Equal(t, expected.BlobType, actual.BlobType, "blob_type mismatch") + require.Equal(t, expected.S3Url, actual.S3Url, "s3_url mismatch") + + // Check creation time with a small tolerance for nanos + require.NotNil(t, expected.CreatedAt) + require.NotNil(t, actual.CreatedAt) + require.Equal(t, expected.CreatedAt.GetSeconds(), actual.CreatedAt.GetSeconds(), "CreatedAt seconds mismatch") + require.InDelta(t, + expected.CreatedAt.GetNanos(), + actual.CreatedAt.GetNanos(), + 1_000_000, // up to microsecond tolerance + "CreatedAt nanos mismatch", + ) } From 743b111181948a344264b53193c2373fa7840957 Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Fri, 24 Jan 2025 12:44:37 -0500 Subject: [PATCH 12/14] blob: added user auth to upload --- blob/memory/server_test.go | 6 +- blob/postgres/server_test.go | 30 ++++++++++ blob/server.go | 39 ++++++++++--- blob/tests/server.go | 109 ++++++++++++++++++++++++++++++----- 4 files changed, 158 insertions(+), 26 deletions(-) create mode 100644 blob/postgres/server_test.go diff --git a/blob/memory/server_test.go b/blob/memory/server_test.go index 4af05e6..04e83b5 100644 --- a/blob/memory/server_test.go +++ b/blob/memory/server_test.go @@ -4,14 +4,18 @@ import ( "testing" "github.com/code-payments/flipchat-server/blob/tests" + + account "github.com/code-payments/flipchat-server/account/memory" s3 "github.com/code-payments/flipchat-server/s3/memory" ) func TestBlob_MemoryServer(t *testing.T) { + testAccountStore := account.NewInMemory() testS3Store := s3.NewInMemory() testStore := NewInMemory() + teardown := func() { testStore.(*store).reset() } - tests.RunBlobServerTests(t, testStore, testS3Store, teardown) + tests.RunBlobServerTests(t, testAccountStore, testStore, testS3Store, teardown) } diff --git a/blob/postgres/server_test.go b/blob/postgres/server_test.go new file mode 100644 index 0000000..d5f6b80 --- /dev/null +++ b/blob/postgres/server_test.go @@ -0,0 +1,30 @@ +//go:build integration + +package postgres + +import ( + "testing" + + account "github.com/code-payments/flipchat-server/account/postgres" + prismatest "github.com/code-payments/flipchat-server/database/prisma/test" + s3 "github.com/code-payments/flipchat-server/s3/memory" + + "github.com/code-payments/flipchat-server/blob/tests" + + _ "github.com/jackc/pgx/v4/stdlib" +) + +func TestMessaging_PostgresServer(t *testing.T) { + client, disconnect := prismatest.NewTestClient(testEnv.DatabaseUrl, t) + defer disconnect() + + accounts := account.NewInPostgres(client) + blobs := NewInPostgres(client) + s3s := s3.NewInMemory() + + teardown := func() { + blobs.(*store).reset() + } + + tests.RunBlobServerTests(t, accounts, blobs, s3s, teardown) +} diff --git a/blob/server.go b/blob/server.go index 87ce02f..c7a300d 100644 --- a/blob/server.go +++ b/blob/server.go @@ -1,6 +1,7 @@ package blob import ( + "bytes" "context" "errors" "time" @@ -11,24 +12,33 @@ import ( blobpb "github.com/code-payments/flipchat-protobuf-api/generated/go/blob/v1" + "github.com/code-payments/flipchat-server/auth" "github.com/code-payments/flipchat-server/s3" ) const loginWindow = 2 * time.Minute type Server struct { - log *zap.Logger - store Store - s3Store s3.Store + log *zap.Logger + + blobStore Store + s3Store s3.Store + authz auth.Authorizer blobpb.UnimplementedBlobServiceServer } -func NewServer(log *zap.Logger, store Store, s3Store s3.Store) *Server { +func NewServer( + log *zap.Logger, + authz auth.Authorizer, + blobStore Store, + s3Store s3.Store, +) *Server { return &Server{ - log: log, - store: store, - s3Store: s3Store, + log: log, + authz: authz, + blobStore: blobStore, + s3Store: s3Store, } } @@ -44,6 +54,17 @@ func (s *Server) Upload(ctx context.Context, req *blobpb.UploadBlobRequest) (*bl return nil, status.Error(codes.InvalidArgument, "raw_data is required") } + // Check if the user is authorized to upload the blob + userID, err := s.authz.Authorize(ctx, req, &req.Auth) + if err != nil { + return nil, err + } + + // Check if the owner_id matches the authenticated user + if bytes.Compare(userID.Value, req.GetOwnerId().Value) != 0 { + return nil, status.Error(codes.PermissionDenied, "owner_id does not match authenticated user") + } + blobId := GenerateBlobID() // Convert BlobType from protobuf to internal type @@ -76,7 +97,7 @@ func (s *Server) Upload(ctx context.Context, req *blobpb.UploadBlobRequest) (*bl CreatedAt: time.Now(), } - if err := s.store.CreateBlob(ctx, blob); err != nil { + if err := s.blobStore.CreateBlob(ctx, blob); err != nil { if errors.Is(err, ErrExists) { return nil, status.Error(codes.AlreadyExists, "blob already exists") } @@ -103,7 +124,7 @@ func (s *Server) GetInfo(ctx context.Context, req *blobpb.GetBlobInfoRequest) (* } // Retrieve Blob from the store - blob, err := s.store.GetBlob(ctx, req.GetBlobId()) + blob, err := s.blobStore.GetBlob(ctx, req.GetBlobId()) if err != nil { if errors.Is(err, ErrNotFound) { return nil, status.Error(codes.NotFound, "blob not found") diff --git a/blob/tests/server.go b/blob/tests/server.go index e48b022..13d783b 100644 --- a/blob/tests/server.go +++ b/blob/tests/server.go @@ -1,7 +1,7 @@ -// blob/tests/server_extended_test.go package tests import ( + "bytes" "context" "testing" @@ -12,24 +12,43 @@ import ( blobpb "github.com/code-payments/flipchat-protobuf-api/generated/go/blob/v1" commonpb "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" + "github.com/code-payments/flipchat-server/account" + "github.com/code-payments/flipchat-server/auth" "github.com/code-payments/flipchat-server/blob" "github.com/code-payments/flipchat-server/model" "github.com/code-payments/flipchat-server/s3" "github.com/code-payments/flipchat-server/testutil" ) -func RunBlobServerTests(t *testing.T, blobStore blob.Store, s3Store s3.Store, teardown func()) { - for _, tf := range []func(t *testing.T, blobStore blob.Store, s3Store s3.Store){ - testServer, // If you'd like, rename to testServerExtended +func RunBlobServerTests(t *testing.T, + accounts account.Store, + blobStore blob.Store, + s3Store s3.Store, + teardown func()) { + for _, tf := range []func(t *testing.T, + accounts account.Store, + blobStore blob.Store, + s3Store s3.Store, + ){ + testServer, } { - tf(t, blobStore, s3Store) + tf(t, accounts, blobStore, s3Store) teardown() } } -func testServer(t *testing.T, blobStore blob.Store, s3Store s3.Store) { +func testServer( + t *testing.T, + accountStore account.Store, + blobStore blob.Store, + s3Store s3.Store, +) { + log := zap.Must(zap.NewDevelopment()) + + authz := account.NewAuthorizer(log, accountStore, auth.NewKeyPairAuthenticator()) server := blob.NewServer( - zap.Must(zap.NewDevelopment()), + log, + authz, blobStore, s3Store, ) @@ -41,16 +60,29 @@ func testServer(t *testing.T, blobStore blob.Store, s3Store s3.Store) { ctx := context.Background() client := blobpb.NewBlobServiceClient(cc) + // Create a user and bind a key pair + ownerKeyPair := model.MustGenerateKeyPair() userId := model.MustGenerateUserID() + + // Authorize the user + _, _ = accountStore.Bind(ctx, userId, ownerKeyPair.Proto()) + var blobId *commonpb.BlobId t.Run("Upload_Success", func(t *testing.T) { rawData := []byte("hello world") - resp, err := client.Upload(ctx, &blobpb.UploadBlobRequest{ + + req := &blobpb.UploadBlobRequest{ OwnerId: userId, BlobType: blobpb.BlobType_BLOB_TYPE_IMAGE, RawData: rawData, - }) + } + + // Sign the request + require.NoError(t, ownerKeyPair.Auth(req, &req.Auth)) + + // Upload the blob + resp, err := client.Upload(ctx, req) require.NoError(t, err, "Upload should succeed") require.NotNil(t, resp, "Upload response should not be nil") @@ -97,32 +129,77 @@ func testServer(t *testing.T, blobStore blob.Store, s3Store s3.Store) { }) t.Run("Upload_Error_NoOwnerID", func(t *testing.T) { - _, err := client.Upload(ctx, &blobpb.UploadBlobRequest{ + req := &blobpb.UploadBlobRequest{ OwnerId: nil, // Missing BlobType: blobpb.BlobType_BLOB_TYPE_IMAGE, RawData: []byte("xyz"), - }) + } + + require.NoError(t, ownerKeyPair.Auth(req, &req.Auth)) + + _, err := client.Upload(ctx, req) require.Error(t, err, "Upload must fail if owner_id is missing") }) t.Run("Upload_Error_UnknownBlobType", func(t *testing.T) { - _, err := client.Upload(ctx, &blobpb.UploadBlobRequest{ + req := &blobpb.UploadBlobRequest{ OwnerId: userId, BlobType: blobpb.BlobType_BLOB_TYPE_UNKNOWN, // invalid type RawData: []byte("abc"), - }) + } + + require.NoError(t, ownerKeyPair.Auth(req, &req.Auth)) + + _, err := client.Upload(ctx, req) require.Error(t, err, "Upload must fail if blob_type = UNKNOWN") }) t.Run("Upload_Error_NoRawData", func(t *testing.T) { - _, err := client.Upload(ctx, &blobpb.UploadBlobRequest{ + req := &blobpb.UploadBlobRequest{ OwnerId: userId, BlobType: blobpb.BlobType_BLOB_TYPE_VIDEO, - RawData: nil, // no data - }) + RawData: nil, // no raw_data + } + + require.NoError(t, ownerKeyPair.Auth(req, &req.Auth)) + + _, err := client.Upload(ctx, req) require.Error(t, err, "Upload must fail if raw_data is missing/empty") }) + t.Run("Upload_Error_InvalidSignature", func(t *testing.T) { + req := &blobpb.UploadBlobRequest{ + OwnerId: userId, + BlobType: blobpb.BlobType_BLOB_TYPE_VIDEO, + RawData: []byte("xyz"), + Auth: nil, // empty Signature + } + + _, err := client.Upload(ctx, req) + require.Error(t, err, "Upload must fail if signature is missing") + + req = &blobpb.UploadBlobRequest{ + OwnerId: userId, + BlobType: blobpb.BlobType_BLOB_TYPE_VIDEO, + RawData: []byte("xyz"), + Auth: &commonpb.Auth{ + Kind: &commonpb.Auth_KeyPair_{ + KeyPair: &commonpb.Auth_KeyPair{ + PubKey: &commonpb.PublicKey{ + Value: userId.Value, + }, + Signature: &commonpb.Signature{ + Value: bytes.Repeat([]byte{0}, 64), + }, // invalid Signature + }, + }, + }, + } + + _, err = client.Upload(ctx, req) + require.Error(t, err, "Upload must fail if signature is invalid") + }) + t.Run("GetInfo_Error_NoBlobID", func(t *testing.T) { _, err := client.GetInfo(ctx, &blobpb.GetBlobInfoRequest{ BlobId: nil, // missing From 52240ee2a750481b78b5877da8f96a141773f660 Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Fri, 24 Jan 2025 12:59:12 -0500 Subject: [PATCH 13/14] blob: added positive sig case after fail case --- blob/tests/server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/blob/tests/server.go b/blob/tests/server.go index 13d783b..9f60ab5 100644 --- a/blob/tests/server.go +++ b/blob/tests/server.go @@ -198,6 +198,12 @@ func testServer( _, err = client.Upload(ctx, req) require.Error(t, err, "Upload must fail if signature is invalid") + + // Test if using a valid signature works after an invalid one + require.NoError(t, ownerKeyPair.Auth(req, &req.Auth)) + + _, err = client.Upload(ctx, req) + require.NoError(t, err, "Upload must succeed if signature is valid") }) t.Run("GetInfo_Error_NoBlobID", func(t *testing.T) { From aae44169a9f5a30f41fe35e855c4f77674eab5fc Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Fri, 24 Jan 2025 14:36:57 -0500 Subject: [PATCH 14/14] blob: added image metadata process --- blob/helpers.go | 8 +++++++ blob/server.go | 31 ++++++++++++++++++++++++++- go.mod | 5 ++++- go.sum | 2 ++ image/process.go | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 image/process.go diff --git a/blob/helpers.go b/blob/helpers.go index b046ed5..ff7a99a 100644 --- a/blob/helpers.go +++ b/blob/helpers.go @@ -3,6 +3,7 @@ package blob import ( "errors" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/timestamppb" blobpb "github.com/code-payments/flipchat-protobuf-api/generated/go/blob/v1" @@ -46,11 +47,18 @@ func ToProtoBlobType(internalType BlobType) blobpb.BlobType { // Converts internal Blob to protobuf Blob, including unmarshaling metadata. func ToProtoBlob(blob *Blob) (*blobpb.Blob, error) { + var metadata blobpb.Blob_Metadata + err := proto.Unmarshal(blob.Metadata, &metadata) + if err != nil { + return nil, err + } + protoBlob := &blobpb.Blob{ BlobId: blob.ID, BlobType: ToProtoBlobType(blob.Type), OwnerId: blob.UserID, S3Url: blob.S3URL, + Metadata: &metadata, CreatedAt: timestamppb.New(blob.CreatedAt), } return protoBlob, nil diff --git a/blob/server.go b/blob/server.go index c7a300d..7228746 100644 --- a/blob/server.go +++ b/blob/server.go @@ -9,10 +9,12 @@ import ( "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" blobpb "github.com/code-payments/flipchat-protobuf-api/generated/go/blob/v1" "github.com/code-payments/flipchat-server/auth" + "github.com/code-payments/flipchat-server/image" "github.com/code-payments/flipchat-server/s3" ) @@ -85,6 +87,33 @@ func (s *Server) Upload(ctx context.Context, req *blobpb.UploadBlobRequest) (*bl return nil, status.Error(codes.Internal, "failed to upload blob") } + // Process the raw_data based on the BlobType + metadata := &blobpb.Blob_Metadata{Version: 0} + switch blobType { + case BlobTypeImage: + info, err := image.ProcessImage(req.GetRawData()) + if err != nil { + s.log.Error("Failed to process image", zap.Error(err)) + } else { + metadata.Info = &blobpb.Blob_Metadata_Image{Image: info} + } + case BlobTypeVideo: + // Not implemented yet + s.log.Warn("Video blob type not implemented") + case BlobTypeAudio: + // Not implemented yet + s.log.Warn("Video blob type not implemented") + default: + // Not Supported + return nil, status.Error(codes.InvalidArgument, "blob_type not supported") + } + + serializedMetadata, err := proto.Marshal(metadata) + if err != nil { + s.log.Error("Failed to marshal metadata", zap.Error(err)) + return nil, status.Error(codes.Internal, "failed to marshal metadata") + } + // Create the Blob record blob := &Blob{ ID: blobId, @@ -92,7 +121,7 @@ func (s *Server) Upload(ctx context.Context, req *blobpb.UploadBlobRequest) (*bl Type: blobType, S3URL: s3Url, Size: int64(len(req.GetRawData())), - Metadata: []byte("version_0: empty"), + Metadata: serializedMetadata, Flagged: false, CreatedAt: time.Now(), } diff --git a/go.mod b/go.mod index 8a706e0..2ea1d72 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,10 @@ require ( google.golang.org/protobuf v1.35.2 ) -require github.com/ReneKroon/ttlcache v1.7.0 +require ( + github.com/ReneKroon/ttlcache v1.7.0 + github.com/buckket/go-blurhash v1.1.0 +) require ( cloud.google.com/go/auth v0.13.0 // indirect diff --git a/go.sum b/go.sum index 137ebcf..8e3d9dc 100644 --- a/go.sum +++ b/go.sum @@ -30,6 +30,8 @@ github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjL github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bits-and-blooms/bloom/v3 v3.1.0 h1:o3Adl6bGuD9eZzMiLDepS5jqmoEAv/ZH+fFe/MH1quA= github.com/bits-and-blooms/bloom/v3 v3.1.0/go.mod h1:MC8muvBzzPOFsrcdND/A7kU7kMhkqb9KI70JlZCP+C8= +github.com/buckket/go-blurhash v1.1.0 h1:X5M6r0LIvwdvKiUtiNcRL2YlmOfMzYobI3VCKCZc9Do= +github.com/buckket/go-blurhash v1.1.0/go.mod h1:aT2iqo5W9vu9GpyoLErKfTHwgODsZp3bQfXjXJUxNb8= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= diff --git a/image/process.go b/image/process.go new file mode 100644 index 0000000..c6b4f7f --- /dev/null +++ b/image/process.go @@ -0,0 +1,55 @@ +package image + +import ( + "bytes" + "fmt" + "image" + _ "image/gif" // Register GIF format + _ "image/jpeg" // Register JPEG format + _ "image/png" // Register PNG format + + "github.com/buckket/go-blurhash" + + commonpb "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" +) + +const ( + // Define BlurHash components (commonly 4x4 or 9x4) + componentsX = 4 + componentsY = 4 +) + +// ProcessImage takes a byte array of image data, decodes it, +// retrieves dimensions, calculates BlurHash, and returns the serialized protobuf. +func ProcessImage(imageData []byte) (*commonpb.ImageInfo, error) { + // Check if image data is empty + if len(imageData) == 0 { + return nil, fmt.Errorf("image data is empty") + } + + // Decode the image + img, _, err := image.Decode(bytes.NewReader(imageData)) + if err != nil { + return nil, fmt.Errorf("failed to decode image: %w", err) + } + + // Get image bounds + bounds := img.Bounds() + width := int32(bounds.Dx()) + height := int32(bounds.Dy()) + + // Calculate BlurHash + blurhashStr, err := blurhash.Encode(componentsX, componentsY, img) + if err != nil { + return nil, fmt.Errorf("failed to encode blurhash: %w", err) + } + + // Create ImageInfo protobuf message + info := &commonpb.ImageInfo{ + Width: width, + Height: height, + BlurHash: blurhashStr, + } + + return info, nil +}