Module: Aserto::Directory::V3::Writer
- Included in:
- Client
- Defined in:
- lib/aserto/directory/v3/writer.rb
Instance Method Summary collapse
-
#delete_object(object_type:, object_id:, with_relations: false) ⇒ Aserto::Directory::Writer::V3::DeleteObjectResponse
Delete an object.
-
#delete_relation(object_type:, object_id:, relation:, subject_type:, subject_id:, subject_relation: "") ⇒ Aserto::Directory::Writer::V3::DeleteRelationRequest
Delete a relation between two objects.
-
#set_object(object_type:, object_id:, display_name: "", properties: {}, etag: nil) ⇒ Aserto::Directory::Writer::V3::SetObjectResponse
Create a new object.
-
#set_relation(object_type:, object_id:, relation:, subject_type:, subject_id:, subject_relation: "") ⇒ Aserto::Directory::Writer::V3::SetRelationResponse
Creates a relation between two objects.
Instance Method Details
#delete_object(object_type:, object_id:, with_relations: false) ⇒ Aserto::Directory::Writer::V3::DeleteObjectResponse
Delete an object
47 48 49 50 51 52 53 54 55 |
# File 'lib/aserto/directory/v3/writer.rb', line 47 def delete_object(object_type:, object_id:, with_relations: false) writer.delete_object( Aserto::Directory::Writer::V3::DeleteObjectRequest.new( object_type: object_type, object_id: object_id, with_relations: with_relations ) ) end |
#delete_relation(object_type:, object_id:, relation:, subject_type:, subject_id:, subject_relation: "") ⇒ Aserto::Directory::Writer::V3::DeleteRelationRequest
Delete a relation between two objects
112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/aserto/directory/v3/writer.rb', line 112 def delete_relation(object_type:, object_id:, relation:, subject_type:, subject_id:, subject_relation: "") writer.delete_relation( Aserto::Directory::Writer::V3::DeleteRelationRequest.new( object_type: object_type, object_id: object_id, relation: relation, subject_type: subject_type, subject_id: subject_id, subject_relation: subject_relation ) ) end |
#set_object(object_type:, object_id:, display_name: "", properties: {}, etag: nil) ⇒ Aserto::Directory::Writer::V3::SetObjectResponse
Create a new object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/aserto/directory/v3/writer.rb', line 22 def set_object(object_type:, object_id:, display_name: "", properties: {}, etag: nil) writer.set_object( Aserto::Directory::Writer::V3::SetObjectRequest.new( object: { type: object_type, id: object_id, display_name: display_name, properties: Google::Protobuf::Struct.from_hash(properties.transform_keys!(&:to_s)), etag: etag } ) ) end |
#set_relation(object_type:, object_id:, relation:, subject_type:, subject_id:, subject_relation: "") ⇒ Aserto::Directory::Writer::V3::SetRelationResponse
Creates a relation between two objects
77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/aserto/directory/v3/writer.rb', line 77 def set_relation(object_type:, object_id:, relation:, subject_type:, subject_id:, subject_relation: "") writer.set_relation( Aserto::Directory::Writer::V3::SetRelationRequest.new( relation: { object_type: object_type, object_id: object_id, relation: relation, subject_type: subject_type, subject_id: subject_id, subject_relation: subject_relation } ) ) end |