smplkit 2.0.3 → 2.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30020aa708d634ffe321a30d974c3f7963eedb3f0c02008d37989bd956a8cefe
4
- data.tar.gz: bee093803b8614ab3d36753f59b99ddbc10b012ccd0718f4fdf7b28e1b322baa
3
+ metadata.gz: 11737e77b9c137965fcfb0f98d42cca4180131afd974aaa4d7b7107813dbc709
4
+ data.tar.gz: bf468bfdf381a811581a9a7dabd03aaec863bf37e77a13e7788128179987d430
5
5
  SHA512:
6
- metadata.gz: '0397940b7bfab7871f4f8c9e7e108ba16d82f4f2b7aa444af185a8caa9d095d183e3f7ae011d0e8b45a6d363d3188dcc832cb7268b7ee2f68dbda4a44b548135'
7
- data.tar.gz: 356964cbc4b413c5e836866fabb98b335d0c2d8bc4ecbb6f61949a641297bc2b4aa326c52c838e82a075288b57540fd4f56d874dffae923dde261e888a054fbc
6
+ metadata.gz: 4956121ef13bc54257048233a7adcb8a35b7d7d8bcfd82e86eecf4776334c33dcfb30cd12dc486d9df0165d493863a4eaa61df0123a6f926d3f2018dff80fe5c
7
+ data.tar.gz: b6522291313374b8315de8d9883db6af3cdbf1a6d31dee45f2f49aea9c6c7d03b74e309481ffe1adf5f85fdd0cec8244d4c7114ff188ff70be8c3ea7a5f38d66
@@ -0,0 +1,217 @@
1
+ =begin
2
+ #smplkit Audit API
3
+
4
+ #Append-only change-history substrate for smpl.* resources and customer-application events. ADR-047.
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::Audit
17
+ # Attribute set for a usage resource. The shape mirrors the ``/api/v1/usage`` contract used by config, flags, and logging — three fields, no per-product extras. Per-period limits live in the product catalog (``GET /api/v1/products``); the usage endpoint reports counts only.
18
+ class UsageAttributes < ApiModelBase
19
+ attr_accessor :limit_key
20
+
21
+ attr_accessor :period
22
+
23
+ attr_accessor :value
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'limit_key' => :'limit_key',
29
+ :'period' => :'period',
30
+ :'value' => :'value'
31
+ }
32
+ end
33
+
34
+ # Returns attribute mapping this model knows about
35
+ def self.acceptable_attribute_map
36
+ attribute_map
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ acceptable_attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'limit_key' => :'String',
48
+ :'period' => :'String',
49
+ :'value' => :'Integer'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::UsageAttributes` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ acceptable_attribute_map = self.class.acceptable_attribute_map
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!acceptable_attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::UsageAttributes`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'limit_key')
76
+ self.limit_key = attributes[:'limit_key']
77
+ else
78
+ self.limit_key = nil
79
+ end
80
+
81
+ if attributes.key?(:'period')
82
+ self.period = attributes[:'period']
83
+ else
84
+ self.period = nil
85
+ end
86
+
87
+ if attributes.key?(:'value')
88
+ self.value = attributes[:'value']
89
+ else
90
+ self.value = nil
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
98
+ invalid_properties = Array.new
99
+ if @limit_key.nil?
100
+ invalid_properties.push('invalid value for "limit_key", limit_key cannot be nil.')
101
+ end
102
+
103
+ if @period.nil?
104
+ invalid_properties.push('invalid value for "period", period cannot be nil.')
105
+ end
106
+
107
+ if @value.nil?
108
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
109
+ end
110
+
111
+ invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ warn '[DEPRECATED] the `valid?` method is obsolete'
118
+ return false if @limit_key.nil?
119
+ return false if @period.nil?
120
+ return false if @value.nil?
121
+ true
122
+ end
123
+
124
+ # Custom attribute writer method with validation
125
+ # @param [Object] limit_key Value to be assigned
126
+ def limit_key=(limit_key)
127
+ if limit_key.nil?
128
+ fail ArgumentError, 'limit_key cannot be nil'
129
+ end
130
+
131
+ @limit_key = limit_key
132
+ end
133
+
134
+ # Custom attribute writer method with validation
135
+ # @param [Object] period Value to be assigned
136
+ def period=(period)
137
+ if period.nil?
138
+ fail ArgumentError, 'period cannot be nil'
139
+ end
140
+
141
+ @period = period
142
+ end
143
+
144
+ # Custom attribute writer method with validation
145
+ # @param [Object] value Value to be assigned
146
+ def value=(value)
147
+ if value.nil?
148
+ fail ArgumentError, 'value cannot be nil'
149
+ end
150
+
151
+ @value = value
152
+ end
153
+
154
+ # Checks equality by comparing each attribute.
155
+ # @param [Object] Object to be compared
156
+ def ==(o)
157
+ return true if self.equal?(o)
158
+ self.class == o.class &&
159
+ limit_key == o.limit_key &&
160
+ period == o.period &&
161
+ value == o.value
162
+ end
163
+
164
+ # @see the `==` method
165
+ # @param [Object] Object to be compared
166
+ def eql?(o)
167
+ self == o
168
+ end
169
+
170
+ # Calculates hash code according to all attributes.
171
+ # @return [Integer] Hash code
172
+ def hash
173
+ [limit_key, period, value].hash
174
+ end
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def self.build_from_hash(attributes)
180
+ return nil unless attributes.is_a?(Hash)
181
+ attributes = attributes.transform_keys(&:to_sym)
182
+ transformed_hash = {}
183
+ openapi_types.each_pair do |key, type|
184
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
185
+ transformed_hash["#{key}"] = nil
186
+ elsif type =~ /\AArray<(.*)>/i
187
+ # check to ensure the input is an array given that the attribute
188
+ # is documented as an array but the input is not
189
+ if attributes[attribute_map[key]].is_a?(Array)
190
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
191
+ end
192
+ elsif !attributes[attribute_map[key]].nil?
193
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
194
+ end
195
+ end
196
+ new(transformed_hash)
197
+ end
198
+
199
+ # Returns the object in the form of hash
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_hash
202
+ hash = {}
203
+ self.class.attribute_map.each_pair do |attr, param|
204
+ value = self.send(attr)
205
+ if value.nil?
206
+ is_nullable = self.class.openapi_nullable.include?(attr)
207
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
208
+ end
209
+
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ end
216
+
217
+ end
@@ -45,7 +45,7 @@ module SmplkitGeneratedClient::Audit
45
45
  {
46
46
  :'id' => :'String',
47
47
  :'type' => :'String',
48
- :'attributes' => :'Hash<String, Object>'
48
+ :'attributes' => :'UsageAttributes'
49
49
  }
50
50
  end
51
51
 
@@ -84,9 +84,7 @@ module SmplkitGeneratedClient::Audit
84
84
  end
85
85
 
86
86
  if attributes.key?(:'attributes')
87
- if (value = attributes[:'attributes']).is_a?(Hash)
88
- self.attributes = value
89
- end
87
+ self.attributes = attributes[:'attributes']
90
88
  else
91
89
  self.attributes = nil
92
90
  end
@@ -39,6 +39,7 @@ require 'smplkit_audit_client/models/http_header'
39
39
  require 'smplkit_audit_client/models/retry_failed_deliveries_summary'
40
40
  require 'smplkit_audit_client/models/test_forwarder_request'
41
41
  require 'smplkit_audit_client/models/test_forwarder_response'
42
+ require 'smplkit_audit_client/models/usage_attributes'
42
43
  require 'smplkit_audit_client/models/usage_resource'
43
44
  require 'smplkit_audit_client/models/usage_response'
44
45
 
@@ -0,0 +1,48 @@
1
+ =begin
2
+ #smplkit Audit API
3
+
4
+ #Append-only change-history substrate for smpl.* resources and customer-application events. ADR-047.
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for SmplkitGeneratedClient::Audit::UsageAttributes
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe SmplkitGeneratedClient::Audit::UsageAttributes do
21
+ #let(:instance) { SmplkitGeneratedClient::Audit::UsageAttributes.new }
22
+
23
+ describe 'test an instance of UsageAttributes' do
24
+ it 'should create an instance of UsageAttributes' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(SmplkitGeneratedClient::Audit::UsageAttributes)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "limit_key"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "period"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ describe 'test attribute "value"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
48
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smplkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Smpl Solutions LLC
@@ -403,6 +403,7 @@ files:
403
403
  - lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/retry_failed_deliveries_summary.rb
404
404
  - lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_request.rb
405
405
  - lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_response.rb
406
+ - lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/usage_attributes.rb
406
407
  - lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/usage_resource.rb
407
408
  - lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/usage_response.rb
408
409
  - lib/smplkit/_generated/audit/lib/smplkit_audit_client/version.rb
@@ -430,6 +431,7 @@ files:
430
431
  - lib/smplkit/_generated/audit/spec/models/retry_failed_deliveries_summary_spec.rb
431
432
  - lib/smplkit/_generated/audit/spec/models/test_forwarder_request_spec.rb
432
433
  - lib/smplkit/_generated/audit/spec/models/test_forwarder_response_spec.rb
434
+ - lib/smplkit/_generated/audit/spec/models/usage_attributes_spec.rb
433
435
  - lib/smplkit/_generated/audit/spec/models/usage_resource_spec.rb
434
436
  - lib/smplkit/_generated/audit/spec/models/usage_response_spec.rb
435
437
  - lib/smplkit/_generated/audit/spec/spec_helper.rb