Class: ReactorSDK::Endpoints::Extensions
- Inherits:
-
BaseEndpoint
- Object
- BaseEndpoint
- ReactorSDK::Endpoints::Extensions
- Defined in:
- lib/reactor_sdk/endpoints/extensions.rb
Instance Method Summary collapse
-
#comprehensive_upstream_chain(extension_or_id, library_id:, property_id:) ⇒ ReactorSDK::Resources::ComprehensiveUpstreamChain
Resolves the extension across the ordered upstream chain using snapshot-aware comprehensive review objects.
-
#create(property_id:, attributes:, relationships:) ⇒ ReactorSDK::Resources::Extension
Creates an extension within a property.
- #create_note(extension_id, text) ⇒ Object
- #delete(extension_id) ⇒ Object
- #extension_package(extension_id) ⇒ Object
-
#find(extension_id) ⇒ ReactorSDK::Resources::Extension
Retrieves a single extension by its Adobe ID.
-
#find_comprehensive(extension_id, library_id:, property_id:) ⇒ ReactorSDK::Resources::ComprehensiveExtension
Fetches the extension from a library-context review snapshot together with dependent resources and normalized review payload.
- #libraries(extension_id) ⇒ Object
-
#list_for_property(property_id) ⇒ Array<ReactorSDK::Resources::Extension>
Lists all extensions installed in a given property.
- #list_notes(extension_id) ⇒ Object
- #origin(extension_id) ⇒ Object
- #property(extension_id) ⇒ Object
-
#revise(extension_id) ⇒ ReactorSDK::Resources::Extension
Revises an extension so it can be added to a library.
-
#upstream_chain(extension_or_id, library_id:, property_id:) ⇒ ReactorSDK::Resources::UpstreamChain
Resolves the extension across the ordered upstream library chain.
Methods inherited from BaseEndpoint
Constructor Details
This class inherits a constructor from ReactorSDK::Endpoints::BaseEndpoint
Instance Method Details
#comprehensive_upstream_chain(extension_or_id, library_id:, property_id:) ⇒ ReactorSDK::Resources::ComprehensiveUpstreamChain
Resolves the extension across the ordered upstream chain using snapshot-aware comprehensive review objects.
153 154 155 156 157 158 159 160 |
# File 'lib/reactor_sdk/endpoints/extensions.rb', line 153 def comprehensive_upstream_chain(extension_or_id, library_id:, property_id:) libraries_endpoint.comprehensive_upstream_chain_for_resource( extension_or_id, library_id: library_id, property_id: property_id, resource_type: 'extensions' ) end |
#create(property_id:, attributes:, relationships:) ⇒ ReactorSDK::Resources::Extension
Creates an extension within a property.
54 55 56 57 58 59 60 61 62 |
# File 'lib/reactor_sdk/endpoints/extensions.rb', line 54 def create(property_id:, attributes:, relationships:) create_resource( "/properties/#{property_id}/extensions", 'extensions', Resources::Extension, attributes: attributes, relationships: relationships ) end |
#create_note(extension_id, text) ⇒ Object
166 167 168 |
# File 'lib/reactor_sdk/endpoints/extensions.rb', line 166 def create_note(extension_id, text) create_note_for_path("/extensions/#{extension_id}/notes", text) end |
#delete(extension_id) ⇒ Object
87 88 89 |
# File 'lib/reactor_sdk/endpoints/extensions.rb', line 87 def delete(extension_id) delete_resource("/extensions/#{extension_id}") end |
#extension_package(extension_id) ⇒ Object
91 92 93 |
# File 'lib/reactor_sdk/endpoints/extensions.rb', line 91 def extension_package(extension_id) fetch_resource("/extensions/#{extension_id}/extension_package", Resources::ExtensionPackage) end |
#find(extension_id) ⇒ ReactorSDK::Resources::Extension
Retrieves a single extension by its Adobe ID.
41 42 43 44 |
# File 'lib/reactor_sdk/endpoints/extensions.rb', line 41 def find(extension_id) response = @connection.get("/extensions/#{extension_id}") @parser.parse(response['data'], Resources::Extension) end |
#find_comprehensive(extension_id, library_id:, property_id:) ⇒ ReactorSDK::Resources::ComprehensiveExtension
Fetches the extension from a library-context review snapshot together with dependent resources and normalized review payload.
133 134 135 136 137 138 139 140 141 142 |
# File 'lib/reactor_sdk/endpoints/extensions.rb', line 133 def find_comprehensive(extension_id, library_id:, property_id:) snapshot = libraries_endpoint.find_snapshot(library_id, property_id: property_id) comprehensive = snapshot.comprehensive_resource(extension_id, resource_type: 'extensions') unless comprehensive raise ReactorSDK::ResourceNotFoundError, "Extension #{extension_id} was not found in library #{library_id}" end comprehensive end |
#libraries(extension_id) ⇒ Object
95 96 97 |
# File 'lib/reactor_sdk/endpoints/extensions.rb', line 95 def libraries(extension_id) list_resources("/extensions/#{extension_id}/libraries", Resources::Library) end |
#list_for_property(property_id) ⇒ Array<ReactorSDK::Resources::Extension>
Lists all extensions installed in a given property. Follows pagination automatically — returns all extensions.
29 30 31 32 |
# File 'lib/reactor_sdk/endpoints/extensions.rb', line 29 def list_for_property(property_id) records = @paginator.all("/properties/#{property_id}/extensions") records.map { |r| @parser.parse(r, Resources::Extension) } end |
#list_notes(extension_id) ⇒ Object
162 163 164 |
# File 'lib/reactor_sdk/endpoints/extensions.rb', line 162 def list_notes(extension_id) list_notes_for_path("/extensions/#{extension_id}/notes") end |
#origin(extension_id) ⇒ Object
103 104 105 |
# File 'lib/reactor_sdk/endpoints/extensions.rb', line 103 def origin(extension_id) fetch_resource("/extensions/#{extension_id}/origin", Resources::Extension) end |
#property(extension_id) ⇒ Object
99 100 101 |
# File 'lib/reactor_sdk/endpoints/extensions.rb', line 99 def property(extension_id) fetch_resource("/extensions/#{extension_id}/property", Resources::Property) end |
#revise(extension_id) ⇒ ReactorSDK::Resources::Extension
Revises an extension so it can be added to a library.
Adobe Launch requires every resource to be explicitly revised before it can be added to a library.
Always call revise before libraries.add_extensions.
76 77 78 79 80 81 82 83 84 85 |
# File 'lib/reactor_sdk/endpoints/extensions.rb', line 76 def revise(extension_id) update_resource( "/extensions/#{extension_id}", extension_id, 'extensions', Resources::Extension, attributes: {}, meta: { action: 'revise' } ) end |
#upstream_chain(extension_or_id, library_id:, property_id:) ⇒ ReactorSDK::Resources::UpstreamChain
Resolves the extension across the ordered upstream library chain.
115 116 117 118 119 120 121 122 |
# File 'lib/reactor_sdk/endpoints/extensions.rb', line 115 def upstream_chain(extension_or_id, library_id:, property_id:) libraries_endpoint.upstream_chain_for_resource( extension_or_id, library_id: library_id, property_id: property_id, resource_type: 'extensions' ) end |