smplkit 3.0.13 → 3.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/api_keys_api.rb +9 -0
  3. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/billing_api.rb +20 -2
  4. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/context_types_api.rb +9 -0
  5. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/context_values_api.rb +97 -0
  6. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/contexts_api.rb +16 -4
  7. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/environments_api.rb +9 -0
  8. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/invitations_api.rb +9 -0
  9. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/metrics_api.rb +27 -0
  10. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/plans_api.rb +9 -0
  11. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/products_api.rb +9 -0
  12. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/services_api.rb +9 -0
  13. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/users_api.rb +8 -17
  14. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/api_key_list_response.rb +30 -4
  15. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context.rb +12 -1
  16. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_list_response.rb +30 -4
  17. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_resource.rb +1 -1
  18. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_type_list_response.rb +30 -4
  19. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_value.rb +166 -0
  20. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_value_list_response.rb +193 -0
  21. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_value_resource.rb +225 -0
  22. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_list_response.rb +30 -4
  23. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation_list_response.rb +30 -4
  24. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invoice_list_response.rb +30 -4
  25. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{user_list_meta.rb → list_meta.rb} +20 -19
  26. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_list_response.rb +30 -4
  27. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_names_response.rb +30 -4
  28. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_rollup_list_response.rb +30 -4
  29. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{page_meta.rb → pagination_meta.rb} +43 -75
  30. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/payment_method_list_response.rb +30 -4
  31. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/plan_list_response.rb +30 -4
  32. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/product_list_response.rb +30 -4
  33. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/service_list_response.rb +30 -4
  34. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/user_list_response.rb +18 -1
  35. data/lib/smplkit/_generated/app/lib/smplkit_app_client.rb +6 -2
  36. data/lib/smplkit/_generated/app/spec/api/api_keys_api_spec.rb +3 -0
  37. data/lib/smplkit/_generated/app/spec/api/billing_api_spec.rb +7 -1
  38. data/lib/smplkit/_generated/app/spec/api/context_types_api_spec.rb +3 -0
  39. data/lib/smplkit/_generated/app/spec/api/context_values_api_spec.rb +52 -0
  40. data/lib/smplkit/_generated/app/spec/api/contexts_api_spec.rb +6 -2
  41. data/lib/smplkit/_generated/app/spec/api/environments_api_spec.rb +3 -0
  42. data/lib/smplkit/_generated/app/spec/api/invitations_api_spec.rb +3 -0
  43. data/lib/smplkit/_generated/app/spec/api/metrics_api_spec.rb +9 -0
  44. data/lib/smplkit/_generated/app/spec/api/plans_api_spec.rb +3 -0
  45. data/lib/smplkit/_generated/app/spec/api/products_api_spec.rb +3 -0
  46. data/lib/smplkit/_generated/app/spec/api/services_api_spec.rb +3 -0
  47. data/lib/smplkit/_generated/app/spec/api/users_api_spec.rb +3 -2
  48. data/lib/smplkit/_generated/app/spec/models/api_key_list_response_spec.rb +6 -0
  49. data/lib/smplkit/_generated/app/spec/models/context_list_response_spec.rb +6 -0
  50. data/lib/smplkit/_generated/app/spec/models/context_spec.rb +6 -0
  51. data/lib/smplkit/_generated/app/spec/models/context_type_list_response_spec.rb +6 -0
  52. data/lib/smplkit/_generated/app/spec/models/context_value_list_response_spec.rb +42 -0
  53. data/lib/smplkit/_generated/app/spec/models/context_value_resource_spec.rb +52 -0
  54. data/lib/smplkit/_generated/app/spec/models/{user_list_meta_spec.rb → context_value_spec.rb} +7 -7
  55. data/lib/smplkit/_generated/app/spec/models/environment_list_response_spec.rb +6 -0
  56. data/lib/smplkit/_generated/app/spec/models/invitation_list_response_spec.rb +6 -0
  57. data/lib/smplkit/_generated/app/spec/models/invoice_list_response_spec.rb +6 -0
  58. data/lib/smplkit/_generated/app/spec/models/list_meta_spec.rb +36 -0
  59. data/lib/smplkit/_generated/app/spec/models/metric_list_response_spec.rb +6 -0
  60. data/lib/smplkit/_generated/app/spec/models/metric_names_response_spec.rb +6 -0
  61. data/lib/smplkit/_generated/app/spec/models/metric_rollup_list_response_spec.rb +6 -0
  62. data/lib/smplkit/_generated/app/spec/models/{page_meta_spec.rb → pagination_meta_spec.rb} +9 -9
  63. data/lib/smplkit/_generated/app/spec/models/payment_method_list_response_spec.rb +6 -0
  64. data/lib/smplkit/_generated/app/spec/models/plan_list_response_spec.rb +6 -0
  65. data/lib/smplkit/_generated/app/spec/models/product_list_response_spec.rb +6 -0
  66. data/lib/smplkit/_generated/app/spec/models/service_list_response_spec.rb +6 -0
  67. metadata +13 -5
@@ -202,9 +202,10 @@ module SmplkitGeneratedClient::App
202
202
  # @option opts [String] :filter_account
203
203
  # @option opts [String] :filter_email
204
204
  # @option opts [String] :filter_search Case-insensitive substring match against display_name and email. If the value is a valid UUID, also matches user id exactly.
205
- # @option opts [Integer] :page_number 1-based page number (default to 1)
206
- # @option opts [Integer] :page_size Items per page (default to 50)
207
205
  # @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `email`. Allowed values: `created_at`, `-created_at`, `display_name`, `-display_name`, `email`, `-email`. (default to 'email')
206
+ # @option opts [Integer] :page_number 1-based page number to return. Optional; defaults to `1` when omitted. Must be `>= 1` — requests with a smaller value are rejected with a 400 error. (default to 1)
207
+ # @option opts [Integer] :page_size Number of items per page. Optional; defaults to `1000` when omitted. Must be between `1` and `1000` inclusive — requests outside that range are rejected with a 400 error. (default to 1000)
208
+ # @option opts [Boolean] :meta_total When `true`, the response's `meta.pagination` block includes `total` (the total number of matching items across all pages) and `total_pages`. Computing these requires an extra `COUNT` query, so omit (or pass `false`) when the totals are not needed. Defaults to `false`. (default to false)
208
209
  # @return [UserListResponse]
209
210
  def list_users(opts = {})
210
211
  data, _status_code, _headers = list_users_with_http_info(opts)
@@ -217,26 +218,15 @@ module SmplkitGeneratedClient::App
217
218
  # @option opts [String] :filter_account
218
219
  # @option opts [String] :filter_email
219
220
  # @option opts [String] :filter_search Case-insensitive substring match against display_name and email. If the value is a valid UUID, also matches user id exactly.
220
- # @option opts [Integer] :page_number 1-based page number (default to 1)
221
- # @option opts [Integer] :page_size Items per page (default to 50)
222
221
  # @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `email`. Allowed values: `created_at`, `-created_at`, `display_name`, `-display_name`, `email`, `-email`. (default to 'email')
222
+ # @option opts [Integer] :page_number 1-based page number to return. Optional; defaults to `1` when omitted. Must be `>= 1` — requests with a smaller value are rejected with a 400 error. (default to 1)
223
+ # @option opts [Integer] :page_size Number of items per page. Optional; defaults to `1000` when omitted. Must be between `1` and `1000` inclusive — requests outside that range are rejected with a 400 error. (default to 1000)
224
+ # @option opts [Boolean] :meta_total When `true`, the response's `meta.pagination` block includes `total` (the total number of matching items across all pages) and `total_pages`. Computing these requires an extra `COUNT` query, so omit (or pass `false`) when the totals are not needed. Defaults to `false`. (default to false)
223
225
  # @return [Array<(UserListResponse, Integer, Hash)>] UserListResponse data, response status code and response headers
224
226
  def list_users_with_http_info(opts = {})
225
227
  if @api_client.config.debugging
226
228
  @api_client.config.logger.debug 'Calling API: UsersApi.list_users ...'
227
229
  end
228
- if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 1
229
- fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling UsersApi.list_users, must be greater than or equal to 1.'
230
- end
231
-
232
- if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 200
233
- fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling UsersApi.list_users, must be smaller than or equal to 200.'
234
- end
235
-
236
- if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
237
- fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling UsersApi.list_users, must be greater than or equal to 1.'
238
- end
239
-
240
230
  allowable_values = ["created_at", "-created_at", "display_name", "-display_name", "email", "-email"]
241
231
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
242
232
  fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
@@ -249,9 +239,10 @@ module SmplkitGeneratedClient::App
249
239
  query_params[:'filter[account]'] = opts[:'filter_account'] if !opts[:'filter_account'].nil?
250
240
  query_params[:'filter[email]'] = opts[:'filter_email'] if !opts[:'filter_email'].nil?
251
241
  query_params[:'filter[search]'] = opts[:'filter_search'] if !opts[:'filter_search'].nil?
242
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
252
243
  query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
253
244
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
254
- query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
245
+ query_params[:'meta[total]'] = opts[:'meta_total'] if !opts[:'meta_total'].nil?
255
246
 
256
247
  # header parameters
257
248
  header_params = opts[:header_params] || {}
@@ -18,10 +18,13 @@ module SmplkitGeneratedClient::App
18
18
  class ApiKeyListResponse < ApiModelBase
19
19
  attr_accessor :data
20
20
 
21
+ attr_accessor :meta
22
+
21
23
  # Attribute mapping from ruby-style variable name to JSON key.
22
24
  def self.attribute_map
23
25
  {
24
- :'data' => :'data'
26
+ :'data' => :'data',
27
+ :'meta' => :'meta'
25
28
  }
26
29
  end
27
30
 
@@ -38,7 +41,8 @@ module SmplkitGeneratedClient::App
38
41
  # Attribute type mapping.
39
42
  def self.openapi_types
40
43
  {
41
- :'data' => :'Array<ApiKeyResource>'
44
+ :'data' => :'Array<ApiKeyResource>',
45
+ :'meta' => :'ListMeta'
42
46
  }
43
47
  end
44
48
 
@@ -71,6 +75,12 @@ module SmplkitGeneratedClient::App
71
75
  else
72
76
  self.data = nil
73
77
  end
78
+
79
+ if attributes.key?(:'meta')
80
+ self.meta = attributes[:'meta']
81
+ else
82
+ self.meta = nil
83
+ end
74
84
  end
75
85
 
76
86
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -82,6 +92,10 @@ module SmplkitGeneratedClient::App
82
92
  invalid_properties.push('invalid value for "data", data cannot be nil.')
83
93
  end
84
94
 
95
+ if @meta.nil?
96
+ invalid_properties.push('invalid value for "meta", meta cannot be nil.')
97
+ end
98
+
85
99
  invalid_properties
86
100
  end
87
101
 
@@ -90,6 +104,7 @@ module SmplkitGeneratedClient::App
90
104
  def valid?
91
105
  warn '[DEPRECATED] the `valid?` method is obsolete'
92
106
  return false if @data.nil?
107
+ return false if @meta.nil?
93
108
  true
94
109
  end
95
110
 
@@ -103,12 +118,23 @@ module SmplkitGeneratedClient::App
103
118
  @data = data
104
119
  end
105
120
 
121
+ # Custom attribute writer method with validation
122
+ # @param [Object] meta Value to be assigned
123
+ def meta=(meta)
124
+ if meta.nil?
125
+ fail ArgumentError, 'meta cannot be nil'
126
+ end
127
+
128
+ @meta = meta
129
+ end
130
+
106
131
  # Checks equality by comparing each attribute.
107
132
  # @param [Object] Object to be compared
108
133
  def ==(o)
109
134
  return true if self.equal?(o)
110
135
  self.class == o.class &&
111
- data == o.data
136
+ data == o.data &&
137
+ meta == o.meta
112
138
  end
113
139
 
114
140
  # @see the `==` method
@@ -120,7 +146,7 @@ module SmplkitGeneratedClient::App
120
146
  # Calculates hash code according to all attributes.
121
147
  # @return [Integer] Hash code
122
148
  def hash
123
- [data].hash
149
+ [data, meta].hash
124
150
  end
125
151
 
126
152
  # Builds the object from hash
@@ -16,6 +16,9 @@ require 'time'
16
16
  module SmplkitGeneratedClient::App
17
17
  # A specific instance of a context type — for example, a particular user, account, or device — together with the attributes observed on it. Context instances are addressed by a composite identifier of the form `context_type:key` (e.g. `user:alice-123`).
18
18
  class Context < ApiModelBase
19
+ # Entity identifier within the context type (e.g. `alice-123`). Together with `context_type` it forms the composite `id` `context_type:key`. Always populated in responses; declared optional only so SDK consumers can construct a draft Context without a key. Set by the bulk-register API; not editable.
20
+ attr_accessor :key
21
+
19
22
  # Human-readable display name for the context instance.
20
23
  attr_accessor :name
21
24
 
@@ -34,6 +37,7 @@ module SmplkitGeneratedClient::App
34
37
  # Attribute mapping from ruby-style variable name to JSON key.
35
38
  def self.attribute_map
36
39
  {
40
+ :'key' => :'key',
37
41
  :'name' => :'name',
38
42
  :'context_type' => :'context_type',
39
43
  :'attributes' => :'attributes',
@@ -55,6 +59,7 @@ module SmplkitGeneratedClient::App
55
59
  # Attribute type mapping.
56
60
  def self.openapi_types
57
61
  {
62
+ :'key' => :'String',
58
63
  :'name' => :'String',
59
64
  :'context_type' => :'String',
60
65
  :'attributes' => :'Hash<String, Object>',
@@ -66,6 +71,7 @@ module SmplkitGeneratedClient::App
66
71
  # List of attributes with nullable: true
67
72
  def self.openapi_nullable
68
73
  Set.new([
74
+ :'key',
69
75
  :'name',
70
76
  :'created_at',
71
77
  :'updated_at'
@@ -88,6 +94,10 @@ module SmplkitGeneratedClient::App
88
94
  h[k.to_sym] = v
89
95
  }
90
96
 
97
+ if attributes.key?(:'key')
98
+ self.key = attributes[:'key']
99
+ end
100
+
91
101
  if attributes.key?(:'name')
92
102
  self.name = attributes[:'name']
93
103
  end
@@ -148,6 +158,7 @@ module SmplkitGeneratedClient::App
148
158
  def ==(o)
149
159
  return true if self.equal?(o)
150
160
  self.class == o.class &&
161
+ key == o.key &&
151
162
  name == o.name &&
152
163
  context_type == o.context_type &&
153
164
  attributes == o.attributes &&
@@ -164,7 +175,7 @@ module SmplkitGeneratedClient::App
164
175
  # Calculates hash code according to all attributes.
165
176
  # @return [Integer] Hash code
166
177
  def hash
167
- [name, context_type, attributes, created_at, updated_at].hash
178
+ [key, name, context_type, attributes, created_at, updated_at].hash
168
179
  end
169
180
 
170
181
  # Builds the object from hash
@@ -18,10 +18,13 @@ module SmplkitGeneratedClient::App
18
18
  class ContextListResponse < ApiModelBase
19
19
  attr_accessor :data
20
20
 
21
+ attr_accessor :meta
22
+
21
23
  # Attribute mapping from ruby-style variable name to JSON key.
22
24
  def self.attribute_map
23
25
  {
24
- :'data' => :'data'
26
+ :'data' => :'data',
27
+ :'meta' => :'meta'
25
28
  }
26
29
  end
27
30
 
@@ -38,7 +41,8 @@ module SmplkitGeneratedClient::App
38
41
  # Attribute type mapping.
39
42
  def self.openapi_types
40
43
  {
41
- :'data' => :'Array<ContextResource>'
44
+ :'data' => :'Array<ContextResource>',
45
+ :'meta' => :'ListMeta'
42
46
  }
43
47
  end
44
48
 
@@ -71,6 +75,12 @@ module SmplkitGeneratedClient::App
71
75
  else
72
76
  self.data = nil
73
77
  end
78
+
79
+ if attributes.key?(:'meta')
80
+ self.meta = attributes[:'meta']
81
+ else
82
+ self.meta = nil
83
+ end
74
84
  end
75
85
 
76
86
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -82,6 +92,10 @@ module SmplkitGeneratedClient::App
82
92
  invalid_properties.push('invalid value for "data", data cannot be nil.')
83
93
  end
84
94
 
95
+ if @meta.nil?
96
+ invalid_properties.push('invalid value for "meta", meta cannot be nil.')
97
+ end
98
+
85
99
  invalid_properties
86
100
  end
87
101
 
@@ -90,6 +104,7 @@ module SmplkitGeneratedClient::App
90
104
  def valid?
91
105
  warn '[DEPRECATED] the `valid?` method is obsolete'
92
106
  return false if @data.nil?
107
+ return false if @meta.nil?
93
108
  true
94
109
  end
95
110
 
@@ -103,12 +118,23 @@ module SmplkitGeneratedClient::App
103
118
  @data = data
104
119
  end
105
120
 
121
+ # Custom attribute writer method with validation
122
+ # @param [Object] meta Value to be assigned
123
+ def meta=(meta)
124
+ if meta.nil?
125
+ fail ArgumentError, 'meta cannot be nil'
126
+ end
127
+
128
+ @meta = meta
129
+ end
130
+
106
131
  # Checks equality by comparing each attribute.
107
132
  # @param [Object] Object to be compared
108
133
  def ==(o)
109
134
  return true if self.equal?(o)
110
135
  self.class == o.class &&
111
- data == o.data
136
+ data == o.data &&
137
+ meta == o.meta
112
138
  end
113
139
 
114
140
  # @see the `==` method
@@ -120,7 +146,7 @@ module SmplkitGeneratedClient::App
120
146
  # Calculates hash code according to all attributes.
121
147
  # @return [Integer] Hash code
122
148
  def hash
123
- [data].hash
149
+ [data, meta].hash
124
150
  end
125
151
 
126
152
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::App
17
- # JSON:API resource envelope for a context instance. `id` is the composite identifier `context_type:key`. It must not be specified for create requests (the server assigns it).
17
+ # JSON:API resource envelope for a context instance. `id` is the composite identifier `context_type:key` (e.g. `user:alice-123`).
18
18
  class ContextResource < ApiModelBase
19
19
  attr_accessor :id
20
20
 
@@ -18,10 +18,13 @@ module SmplkitGeneratedClient::App
18
18
  class ContextTypeListResponse < ApiModelBase
19
19
  attr_accessor :data
20
20
 
21
+ attr_accessor :meta
22
+
21
23
  # Attribute mapping from ruby-style variable name to JSON key.
22
24
  def self.attribute_map
23
25
  {
24
- :'data' => :'data'
26
+ :'data' => :'data',
27
+ :'meta' => :'meta'
25
28
  }
26
29
  end
27
30
 
@@ -38,7 +41,8 @@ module SmplkitGeneratedClient::App
38
41
  # Attribute type mapping.
39
42
  def self.openapi_types
40
43
  {
41
- :'data' => :'Array<ContextTypeResource>'
44
+ :'data' => :'Array<ContextTypeResource>',
45
+ :'meta' => :'ListMeta'
42
46
  }
43
47
  end
44
48
 
@@ -71,6 +75,12 @@ module SmplkitGeneratedClient::App
71
75
  else
72
76
  self.data = nil
73
77
  end
78
+
79
+ if attributes.key?(:'meta')
80
+ self.meta = attributes[:'meta']
81
+ else
82
+ self.meta = nil
83
+ end
74
84
  end
75
85
 
76
86
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -82,6 +92,10 @@ module SmplkitGeneratedClient::App
82
92
  invalid_properties.push('invalid value for "data", data cannot be nil.')
83
93
  end
84
94
 
95
+ if @meta.nil?
96
+ invalid_properties.push('invalid value for "meta", meta cannot be nil.')
97
+ end
98
+
85
99
  invalid_properties
86
100
  end
87
101
 
@@ -90,6 +104,7 @@ module SmplkitGeneratedClient::App
90
104
  def valid?
91
105
  warn '[DEPRECATED] the `valid?` method is obsolete'
92
106
  return false if @data.nil?
107
+ return false if @meta.nil?
93
108
  true
94
109
  end
95
110
 
@@ -103,12 +118,23 @@ module SmplkitGeneratedClient::App
103
118
  @data = data
104
119
  end
105
120
 
121
+ # Custom attribute writer method with validation
122
+ # @param [Object] meta Value to be assigned
123
+ def meta=(meta)
124
+ if meta.nil?
125
+ fail ArgumentError, 'meta cannot be nil'
126
+ end
127
+
128
+ @meta = meta
129
+ end
130
+
106
131
  # Checks equality by comparing each attribute.
107
132
  # @param [Object] Object to be compared
108
133
  def ==(o)
109
134
  return true if self.equal?(o)
110
135
  self.class == o.class &&
111
- data == o.data
136
+ data == o.data &&
137
+ meta == o.meta
112
138
  end
113
139
 
114
140
  # @see the `==` method
@@ -120,7 +146,7 @@ module SmplkitGeneratedClient::App
120
146
  # Calculates hash code according to all attributes.
121
147
  # @return [Integer] Hash code
122
148
  def hash
123
- [data].hash
149
+ [data, meta].hash
124
150
  end
125
151
 
126
152
  # Builds the object from hash
@@ -0,0 +1,166 @@
1
+ =begin
2
+ #smplkit API
3
+
4
+ #API for the smplkit platform.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SmplkitGeneratedClient::App
17
+ # A single distinct attribute value observed across context instances. Returned by `GET /api/v1/context_values` to power typeahead pickers in rule-building UIs. The set of values reflects what has been registered via the bulk-context endpoint — it is observational, not a customer- declared enumeration.
18
+ class ContextValue < ApiModelBase
19
+ # The distinct attribute value as it appears on at least one context instance of the requested type.
20
+ attr_accessor :value
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'value' => :'value'
26
+ }
27
+ end
28
+
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ acceptable_attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'value' => :'String'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::ContextValue` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::ContextValue`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'value')
69
+ self.value = attributes[:'value']
70
+ else
71
+ self.value = nil
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
+ invalid_properties = Array.new
80
+ if @value.nil?
81
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
82
+ end
83
+
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ return false if @value.nil?
92
+ true
93
+ end
94
+
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] value Value to be assigned
97
+ def value=(value)
98
+ if value.nil?
99
+ fail ArgumentError, 'value cannot be nil'
100
+ end
101
+
102
+ @value = value
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ value == o.value
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [value].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Returns the object in the form of hash
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_hash
151
+ hash = {}
152
+ self.class.attribute_map.each_pair do |attr, param|
153
+ value = self.send(attr)
154
+ if value.nil?
155
+ is_nullable = self.class.openapi_nullable.include?(attr)
156
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
157
+ end
158
+
159
+ hash[param] = _to_hash(value)
160
+ end
161
+ hash
162
+ end
163
+
164
+ end
165
+
166
+ end