Commit graph

8 commits

Author SHA1 Message Date
Leonard Lyubich
14fa89b819 [#155] sdk/object: Add Object to RawObject converter
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-22 18:07:14 +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
Leonard Lyubich
9b0eef0d43 [#135] sdk/object: Add Release method to RawObject
Implement Release method that converts RawObject to read-only finalized
Object instance. Remove ToV2 method overriding from Object.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
8c3f8268b9 [#130] sdk: Define object types
Define Object type that represents the immutable NeoFS object. Define
RawObject type that provides interface for convenient construction of NeoFS
object.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00