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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97fc9d5f5ccd8884a150cc985e0c09dc4f0323f19ba39940d435e4b30fa6a8a4
4
- data.tar.gz: a66fa0dd76a8188fd8a3673c122bd6305f3916da73174f5d8dcd75b9edd2628a
3
+ metadata.gz: 11488119828863f978e3b7c3780b41c9e87cbc02809ceb1284fa6dc7574f374f
4
+ data.tar.gz: 1fef1181d7ae0a83b4c9d82ec7b36ad9c353c714d16cf9757b1a5f9718e21272
5
5
  SHA512:
6
- metadata.gz: 2e2970204abfbab07db8d18f3e9ba94c33fe8e5d7d56f78ffd3bc436c8fe01b8add1db4c541ee4307756b5f030403667d2ac258b3bf1cbde0423749167390f39
7
- data.tar.gz: 923a51443ab908653434775e9f94ff40ad8a02a18cb981176da51baba6469f6164cccddf3b210e5de5b454bcdb71c6a446d8126cbdce8f314cb93f59cf723399
6
+ metadata.gz: abcea7cbf71f8a05c542c30e0b4b024213220e4ba1b07708a08ea2332f4b6b9b2f87e6d6c2eec77a29c47d29252126f6aa0fd74568574f6d5a7f79398ff69814
7
+ data.tar.gz: 11982cc8a2d20fac366e597610bf3e36f6dbcad72bd10eb579430c7a76a718bc15881991e6b2558e2f5a381f0ad1923fa2b91a9744174600b089c5252e74d07f
@@ -0,0 +1,95 @@
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 'cgi'
14
+
15
+ module SmplkitGeneratedClient::App
16
+ class DiscountTiersApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List Discount Tiers
23
+ # 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 `products_count` ascending, which is the natural ladder customers traverse as they add products.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `products_count`. Allowed values: `percent_off`, `-percent_off`, `products_count`, `-products_count`. (default to 'products_count')
26
+ # @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)
27
+ # @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)
28
+ # @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)
29
+ # @return [DiscountTierListResponse]
30
+ def list_discount_tiers(opts = {})
31
+ data, _status_code, _headers = list_discount_tiers_with_http_info(opts)
32
+ data
33
+ end
34
+
35
+ # List Discount Tiers
36
+ # 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 `products_count` ascending, which is the natural ladder customers traverse as they add products.
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `products_count`. Allowed values: `percent_off`, `-percent_off`, `products_count`, `-products_count`. (default to 'products_count')
39
+ # @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)
40
+ # @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)
41
+ # @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)
42
+ # @return [Array<(DiscountTierListResponse, Integer, Hash)>] DiscountTierListResponse data, response status code and response headers
43
+ def list_discount_tiers_with_http_info(opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: DiscountTiersApi.list_discount_tiers ...'
46
+ end
47
+ allowable_values = ["percent_off", "-percent_off", "products_count", "-products_count"]
48
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
49
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
50
+ end
51
+ # resource path
52
+ local_var_path = '/api/v1/discount_tiers'
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
57
+ query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
58
+ query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
59
+ query_params[:'meta[total]'] = opts[:'meta_total'] if !opts[:'meta_total'].nil?
60
+
61
+ # header parameters
62
+ header_params = opts[:header_params] || {}
63
+ # HTTP header 'Accept' (if needed)
64
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
65
+
66
+ # form parameters
67
+ form_params = opts[:form_params] || {}
68
+
69
+ # http body (model)
70
+ post_body = opts[:debug_body]
71
+
72
+ # return_type
73
+ return_type = opts[:debug_return_type] || 'DiscountTierListResponse'
74
+
75
+ # auth_names
76
+ auth_names = opts[:debug_auth_names] || []
77
+
78
+ new_options = opts.merge(
79
+ :operation => :"DiscountTiersApi.list_discount_tiers",
80
+ :header_params => header_params,
81
+ :query_params => query_params,
82
+ :form_params => form_params,
83
+ :body => post_body,
84
+ :auth_names => auth_names,
85
+ :return_type => return_type
86
+ )
87
+
88
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
89
+ if @api_client.config.debugging
90
+ @api_client.config.logger.debug "API called: DiscountTiersApi#list_discount_tiers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
91
+ end
92
+ return data, status_code, headers
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,193 @@
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 tier of the multi-product volume discount schedule.
18
+ class DiscountTier < ApiModelBase
19
+ # Minimum number of paid product subscriptions a customer must hold for this tier's discount to apply. Counts above the highest defined tier are clamped to that tier.
20
+ attr_accessor :products_count
21
+
22
+ # Discount percentage applied to every paid subscription item when the customer holds at least ``products_count`` paid products. 0 means no discount at this tier.
23
+ attr_accessor :percent_off
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'products_count' => :'products_count',
29
+ :'percent_off' => :'percent_off'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'products_count' => :'Integer',
47
+ :'percent_off' => :'Integer'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::DiscountTier` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::DiscountTier`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'products_count')
74
+ self.products_count = attributes[:'products_count']
75
+ else
76
+ self.products_count = nil
77
+ end
78
+
79
+ if attributes.key?(:'percent_off')
80
+ self.percent_off = attributes[:'percent_off']
81
+ else
82
+ self.percent_off = nil
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
+ invalid_properties = Array.new
91
+ if @products_count.nil?
92
+ invalid_properties.push('invalid value for "products_count", products_count cannot be nil.')
93
+ end
94
+
95
+ if @percent_off.nil?
96
+ invalid_properties.push('invalid value for "percent_off", percent_off cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ warn '[DEPRECATED] the `valid?` method is obsolete'
106
+ return false if @products_count.nil?
107
+ return false if @percent_off.nil?
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param [Object] products_count Value to be assigned
113
+ def products_count=(products_count)
114
+ if products_count.nil?
115
+ fail ArgumentError, 'products_count cannot be nil'
116
+ end
117
+
118
+ @products_count = products_count
119
+ end
120
+
121
+ # Custom attribute writer method with validation
122
+ # @param [Object] percent_off Value to be assigned
123
+ def percent_off=(percent_off)
124
+ if percent_off.nil?
125
+ fail ArgumentError, 'percent_off cannot be nil'
126
+ end
127
+
128
+ @percent_off = percent_off
129
+ end
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ products_count == o.products_count &&
137
+ percent_off == o.percent_off
138
+ end
139
+
140
+ # @see the `==` method
141
+ # @param [Object] Object to be compared
142
+ def eql?(o)
143
+ self == o
144
+ end
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Integer] Hash code
148
+ def hash
149
+ [products_count, percent_off].hash
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def self.build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ attributes = attributes.transform_keys(&:to_sym)
158
+ transformed_hash = {}
159
+ openapi_types.each_pair do |key, type|
160
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
161
+ transformed_hash["#{key}"] = nil
162
+ elsif type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[attribute_map[key]].is_a?(Array)
166
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
167
+ end
168
+ elsif !attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
170
+ end
171
+ end
172
+ new(transformed_hash)
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ if value.nil?
182
+ is_nullable = self.class.openapi_nullable.include?(attr)
183
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
184
+ end
185
+
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ end
192
+
193
+ end
@@ -0,0 +1,193 @@
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 collection response for the volume discount schedule.
18
+ class DiscountTierListResponse < ApiModelBase
19
+ attr_accessor :data
20
+
21
+ attr_accessor :meta
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'data' => :'data',
27
+ :'meta' => :'meta'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'data' => :'Array<DiscountTierResource>',
45
+ :'meta' => :'ListMeta'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::DiscountTierListResponse` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::DiscountTierListResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'data')
72
+ if (value = attributes[:'data']).is_a?(Array)
73
+ self.data = value
74
+ end
75
+ else
76
+ self.data = nil
77
+ end
78
+
79
+ if attributes.key?(:'meta')
80
+ self.meta = attributes[:'meta']
81
+ else
82
+ self.meta = nil
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
+ invalid_properties = Array.new
91
+ if @data.nil?
92
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
93
+ end
94
+
95
+ if @meta.nil?
96
+ invalid_properties.push('invalid value for "meta", meta cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ warn '[DEPRECATED] the `valid?` method is obsolete'
106
+ return false if @data.nil?
107
+ return false if @meta.nil?
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param [Object] data Value to be assigned
113
+ def data=(data)
114
+ if data.nil?
115
+ fail ArgumentError, 'data cannot be nil'
116
+ end
117
+
118
+ @data = data
119
+ end
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
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ data == o.data &&
137
+ meta == o.meta
138
+ end
139
+
140
+ # @see the `==` method
141
+ # @param [Object] Object to be compared
142
+ def eql?(o)
143
+ self == o
144
+ end
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Integer] Hash code
148
+ def hash
149
+ [data, meta].hash
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def self.build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ attributes = attributes.transform_keys(&:to_sym)
158
+ transformed_hash = {}
159
+ openapi_types.each_pair do |key, type|
160
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
161
+ transformed_hash["#{key}"] = nil
162
+ elsif type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[attribute_map[key]].is_a?(Array)
166
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
167
+ end
168
+ elsif !attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
170
+ end
171
+ end
172
+ new(transformed_hash)
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ if value.nil?
182
+ is_nullable = self.class.openapi_nullable.include?(attr)
183
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
184
+ end
185
+
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ end
192
+
193
+ end