smplkit 3.0.65 → 3.0.66

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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/group_memberships_api.rb +295 -0
  3. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/groups_api.rb +366 -0
  4. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group.rb +247 -0
  5. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_create_request.rb +165 -0
  6. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_create_resource.rb +242 -0
  7. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_list_response.rb +193 -0
  8. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_membership.rb +215 -0
  9. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_membership_list_response.rb +193 -0
  10. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_membership_request.rb +165 -0
  11. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_membership_resource.rb +225 -0
  12. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_membership_response.rb +165 -0
  13. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_request.rb +165 -0
  14. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_resource.rb +225 -0
  15. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_response.rb +165 -0
  16. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation.rb +14 -1
  17. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation_create_item.rb +17 -4
  18. data/lib/smplkit/_generated/app/lib/smplkit_app_client.rb +14 -0
  19. data/lib/smplkit/_generated/app/spec/api/group_memberships_api_spec.rb +88 -0
  20. data/lib/smplkit/_generated/app/spec/api/groups_api_spec.rb +100 -0
  21. data/lib/smplkit/_generated/app/spec/models/group_create_request_spec.rb +36 -0
  22. data/lib/smplkit/_generated/app/spec/models/group_create_resource_spec.rb +52 -0
  23. data/lib/smplkit/_generated/app/spec/models/group_list_response_spec.rb +42 -0
  24. data/lib/smplkit/_generated/app/spec/models/group_membership_list_response_spec.rb +42 -0
  25. data/lib/smplkit/_generated/app/spec/models/group_membership_request_spec.rb +36 -0
  26. data/lib/smplkit/_generated/app/spec/models/group_membership_resource_spec.rb +52 -0
  27. data/lib/smplkit/_generated/app/spec/models/group_membership_response_spec.rb +36 -0
  28. data/lib/smplkit/_generated/app/spec/models/group_membership_spec.rb +54 -0
  29. data/lib/smplkit/_generated/app/spec/models/group_request_spec.rb +36 -0
  30. data/lib/smplkit/_generated/app/spec/models/group_resource_spec.rb +52 -0
  31. data/lib/smplkit/_generated/app/spec/models/group_response_spec.rb +36 -0
  32. data/lib/smplkit/_generated/app/spec/models/group_spec.rb +66 -0
  33. data/lib/smplkit/_generated/app/spec/models/invitation_create_item_spec.rb +6 -0
  34. data/lib/smplkit/_generated/app/spec/models/invitation_spec.rb +6 -0
  35. metadata +29 -1
@@ -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 groups.
18
+ class GroupListResponse < 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<GroupResource>',
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::GroupListResponse` 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::GroupListResponse`. 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
@@ -0,0 +1,215 @@
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 (user, group) link inside an account. Adding a user to a group creates one membership; removing them deletes one. Memberships are create-and-delete only — they expose no mutable attributes. The unique constraint on (account, user, group) makes a duplicate add a 409.
18
+ class GroupMembership < ApiModelBase
19
+ # UUID of the user this membership links. Required on create; immutable thereafter.
20
+ attr_accessor :user
21
+
22
+ # Key (id) of the group this membership links. Required on create; immutable thereafter.
23
+ attr_accessor :group
24
+
25
+ # When the membership was created.
26
+ attr_accessor :created_at
27
+
28
+ # When the membership record was last modified.
29
+ attr_accessor :updated_at
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'user' => :'user',
35
+ :'group' => :'group',
36
+ :'created_at' => :'created_at',
37
+ :'updated_at' => :'updated_at'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'user' => :'String',
55
+ :'group' => :'String',
56
+ :'created_at' => :'Time',
57
+ :'updated_at' => :'Time'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ :'created_at',
65
+ :'updated_at'
66
+ ])
67
+ end
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ def initialize(attributes = {})
72
+ if (!attributes.is_a?(Hash))
73
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::GroupMembership` initialize method"
74
+ end
75
+
76
+ # check to see if the attribute exists and convert string to symbol for hash key
77
+ acceptable_attribute_map = self.class.acceptable_attribute_map
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!acceptable_attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::GroupMembership`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'user')
86
+ self.user = attributes[:'user']
87
+ else
88
+ self.user = nil
89
+ end
90
+
91
+ if attributes.key?(:'group')
92
+ self.group = attributes[:'group']
93
+ else
94
+ self.group = nil
95
+ end
96
+
97
+ if attributes.key?(:'created_at')
98
+ self.created_at = attributes[:'created_at']
99
+ end
100
+
101
+ if attributes.key?(:'updated_at')
102
+ self.updated_at = attributes[:'updated_at']
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
110
+ invalid_properties = Array.new
111
+ if @user.nil?
112
+ invalid_properties.push('invalid value for "user", user cannot be nil.')
113
+ end
114
+
115
+ if @group.nil?
116
+ invalid_properties.push('invalid value for "group", group cannot be nil.')
117
+ end
118
+
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ warn '[DEPRECATED] the `valid?` method is obsolete'
126
+ return false if @user.nil?
127
+ return false if @group.nil?
128
+ true
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param [Object] user Value to be assigned
133
+ def user=(user)
134
+ if user.nil?
135
+ fail ArgumentError, 'user cannot be nil'
136
+ end
137
+
138
+ @user = user
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] group Value to be assigned
143
+ def group=(group)
144
+ if group.nil?
145
+ fail ArgumentError, 'group cannot be nil'
146
+ end
147
+
148
+ @group = group
149
+ end
150
+
151
+ # Checks equality by comparing each attribute.
152
+ # @param [Object] Object to be compared
153
+ def ==(o)
154
+ return true if self.equal?(o)
155
+ self.class == o.class &&
156
+ user == o.user &&
157
+ group == o.group &&
158
+ created_at == o.created_at &&
159
+ updated_at == o.updated_at
160
+ end
161
+
162
+ # @see the `==` method
163
+ # @param [Object] Object to be compared
164
+ def eql?(o)
165
+ self == o
166
+ end
167
+
168
+ # Calculates hash code according to all attributes.
169
+ # @return [Integer] Hash code
170
+ def hash
171
+ [user, group, created_at, updated_at].hash
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def self.build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ attributes = attributes.transform_keys(&:to_sym)
180
+ transformed_hash = {}
181
+ openapi_types.each_pair do |key, type|
182
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
183
+ transformed_hash["#{key}"] = nil
184
+ elsif type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[attribute_map[key]].is_a?(Array)
188
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
189
+ end
190
+ elsif !attributes[attribute_map[key]].nil?
191
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
192
+ end
193
+ end
194
+ new(transformed_hash)
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ if value.nil?
204
+ is_nullable = self.class.openapi_nullable.include?(attr)
205
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
206
+ end
207
+
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ end
214
+
215
+ 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 memberships.
18
+ class GroupMembershipListResponse < 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<GroupMembershipResource>',
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::GroupMembershipListResponse` 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::GroupMembershipListResponse`. 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