smplkit 3.0.37 → 3.0.39

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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/discount_tiers_api.rb +95 -0
  3. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/discount_tier.rb +193 -0
  4. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/discount_tier_list_response.rb +193 -0
  5. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/discount_tier_resource.rb +225 -0
  6. data/lib/smplkit/_generated/app/lib/smplkit_app_client.rb +4 -0
  7. data/lib/smplkit/_generated/app/spec/api/discount_tiers_api_spec.rb +50 -0
  8. data/lib/smplkit/_generated/app/spec/models/discount_tier_list_response_spec.rb +42 -0
  9. data/lib/smplkit/_generated/app/spec/models/discount_tier_resource_spec.rb +52 -0
  10. data/lib/smplkit/_generated/app/spec/models/discount_tier_spec.rb +42 -0
  11. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/{actions_api.rb → event_types_api.rb} +15 -15
  12. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/events_api.rb +3 -3
  13. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb +21 -21
  14. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb +9 -9
  15. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/{action_attributes.rb → event_type_attributes.rb} +21 -21
  16. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/{action_list_response.rb → event_type_list_response.rb} +4 -4
  17. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/{action_resource.rb → event_type_resource.rb} +6 -6
  18. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client.rb +4 -4
  19. data/lib/smplkit/_generated/audit/spec/api/{actions_api_spec.rb → event_types_api_spec.rb} +11 -11
  20. data/lib/smplkit/_generated/audit/spec/api/events_api_spec.rb +1 -1
  21. data/lib/smplkit/_generated/audit/spec/models/event_search_request_spec.rb +1 -1
  22. data/lib/smplkit/_generated/audit/spec/models/event_spec.rb +1 -1
  23. data/lib/smplkit/_generated/audit/spec/models/{action_attributes_spec.rb → event_type_attributes_spec.rb} +7 -7
  24. data/lib/smplkit/_generated/audit/spec/models/{action_list_response_spec.rb → event_type_list_response_spec.rb} +6 -6
  25. data/lib/smplkit/_generated/audit/spec/models/{action_resource_spec.rb → event_type_resource_spec.rb} +6 -6
  26. data/lib/smplkit/audit/client.rb +2 -2
  27. data/lib/smplkit/audit/{actions.rb → event_types.rb} +8 -8
  28. data/lib/smplkit/audit/events.rb +5 -5
  29. data/lib/smplkit/audit/models.rb +15 -15
  30. data/lib/smplkit.rb +1 -1
  31. metadata +18 -10
@@ -0,0 +1,225 @@
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
+ # JSON:API resource envelope for a volume discount tier.
18
+ class DiscountTierResource < ApiModelBase
19
+ attr_accessor :id
20
+
21
+ attr_accessor :type
22
+
23
+ attr_accessor :attributes
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'id' => :'id',
51
+ :'type' => :'type',
52
+ :'attributes' => :'attributes'
53
+ }
54
+ end
55
+
56
+ # Returns attribute mapping this model knows about
57
+ def self.acceptable_attribute_map
58
+ attribute_map
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ acceptable_attribute_map.values
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'id' => :'String',
70
+ :'type' => :'String',
71
+ :'attributes' => :'DiscountTier'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ :'id',
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::DiscountTierResource` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::DiscountTierResource`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'id')
99
+ self.id = attributes[:'id']
100
+ end
101
+
102
+ if attributes.key?(:'type')
103
+ self.type = attributes[:'type']
104
+ else
105
+ self.type = nil
106
+ end
107
+
108
+ if attributes.key?(:'attributes')
109
+ self.attributes = attributes[:'attributes']
110
+ else
111
+ self.attributes = nil
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
119
+ invalid_properties = Array.new
120
+ if @type.nil?
121
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
122
+ end
123
+
124
+ if @attributes.nil?
125
+ invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
126
+ end
127
+
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ warn '[DEPRECATED] the `valid?` method is obsolete'
135
+ return false if @type.nil?
136
+ type_validator = EnumAttributeValidator.new('String', ["discount_tier"])
137
+ return false unless type_validator.valid?(@type)
138
+ return false if @attributes.nil?
139
+ true
140
+ end
141
+
142
+ # Custom attribute writer method checking allowed values (enum).
143
+ # @param [Object] type Object to be assigned
144
+ def type=(type)
145
+ validator = EnumAttributeValidator.new('String', ["discount_tier"])
146
+ unless validator.valid?(type)
147
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
148
+ end
149
+ @type = type
150
+ end
151
+
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] attributes Value to be assigned
154
+ def attributes=(attributes)
155
+ if attributes.nil?
156
+ fail ArgumentError, 'attributes cannot be nil'
157
+ end
158
+
159
+ @attributes = attributes
160
+ end
161
+
162
+ # Checks equality by comparing each attribute.
163
+ # @param [Object] Object to be compared
164
+ def ==(o)
165
+ return true if self.equal?(o)
166
+ self.class == o.class &&
167
+ id == o.id &&
168
+ type == o.type &&
169
+ attributes == o.attributes
170
+ end
171
+
172
+ # @see the `==` method
173
+ # @param [Object] Object to be compared
174
+ def eql?(o)
175
+ self == o
176
+ end
177
+
178
+ # Calculates hash code according to all attributes.
179
+ # @return [Integer] Hash code
180
+ def hash
181
+ [id, type, attributes].hash
182
+ end
183
+
184
+ # Builds the object from hash
185
+ # @param [Hash] attributes Model attributes in the form of hash
186
+ # @return [Object] Returns the model itself
187
+ def self.build_from_hash(attributes)
188
+ return nil unless attributes.is_a?(Hash)
189
+ attributes = attributes.transform_keys(&:to_sym)
190
+ transformed_hash = {}
191
+ openapi_types.each_pair do |key, type|
192
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
193
+ transformed_hash["#{key}"] = nil
194
+ elsif type =~ /\AArray<(.*)>/i
195
+ # check to ensure the input is an array given that the attribute
196
+ # is documented as an array but the input is not
197
+ if attributes[attribute_map[key]].is_a?(Array)
198
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
199
+ end
200
+ elsif !attributes[attribute_map[key]].nil?
201
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
202
+ end
203
+ end
204
+ new(transformed_hash)
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ end
224
+
225
+ end
@@ -52,6 +52,9 @@ require 'smplkit_app_client/models/context_type_response'
52
52
  require 'smplkit_app_client/models/context_value'
53
53
  require 'smplkit_app_client/models/context_value_list_response'
54
54
  require 'smplkit_app_client/models/context_value_resource'
55
+ require 'smplkit_app_client/models/discount_tier'
56
+ require 'smplkit_app_client/models/discount_tier_list_response'
57
+ require 'smplkit_app_client/models/discount_tier_resource'
55
58
  require 'smplkit_app_client/models/email'
56
59
  require 'smplkit_app_client/models/email_resource'
57
60
  require 'smplkit_app_client/models/email_response'
@@ -140,6 +143,7 @@ require 'smplkit_app_client/api/billing_api'
140
143
  require 'smplkit_app_client/api/context_types_api'
141
144
  require 'smplkit_app_client/api/context_values_api'
142
145
  require 'smplkit_app_client/api/contexts_api'
146
+ require 'smplkit_app_client/api/discount_tiers_api'
143
147
  require 'smplkit_app_client/api/email_registrations_api'
144
148
  require 'smplkit_app_client/api/emails_api'
145
149
  require 'smplkit_app_client/api/environments_api'
@@ -0,0 +1,50 @@
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 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for SmplkitGeneratedClient::App::DiscountTiersApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'DiscountTiersApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = SmplkitGeneratedClient::App::DiscountTiersApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of DiscountTiersApi' do
30
+ it 'should create an instance of DiscountTiersApi' do
31
+ expect(@api_instance).to be_instance_of(SmplkitGeneratedClient::App::DiscountTiersApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for list_discount_tiers
36
+ # List Discount Tiers
37
+ # Return the multi-product volume discount schedule. Each tier is identified by the minimum number of paid products at which the discount applies. The first tier (1 product) carries no discount; subsequent tiers grant a progressively larger percent off every paid subscription item. Default sort is &#x60;products_count&#x60; ascending, which is the natural ladder customers traverse as they add products.
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;products_count&#x60;. Allowed values: &#x60;percent_off&#x60;, &#x60;-percent_off&#x60;, &#x60;products_count&#x60;, &#x60;-products_count&#x60;.
40
+ # @option opts [Integer] :page_number 1-based page number to return. Optional; defaults to &#x60;1&#x60; when omitted. Must be &#x60;&gt;&#x3D; 1&#x60; — requests with a smaller value are rejected with a 400 error.
41
+ # @option opts [Integer] :page_size Number of items per page. Optional; defaults to &#x60;1000&#x60; when omitted. Must be between &#x60;1&#x60; and &#x60;1000&#x60; inclusive — requests outside that range are rejected with a 400 error.
42
+ # @option opts [Boolean] :meta_total When &#x60;true&#x60;, the response&#39;s &#x60;meta.pagination&#x60; block includes &#x60;total&#x60; (the total number of matching items across all pages) and &#x60;total_pages&#x60;. Computing these requires an extra &#x60;COUNT&#x60; query, so omit (or pass &#x60;false&#x60;) when the totals are not needed. Defaults to &#x60;false&#x60;.
43
+ # @return [DiscountTierListResponse]
44
+ describe 'list_discount_tiers test' do
45
+ it 'should work' do
46
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
47
+ end
48
+ end
49
+
50
+ end
@@ -0,0 +1,42 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for SmplkitGeneratedClient::App::DiscountTierListResponse
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe SmplkitGeneratedClient::App::DiscountTierListResponse do
21
+ #let(:instance) { SmplkitGeneratedClient::App::DiscountTierListResponse.new }
22
+
23
+ describe 'test an instance of DiscountTierListResponse' do
24
+ it 'should create an instance of DiscountTierListResponse' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(SmplkitGeneratedClient::App::DiscountTierListResponse)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "data"' 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 "meta"' 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
+ end
@@ -0,0 +1,52 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for SmplkitGeneratedClient::App::DiscountTierResource
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe SmplkitGeneratedClient::App::DiscountTierResource do
21
+ #let(:instance) { SmplkitGeneratedClient::App::DiscountTierResource.new }
22
+
23
+ describe 'test an instance of DiscountTierResource' do
24
+ it 'should create an instance of DiscountTierResource' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(SmplkitGeneratedClient::App::DiscountTierResource)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "id"' 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 "type"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["discount_tier"])
40
+ # validator.allowable_values.each do |value|
41
+ # expect { instance.type = value }.not_to raise_error
42
+ # end
43
+ end
44
+ end
45
+
46
+ describe 'test attribute "attributes"' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
49
+ end
50
+ end
51
+
52
+ end
@@ -0,0 +1,42 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for SmplkitGeneratedClient::App::DiscountTier
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe SmplkitGeneratedClient::App::DiscountTier do
21
+ #let(:instance) { SmplkitGeneratedClient::App::DiscountTier.new }
22
+
23
+ describe 'test an instance of DiscountTier' do
24
+ it 'should create an instance of DiscountTier' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(SmplkitGeneratedClient::App::DiscountTier)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "products_count"' 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 "percent_off"' 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
+ end
@@ -13,45 +13,45 @@ Generator version: 7.22.0
13
13
  require 'cgi'
14
14
 
15
15
  module SmplkitGeneratedClient::Audit
16
- class ActionsApi
16
+ class EventTypesApi
17
17
  attr_accessor :api_client
18
18
 
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # List Actions
23
- # List the distinct `action` slugs recorded for this account. Default sort is `key` ascending; pass `sort=-key` for descending. Without `filter[resource_type]`, returns one row per distinct action. With `filter[resource_type]`, returns the actions recorded for that specific resource type.
22
+ # List Event Types
23
+ # List the distinct `event_type` slugs recorded for this account. Default sort is `key` ascending; pass `sort=-key` for descending. Without `filter[resource_type]`, returns one row per distinct event_type. With `filter[resource_type]`, returns the event_types recorded for that specific resource type.
24
24
  # @param [Hash] opts the optional parameters
25
25
  # @option opts [String] :filter_resource_type
26
26
  # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;key&#x60;. Allowed values: &#x60;key&#x60;, &#x60;-key&#x60;. (default to 'key')
27
27
  # @option opts [Integer] :page_number 1-based page number to return. Optional; defaults to &#x60;1&#x60; when omitted. Must be &#x60;&gt;&#x3D; 1&#x60; — requests with a smaller value are rejected with a 400 error. (default to 1)
28
28
  # @option opts [Integer] :page_size Number of items per page. Optional; defaults to &#x60;1000&#x60; when omitted. Must be between &#x60;1&#x60; and &#x60;1000&#x60; inclusive — requests outside that range are rejected with a 400 error. (default to 1000)
29
29
  # @option opts [Boolean] :meta_total When &#x60;true&#x60;, the response&#39;s &#x60;meta.pagination&#x60; block includes &#x60;total&#x60; (the total number of matching items across all pages) and &#x60;total_pages&#x60;. Computing these requires an extra &#x60;COUNT&#x60; query, so omit (or pass &#x60;false&#x60;) when the totals are not needed. Defaults to &#x60;false&#x60;. (default to false)
30
- # @return [ActionListResponse]
31
- def list_actions(opts = {})
32
- data, _status_code, _headers = list_actions_with_http_info(opts)
30
+ # @return [EventTypeListResponse]
31
+ def list_event_types(opts = {})
32
+ data, _status_code, _headers = list_event_types_with_http_info(opts)
33
33
  data
34
34
  end
35
35
 
36
- # List Actions
37
- # List the distinct &#x60;action&#x60; slugs recorded for this account. Default sort is &#x60;key&#x60; ascending; pass &#x60;sort&#x3D;-key&#x60; for descending. Without &#x60;filter[resource_type]&#x60;, returns one row per distinct action. With &#x60;filter[resource_type]&#x60;, returns the actions recorded for that specific resource type.
36
+ # List Event Types
37
+ # List the distinct &#x60;event_type&#x60; slugs recorded for this account. Default sort is &#x60;key&#x60; ascending; pass &#x60;sort&#x3D;-key&#x60; for descending. Without &#x60;filter[resource_type]&#x60;, returns one row per distinct event_type. With &#x60;filter[resource_type]&#x60;, returns the event_types recorded for that specific resource type.
38
38
  # @param [Hash] opts the optional parameters
39
39
  # @option opts [String] :filter_resource_type
40
40
  # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;key&#x60;. Allowed values: &#x60;key&#x60;, &#x60;-key&#x60;. (default to 'key')
41
41
  # @option opts [Integer] :page_number 1-based page number to return. Optional; defaults to &#x60;1&#x60; when omitted. Must be &#x60;&gt;&#x3D; 1&#x60; — requests with a smaller value are rejected with a 400 error. (default to 1)
42
42
  # @option opts [Integer] :page_size Number of items per page. Optional; defaults to &#x60;1000&#x60; when omitted. Must be between &#x60;1&#x60; and &#x60;1000&#x60; inclusive — requests outside that range are rejected with a 400 error. (default to 1000)
43
43
  # @option opts [Boolean] :meta_total When &#x60;true&#x60;, the response&#39;s &#x60;meta.pagination&#x60; block includes &#x60;total&#x60; (the total number of matching items across all pages) and &#x60;total_pages&#x60;. Computing these requires an extra &#x60;COUNT&#x60; query, so omit (or pass &#x60;false&#x60;) when the totals are not needed. Defaults to &#x60;false&#x60;. (default to false)
44
- # @return [Array<(ActionListResponse, Integer, Hash)>] ActionListResponse data, response status code and response headers
45
- def list_actions_with_http_info(opts = {})
44
+ # @return [Array<(EventTypeListResponse, Integer, Hash)>] EventTypeListResponse data, response status code and response headers
45
+ def list_event_types_with_http_info(opts = {})
46
46
  if @api_client.config.debugging
47
- @api_client.config.logger.debug 'Calling API: ActionsApi.list_actions ...'
47
+ @api_client.config.logger.debug 'Calling API: EventTypesApi.list_event_types ...'
48
48
  end
49
49
  allowable_values = ["key", "-key"]
50
50
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
51
51
  fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
52
52
  end
53
53
  # resource path
54
- local_var_path = '/api/v1/actions'
54
+ local_var_path = '/api/v1/event_types'
55
55
 
56
56
  # query parameters
57
57
  query_params = opts[:query_params] || {}
@@ -73,13 +73,13 @@ module SmplkitGeneratedClient::Audit
73
73
  post_body = opts[:debug_body]
74
74
 
75
75
  # return_type
76
- return_type = opts[:debug_return_type] || 'ActionListResponse'
76
+ return_type = opts[:debug_return_type] || 'EventTypeListResponse'
77
77
 
78
78
  # auth_names
79
79
  auth_names = opts[:debug_auth_names] || ['HTTPBearer']
80
80
 
81
81
  new_options = opts.merge(
82
- :operation => :"ActionsApi.list_actions",
82
+ :operation => :"EventTypesApi.list_event_types",
83
83
  :header_params => header_params,
84
84
  :query_params => query_params,
85
85
  :form_params => form_params,
@@ -90,7 +90,7 @@ module SmplkitGeneratedClient::Audit
90
90
 
91
91
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
92
92
  if @api_client.config.debugging
93
- @api_client.config.logger.debug "API called: ActionsApi#list_actions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93
+ @api_client.config.logger.debug "API called: EventTypesApi#list_event_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
94
94
  end
95
95
  return data, status_code, headers
96
96
  end
@@ -88,7 +88,7 @@ module SmplkitGeneratedClient::Audit
88
88
  # @option opts [String] :filter_occurred_at
89
89
  # @option opts [String] :filter_actor_type
90
90
  # @option opts [String] :filter_actor_id
91
- # @option opts [String] :filter_action
91
+ # @option opts [String] :filter_event_type
92
92
  # @option opts [String] :filter_resource_type
93
93
  # @option opts [String] :filter_resource_id
94
94
  # @option opts [String] :filter_search Case-insensitive substring match against &#x60;resource_id&#x60; or &#x60;description&#x60;. Use &#x60;filter[resource_id]&#x60; for an exact match on &#x60;resource_id&#x60;.
@@ -108,7 +108,7 @@ module SmplkitGeneratedClient::Audit
108
108
  # @option opts [String] :filter_occurred_at
109
109
  # @option opts [String] :filter_actor_type
110
110
  # @option opts [String] :filter_actor_id
111
- # @option opts [String] :filter_action
111
+ # @option opts [String] :filter_event_type
112
112
  # @option opts [String] :filter_resource_type
113
113
  # @option opts [String] :filter_resource_id
114
114
  # @option opts [String] :filter_search Case-insensitive substring match against &#x60;resource_id&#x60; or &#x60;description&#x60;. Use &#x60;filter[resource_id]&#x60; for an exact match on &#x60;resource_id&#x60;.
@@ -137,7 +137,7 @@ module SmplkitGeneratedClient::Audit
137
137
  query_params[:'filter[occurred_at]'] = opts[:'filter_occurred_at'] if !opts[:'filter_occurred_at'].nil?
138
138
  query_params[:'filter[actor_type]'] = opts[:'filter_actor_type'] if !opts[:'filter_actor_type'].nil?
139
139
  query_params[:'filter[actor_id]'] = opts[:'filter_actor_id'] if !opts[:'filter_actor_id'].nil?
140
- query_params[:'filter[action]'] = opts[:'filter_action'] if !opts[:'filter_action'].nil?
140
+ query_params[:'filter[event_type]'] = opts[:'filter_event_type'] if !opts[:'filter_event_type'].nil?
141
141
  query_params[:'filter[resource_type]'] = opts[:'filter_resource_type'] if !opts[:'filter_resource_type'].nil?
142
142
  query_params[:'filter[resource_id]'] = opts[:'filter_resource_id'] if !opts[:'filter_resource_id'].nil?
143
143
  query_params[:'filter[search]'] = opts[:'filter_search'] if !opts[:'filter_search'].nil?
@@ -17,7 +17,7 @@ module SmplkitGeneratedClient::Audit
17
17
  # An audit event — a record that something happened, attributed to an actor and a resource. When recording a snapshot of the resource at the time of the event, place it inside `data`. smplkit's own integrations nest it under `data.snapshot`, but the slot is yours to use however you like.
18
18
  class Event < ApiModelBase
19
19
  # What happened, e.g. `user.created`. Any non-empty string.
20
- attr_accessor :action
20
+ attr_accessor :event_type
21
21
 
22
22
  # Kind of resource the event is about, e.g. `user`. Any non-empty string.
23
23
  attr_accessor :resource_type
@@ -55,7 +55,7 @@ module SmplkitGeneratedClient::Audit
55
55
  # Attribute mapping from ruby-style variable name to JSON key.
56
56
  def self.attribute_map
57
57
  {
58
- :'action' => :'action',
58
+ :'event_type' => :'event_type',
59
59
  :'resource_type' => :'resource_type',
60
60
  :'resource_id' => :'resource_id',
61
61
  :'description' => :'description',
@@ -83,7 +83,7 @@ module SmplkitGeneratedClient::Audit
83
83
  # Attribute type mapping.
84
84
  def self.openapi_types
85
85
  {
86
- :'action' => :'String',
86
+ :'event_type' => :'String',
87
87
  :'resource_type' => :'String',
88
88
  :'resource_id' => :'String',
89
89
  :'description' => :'String',
@@ -127,10 +127,10 @@ module SmplkitGeneratedClient::Audit
127
127
  h[k.to_sym] = v
128
128
  }
129
129
 
130
- if attributes.key?(:'action')
131
- self.action = attributes[:'action']
130
+ if attributes.key?(:'event_type')
131
+ self.event_type = attributes[:'event_type']
132
132
  else
133
- self.action = nil
133
+ self.event_type = nil
134
134
  end
135
135
 
136
136
  if attributes.key?(:'resource_type')
@@ -191,12 +191,12 @@ module SmplkitGeneratedClient::Audit
191
191
  def list_invalid_properties
192
192
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
193
193
  invalid_properties = Array.new
194
- if @action.nil?
195
- invalid_properties.push('invalid value for "action", action cannot be nil.')
194
+ if @event_type.nil?
195
+ invalid_properties.push('invalid value for "event_type", event_type cannot be nil.')
196
196
  end
197
197
 
198
- if @action.to_s.length < 1
199
- invalid_properties.push('invalid value for "action", the character length must be greater than or equal to 1.')
198
+ if @event_type.to_s.length < 1
199
+ invalid_properties.push('invalid value for "event_type", the character length must be greater than or equal to 1.')
200
200
  end
201
201
 
202
202
  if @resource_type.nil?
@@ -222,8 +222,8 @@ module SmplkitGeneratedClient::Audit
222
222
  # @return true if the model is valid
223
223
  def valid?
224
224
  warn '[DEPRECATED] the `valid?` method is obsolete'
225
- return false if @action.nil?
226
- return false if @action.to_s.length < 1
225
+ return false if @event_type.nil?
226
+ return false if @event_type.to_s.length < 1
227
227
  return false if @resource_type.nil?
228
228
  return false if @resource_type.to_s.length < 1
229
229
  return false if @resource_id.nil?
@@ -232,17 +232,17 @@ module SmplkitGeneratedClient::Audit
232
232
  end
233
233
 
234
234
  # Custom attribute writer method with validation
235
- # @param [Object] action Value to be assigned
236
- def action=(action)
237
- if action.nil?
238
- fail ArgumentError, 'action cannot be nil'
235
+ # @param [Object] event_type Value to be assigned
236
+ def event_type=(event_type)
237
+ if event_type.nil?
238
+ fail ArgumentError, 'event_type cannot be nil'
239
239
  end
240
240
 
241
- if action.to_s.length < 1
242
- fail ArgumentError, 'invalid value for "action", the character length must be greater than or equal to 1.'
241
+ if event_type.to_s.length < 1
242
+ fail ArgumentError, 'invalid value for "event_type", the character length must be greater than or equal to 1.'
243
243
  end
244
244
 
245
- @action = action
245
+ @event_type = event_type
246
246
  end
247
247
 
248
248
  # Custom attribute writer method with validation
@@ -278,7 +278,7 @@ module SmplkitGeneratedClient::Audit
278
278
  def ==(o)
279
279
  return true if self.equal?(o)
280
280
  self.class == o.class &&
281
- action == o.action &&
281
+ event_type == o.event_type &&
282
282
  resource_type == o.resource_type &&
283
283
  resource_id == o.resource_id &&
284
284
  description == o.description &&
@@ -301,7 +301,7 @@ module SmplkitGeneratedClient::Audit
301
301
  # Calculates hash code according to all attributes.
302
302
  # @return [Integer] Hash code
303
303
  def hash
304
- [action, resource_type, resource_id, description, occurred_at, actor_type, actor_id, actor_label, data, do_not_forward, created_at, idempotency_key].hash
304
+ [event_type, resource_type, resource_id, description, occurred_at, actor_type, actor_id, actor_label, data, do_not_forward, created_at, idempotency_key].hash
305
305
  end
306
306
 
307
307
  # Builds the object from hash