Commit graph

6 commits

Author SHA1 Message Date
Leonard Lyubich
ae81f4584e [#164] sdk/object: Add parent ID getter and setter
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-10-01 10:06:30 +03:00
Leonard Lyubich
cecdeeac73 [#155] sdk/object: Add CutPayload method to RawObject
Add CutPayload method that returns RawObject's copy with untethered empty
payload. Changing the result payload doesn't affect source object. Changing
the other fields affects source object.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-22 18:07:14 +03:00
Leonard Lyubich
dbb5102c02 [#155] sdk/object: Add object type getter/setter
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-22 18:07:14 +03:00
Leonard Lyubich
c66b23995c [#155] sdk/object: Add session token getter/setter
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-22 18:07:14 +03:00
Leonard Lyubich
1ac6f2eeeb [#145] sdk/object: Refactor logic of field setters
In previous implementation RawObject constructor initialized internal v2
Object structure recursively so that further you can directly set the values
of nested fields. This caused the object created by constructor New to be
different from the object created from the empty object v2.

Remove recursive initialization of v2 Object from New and NewRaw
constructors. Make setters to initialize nested structures on demand.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
6ce70d4a18 [#140] sdk/object: Refactor object types
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00