Class: AnalyticsOps::Governance::AccessReport

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

Overview

Bounded aggregate report of Data API quota usage.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(property_id:, dimension_headers:, metric_headers:, rows:, row_count:, quota:) ⇒ AccessReport

Returns a new instance of AccessReport.



192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/analytics_ops/governance.rb', line 192

def initialize(property_id:, dimension_headers:, metric_headers:, rows:, row_count:, quota:)
  validate_property_id!(property_id)
  headers = validate_headers!(dimension_headers, metric_headers)
  validate_rows!(rows, headers)
  validate_summary!(rows, row_count, quota)

  @property_id = property_id.dup.freeze
  @dimension_headers = Canonical.immutable(dimension_headers)
  @metric_headers = Canonical.immutable(metric_headers)
  @rows = Canonical.immutable(rows)
  @row_count = row_count
  @quota = Canonical.immutable(quota)
  freeze
end

Instance Attribute Details

#dimension_headersArray[String] (readonly)

Returns the value of attribute dimension_headers.

Returns:

  • (Array[String])


190
191
192
# File 'lib/analytics_ops/governance.rb', line 190

def dimension_headers
  @dimension_headers
end

#metric_headersArray[String] (readonly)

Returns the value of attribute metric_headers.

Returns:

  • (Array[String])


190
191
192
# File 'lib/analytics_ops/governance.rb', line 190

def metric_headers
  @metric_headers
end

#property_idString (readonly)

Returns the value of attribute property_id.

Returns:

  • (String)


190
191
192
# File 'lib/analytics_ops/governance.rb', line 190

def property_id
  @property_id
end

#quotarecord (readonly)

Returns the value of attribute quota.

Returns:

  • (record)


190
191
192
# File 'lib/analytics_ops/governance.rb', line 190

def quota
  @quota
end

#row_countInteger (readonly)

Returns the value of attribute row_count.

Returns:

  • (Integer)


190
191
192
# File 'lib/analytics_ops/governance.rb', line 190

def row_count
  @row_count
end

#rowsArray[record] (readonly)

Returns the value of attribute rows.

Returns:

  • (Array[record])


190
191
192
# File 'lib/analytics_ops/governance.rb', line 190

def rows
  @rows
end

Instance Method Details

#to_hrecord

Returns:

  • (record)


207
208
209
210
211
212
213
214
215
216
217
# File 'lib/analytics_ops/governance.rb', line 207

def to_h
  {
    "experimental" => true,
    "property_id" => property_id,
    "dimension_headers" => dimension_headers,
    "metric_headers" => metric_headers,
    "rows" => rows,
    "row_count" => row_count,
    "quota" => quota
  }
end