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.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/account_api.rb +11 -11
  3. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/api_keys_api.rb +18 -18
  4. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/billing_api.rb +21 -21
  5. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/context_types_api.rb +18 -18
  6. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/contexts_api.rb +11 -11
  7. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/environments_api.rb +18 -18
  8. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/metrics_api.rb +2 -2
  9. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/services_api.rb +18 -18
  10. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/users_api.rb +18 -18
  11. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/account.rb +14 -31
  12. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/account_request.rb +165 -0
  13. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/account_resource.rb +1 -0
  14. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/account_response.rb +1 -0
  15. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/account_wipe_request.rb +3 -3
  16. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/add_payment_method_attributes.rb +3 -1
  17. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/add_payment_method_body.rb +1 -0
  18. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/add_payment_method_data.rb +1 -0
  19. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/api_key.rb +15 -16
  20. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/api_key_list_response.rb +1 -0
  21. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/api_key_request.rb +165 -0
  22. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/api_key_resource.rb +1 -0
  23. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/api_key_response.rb +1 -0
  24. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/auth_token_response.rb +3 -0
  25. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context.rb +6 -3
  26. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_batch_response.rb +2 -0
  27. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_bulk_item.rb +4 -2
  28. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_bulk_register.rb +2 -0
  29. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_list_response.rb +1 -0
  30. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_request.rb +165 -0
  31. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_resource.rb +1 -0
  32. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_response.rb +1 -0
  33. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_type.rb +5 -2
  34. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_type_list_response.rb +1 -0
  35. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_type_request.rb +165 -0
  36. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_type_resource.rb +1 -0
  37. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_type_response.rb +1 -0
  38. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_subscription_attributes.rb +4 -0
  39. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_subscription_body.rb +1 -0
  40. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_subscription_data.rb +2 -0
  41. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/email.rb +3 -1
  42. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/email_resource.rb +1 -0
  43. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/email_response.rb +1 -0
  44. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment.rb +6 -0
  45. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_list_response.rb +1 -0
  46. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_request.rb +165 -0
  47. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_resource.rb +1 -0
  48. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_response.rb +1 -0
  49. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation.rb +11 -0
  50. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation_accept_request.rb +2 -0
  51. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation_bulk_create_request.rb +2 -0
  52. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation_create_item.rb +3 -0
  53. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation_list_response.rb +1 -0
  54. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation_resource.rb +1 -0
  55. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation_response.rb +1 -0
  56. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invoice.rb +13 -0
  57. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invoice_list_response.rb +1 -0
  58. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invoice_resource.rb +1 -0
  59. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invoice_single_response.rb +1 -0
  60. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/limit_definition.rb +5 -0
  61. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/login_request.rb +3 -0
  62. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_attributes.rb +7 -0
  63. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_bulk_request.rb +2 -0
  64. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_list_response.rb +1 -0
  65. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_name_item.rb +3 -0
  66. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_names_response.rb +1 -0
  67. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_resource.rb +1 -0
  68. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_rollup_attributes.rb +6 -0
  69. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_rollup_list_response.rb +1 -0
  70. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_rollup_resource.rb +1 -0
  71. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/next_tier_meta.rb +4 -0
  72. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/page_meta.rb +5 -4
  73. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/payment_method.rb +9 -1
  74. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/payment_method_list_response.rb +1 -0
  75. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/payment_method_request.rb +165 -0
  76. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/payment_method_resource.rb +1 -0
  77. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/payment_method_response.rb +1 -0
  78. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/plan.rb +4 -0
  79. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/plan_change_request.rb +2 -0
  80. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/plan_definition.rb +3 -0
  81. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/plan_list_response.rb +1 -0
  82. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/plan_resource.rb +1 -0
  83. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/product.rb +8 -0
  84. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/product_list_response.rb +1 -0
  85. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/product_resource.rb +1 -0
  86. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/register_request.rb +4 -1
  87. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/service.rb +4 -0
  88. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/service_list_response.rb +1 -0
  89. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/service_request.rb +165 -0
  90. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/service_resource.rb +1 -0
  91. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/service_response.rb +1 -0
  92. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/setup_intent_attributes.rb +2 -0
  93. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/setup_intent_response.rb +1 -0
  94. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_attributes.rb +8 -0
  95. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_list_meta.rb +6 -1
  96. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_list_response.rb +1 -0
  97. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_resource.rb +1 -0
  98. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_response.rb +1 -0
  99. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/user.rb +11 -21
  100. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/user_list_response.rb +1 -0
  101. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/user_request.rb +165 -0
  102. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/user_resource.rb +1 -0
  103. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/user_response.rb +1 -0
  104. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/value.rb +1 -0
  105. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/verify_email_request.rb +2 -0
  106. data/lib/smplkit/_generated/app/lib/smplkit_app_client.rb +8 -0
  107. data/lib/smplkit/_generated/app/spec/api/account_api_spec.rb +2 -2
  108. data/lib/smplkit/_generated/app/spec/api/api_keys_api_spec.rb +2 -2
  109. data/lib/smplkit/_generated/app/spec/api/billing_api_spec.rb +7 -7
  110. data/lib/smplkit/_generated/app/spec/api/context_types_api_spec.rb +2 -2
  111. data/lib/smplkit/_generated/app/spec/api/contexts_api_spec.rb +2 -2
  112. data/lib/smplkit/_generated/app/spec/api/environments_api_spec.rb +2 -2
  113. data/lib/smplkit/_generated/app/spec/api/metrics_api_spec.rb +1 -1
  114. data/lib/smplkit/_generated/app/spec/api/services_api_spec.rb +2 -2
  115. data/lib/smplkit/_generated/app/spec/api/users_api_spec.rb +2 -2
  116. data/lib/smplkit/_generated/app/spec/models/account_request_spec.rb +36 -0
  117. data/lib/smplkit/_generated/app/spec/models/api_key_request_spec.rb +36 -0
  118. data/lib/smplkit/_generated/app/spec/models/api_key_spec.rb +0 -6
  119. data/lib/smplkit/_generated/app/spec/models/context_request_spec.rb +36 -0
  120. data/lib/smplkit/_generated/app/spec/models/context_type_request_spec.rb +36 -0
  121. data/lib/smplkit/_generated/app/spec/models/environment_request_spec.rb +36 -0
  122. data/lib/smplkit/_generated/app/spec/models/payment_method_request_spec.rb +36 -0
  123. data/lib/smplkit/_generated/app/spec/models/service_request_spec.rb +36 -0
  124. data/lib/smplkit/_generated/app/spec/models/user_request_spec.rb +36 -0
  125. 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,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::App
17
+ # JSON:API resource envelope for an API key. `id` must not be specified for create requests (the server assigns it).
17
18
  class ApiKeyResource < ApiModelBase
18
19
  attr_accessor :id
19
20
 
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::App
17
+ # JSON:API single-resource response envelope for an API key.
17
18
  class ApiKeyResponse < ApiModelBase
18
19
  attr_accessor :data
19
20
 
@@ -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
- # Context type key (e.g., 'user', 'account')
22
+ # Key of the context type this instance belongs to (e.g. `user`, `account`).
22
23
  attr_accessor :context_type
23
24
 
24
- # Observed attributes
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
- # Context type key: 'user', 'account', 'device'
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: 'user-123', 'acme-corp'
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.
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::App
17
+ # JSON:API collection response for context instances.
17
18
  class ContextListResponse < ApiModelBase
18
19
  attr_accessor :data
19
20
 
@@ -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,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::App
17
+ # JSON:API single-resource response envelope for a context instance.
17
18
  class ContextResponse < ApiModelBase
18
19
  attr_accessor :data
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: User, Account, Device
19
+ # Display label for the context type, e.g. `User`, `Account`, or `Device`.
19
20
  attr_accessor :name
20
21
 
21
- # Known attribute keys with metadata objects
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.
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::App
17
+ # JSON:API collection response for context types.
17
18
  class ContextTypeListResponse < ApiModelBase
18
19
  attr_accessor :data
19
20
 
@@ -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
 
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::App
17
+ # JSON:API single-resource response envelope for a context type.
17
18
  class ContextTypeResponse < ApiModelBase
18
19
  attr_accessor :data
19
20
 
@@ -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.