Class: ApiReference::LicenseUsageQueryParams
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ApiReference::LicenseUsageQueryParams
- Defined in:
- lib/api_reference/models/license_usage_query_params.rb
Overview
Base query parameters for license usage endpoints. Contains common parameters like date range, grouping, and pagination.
Instance Attribute Summary collapse
-
#cursor ⇒ String
Pagination cursor from a previous request.
-
#end_date ⇒ Date
End date for the usage period (YYYY-MM-DD).
-
#group_by ⇒ String
How to group the results.
-
#limit ⇒ Integer
Maximum number of rows in the response data (default 20, max 100).
-
#start_date ⇒ Date
Start date for the usage period (YYYY-MM-DD).
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(start_date: SKIP, end_date: SKIP, group_by: SKIP, cursor: SKIP, limit: 20) ⇒ LicenseUsageQueryParams
constructor
A new instance of LicenseUsageQueryParams.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(start_date: SKIP, end_date: SKIP, group_by: SKIP, cursor: SKIP, limit: 20) ⇒ LicenseUsageQueryParams
Returns a new instance of LicenseUsageQueryParams.
68 69 70 71 72 73 74 75 |
# File 'lib/api_reference/models/license_usage_query_params.rb', line 68 def initialize(start_date: SKIP, end_date: SKIP, group_by: SKIP, cursor: SKIP, limit: 20) @start_date = start_date unless start_date == SKIP @end_date = end_date unless end_date == SKIP @group_by = group_by unless group_by == SKIP @cursor = cursor unless cursor == SKIP @limit = limit unless limit == SKIP end |
Instance Attribute Details
#cursor ⇒ String
Pagination cursor from a previous request.
30 31 32 |
# File 'lib/api_reference/models/license_usage_query_params.rb', line 30 def cursor @cursor end |
#end_date ⇒ Date
End date for the usage period (YYYY-MM-DD). Defaults to end of current billing period.
21 22 23 |
# File 'lib/api_reference/models/license_usage_query_params.rb', line 21 def end_date @end_date end |
#group_by ⇒ String
How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., 'license,day').
26 27 28 |
# File 'lib/api_reference/models/license_usage_query_params.rb', line 26 def group_by @group_by end |
#limit ⇒ Integer
Maximum number of rows in the response data (default 20, max 100).
34 35 36 |
# File 'lib/api_reference/models/license_usage_query_params.rb', line 34 def limit @limit end |
#start_date ⇒ Date
Start date for the usage period (YYYY-MM-DD). Defaults to start of current billing period.
16 17 18 |
# File 'lib/api_reference/models/license_usage_query_params.rb', line 16 def start_date @start_date end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/api_reference/models/license_usage_query_params.rb', line 78 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. start_date = hash.key?('start_date') ? hash['start_date'] : SKIP end_date = hash.key?('end_date') ? hash['end_date'] : SKIP group_by = hash.key?('group_by') ? hash['group_by'] : SKIP cursor = hash.key?('cursor') ? hash['cursor'] : SKIP limit = hash['limit'] ||= 20 # Create object from extracted values. LicenseUsageQueryParams.new(start_date: start_date, end_date: end_date, group_by: group_by, cursor: cursor, limit: limit) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 |
# File 'lib/api_reference/models/license_usage_query_params.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['start_date'] = 'start_date' @_hash['end_date'] = 'end_date' @_hash['group_by'] = 'group_by' @_hash['cursor'] = 'cursor' @_hash['limit'] = 'limit' @_hash end |
.nullables ⇒ Object
An array for nullable fields
59 60 61 62 63 64 65 66 |
# File 'lib/api_reference/models/license_usage_query_params.rb', line 59 def self.nullables %w[ start_date end_date group_by cursor ] end |
.optionals ⇒ Object
An array for optional fields
48 49 50 51 52 53 54 55 56 |
# File 'lib/api_reference/models/license_usage_query_params.rb', line 48 def self.optionals %w[ start_date end_date group_by cursor limit ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
104 105 106 107 108 |
# File 'lib/api_reference/models/license_usage_query_params.rb', line 104 def inspect class_name = self.class.name.split('::').last "<#{class_name} start_date: #{@start_date.inspect}, end_date: #{@end_date.inspect},"\ " group_by: #{@group_by.inspect}, cursor: #{@cursor.inspect}, limit: #{@limit.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
97 98 99 100 101 |
# File 'lib/api_reference/models/license_usage_query_params.rb', line 97 def to_s class_name = self.class.name.split('::').last "<#{class_name} start_date: #{@start_date}, end_date: #{@end_date}, group_by: #{@group_by},"\ " cursor: #{@cursor}, limit: #{@limit}>" end |