Class: AWSCDK::CXAPI::TreeCloudArtifact
- Inherits:
-
CloudArtifact
- Object
- CloudArtifact
- AWSCDK::CXAPI::TreeCloudArtifact
- Defined in:
- cxapi/tree_cloud_artifact.rb
Class Method Summary collapse
-
.is_tree_cloud_artifact(art) ⇒ Boolean
Checks if
artis an instance of this class. - .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
- #assembly ⇒ AWSCDK::CXAPI::CloudAssembly
-
#dependencies ⇒ Array<AWSCDK::CXAPI::CloudArtifact>
Returns all the artifacts that this artifact depends on.
- #file ⇒ String
-
#find_metadata_by_type(type) ⇒ Array<AWSCDK::CXAPI::MetadataEntryResult>
All the metadata entries of a specific type in this artifact.
-
#hierarchical_id ⇒ String
An identifier that shows where this artifact is located in the tree of nested assemblies, based on their manifests.
- #id ⇒ String
-
#initialize(assembly, name, artifact) ⇒ TreeCloudArtifact
constructor
A new instance of TreeCloudArtifact.
-
#manifest ⇒ AWSCDK::CloudAssemblySchema::ArtifactManifest
The artifact's manifest.
-
#messages ⇒ Array<AWSCDK::CXAPI::SynthesisMessage>
The set of messages extracted from the artifact's metadata.
-
#metadata ⇒ Hash{String => Array<AWSCDK::CloudAssemblySchema::MetadataEntry>}
Returns the metadata associated with this Cloud Artifact.
Constructor Details
#initialize(assembly, name, artifact) ⇒ TreeCloudArtifact
Returns a new instance of TreeCloudArtifact.
10 11 12 13 14 15 16 |
# File 'cxapi/tree_cloud_artifact.rb', line 10 def initialize(assembly, name, artifact) artifact = artifact.is_a?(Hash) ? ::AWSCDK::CloudAssemblySchema::ArtifactManifest.new(**artifact.transform_keys(&:to_sym)) : artifact Jsii::Type.check_type(assembly, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5jeF9hcGkuQ2xvdWRBc3NlbWJseSJ9")), "assembly") Jsii::Type.check_type(name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") Jsii::Type.check_type(artifact, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5jbG91ZF9hc3NlbWJseV9zY2hlbWEuQXJ0aWZhY3RNYW5pZmVzdCJ9")), "artifact") Jsii::Object.instance_method(:initialize).bind(self).call(assembly, name, artifact) end |
Class Method Details
.is_tree_cloud_artifact(art) ⇒ Boolean
Checks if art is an instance of this class.
Use this method instead of instanceof to properly detect TreeCloudArtifact
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the cx-api library on
disk are seen as independent, completely different libraries. As a
consequence, the class TreeCloudArtifact in each copy of the cx-api library
is seen as a different class, and an instance of one class will not test as
instanceof the other class. npm install will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the cx-api
library can be accidentally installed, and instanceof will behave
unpredictably. It is safest to avoid using instanceof, and using
this type-testing method instead.
50 51 52 53 |
# File 'cxapi/tree_cloud_artifact.rb', line 50 def self.is_tree_cloud_artifact(art) Jsii::Type.check_type(art, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "art") Jsii::Kernel.instance.call_static("aws-cdk-lib.cx_api.TreeCloudArtifact", "isTreeCloudArtifact", [art]) end |
.jsii_overridable_methods ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'cxapi/tree_cloud_artifact.rb', line 18 def self.jsii_overridable_methods { :assembly => { kind: :property, name: "assembly", is_optional: false }, :dependencies => { kind: :property, name: "dependencies", is_optional: false }, :hierarchical_id => { kind: :property, name: "hierarchicalId", is_optional: false }, :id => { kind: :property, name: "id", is_optional: false }, :manifest => { kind: :property, name: "manifest", is_optional: false }, :messages => { kind: :property, name: "messages", is_optional: false }, :metadata => { kind: :property, name: "metadata", is_optional: false }, :file => { kind: :property, name: "file", is_optional: false }, :find_metadata_by_type => { kind: :method, name: "findMetadataByType", is_optional: false }, } end |
Instance Method Details
#assembly ⇒ AWSCDK::CXAPI::CloudAssembly
56 57 58 |
# File 'cxapi/tree_cloud_artifact.rb', line 56 def assembly() jsii_get_property("assembly") end |
#dependencies ⇒ Array<AWSCDK::CXAPI::CloudArtifact>
Returns all the artifacts that this artifact depends on.
63 64 65 |
# File 'cxapi/tree_cloud_artifact.rb', line 63 def dependencies() jsii_get_property("dependencies") end |
#file ⇒ String
104 105 106 |
# File 'cxapi/tree_cloud_artifact.rb', line 104 def file() jsii_get_property("file") end |
#find_metadata_by_type(type) ⇒ Array<AWSCDK::CXAPI::MetadataEntryResult>
Returns all the metadata entries of a specific type in this artifact.
110 111 112 113 |
# File 'cxapi/tree_cloud_artifact.rb', line 110 def (type) Jsii::Type.check_type(type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type") jsii_call_method("findMetadataByType", [type]) end |
#hierarchical_id ⇒ String
An identifier that shows where this artifact is located in the tree of nested assemblies, based on their manifests.
Defaults to the normal id. Should only be used in user interfaces.
73 74 75 |
# File 'cxapi/tree_cloud_artifact.rb', line 73 def hierarchical_id() jsii_get_property("hierarchicalId") end |
#id ⇒ String
78 79 80 |
# File 'cxapi/tree_cloud_artifact.rb', line 78 def id() jsii_get_property("id") end |
#manifest ⇒ AWSCDK::CloudAssemblySchema::ArtifactManifest
The artifact's manifest.
85 86 87 |
# File 'cxapi/tree_cloud_artifact.rb', line 85 def manifest() jsii_get_property("manifest") end |
#messages ⇒ Array<AWSCDK::CXAPI::SynthesisMessage>
The set of messages extracted from the artifact's metadata.
92 93 94 |
# File 'cxapi/tree_cloud_artifact.rb', line 92 def () jsii_get_property("messages") end |
#metadata ⇒ Hash{String => Array<AWSCDK::CloudAssemblySchema::MetadataEntry>}
Returns the metadata associated with this Cloud Artifact.
99 100 101 |
# File 'cxapi/tree_cloud_artifact.rb', line 99 def () jsii_get_property("metadata") end |