Skip to content

Commit

Permalink
Merge pull request #42 from kintone-labs/SSR-2114
Browse files Browse the repository at this point in the history
SSR-2114: Add NewRecordWithIdAndRevision function
  • Loading branch information
Pham-Gia-Huong committed Mar 17, 2022
2 parents ed2fe27 + 7e16f58 commit 273ffde
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions record.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ func NewRecordWithId(id uint64, fields map[string]interface{}) *Record {
return &Record{id, -1, fields}
}

// NewRecordWithIdAndRevision creates using an existing record id and revision.
func NewRecordWithIdAndRevision(id uint64, revision int64, fields map[string]interface{}) *Record {
return &Record{id, revision, fields}

}

// MarshalJSON marshals field data of a record into JSON.
func (rec Record) MarshalJSON() ([]byte, error) {
return json.Marshal(rec.Fields)
Expand Down

0 comments on commit 273ffde

Please sign in to comment.