Class: AnalyticsOps::DesiredState
- Inherits:
-
Object
- Object
- AnalyticsOps::DesiredState
- Defined in:
- lib/analytics_ops/desired_state.rb,
sig/analytics_ops.rbs
Overview
Validated, immutable desired state for one named profile.
Instance Attribute Summary collapse
-
#bigquery ⇒ record?
readonly
Returns the value of attribute bigquery.
-
#custom_dimensions ⇒ Array[record]
readonly
Returns the value of attribute custom_dimensions.
-
#custom_metrics ⇒ Array[record]
readonly
Returns the value of attribute custom_metrics.
-
#funnels ⇒ Hash[String, Funnels::Definition]
readonly
Returns the value of attribute funnels.
-
#google_signals ⇒ record?
readonly
Returns the value of attribute google_signals.
-
#governance ⇒ record?
readonly
Returns the value of attribute governance.
-
#health ⇒ record?
readonly
Returns the value of attribute health.
-
#key_events ⇒ Array[String]
readonly
Returns the value of attribute key_events.
-
#labels ⇒ record
readonly
Returns the value of attribute labels.
-
#manual_requirements ⇒ Array[String]
readonly
Returns the value of attribute manual_requirements.
-
#profile ⇒ String
readonly
Returns the value of attribute profile.
-
#property_id ⇒ String
readonly
Returns the value of attribute property_id.
-
#reports ⇒ Hash[String, Reports::Definition]
readonly
Returns the value of attribute reports.
-
#retention ⇒ record?
readonly
Returns the value of attribute retention.
-
#streams ⇒ Array[record]
readonly
Returns the value of attribute streams.
Instance Method Summary collapse
-
#initialize(profile:, property_id:, streams:, retention:, key_events:, custom_dimensions:, custom_metrics:, manual_requirements:, google_signals:, labels: {}, reports: {}, health: nil, funnels: {}, bigquery: nil, governance: nil) ⇒ DesiredState
constructor
A new instance of DesiredState.
- #to_h ⇒ record
Constructor Details
#initialize(profile:, property_id:, streams:, retention:, key_events:, custom_dimensions:, custom_metrics:, manual_requirements:, google_signals:, labels: {}, reports: {}, health: nil, funnels: {}, bigquery: nil, governance: nil) ⇒ DesiredState
Returns a new instance of DesiredState.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/analytics_ops/desired_state.rb', line 13 def initialize(profile:, property_id:, streams:, retention:, key_events:, custom_dimensions:, custom_metrics:, manual_requirements:, google_signals:, labels: {}, reports: {}, health: nil, funnels: {}, bigquery: nil, governance: nil) @profile = Canonical.immutable(profile) @property_id = Canonical.immutable(property_id) @streams = Canonical.immutable(streams) @retention = Canonical.immutable(retention) @key_events = Canonical.immutable(key_events) @custom_dimensions = Canonical.immutable(custom_dimensions) @custom_metrics = Canonical.immutable(custom_metrics) @manual_requirements = Canonical.immutable(manual_requirements) @google_signals = Canonical.immutable(google_signals) @labels = Canonical.immutable(labels) @reports = immutable_values(reports) @health = Canonical.immutable(health) @funnels = immutable_values(funnels) @bigquery = Canonical.immutable(bigquery) @governance = Canonical.immutable(governance) freeze end |
Instance Attribute Details
#bigquery ⇒ record? (readonly)
Returns the value of attribute bigquery.
8 9 10 |
# File 'lib/analytics_ops/desired_state.rb', line 8 def bigquery @bigquery end |
#custom_dimensions ⇒ Array[record] (readonly)
Returns the value of attribute custom_dimensions.
8 9 10 |
# File 'lib/analytics_ops/desired_state.rb', line 8 def custom_dimensions @custom_dimensions end |
#custom_metrics ⇒ Array[record] (readonly)
Returns the value of attribute custom_metrics.
8 9 10 |
# File 'lib/analytics_ops/desired_state.rb', line 8 def custom_metrics @custom_metrics end |
#funnels ⇒ Hash[String, Funnels::Definition] (readonly)
Returns the value of attribute funnels.
8 9 10 |
# File 'lib/analytics_ops/desired_state.rb', line 8 def funnels @funnels end |
#google_signals ⇒ record? (readonly)
Returns the value of attribute google_signals.
8 9 10 |
# File 'lib/analytics_ops/desired_state.rb', line 8 def google_signals @google_signals end |
#governance ⇒ record? (readonly)
Returns the value of attribute governance.
8 9 10 |
# File 'lib/analytics_ops/desired_state.rb', line 8 def governance @governance end |
#health ⇒ record? (readonly)
Returns the value of attribute health.
8 9 10 |
# File 'lib/analytics_ops/desired_state.rb', line 8 def health @health end |
#key_events ⇒ Array[String] (readonly)
Returns the value of attribute key_events.
8 9 10 |
# File 'lib/analytics_ops/desired_state.rb', line 8 def key_events @key_events end |
#labels ⇒ record (readonly)
Returns the value of attribute labels.
8 9 10 |
# File 'lib/analytics_ops/desired_state.rb', line 8 def labels @labels end |
#manual_requirements ⇒ Array[String] (readonly)
Returns the value of attribute manual_requirements.
8 9 10 |
# File 'lib/analytics_ops/desired_state.rb', line 8 def manual_requirements @manual_requirements end |
#profile ⇒ String (readonly)
Returns the value of attribute profile.
8 9 10 |
# File 'lib/analytics_ops/desired_state.rb', line 8 def profile @profile end |
#property_id ⇒ String (readonly)
Returns the value of attribute property_id.
8 9 10 |
# File 'lib/analytics_ops/desired_state.rb', line 8 def property_id @property_id end |
#reports ⇒ Hash[String, Reports::Definition] (readonly)
Returns the value of attribute reports.
8 9 10 |
# File 'lib/analytics_ops/desired_state.rb', line 8 def reports @reports end |
#retention ⇒ record? (readonly)
Returns the value of attribute retention.
8 9 10 |
# File 'lib/analytics_ops/desired_state.rb', line 8 def retention @retention end |
#streams ⇒ Array[record] (readonly)
Returns the value of attribute streams.
8 9 10 |
# File 'lib/analytics_ops/desired_state.rb', line 8 def streams @streams end |
Instance Method Details
#to_h ⇒ record
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/analytics_ops/desired_state.rb', line 34 def to_h { "profile" => profile, "property_id" => property_id, "streams" => streams, "retention" => retention, "key_events" => key_events, "custom_dimensions" => custom_dimensions, "custom_metrics" => custom_metrics, "manual_requirements" => manual_requirements, "google_signals" => google_signals, "labels" => labels, "reports" => reports.transform_values(&:to_h), "health" => health, "funnels" => funnels.transform_values { |value| value.respond_to?(:to_h) ? value.to_h : value }, "bigquery" => bigquery, "governance" => governance } end |