pycti 6.6.18__py3-none-any.whl → 6.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pycti might be problematic. Click here for more details.

@@ -802,6 +802,87 @@ class StixSightingRelationship:
802
802
  self.opencti.app_logger.error("Missing parameters: id")
803
803
  return False
804
804
 
805
+ """
806
+ Share element to multiple organizations
807
+
808
+ :param entity_id: the stix_sighting id
809
+ :param organization_id:s the organization to share with
810
+ :return void
811
+ """
812
+
813
+ def organization_share(self, entity_id, organization_ids, sharing_direct_container):
814
+ query = """
815
+ mutation StixSightingRelationshipEdit($id: ID!, $organizationId: [ID!]!, $directContainerSharing: Boolean) {
816
+ stixSightingRelationshipEdit(id: $id) {
817
+ restrictionOrganizationAdd(organizationId: $organizationId, directContainerSharing: $directContainerSharing) {
818
+ id
819
+ }
820
+ }
821
+ }
822
+ """
823
+ self.opencti.query(
824
+ query,
825
+ {
826
+ "id": entity_id,
827
+ "organizationId": organization_ids,
828
+ "directContainerSharing": sharing_direct_container,
829
+ },
830
+ )
831
+
832
+ """
833
+ Unshare element from multiple organizations
834
+
835
+ :param entity_id: the stix_sighting id
836
+ :param organization_id:s the organization to share with
837
+ :return void
838
+ """
839
+
840
+ def organization_unshare(
841
+ self, entity_id, organization_ids, sharing_direct_container
842
+ ):
843
+ query = """
844
+ mutation StixSightingRelationshipEdit($id: ID!, $organizationId: [ID!]!, $directContainerSharing: Boolean) {
845
+ stixSightingRelationshipEdit(id: $id) {
846
+ restrictionOrganizationDelete(organizationId: $organizationId, directContainerSharing: $directContainerSharing) {
847
+ id
848
+ }
849
+ }
850
+ }
851
+ """
852
+ self.opencti.query(
853
+ query,
854
+ {
855
+ "id": entity_id,
856
+ "organizationId": organization_ids,
857
+ "directContainerSharing": sharing_direct_container,
858
+ },
859
+ )
860
+
861
+ """
862
+ Remove a stix_sighting object from draft (revert)
863
+
864
+ :param id: the stix_sighting id
865
+ :return void
866
+ """
867
+
868
+ def remove_from_draft(self, **kwargs):
869
+ id = kwargs.get("id", None)
870
+ if id is not None:
871
+ self.opencti.app_logger.info("Draft remove stix_sighting", {"id": id})
872
+ query = """
873
+ mutation StixSightingRelationshipEditDraftRemove($id: ID!) {
874
+ stixSightingRelationshipEdit(id: $id) {
875
+ removeFromDraft
876
+ }
877
+ }
878
+ """
879
+ self.opencti.query(query, {"id": id})
880
+ else:
881
+ self.opencti.app_logger.error(
882
+ "[stix_sighting] Cant remove from draft, missing parameters: id"
883
+ )
884
+ return None
885
+
805
886
  """
806
887
  Delete a stix_sighting
807
888