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.
- checksums.yaml +4 -4
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/group_memberships_api.rb +295 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/groups_api.rb +366 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group.rb +247 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_create_request.rb +165 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_create_resource.rb +242 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_list_response.rb +193 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_membership.rb +215 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_membership_list_response.rb +193 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_membership_request.rb +165 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_membership_resource.rb +225 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_membership_response.rb +165 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_request.rb +165 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_resource.rb +225 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/group_response.rb +165 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation.rb +14 -1
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/invitation_create_item.rb +17 -4
- data/lib/smplkit/_generated/app/lib/smplkit_app_client.rb +14 -0
- data/lib/smplkit/_generated/app/spec/api/group_memberships_api_spec.rb +88 -0
- data/lib/smplkit/_generated/app/spec/api/groups_api_spec.rb +100 -0
- data/lib/smplkit/_generated/app/spec/models/group_create_request_spec.rb +36 -0
- data/lib/smplkit/_generated/app/spec/models/group_create_resource_spec.rb +52 -0
- data/lib/smplkit/_generated/app/spec/models/group_list_response_spec.rb +42 -0
- data/lib/smplkit/_generated/app/spec/models/group_membership_list_response_spec.rb +42 -0
- data/lib/smplkit/_generated/app/spec/models/group_membership_request_spec.rb +36 -0
- data/lib/smplkit/_generated/app/spec/models/group_membership_resource_spec.rb +52 -0
- data/lib/smplkit/_generated/app/spec/models/group_membership_response_spec.rb +36 -0
- data/lib/smplkit/_generated/app/spec/models/group_membership_spec.rb +54 -0
- data/lib/smplkit/_generated/app/spec/models/group_request_spec.rb +36 -0
- data/lib/smplkit/_generated/app/spec/models/group_resource_spec.rb +52 -0
- data/lib/smplkit/_generated/app/spec/models/group_response_spec.rb +36 -0
- data/lib/smplkit/_generated/app/spec/models/group_spec.rb +66 -0
- data/lib/smplkit/_generated/app/spec/models/invitation_create_item_spec.rb +6 -0
- data/lib/smplkit/_generated/app/spec/models/invitation_spec.rb +6 -0
- metadata +29 -1
|
@@ -0,0 +1,247 @@
|
|
|
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
|
+
# An Environment Access Group: a named bundle of standard environments its members may manage. A user's effective managed-environment set is the union across all their groups (or \"all\" if any of their groups grants ``[\"*\"]``). Roles answer *what* a user may do; groups answer *which environments* that capability reaches.
|
|
18
|
+
class Group < ApiModelBase
|
|
19
|
+
# Human-readable name for the group.
|
|
20
|
+
attr_accessor :name
|
|
21
|
+
|
|
22
|
+
# Free-text description shown on the group's detail page.
|
|
23
|
+
attr_accessor :description
|
|
24
|
+
|
|
25
|
+
# The set of environments members of this group may manage. Either the exact value `[\"*\"]` to grant every standard environment, or an explicit array of standard environment keys. Ad-hoc environments are never listed here — they are exempt from group governance and remain manageable by every member of the account.
|
|
26
|
+
attr_accessor :managed_environments
|
|
27
|
+
|
|
28
|
+
# True for built-in groups the platform reserves. The `default` group has `system=true`; it cannot be deleted or renamed, though its `managed_environments` may be narrowed.
|
|
29
|
+
attr_accessor :system
|
|
30
|
+
|
|
31
|
+
# When the group was created.
|
|
32
|
+
attr_accessor :created_at
|
|
33
|
+
|
|
34
|
+
# When the group was last modified.
|
|
35
|
+
attr_accessor :updated_at
|
|
36
|
+
|
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
38
|
+
def self.attribute_map
|
|
39
|
+
{
|
|
40
|
+
:'name' => :'name',
|
|
41
|
+
:'description' => :'description',
|
|
42
|
+
:'managed_environments' => :'managed_environments',
|
|
43
|
+
:'system' => :'system',
|
|
44
|
+
:'created_at' => :'created_at',
|
|
45
|
+
:'updated_at' => :'updated_at'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Returns attribute mapping this model knows about
|
|
50
|
+
def self.acceptable_attribute_map
|
|
51
|
+
attribute_map
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Returns all the JSON keys this model knows about
|
|
55
|
+
def self.acceptable_attributes
|
|
56
|
+
acceptable_attribute_map.values
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Attribute type mapping.
|
|
60
|
+
def self.openapi_types
|
|
61
|
+
{
|
|
62
|
+
:'name' => :'String',
|
|
63
|
+
:'description' => :'String',
|
|
64
|
+
:'managed_environments' => :'Array<String>',
|
|
65
|
+
:'system' => :'Boolean',
|
|
66
|
+
:'created_at' => :'Time',
|
|
67
|
+
:'updated_at' => :'Time'
|
|
68
|
+
}
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# List of attributes with nullable: true
|
|
72
|
+
def self.openapi_nullable
|
|
73
|
+
Set.new([
|
|
74
|
+
:'description',
|
|
75
|
+
:'created_at',
|
|
76
|
+
:'updated_at'
|
|
77
|
+
])
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Initializes the object
|
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
82
|
+
def initialize(attributes = {})
|
|
83
|
+
if (!attributes.is_a?(Hash))
|
|
84
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::Group` initialize method"
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
88
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
89
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
90
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
91
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::Group`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
92
|
+
end
|
|
93
|
+
h[k.to_sym] = v
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'name')
|
|
97
|
+
self.name = attributes[:'name']
|
|
98
|
+
else
|
|
99
|
+
self.name = nil
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'description')
|
|
103
|
+
self.description = attributes[:'description']
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'managed_environments')
|
|
107
|
+
if (value = attributes[:'managed_environments']).is_a?(Array)
|
|
108
|
+
self.managed_environments = value
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'system')
|
|
113
|
+
self.system = attributes[:'system']
|
|
114
|
+
else
|
|
115
|
+
self.system = false
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'created_at')
|
|
119
|
+
self.created_at = attributes[:'created_at']
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'updated_at')
|
|
123
|
+
self.updated_at = attributes[:'updated_at']
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
128
|
+
# @return Array for valid properties with the reasons
|
|
129
|
+
def list_invalid_properties
|
|
130
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
131
|
+
invalid_properties = Array.new
|
|
132
|
+
if @name.nil?
|
|
133
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if @name.to_s.length > 255
|
|
137
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if !@description.nil? && @description.to_s.length > 1024
|
|
141
|
+
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 1024.')
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
invalid_properties
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Check to see if the all the properties in the model are valid
|
|
148
|
+
# @return true if the model is valid
|
|
149
|
+
def valid?
|
|
150
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
151
|
+
return false if @name.nil?
|
|
152
|
+
return false if @name.to_s.length > 255
|
|
153
|
+
return false if !@description.nil? && @description.to_s.length > 1024
|
|
154
|
+
true
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Custom attribute writer method with validation
|
|
158
|
+
# @param [Object] name Value to be assigned
|
|
159
|
+
def name=(name)
|
|
160
|
+
if name.nil?
|
|
161
|
+
fail ArgumentError, 'name cannot be nil'
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if name.to_s.length > 255
|
|
165
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
@name = name
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Custom attribute writer method with validation
|
|
172
|
+
# @param [Object] description Value to be assigned
|
|
173
|
+
def description=(description)
|
|
174
|
+
if !description.nil? && description.to_s.length > 1024
|
|
175
|
+
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 1024.'
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
@description = description
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Checks equality by comparing each attribute.
|
|
182
|
+
# @param [Object] Object to be compared
|
|
183
|
+
def ==(o)
|
|
184
|
+
return true if self.equal?(o)
|
|
185
|
+
self.class == o.class &&
|
|
186
|
+
name == o.name &&
|
|
187
|
+
description == o.description &&
|
|
188
|
+
managed_environments == o.managed_environments &&
|
|
189
|
+
system == o.system &&
|
|
190
|
+
created_at == o.created_at &&
|
|
191
|
+
updated_at == o.updated_at
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# @see the `==` method
|
|
195
|
+
# @param [Object] Object to be compared
|
|
196
|
+
def eql?(o)
|
|
197
|
+
self == o
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Calculates hash code according to all attributes.
|
|
201
|
+
# @return [Integer] Hash code
|
|
202
|
+
def hash
|
|
203
|
+
[name, description, managed_environments, system, created_at, updated_at].hash
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Builds the object from hash
|
|
207
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
208
|
+
# @return [Object] Returns the model itself
|
|
209
|
+
def self.build_from_hash(attributes)
|
|
210
|
+
return nil unless attributes.is_a?(Hash)
|
|
211
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
212
|
+
transformed_hash = {}
|
|
213
|
+
openapi_types.each_pair do |key, type|
|
|
214
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
215
|
+
transformed_hash["#{key}"] = nil
|
|
216
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
217
|
+
# check to ensure the input is an array given that the attribute
|
|
218
|
+
# is documented as an array but the input is not
|
|
219
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
220
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
221
|
+
end
|
|
222
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
223
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
new(transformed_hash)
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Returns the object in the form of hash
|
|
230
|
+
# @return [Hash] Returns the object in the form of hash
|
|
231
|
+
def to_hash
|
|
232
|
+
hash = {}
|
|
233
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
234
|
+
value = self.send(attr)
|
|
235
|
+
if value.nil?
|
|
236
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
237
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
hash[param] = _to_hash(value)
|
|
241
|
+
end
|
|
242
|
+
hash
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
end
|
|
@@ -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 a group. Distinct from :class:`GroupRequest` because create requires caller-supplied ``data.id`` while update does not.
|
|
18
|
+
class GroupCreateRequest < 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' => :'GroupCreateResource'
|
|
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::GroupCreateRequest` 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::GroupCreateRequest`. 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
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#smplkit API
|
|
3
|
+
|
|
4
|
+
#API for the smplkit platform.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module SmplkitGeneratedClient::App
|
|
17
|
+
# JSON:API resource envelope for creating a group (id required).
|
|
18
|
+
class GroupCreateResource < ApiModelBase
|
|
19
|
+
# Client-supplied resource id.
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
attr_accessor :type
|
|
23
|
+
|
|
24
|
+
attr_accessor :attributes
|
|
25
|
+
|
|
26
|
+
class EnumAttributeValidator
|
|
27
|
+
attr_reader :datatype
|
|
28
|
+
attr_reader :allowable_values
|
|
29
|
+
|
|
30
|
+
def initialize(datatype, allowable_values)
|
|
31
|
+
@allowable_values = allowable_values.map do |value|
|
|
32
|
+
case datatype.to_s
|
|
33
|
+
when /Integer/i
|
|
34
|
+
value.to_i
|
|
35
|
+
when /Float/i
|
|
36
|
+
value.to_f
|
|
37
|
+
else
|
|
38
|
+
value
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def valid?(value)
|
|
44
|
+
!value || allowable_values.include?(value)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
49
|
+
def self.attribute_map
|
|
50
|
+
{
|
|
51
|
+
:'id' => :'id',
|
|
52
|
+
:'type' => :'type',
|
|
53
|
+
:'attributes' => :'attributes'
|
|
54
|
+
}
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns attribute mapping this model knows about
|
|
58
|
+
def self.acceptable_attribute_map
|
|
59
|
+
attribute_map
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Returns all the JSON keys this model knows about
|
|
63
|
+
def self.acceptable_attributes
|
|
64
|
+
acceptable_attribute_map.values
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Attribute type mapping.
|
|
68
|
+
def self.openapi_types
|
|
69
|
+
{
|
|
70
|
+
:'id' => :'String',
|
|
71
|
+
:'type' => :'String',
|
|
72
|
+
:'attributes' => :'Group'
|
|
73
|
+
}
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# List of attributes with nullable: true
|
|
77
|
+
def self.openapi_nullable
|
|
78
|
+
Set.new([
|
|
79
|
+
])
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Initializes the object
|
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
84
|
+
def initialize(attributes = {})
|
|
85
|
+
if (!attributes.is_a?(Hash))
|
|
86
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::GroupCreateResource` initialize method"
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
90
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
91
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
92
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
93
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::GroupCreateResource`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
94
|
+
end
|
|
95
|
+
h[k.to_sym] = v
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'id')
|
|
99
|
+
self.id = attributes[:'id']
|
|
100
|
+
else
|
|
101
|
+
self.id = nil
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'type')
|
|
105
|
+
self.type = attributes[:'type']
|
|
106
|
+
else
|
|
107
|
+
self.type = nil
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'attributes')
|
|
111
|
+
self.attributes = attributes[:'attributes']
|
|
112
|
+
else
|
|
113
|
+
self.attributes = nil
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
118
|
+
# @return Array for valid properties with the reasons
|
|
119
|
+
def list_invalid_properties
|
|
120
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
121
|
+
invalid_properties = Array.new
|
|
122
|
+
if @id.nil?
|
|
123
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if @type.nil?
|
|
127
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if @attributes.nil?
|
|
131
|
+
invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
invalid_properties
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Check to see if the all the properties in the model are valid
|
|
138
|
+
# @return true if the model is valid
|
|
139
|
+
def valid?
|
|
140
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
141
|
+
return false if @id.nil?
|
|
142
|
+
return false if @type.nil?
|
|
143
|
+
type_validator = EnumAttributeValidator.new('String', ["group"])
|
|
144
|
+
return false unless type_validator.valid?(@type)
|
|
145
|
+
return false if @attributes.nil?
|
|
146
|
+
true
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Custom attribute writer method with validation
|
|
150
|
+
# @param [Object] id Value to be assigned
|
|
151
|
+
def id=(id)
|
|
152
|
+
if id.nil?
|
|
153
|
+
fail ArgumentError, 'id cannot be nil'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
@id = id
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
160
|
+
# @param [Object] type Object to be assigned
|
|
161
|
+
def type=(type)
|
|
162
|
+
validator = EnumAttributeValidator.new('String', ["group"])
|
|
163
|
+
unless validator.valid?(type)
|
|
164
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
165
|
+
end
|
|
166
|
+
@type = type
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Custom attribute writer method with validation
|
|
170
|
+
# @param [Object] attributes Value to be assigned
|
|
171
|
+
def attributes=(attributes)
|
|
172
|
+
if attributes.nil?
|
|
173
|
+
fail ArgumentError, 'attributes cannot be nil'
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
@attributes = attributes
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Checks equality by comparing each attribute.
|
|
180
|
+
# @param [Object] Object to be compared
|
|
181
|
+
def ==(o)
|
|
182
|
+
return true if self.equal?(o)
|
|
183
|
+
self.class == o.class &&
|
|
184
|
+
id == o.id &&
|
|
185
|
+
type == o.type &&
|
|
186
|
+
attributes == o.attributes
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# @see the `==` method
|
|
190
|
+
# @param [Object] Object to be compared
|
|
191
|
+
def eql?(o)
|
|
192
|
+
self == o
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Calculates hash code according to all attributes.
|
|
196
|
+
# @return [Integer] Hash code
|
|
197
|
+
def hash
|
|
198
|
+
[id, type, attributes].hash
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Builds the object from hash
|
|
202
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
203
|
+
# @return [Object] Returns the model itself
|
|
204
|
+
def self.build_from_hash(attributes)
|
|
205
|
+
return nil unless attributes.is_a?(Hash)
|
|
206
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
207
|
+
transformed_hash = {}
|
|
208
|
+
openapi_types.each_pair do |key, type|
|
|
209
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
210
|
+
transformed_hash["#{key}"] = nil
|
|
211
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
212
|
+
# check to ensure the input is an array given that the attribute
|
|
213
|
+
# is documented as an array but the input is not
|
|
214
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
215
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
216
|
+
end
|
|
217
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
218
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
new(transformed_hash)
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Returns the object in the form of hash
|
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
|
226
|
+
def to_hash
|
|
227
|
+
hash = {}
|
|
228
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
229
|
+
value = self.send(attr)
|
|
230
|
+
if value.nil?
|
|
231
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
232
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
hash[param] = _to_hash(value)
|
|
236
|
+
end
|
|
237
|
+
hash
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
end
|