Class: AnalyticsOps::Governance::Snapshot

Inherits:
Object
  • Object
show all
Defined in:
lib/analytics_ops/governance.rb,
sig/analytics_ops.rbs

Overview

Immutable snapshot of experimental governance resources for one property.

Constant Summary collapse

MAX_RESOURCES =
10_000

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(property_id:, stream_settings:, reporting_identity:, attribution:, channel_groups:, calculated_metrics:, event_create_rules:, event_edit_rules:, bigquery_links:) ⇒ Snapshot

Returns a new instance of Snapshot.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/analytics_ops/governance.rb', line 19

def initialize(property_id:, stream_settings:, reporting_identity:, attribution:,
               channel_groups:, calculated_metrics:, event_create_rules:,
               event_edit_rules:, bigquery_links:)
  validate_property_id!(property_id)
  validate_streams!(property_id, stream_settings)
  validate_resources!(
    reporting_identity,
    attribution,
    channel_groups,
    calculated_metrics,
    event_create_rules,
    event_edit_rules,
    bigquery_links
  )

  @property_id = property_id.dup.freeze
  @stream_settings = stream_settings.dup.freeze
  @reporting_identity = Canonical.immutable(reporting_identity)
  @attribution = Canonical.immutable(attribution)
  @channel_groups = Canonical.immutable(channel_groups)
  @calculated_metrics = Canonical.immutable(calculated_metrics)
  @event_create_rules = Canonical.immutable(event_create_rules)
  @event_edit_rules = Canonical.immutable(event_edit_rules)
  @bigquery_links = Canonical.immutable(bigquery_links)
  freeze
end

Instance Attribute Details

#attributionrecord (readonly)

Returns the value of attribute attribution.

Returns:

  • (record)


15
16
17
# File 'lib/analytics_ops/governance.rb', line 15

def attribution
  @attribution
end

Returns the value of attribute bigquery_links.

Returns:

  • (Array[record])


15
16
17
# File 'lib/analytics_ops/governance.rb', line 15

def bigquery_links
  @bigquery_links
end

#calculated_metricsArray[record] (readonly)

Returns the value of attribute calculated_metrics.

Returns:

  • (Array[record])


15
16
17
# File 'lib/analytics_ops/governance.rb', line 15

def calculated_metrics
  @calculated_metrics
end

#channel_groupsArray[record] (readonly)

Returns the value of attribute channel_groups.

Returns:

  • (Array[record])


15
16
17
# File 'lib/analytics_ops/governance.rb', line 15

def channel_groups
  @channel_groups
end

#event_create_rulesArray[record] (readonly)

Returns the value of attribute event_create_rules.

Returns:

  • (Array[record])


15
16
17
# File 'lib/analytics_ops/governance.rb', line 15

def event_create_rules
  @event_create_rules
end

#event_edit_rulesArray[record] (readonly)

Returns the value of attribute event_edit_rules.

Returns:

  • (Array[record])


15
16
17
# File 'lib/analytics_ops/governance.rb', line 15

def event_edit_rules
  @event_edit_rules
end

#property_idString (readonly)

Returns the value of attribute property_id.

Returns:

  • (String)


15
16
17
# File 'lib/analytics_ops/governance.rb', line 15

def property_id
  @property_id
end

#reporting_identityrecord (readonly)

Returns the value of attribute reporting_identity.

Returns:

  • (record)


15
16
17
# File 'lib/analytics_ops/governance.rb', line 15

def reporting_identity
  @reporting_identity
end

#stream_settingsArray[StreamSettings] (readonly)

Returns the value of attribute stream_settings.

Returns:



15
16
17
# File 'lib/analytics_ops/governance.rb', line 15

def stream_settings
  @stream_settings
end

Instance Method Details

#to_hrecord

Returns:

  • (record)


46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/analytics_ops/governance.rb', line 46

def to_h
  {
    "property_id" => property_id,
    "stream_settings" => stream_settings.map(&:to_h),
    "reporting_identity" => reporting_identity,
    "attribution" => attribution,
    "channel_groups" => channel_groups,
    "calculated_metrics" => calculated_metrics,
    "event_create_rules" => event_create_rules,
    "event_edit_rules" => event_edit_rules,
    "bigquery_links" => bigquery_links
  }
end