smplkit 2.0.13 → 2.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.
- checksums.yaml +4 -4
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/account_api.rb +11 -11
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/api_keys_api.rb +18 -18
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/billing_api.rb +21 -21
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/context_types_api.rb +18 -18
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/contexts_api.rb +11 -11
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/environments_api.rb +18 -18
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/metrics_api.rb +2 -2
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/services_api.rb +18 -18
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/users_api.rb +18 -18
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/account.rb +14 -31
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/account_request.rb +165 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/account_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/account_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/account_wipe_request.rb +3 -3
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/add_payment_method_attributes.rb +3 -1
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/add_payment_method_body.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/add_payment_method_data.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/api_key.rb +15 -16
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/api_key_list_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/api_key_request.rb +165 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/api_key_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/api_key_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/auth_token_response.rb +3 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context.rb +6 -3
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_batch_response.rb +2 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_bulk_item.rb +4 -2
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_bulk_register.rb +2 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_list_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_request.rb +165 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_type.rb +5 -2
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_type_list_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_type_request.rb +165 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_type_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_type_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_subscription_attributes.rb +4 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_subscription_body.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_subscription_data.rb +2 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/email.rb +3 -1
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/email_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/email_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment.rb +6 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_list_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_request.rb +165 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation.rb +11 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation_accept_request.rb +2 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation_bulk_create_request.rb +2 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation_create_item.rb +3 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation_list_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invoice.rb +13 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invoice_list_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invoice_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invoice_single_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/limit_definition.rb +5 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/login_request.rb +3 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_attributes.rb +7 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_bulk_request.rb +2 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_list_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_name_item.rb +3 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_names_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_rollup_attributes.rb +6 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_rollup_list_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_rollup_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/next_tier_meta.rb +4 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/page_meta.rb +5 -4
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/payment_method.rb +9 -1
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/payment_method_list_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/payment_method_request.rb +165 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/payment_method_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/payment_method_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/plan.rb +4 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/plan_change_request.rb +2 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/plan_definition.rb +3 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/plan_list_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/plan_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/product.rb +8 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/product_list_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/product_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/register_request.rb +4 -1
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/service.rb +4 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/service_list_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/service_request.rb +165 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/service_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/service_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/setup_intent_attributes.rb +2 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/setup_intent_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_attributes.rb +8 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_list_meta.rb +6 -1
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_list_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/user.rb +11 -21
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/user_list_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/user_request.rb +165 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/user_resource.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/user_response.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/value.rb +1 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/verify_email_request.rb +2 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client.rb +8 -0
- data/lib/smplkit/_generated/app/spec/api/account_api_spec.rb +2 -2
- data/lib/smplkit/_generated/app/spec/api/api_keys_api_spec.rb +2 -2
- data/lib/smplkit/_generated/app/spec/api/billing_api_spec.rb +7 -7
- data/lib/smplkit/_generated/app/spec/api/context_types_api_spec.rb +2 -2
- data/lib/smplkit/_generated/app/spec/api/contexts_api_spec.rb +2 -2
- data/lib/smplkit/_generated/app/spec/api/environments_api_spec.rb +2 -2
- data/lib/smplkit/_generated/app/spec/api/metrics_api_spec.rb +1 -1
- data/lib/smplkit/_generated/app/spec/api/services_api_spec.rb +2 -2
- data/lib/smplkit/_generated/app/spec/api/users_api_spec.rb +2 -2
- data/lib/smplkit/_generated/app/spec/models/account_request_spec.rb +36 -0
- data/lib/smplkit/_generated/app/spec/models/api_key_request_spec.rb +36 -0
- data/lib/smplkit/_generated/app/spec/models/api_key_spec.rb +0 -6
- data/lib/smplkit/_generated/app/spec/models/context_request_spec.rb +36 -0
- data/lib/smplkit/_generated/app/spec/models/context_type_request_spec.rb +36 -0
- data/lib/smplkit/_generated/app/spec/models/environment_request_spec.rb +36 -0
- data/lib/smplkit/_generated/app/spec/models/payment_method_request_spec.rb +36 -0
- data/lib/smplkit/_generated/app/spec/models/service_request_spec.rb +36 -0
- data/lib/smplkit/_generated/app/spec/models/user_request_spec.rb +36 -0
- metadata +17 -1
|
@@ -0,0 +1,165 @@
|
|
|
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 request envelope for creating or updating an API key.
|
|
18
|
+
class ApiKeyRequest < ApiModelBase
|
|
19
|
+
attr_accessor :data
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'data' => :'data'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
acceptable_attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'data' => :'ApiKeyResource'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::ApiKeyRequest` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::ApiKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:'data')
|
|
68
|
+
self.data = attributes[:'data']
|
|
69
|
+
else
|
|
70
|
+
self.data = nil
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
75
|
+
# @return Array for valid properties with the reasons
|
|
76
|
+
def list_invalid_properties
|
|
77
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
78
|
+
invalid_properties = Array.new
|
|
79
|
+
if @data.nil?
|
|
80
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
invalid_properties
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Check to see if the all the properties in the model are valid
|
|
87
|
+
# @return true if the model is valid
|
|
88
|
+
def valid?
|
|
89
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
90
|
+
return false if @data.nil?
|
|
91
|
+
true
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Custom attribute writer method with validation
|
|
95
|
+
# @param [Object] data Value to be assigned
|
|
96
|
+
def data=(data)
|
|
97
|
+
if data.nil?
|
|
98
|
+
fail ArgumentError, 'data cannot be nil'
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
@data = data
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Checks equality by comparing each attribute.
|
|
105
|
+
# @param [Object] Object to be compared
|
|
106
|
+
def ==(o)
|
|
107
|
+
return true if self.equal?(o)
|
|
108
|
+
self.class == o.class &&
|
|
109
|
+
data == o.data
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# @see the `==` method
|
|
113
|
+
# @param [Object] Object to be compared
|
|
114
|
+
def eql?(o)
|
|
115
|
+
self == o
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Calculates hash code according to all attributes.
|
|
119
|
+
# @return [Integer] Hash code
|
|
120
|
+
def hash
|
|
121
|
+
[data].hash
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Builds the object from hash
|
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
126
|
+
# @return [Object] Returns the model itself
|
|
127
|
+
def self.build_from_hash(attributes)
|
|
128
|
+
return nil unless attributes.is_a?(Hash)
|
|
129
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
130
|
+
transformed_hash = {}
|
|
131
|
+
openapi_types.each_pair do |key, type|
|
|
132
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
133
|
+
transformed_hash["#{key}"] = nil
|
|
134
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
135
|
+
# check to ensure the input is an array given that the attribute
|
|
136
|
+
# is documented as an array but the input is not
|
|
137
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
138
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
139
|
+
end
|
|
140
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
141
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
new(transformed_hash)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Returns the object in the form of hash
|
|
148
|
+
# @return [Hash] Returns the object in the form of hash
|
|
149
|
+
def to_hash
|
|
150
|
+
hash = {}
|
|
151
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
152
|
+
value = self.send(attr)
|
|
153
|
+
if value.nil?
|
|
154
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
155
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
hash[param] = _to_hash(value)
|
|
159
|
+
end
|
|
160
|
+
hash
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
end
|
|
@@ -14,9 +14,12 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::App
|
|
17
|
+
# Authentication token issued on successful login or registration.
|
|
17
18
|
class AuthTokenResponse < ApiModelBase
|
|
19
|
+
# Bearer token to pass in the `Authorization` header.
|
|
18
20
|
attr_accessor :token
|
|
19
21
|
|
|
22
|
+
# Seconds until the token expires.
|
|
20
23
|
attr_accessor :expires_in
|
|
21
24
|
|
|
22
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -14,18 +14,21 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::App
|
|
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`).
|
|
17
18
|
class Context < ApiModelBase
|
|
18
|
-
# Human-readable display name
|
|
19
|
+
# Human-readable display name for the context instance.
|
|
19
20
|
attr_accessor :name
|
|
20
21
|
|
|
21
|
-
#
|
|
22
|
+
# Key of the context type this instance belongs to (e.g. `user`, `account`).
|
|
22
23
|
attr_accessor :context_type
|
|
23
24
|
|
|
24
|
-
# Observed
|
|
25
|
+
# Observed attribute values for this context instance. The key set is conventionally aligned with the parent context type's known attribute keys, but additional keys are accepted.
|
|
25
26
|
attr_accessor :attributes
|
|
26
27
|
|
|
28
|
+
# When the context instance was first registered.
|
|
27
29
|
attr_accessor :created_at
|
|
28
30
|
|
|
31
|
+
# When the context instance was last modified.
|
|
29
32
|
attr_accessor :updated_at
|
|
30
33
|
|
|
31
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -14,7 +14,9 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::App
|
|
17
|
+
# Summary returned by the bulk context registration endpoint.
|
|
17
18
|
class ContextBatchResponse < ApiModelBase
|
|
19
|
+
# Number of context instances that were created or updated.
|
|
18
20
|
attr_accessor :registered
|
|
19
21
|
|
|
20
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -14,13 +14,15 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::App
|
|
17
|
+
# One context instance in a bulk registration payload.
|
|
17
18
|
class ContextBulkItem < ApiModelBase
|
|
18
|
-
#
|
|
19
|
+
# Key of the context type this instance belongs to (e.g. `user`, `account`, `device`).
|
|
19
20
|
attr_accessor :type
|
|
20
21
|
|
|
21
|
-
# Entity identifier
|
|
22
|
+
# Entity identifier within the context type, e.g. `user-123`.
|
|
22
23
|
attr_accessor :key
|
|
23
24
|
|
|
25
|
+
# Observed attribute values for this context instance.
|
|
24
26
|
attr_accessor :attributes
|
|
25
27
|
|
|
26
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -14,7 +14,9 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::App
|
|
17
|
+
# Bulk registration request body for the contexts endpoint.
|
|
17
18
|
class ContextBulkRegister < ApiModelBase
|
|
19
|
+
# One context instance per entry.
|
|
18
20
|
attr_accessor :contexts
|
|
19
21
|
|
|
20
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -0,0 +1,165 @@
|
|
|
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 request envelope for creating or updating a context instance.
|
|
18
|
+
class ContextRequest < ApiModelBase
|
|
19
|
+
attr_accessor :data
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'data' => :'data'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
acceptable_attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'data' => :'ContextResource'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::ContextRequest` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::ContextRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:'data')
|
|
68
|
+
self.data = attributes[:'data']
|
|
69
|
+
else
|
|
70
|
+
self.data = nil
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
75
|
+
# @return Array for valid properties with the reasons
|
|
76
|
+
def list_invalid_properties
|
|
77
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
78
|
+
invalid_properties = Array.new
|
|
79
|
+
if @data.nil?
|
|
80
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
invalid_properties
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Check to see if the all the properties in the model are valid
|
|
87
|
+
# @return true if the model is valid
|
|
88
|
+
def valid?
|
|
89
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
90
|
+
return false if @data.nil?
|
|
91
|
+
true
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Custom attribute writer method with validation
|
|
95
|
+
# @param [Object] data Value to be assigned
|
|
96
|
+
def data=(data)
|
|
97
|
+
if data.nil?
|
|
98
|
+
fail ArgumentError, 'data cannot be nil'
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
@data = data
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Checks equality by comparing each attribute.
|
|
105
|
+
# @param [Object] Object to be compared
|
|
106
|
+
def ==(o)
|
|
107
|
+
return true if self.equal?(o)
|
|
108
|
+
self.class == o.class &&
|
|
109
|
+
data == o.data
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# @see the `==` method
|
|
113
|
+
# @param [Object] Object to be compared
|
|
114
|
+
def eql?(o)
|
|
115
|
+
self == o
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Calculates hash code according to all attributes.
|
|
119
|
+
# @return [Integer] Hash code
|
|
120
|
+
def hash
|
|
121
|
+
[data].hash
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Builds the object from hash
|
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
126
|
+
# @return [Object] Returns the model itself
|
|
127
|
+
def self.build_from_hash(attributes)
|
|
128
|
+
return nil unless attributes.is_a?(Hash)
|
|
129
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
130
|
+
transformed_hash = {}
|
|
131
|
+
openapi_types.each_pair do |key, type|
|
|
132
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
133
|
+
transformed_hash["#{key}"] = nil
|
|
134
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
135
|
+
# check to ensure the input is an array given that the attribute
|
|
136
|
+
# is documented as an array but the input is not
|
|
137
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
138
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
139
|
+
end
|
|
140
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
141
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
new(transformed_hash)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Returns the object in the form of hash
|
|
148
|
+
# @return [Hash] Returns the object in the form of hash
|
|
149
|
+
def to_hash
|
|
150
|
+
hash = {}
|
|
151
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
152
|
+
value = self.send(attr)
|
|
153
|
+
if value.nil?
|
|
154
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
155
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
hash[param] = _to_hash(value)
|
|
159
|
+
end
|
|
160
|
+
hash
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
end
|
|
@@ -14,6 +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
18
|
class ContextResource < ApiModelBase
|
|
18
19
|
attr_accessor :id
|
|
19
20
|
|
|
@@ -14,15 +14,18 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::App
|
|
17
|
+
# A kind of context — for example, `user`, `account`, or `device` — that groups together context instances sharing a common set of attributes. The known attribute keys for the type accumulate as instances are registered; each key carries an optional metadata object describing it.
|
|
17
18
|
class ContextType < ApiModelBase
|
|
18
|
-
# Display label
|
|
19
|
+
# Display label for the context type, e.g. `User`, `Account`, or `Device`.
|
|
19
20
|
attr_accessor :name
|
|
20
21
|
|
|
21
|
-
#
|
|
22
|
+
# Map of known attribute key to per-attribute metadata. The metadata object is free-form and may be empty. Keys grow as new attributes are observed on context instances of this type.
|
|
22
23
|
attr_accessor :attributes
|
|
23
24
|
|
|
25
|
+
# When the context type was created.
|
|
24
26
|
attr_accessor :created_at
|
|
25
27
|
|
|
28
|
+
# When the context type was last modified.
|
|
26
29
|
attr_accessor :updated_at
|
|
27
30
|
|
|
28
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -0,0 +1,165 @@
|
|
|
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 request envelope for creating or updating a context type.
|
|
18
|
+
class ContextTypeRequest < ApiModelBase
|
|
19
|
+
attr_accessor :data
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'data' => :'data'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
acceptable_attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'data' => :'ContextTypeResource'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::ContextTypeRequest` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::ContextTypeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:'data')
|
|
68
|
+
self.data = attributes[:'data']
|
|
69
|
+
else
|
|
70
|
+
self.data = nil
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
75
|
+
# @return Array for valid properties with the reasons
|
|
76
|
+
def list_invalid_properties
|
|
77
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
78
|
+
invalid_properties = Array.new
|
|
79
|
+
if @data.nil?
|
|
80
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
invalid_properties
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Check to see if the all the properties in the model are valid
|
|
87
|
+
# @return true if the model is valid
|
|
88
|
+
def valid?
|
|
89
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
90
|
+
return false if @data.nil?
|
|
91
|
+
true
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Custom attribute writer method with validation
|
|
95
|
+
# @param [Object] data Value to be assigned
|
|
96
|
+
def data=(data)
|
|
97
|
+
if data.nil?
|
|
98
|
+
fail ArgumentError, 'data cannot be nil'
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
@data = data
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Checks equality by comparing each attribute.
|
|
105
|
+
# @param [Object] Object to be compared
|
|
106
|
+
def ==(o)
|
|
107
|
+
return true if self.equal?(o)
|
|
108
|
+
self.class == o.class &&
|
|
109
|
+
data == o.data
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# @see the `==` method
|
|
113
|
+
# @param [Object] Object to be compared
|
|
114
|
+
def eql?(o)
|
|
115
|
+
self == o
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Calculates hash code according to all attributes.
|
|
119
|
+
# @return [Integer] Hash code
|
|
120
|
+
def hash
|
|
121
|
+
[data].hash
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Builds the object from hash
|
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
126
|
+
# @return [Object] Returns the model itself
|
|
127
|
+
def self.build_from_hash(attributes)
|
|
128
|
+
return nil unless attributes.is_a?(Hash)
|
|
129
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
130
|
+
transformed_hash = {}
|
|
131
|
+
openapi_types.each_pair do |key, type|
|
|
132
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
133
|
+
transformed_hash["#{key}"] = nil
|
|
134
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
135
|
+
# check to ensure the input is an array given that the attribute
|
|
136
|
+
# is documented as an array but the input is not
|
|
137
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
138
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
139
|
+
end
|
|
140
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
141
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
new(transformed_hash)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Returns the object in the form of hash
|
|
148
|
+
# @return [Hash] Returns the object in the form of hash
|
|
149
|
+
def to_hash
|
|
150
|
+
hash = {}
|
|
151
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
152
|
+
value = self.send(attr)
|
|
153
|
+
if value.nil?
|
|
154
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
155
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
hash[param] = _to_hash(value)
|
|
159
|
+
end
|
|
160
|
+
hash
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
end
|
|
@@ -14,6 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::App
|
|
17
|
+
# JSON:API resource envelope for a context type. `id` must not be specified for create requests (the server assigns it).
|
|
17
18
|
class ContextTypeResource < ApiModelBase
|
|
18
19
|
attr_accessor :id
|
|
19
20
|
|
data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_subscription_attributes.rb
CHANGED
|
@@ -14,11 +14,15 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::App
|
|
17
|
+
# Attributes accepted when creating a new subscription.
|
|
17
18
|
class CreateSubscriptionAttributes < ApiModelBase
|
|
19
|
+
# Product key to subscribe to, e.g. `flags`.
|
|
18
20
|
attr_accessor :product
|
|
19
21
|
|
|
22
|
+
# Plan key to subscribe on, e.g. `pro`.
|
|
20
23
|
attr_accessor :plan
|
|
21
24
|
|
|
25
|
+
# UUID of a payment method on file to bill against. If omitted, the account's default payment method is used.
|
|
22
26
|
attr_accessor :payment_method
|
|
23
27
|
|
|
24
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|