Class: Stigg::Models::V1::UsageReportResponse::Data

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/stigg/models/v1/usage_report_response.rb

Defined Under Namespace

Classes: Credit

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id:, created_at:, customer_id:, feature_id:, timestamp:, value:, credit: nil, current_usage: nil, next_reset_date: nil, resource_id: nil, usage_period_end: nil, usage_period_start: nil) ⇒ Object

Some parameter documentations has been truncated, see Stigg::Models::V1::UsageReportResponse::Data for more details.

Recorded usage with period info

Parameters:

  • id (String)

    Unique identifier for the entity

  • created_at (Time)

    Timestamp of when the record was created

  • customer_id (String)

    Customer id

  • feature_id (String)

    Feature id

  • timestamp (Time)

    Timestamp

  • value (Integer)

    The usage measurement record

  • credit (Stigg::Models::V1::UsageReportResponse::Data::Credit, nil) (defaults to: nil)

    Optimistic credit balance for a credit-backed feature

  • current_usage (Float, nil) (defaults to: nil)

    The current measured usage value

  • next_reset_date (Time, nil) (defaults to: nil)

    The date when the next usage reset will occur

  • resource_id (String, nil) (defaults to: nil)

    Resource id

  • usage_period_end (Time, nil) (defaults to: nil)

    The end date of the usage period in which this measurement resides (for entitlem

  • usage_period_start (Time, nil) (defaults to: nil)

    The start date of the usage period in which this measurement resides (for entitl



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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/stigg/models/v1/usage_report_response.rb', line 20

class Data < Stigg::Internal::Type::BaseModel
  # @!attribute id
  #   Unique identifier for the entity
  #
  #   @return [String]
  required :id, String

  # @!attribute created_at
  #   Timestamp of when the record was created
  #
  #   @return [Time]
  required :created_at, Time, api_name: :createdAt

  # @!attribute customer_id
  #   Customer id
  #
  #   @return [String]
  required :customer_id, String, api_name: :customerId

  # @!attribute feature_id
  #   Feature id
  #
  #   @return [String]
  required :feature_id, String, api_name: :featureId

  # @!attribute timestamp
  #   Timestamp
  #
  #   @return [Time]
  required :timestamp, Time

  # @!attribute value
  #   The usage measurement record
  #
  #   @return [Integer]
  required :value, Integer

  # @!attribute credit
  #   Optimistic credit balance for a credit-backed feature
  #
  #   @return [Stigg::Models::V1::UsageReportResponse::Data::Credit, nil]
  optional :credit, -> { Stigg::Models::V1::UsageReportResponse::Data::Credit }, nil?: true

  # @!attribute current_usage
  #   The current measured usage value
  #
  #   @return [Float, nil]
  optional :current_usage, Float, api_name: :currentUsage, nil?: true

  # @!attribute next_reset_date
  #   The date when the next usage reset will occur
  #
  #   @return [Time, nil]
  optional :next_reset_date, Time, api_name: :nextResetDate, nil?: true

  # @!attribute resource_id
  #   Resource id
  #
  #   @return [String, nil]
  optional :resource_id, String, api_name: :resourceId, nil?: true

  # @!attribute usage_period_end
  #   The end date of the usage period in which this measurement resides (for
  #   entitlements with a reset period)
  #
  #   @return [Time, nil]
  optional :usage_period_end, Time, api_name: :usagePeriodEnd, nil?: true

  # @!attribute usage_period_start
  #   The start date of the usage period in which this measurement resides (for
  #   entitlements with a reset period)
  #
  #   @return [Time, nil]
  optional :usage_period_start, Time, api_name: :usagePeriodStart, nil?: true

  # @!method initialize(id:, created_at:, customer_id:, feature_id:, timestamp:, value:, credit: nil, current_usage: nil, next_reset_date: nil, resource_id: nil, usage_period_end: nil, usage_period_start: nil)
  #   Some parameter documentations has been truncated, see
  #   {Stigg::Models::V1::UsageReportResponse::Data} for more details.
  #
  #   Recorded usage with period info
  #
  #   @param id [String] Unique identifier for the entity
  #
  #   @param created_at [Time] Timestamp of when the record was created
  #
  #   @param customer_id [String] Customer id
  #
  #   @param feature_id [String] Feature id
  #
  #   @param timestamp [Time] Timestamp
  #
  #   @param value [Integer] The usage measurement record
  #
  #   @param credit [Stigg::Models::V1::UsageReportResponse::Data::Credit, nil] Optimistic credit balance for a credit-backed feature
  #
  #   @param current_usage [Float, nil] The current measured usage value
  #
  #   @param next_reset_date [Time, nil] The date when the next usage reset will occur
  #
  #   @param resource_id [String, nil] Resource id
  #
  #   @param usage_period_end [Time, nil] The end date of the usage period in which this measurement resides (for entitlem
  #
  #   @param usage_period_start [Time, nil] The start date of the usage period in which this measurement resides (for entitl

  # @see Stigg::Models::V1::UsageReportResponse::Data#credit
  class Credit < Stigg::Internal::Type::BaseModel
    # @!attribute currency_id
    #   The credit currency identifier
    #
    #   @return [String]
    required :currency_id, String, api_name: :currencyId

    # @!attribute current_usage
    #   The credits consumed (optimistic — includes not-yet-reconciled usage)
    #
    #   @return [Float]
    required :current_usage, Float, api_name: :currentUsage

    # @!attribute timestamp
    #   The grant-version timestamp of this balance, used by the SDK for last-write-wins
    #   reconciliation
    #
    #   @return [Time]
    required :timestamp, Time

    # @!attribute usage_limit
    #   The total credits granted
    #
    #   @return [Float]
    required :usage_limit, Float, api_name: :usageLimit

    # @!method initialize(currency_id:, current_usage:, timestamp:, usage_limit:)
    #   Some parameter documentations has been truncated, see
    #   {Stigg::Models::V1::UsageReportResponse::Data::Credit} for more details.
    #
    #   Optimistic credit balance for a credit-backed feature
    #
    #   @param currency_id [String] The credit currency identifier
    #
    #   @param current_usage [Float] The credits consumed (optimistic — includes not-yet-reconciled usage)
    #
    #   @param timestamp [Time] The grant-version timestamp of this balance, used by the SDK for last-write-wins
    #
    #   @param usage_limit [Float] The total credits granted
  end
end

Instance Attribute Details

#created_atTime

Timestamp of when the record was created

Returns:

  • (Time)


31
# File 'lib/stigg/models/v1/usage_report_response.rb', line 31

required :created_at, Time, api_name: :createdAt

#creditStigg::Models::V1::UsageReportResponse::Data::Credit?

Optimistic credit balance for a credit-backed feature



61
# File 'lib/stigg/models/v1/usage_report_response.rb', line 61

optional :credit, -> { Stigg::Models::V1::UsageReportResponse::Data::Credit }, nil?: true

#current_usageFloat?

The current measured usage value

Returns:

  • (Float, nil)


67
# File 'lib/stigg/models/v1/usage_report_response.rb', line 67

optional :current_usage, Float, api_name: :currentUsage, nil?: true

#customer_idString

Customer id

Returns:

  • (String)


37
# File 'lib/stigg/models/v1/usage_report_response.rb', line 37

required :customer_id, String, api_name: :customerId

#feature_idString

Feature id

Returns:

  • (String)


43
# File 'lib/stigg/models/v1/usage_report_response.rb', line 43

required :feature_id, String, api_name: :featureId

#idString

Unique identifier for the entity

Returns:

  • (String)


25
# File 'lib/stigg/models/v1/usage_report_response.rb', line 25

required :id, String

#next_reset_dateTime?

The date when the next usage reset will occur

Returns:

  • (Time, nil)


73
# File 'lib/stigg/models/v1/usage_report_response.rb', line 73

optional :next_reset_date, Time, api_name: :nextResetDate, nil?: true

#resource_idString?

Resource id

Returns:

  • (String, nil)


79
# File 'lib/stigg/models/v1/usage_report_response.rb', line 79

optional :resource_id, String, api_name: :resourceId, nil?: true

#timestampTime

Timestamp

Returns:

  • (Time)


49
# File 'lib/stigg/models/v1/usage_report_response.rb', line 49

required :timestamp, Time

#usage_period_endTime?

The end date of the usage period in which this measurement resides (for entitlements with a reset period)

Returns:

  • (Time, nil)


86
# File 'lib/stigg/models/v1/usage_report_response.rb', line 86

optional :usage_period_end, Time, api_name: :usagePeriodEnd, nil?: true

#usage_period_startTime?

The start date of the usage period in which this measurement resides (for entitlements with a reset period)

Returns:

  • (Time, nil)


93
# File 'lib/stigg/models/v1/usage_report_response.rb', line 93

optional :usage_period_start, Time, api_name: :usagePeriodStart, nil?: true

#valueInteger

The usage measurement record

Returns:

  • (Integer)


55
# File 'lib/stigg/models/v1/usage_report_response.rb', line 55

required :value, Integer