@@ -29,6 +29,8 @@ def __init__(self, opencti):
2929 name
3030 description
3131
32+ entity_type
33+ parent_types
3234 created_at
3335 updated_at
3436
@@ -125,7 +127,7 @@ def list(self, **kwargs) -> List[Dict]:
125127 orderMode = kwargs .get ("orderMode" , None )
126128 search = kwargs .get ("search" , None )
127129 filters = kwargs .get ("filters" , None )
128- customAttributes = kwargs .get ("customAttributes" , None )
130+ custom_attributes = kwargs .get ("customAttributes" , None )
129131 getAll = kwargs .get ("getAll" , False )
130132 withPagination = kwargs .get ("withPagination" , False )
131133
@@ -142,7 +144,7 @@ def list(self, **kwargs) -> List[Dict]:
142144 edges {
143145 node {
144146 """
145- + (self .properties if customAttributes is None else customAttributes )
147+ + (self .properties if custom_attributes is None else custom_attributes )
146148 + """
147149 }
148150 }
@@ -211,15 +213,15 @@ def read(self, **kwargs) -> Optional[Dict]:
211213 id = kwargs .get ("id" , None )
212214 filters = kwargs .get ("filters" , None )
213215 search = kwargs .get ("search" , None )
214- customAttributes = kwargs .get ("customAttributes" , None )
216+ custom_attributes = kwargs .get ("customAttributes" , None )
215217 if id is not None :
216218 self .opencti .admin_logger .info ("Fetching group with ID" , {"id" : id })
217219 query = (
218220 """
219221 query Group($id: String!) {
220222 group(id: $id) {
221223 """
222- + (self .properties if customAttributes is None else customAttributes )
224+ + (self .properties if custom_attributes is None else custom_attributes )
223225 + """
224226 }
225227 }
@@ -229,7 +231,7 @@ def read(self, **kwargs) -> Optional[Dict]:
229231 return self .opencti .process_multiple_fields (result ["data" ]["group" ])
230232 elif filters is not None or search is not None :
231233 results = self .list (
232- filters = filters , search = search , customAttributes = customAttributes
234+ filters = filters , search = search , customAttributes = custom_attributes
233235 )
234236 return results [0 ] if results else None
235237 else :
@@ -275,11 +277,11 @@ def create(self, **kwargs) -> Optional[Dict]:
275277 no_creators = kwargs .get ("no_creators" , False )
276278 restrict_delete = kwargs .get ("restrict_delete" , False )
277279 auto_new_marking = kwargs .get ("auto_new_marking" , False )
278- customAttributes = kwargs .get ("customAttributes" , None )
280+ custom_attributes = kwargs .get ("customAttributes" , None )
279281
280282 if name is None or group_confidence_level is None :
281283 self .opencti .admin_logger .error (
282- "[opencti_group] Missing parameters: name and " " group_confidence_level"
284+ "[opencti_group] Missing parameters: name and group_confidence_level"
283285 )
284286 return None
285287
@@ -300,7 +302,7 @@ def create(self, **kwargs) -> Optional[Dict]:
300302 mutation GroupAdd($input: GroupAddInput!) {
301303 groupAdd(input: $input) {
302304 """
303- + (self .properties if customAttributes is None else customAttributes )
305+ + (self .properties if custom_attributes is None else custom_attributes )
304306 + """
305307 }
306308 }
@@ -352,7 +354,7 @@ def update_field(self, **kwargs) -> Optional[Dict]:
352354 """
353355 id = kwargs .get ("id" , None )
354356 input = kwargs .get ("input" , None )
355- customAttributes = kwargs .get ("customAttributes" , None )
357+ custom_attributes = kwargs .get ("customAttributes" , None )
356358
357359 if id is None or input is None :
358360 self .opencti .admin_logger .error (
@@ -367,7 +369,7 @@ def update_field(self, **kwargs) -> Optional[Dict]:
367369 groupEdit(id: $id) {
368370 fieldPatch(input: $input) {
369371 """
370- + (self .properties if customAttributes is None else customAttributes )
372+ + (self .properties if custom_attributes is None else custom_attributes )
371373 + """
372374 }
373375 }
@@ -402,7 +404,7 @@ def add_member(self, **kwargs) -> Optional[Dict]:
402404 "Adding member to group" , {"groupId" : id , "userId" : user_id }
403405 )
404406 query = """
405- mutation MemberAdd ($groupId: ID!, $userId: ID!) {
407+ mutation GroupEditMemberAdd ($groupId: ID!, $userId: ID!) {
406408 groupEdit(id: $groupId) {
407409 relationAdd(input: {
408410 fromId: $userId,
@@ -449,7 +451,7 @@ def delete_member(self, **kwargs) -> Optional[Dict]:
449451 )
450452 query = (
451453 """
452- mutation MemberDelete ($groupId: ID!, $userId: StixRef!) {
454+ mutation GroupEditMemberDelete ($groupId: ID!, $userId: StixRef!) {
453455 groupEdit(id: $groupId) {
454456 relationDelete(fromId: $userId, relationship_type: "member-of") {
455457 """
@@ -488,7 +490,7 @@ def add_role(self, **kwargs) -> Optional[Dict]:
488490 "Adding role to group" , {"groupId" : id , "roleId" : role_id }
489491 )
490492 query = """
491- mutation RoleAdd ($groupId: ID!, $roleId: ID!) {
493+ mutation GroupEditRoleAdd ($groupId: ID!, $roleId: ID!) {
492494 groupEdit(id: $groupId) {
493495 relationAdd(input: {
494496 toId: $roleId, relationship_type: "has-role"
@@ -534,7 +536,7 @@ def delete_role(self, **kwargs) -> Optional[Dict]:
534536 )
535537 query = (
536538 """
537- mutation RoleDelete ($groupId: ID!, $roleId: StixRef!) {
539+ mutation GroupEditRoleDelete ($groupId: ID!, $roleId: StixRef!) {
538540 groupEdit(id: $groupId) {
539541 relationDelete(toId: $roleId, relationship_type: "has-role") {
540542 """
@@ -581,7 +583,7 @@ def edit_default_marking(self, **kwargs) -> Optional[Dict]:
581583 )
582584 query = (
583585 """
584- mutation EditDefaultMarking ($id: ID!, $entity_type: String!, $values: [String!]) {
586+ mutation GroupEditEditDefaultMarking ($id: ID!, $entity_type: String!, $values: [String!]) {
585587 groupEdit(id: $id) {
586588 editDefaultMarking(input: {
587589 entity_type: $entity_type,
@@ -699,7 +701,7 @@ def delete_allowed_marking(self, **kwargs) -> Optional[Dict]:
699701 )
700702 query = (
701703 """
702- mutation MarkingForbid ($groupId: ID!, $markingId: StixRef!) {
704+ mutation GroupEditMarkingRemove ($groupId: ID!, $markingId: StixRef!) {
703705 groupEdit(id: $groupId) {
704706 relationDelete(toId: $markingId, relationship_type: "accesses-to") {
705707 """
0 commit comments