Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
beem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
beem
Commits
8e8fe0d4
Unverified
Commit
8e8fe0d4
authored
5 years ago
by
Alexander Morris
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update objects.py
parent
acca00b4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beembase/objects.py
+97
-0
97 additions, 0 deletions
beembase/objects.py
with
97 additions
and
0 deletions
beembase/objects.py
+
97
−
0
View file @
8e8fe0d4
...
...
@@ -314,3 +314,100 @@ class CommentOptionExtensions(Static_variant):
else
:
raise
Exception
(
"
Unknown CommentOptionExtension
"
)
super
(
CommentOptionExtensions
,
self
).
__init__
(
data
,
type_id
)
class
SocialActionCommentCreate
(
GrapheneObject
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
if
isArgsThisClass
(
self
,
args
):
self
.
data
=
args
[
0
].
data
else
:
if
len
(
args
)
==
1
and
len
(
kwargs
)
==
0
:
kwargs
=
args
[
0
]
meta
=
""
if
"
json_metadata
"
in
kwargs
and
kwargs
[
"
json_metadata
"
]:
if
(
isinstance
(
kwargs
[
"
json_metadata
"
],
dict
)
or
isinstance
(
kwargs
[
"
json_metadata
"
],
list
)):
meta
=
json
.
dumps
(
kwargs
[
"
json_metadata
"
])
else
:
meta
=
kwargs
[
"
json_metadata
"
]
pod
=
String
(
kwargs
[
"
pod
"
])
if
"
pod
"
in
kwargs
else
None
max_accepted_payout
=
Amount
(
kwargs
[
"
max_accepted_payout
"
])
if
"
max_accepted_payout
"
in
kwargs
else
None
allow_replies
=
Bool
(
kwargs
[
"
allow_replies
"
])
if
"
allow_replies
"
in
kwargs
else
None
allow_votes
=
Bool
(
kwargs
[
"
allow_votes
"
])
if
"
allow_votes
"
in
kwargs
else
None
allow_curation_rewards
=
Bool
(
kwargs
[
"
allow_curation_rewards
"
])
if
"
allow_curation_rewards
"
in
kwargs
else
None
allow_friends
=
Bool
(
kwargs
[
"
allow_friends
"
])
if
"
allow_friends
"
in
kwargs
else
None
super
(
SocialActionCommentCreate
,
self
).
__init__
(
OrderedDict
([
(
'
permlink
'
,
String
(
kwargs
[
"
permlink
"
])),
(
'
parent_author
'
,
String
(
kwargs
[
"
parent_author
"
])),
(
'
parent_permlink
'
,
String
(
kwargs
[
"
parent_permlink
"
])),
(
'
pod
'
,
Optional
(
pod
)),
(
'
max_accepted_payout
'
,
Optional
(
max_accepted_payout
)),
(
'
allow_replies
'
,
Optional
(
allow_replies
)),
(
'
allow_votes
'
,
Optional
(
allow_votes
)),
(
'
allow_curation_rewards
'
,
Optional
(
allow_curation_rewards
)),
(
'
allow_friends
'
,
Optional
(
allow_friends
)),
(
'
title
'
,
String
(
kwargs
[
"
title
"
])),
(
'
body
'
,
String
(
kwargs
[
"
body
"
])),
(
'
json_metadata
'
,
String
(
meta
)),
]))
class
SocialActionCommentUpdate
(
GrapheneObject
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
if
isArgsThisClass
(
self
,
args
):
self
.
data
=
args
[
0
].
data
else
:
if
len
(
args
)
==
1
and
len
(
kwargs
)
==
0
:
kwargs
=
args
[
0
]
meta
=
Optional
(
None
)
if
"
json_metadata
"
in
kwargs
and
kwargs
[
"
json_metadata
"
]:
if
(
isinstance
(
kwargs
[
"
json_metadata
"
],
dict
)
or
isinstance
(
kwargs
[
"
json_metadata
"
],
list
)):
meta
=
json
.
dumps
(
kwargs
[
"
json_metadata
"
])
else
:
if
"
json_metadata
"
in
kwargs
:
meta
=
kwargs
[
"
json_metadata
"
]
title
=
kwargs
[
"
title
"
]
if
"
title
"
in
kwargs
else
None
body
=
kwargs
[
"
body
"
]
if
"
body
"
in
kwargs
else
None
super
(
SocialActionCommentUpdate
,
self
).
__init__
(
OrderedDict
([
(
'
permlink
'
,
String
(
kwargs
[
"
permlink
"
])),
(
'
title
'
,
Optional
(
String
(
kwargs
[
"
title
"
]))),
(
'
body
'
,
Optional
(
String
(
kwargs
[
"
body
"
]))),
(
'
json_metadata
'
,
meta
),
]))
class
SocialActionCommentDelete
(
GrapheneObject
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
if
isArgsThisClass
(
self
,
args
):
self
.
data
=
args
[
0
].
data
else
:
if
len
(
args
)
==
1
and
len
(
kwargs
)
==
0
:
kwargs
=
args
[
0
]
super
(
SocialActionCommentDelete
,
self
).
__init__
(
OrderedDict
([
(
'
permlink
'
,
String
(
kwargs
[
"
permlink
"
]))
]))
class
SocialActionVariant
(
Static_variant
):
def
__init__
(
self
,
o
):
type_id
,
data
=
o
if
type_id
==
0
:
data
=
SocialActionCommentCreate
(
data
)
else
:
if
type_id
==
1
:
data
=
SocialActionCommentUpdate
(
data
)
else
:
if
type_id
==
2
:
data
=
SocialActionCommentDelete
(
data
)
else
:
raise
Exception
(
"
Unknown SocialAction
"
)
Static_variant
.
__init__
(
self
,
data
,
type_id
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment