authress-sdk 1.0.21.0 → 2.0.31.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,218 +0,0 @@
1
- =begin
2
-
3
- =end
4
-
5
- require 'date'
6
-
7
- module AuthressSdk
8
- # The user invite used to invite users to your application.
9
- class Body5
10
- # Only used when the invite includes Authress specific permissions. If no Authress permissions are defined in the statements, then the email will not be used.
11
- attr_accessor :email
12
-
13
- # A list of statements which match roles to resources. The invited user will all statements apply to them
14
- attr_accessor :statements
15
-
16
- # Attribute mapping from ruby-style variable name to JSON key.
17
- def self.attribute_map
18
- {
19
- :'email' => :'email',
20
- :'statements' => :'statements'
21
- }
22
- end
23
-
24
- # Attribute type mapping.
25
- def self.openapi_types
26
- {
27
- :'email' => :'Object',
28
- :'statements' => :'Object'
29
- }
30
- end
31
-
32
- # List of attributes with nullable: true
33
- def self.openapi_nullable
34
- Set.new([
35
- ])
36
- end
37
-
38
- # Initializes the object
39
- # @param [Hash] attributes Model attributes in the form of hash
40
- def initialize(attributes = {})
41
- if (!attributes.is_a?(Hash))
42
- fail ArgumentError, "The input argument (attributes) must be a hash in `AuthressSdk::Body5` initialize method"
43
- end
44
-
45
- # check to see if the attribute exists and convert string to symbol for hash key
46
- attributes = attributes.each_with_object({}) { |(k, v), h|
47
- if (!self.class.attribute_map.key?(k.to_sym))
48
- fail ArgumentError, "`#{k}` is not a valid attribute in `AuthressSdk::Body5`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
49
- end
50
- h[k.to_sym] = v
51
- }
52
-
53
- if attributes.key?(:'email')
54
- self.email = attributes[:'email']
55
- end
56
-
57
- if attributes.key?(:'statements')
58
- if (value = attributes[:'statements']).is_a?(Array)
59
- self.statements = value
60
- end
61
- end
62
- end
63
-
64
- # Show invalid properties with the reasons. Usually used together with valid?
65
- # @return Array for valid properties with the reasons
66
- def list_invalid_properties
67
- invalid_properties = Array.new
68
- if @statements.nil?
69
- invalid_properties.push('invalid value for "statements", statements cannot be nil.')
70
- end
71
-
72
- invalid_properties
73
- end
74
-
75
- # Check to see if the all the properties in the model are valid
76
- # @return true if the model is valid
77
- def valid?
78
- return false if @statements.nil?
79
- true
80
- end
81
-
82
- # Checks equality by comparing each attribute.
83
- # @param [Object] Object to be compared
84
- def ==(o)
85
- return true if self.equal?(o)
86
- self.class == o.class &&
87
- email == o.email &&
88
- statements == o.statements
89
- end
90
-
91
- # @see the `==` method
92
- # @param [Object] Object to be compared
93
- def eql?(o)
94
- self == o
95
- end
96
-
97
- # Calculates hash code according to all attributes.
98
- # @return [Integer] Hash code
99
- def hash
100
- [email, statements].hash
101
- end
102
-
103
- # Builds the object from hash
104
- # @param [Hash] attributes Model attributes in the form of hash
105
- # @return [Object] Returns the model itself
106
- def self.build_from_hash(attributes)
107
- new.build_from_hash(attributes)
108
- end
109
-
110
- # Builds the object from hash
111
- # @param [Hash] attributes Model attributes in the form of hash
112
- # @return [Object] Returns the model itself
113
- def build_from_hash(attributes)
114
- return nil unless attributes.is_a?(Hash)
115
- self.class.openapi_types.each_pair do |key, type|
116
- if type =~ /\AArray<(.*)>/i
117
- # check to ensure the input is an array given that the attribute
118
- # is documented as an array but the input is not
119
- if attributes[self.class.attribute_map[key]].is_a?(Array)
120
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
121
- end
122
- elsif !attributes[self.class.attribute_map[key]].nil?
123
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
125
- self.send("#{key}=", nil)
126
- end
127
- end
128
-
129
- self
130
- end
131
-
132
- # Deserializes the data based on type
133
- # @param string type Data type
134
- # @param string value Value to be deserialized
135
- # @return [Object] Deserialized data
136
- def _deserialize(type, value)
137
- case type.to_sym
138
- when :DateTime
139
- DateTime.parse(value)
140
- when :Date
141
- Date.parse(value)
142
- when :String
143
- value.to_s
144
- when :Integer
145
- value.to_i
146
- when :Float
147
- value.to_f
148
- when :Boolean
149
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
- true
151
- else
152
- false
153
- end
154
- when :Object
155
- # generic object (usually a Hash), return directly
156
- value
157
- when /\AArray<(?<inner_type>.+)>\z/
158
- inner_type = Regexp.last_match[:inner_type]
159
- value.map { |v| _deserialize(inner_type, v) }
160
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
- k_type = Regexp.last_match[:k_type]
162
- v_type = Regexp.last_match[:v_type]
163
- {}.tap do |hash|
164
- value.each do |k, v|
165
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
- end
167
- end
168
- else # model
169
- AuthressSdk.const_get(type).build_from_hash(value)
170
- end
171
- end
172
-
173
- # Returns the string representation of the object
174
- # @return [String] String presentation of the object
175
- def to_s
176
- to_hash.to_s
177
- end
178
-
179
- # to_body is an alias to to_hash (backward compatibility)
180
- # @return [Hash] Returns the object in the form of hash
181
- def to_body
182
- to_hash
183
- end
184
-
185
- # Returns the object in the form of hash
186
- # @return [Hash] Returns the object in the form of hash
187
- def to_hash
188
- hash = {}
189
- self.class.attribute_map.each_pair do |attr, param|
190
- value = self.send(attr)
191
- if value.nil?
192
- is_nullable = self.class.openapi_nullable.include?(attr)
193
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
- end
195
-
196
- hash[param] = _to_hash(value)
197
- end
198
- hash
199
- end
200
-
201
- # Outputs non-array value in the form of hash
202
- # For object, use to_hash. Otherwise, just return the value
203
- # @param [Object] value Any valid value
204
- # @return [Hash] Returns the value in the form of hash
205
- def _to_hash(value)
206
- if value.is_a?(Array)
207
- value.compact.map { |v| _to_hash(v) }
208
- elsif value.is_a?(Hash)
209
- {}.tap do |hash|
210
- value.each { |k, v| hash[k] = _to_hash(v) }
211
- end
212
- elsif value.respond_to? :to_hash
213
- value.to_hash
214
- else
215
- value
216
- end
217
- end end
218
- end
@@ -1,248 +0,0 @@
1
- =begin
2
-
3
- =end
4
-
5
- require 'date'
6
-
7
- module AuthressSdk
8
- # The role which contains a list of permissions.
9
- class Body6
10
- # Unique identifier for the role, can be specified on creation, and used by records to map to permissions.
11
- attr_accessor :role_id
12
-
13
- # A helpful name for this role
14
- attr_accessor :name
15
-
16
- # A description for when to the user as well as additional information.
17
- attr_accessor :description
18
-
19
- # A list of the permissions
20
- attr_accessor :permissions
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'role_id' => :'roleId',
26
- :'name' => :'name',
27
- :'description' => :'description',
28
- :'permissions' => :'permissions'
29
- }
30
- end
31
-
32
- # Attribute type mapping.
33
- def self.openapi_types
34
- {
35
- :'role_id' => :'Object',
36
- :'name' => :'Object',
37
- :'description' => :'Object',
38
- :'permissions' => :'Object'
39
- }
40
- end
41
-
42
- # List of attributes with nullable: true
43
- def self.openapi_nullable
44
- Set.new([
45
- ])
46
- end
47
-
48
- # Initializes the object
49
- # @param [Hash] attributes Model attributes in the form of hash
50
- def initialize(attributes = {})
51
- if (!attributes.is_a?(Hash))
52
- fail ArgumentError, "The input argument (attributes) must be a hash in `AuthressSdk::Body6` initialize method"
53
- end
54
-
55
- # check to see if the attribute exists and convert string to symbol for hash key
56
- attributes = attributes.each_with_object({}) { |(k, v), h|
57
- if (!self.class.attribute_map.key?(k.to_sym))
58
- fail ArgumentError, "`#{k}` is not a valid attribute in `AuthressSdk::Body6`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
- end
60
- h[k.to_sym] = v
61
- }
62
-
63
- if attributes.key?(:'role_id')
64
- self.role_id = attributes[:'role_id']
65
- end
66
-
67
- if attributes.key?(:'name')
68
- self.name = attributes[:'name']
69
- end
70
-
71
- if attributes.key?(:'description')
72
- self.description = attributes[:'description']
73
- end
74
-
75
- if attributes.key?(:'permissions')
76
- if (value = attributes[:'permissions']).is_a?(Array)
77
- self.permissions = value
78
- end
79
- end
80
- end
81
-
82
- # Show invalid properties with the reasons. Usually used together with valid?
83
- # @return Array for valid properties with the reasons
84
- def list_invalid_properties
85
- invalid_properties = Array.new
86
- if @role_id.nil?
87
- invalid_properties.push('invalid value for "role_id", role_id cannot be nil.')
88
- end
89
-
90
- if @name.nil?
91
- invalid_properties.push('invalid value for "name", name cannot be nil.')
92
- end
93
-
94
- if @permissions.nil?
95
- invalid_properties.push('invalid value for "permissions", permissions cannot be nil.')
96
- end
97
-
98
- invalid_properties
99
- end
100
-
101
- # Check to see if the all the properties in the model are valid
102
- # @return true if the model is valid
103
- def valid?
104
- return false if @role_id.nil?
105
- return false if @name.nil?
106
- return false if @permissions.nil?
107
- true
108
- end
109
-
110
- # Checks equality by comparing each attribute.
111
- # @param [Object] Object to be compared
112
- def ==(o)
113
- return true if self.equal?(o)
114
- self.class == o.class &&
115
- role_id == o.role_id &&
116
- name == o.name &&
117
- description == o.description &&
118
- permissions == o.permissions
119
- end
120
-
121
- # @see the `==` method
122
- # @param [Object] Object to be compared
123
- def eql?(o)
124
- self == o
125
- end
126
-
127
- # Calculates hash code according to all attributes.
128
- # @return [Integer] Hash code
129
- def hash
130
- [role_id, name, description, permissions].hash
131
- end
132
-
133
- # Builds the object from hash
134
- # @param [Hash] attributes Model attributes in the form of hash
135
- # @return [Object] Returns the model itself
136
- def self.build_from_hash(attributes)
137
- new.build_from_hash(attributes)
138
- end
139
-
140
- # Builds the object from hash
141
- # @param [Hash] attributes Model attributes in the form of hash
142
- # @return [Object] Returns the model itself
143
- def build_from_hash(attributes)
144
- return nil unless attributes.is_a?(Hash)
145
- self.class.openapi_types.each_pair do |key, type|
146
- if type =~ /\AArray<(.*)>/i
147
- # check to ensure the input is an array given that the attribute
148
- # is documented as an array but the input is not
149
- if attributes[self.class.attribute_map[key]].is_a?(Array)
150
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
151
- end
152
- elsif !attributes[self.class.attribute_map[key]].nil?
153
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
155
- self.send("#{key}=", nil)
156
- end
157
- end
158
-
159
- self
160
- end
161
-
162
- # Deserializes the data based on type
163
- # @param string type Data type
164
- # @param string value Value to be deserialized
165
- # @return [Object] Deserialized data
166
- def _deserialize(type, value)
167
- case type.to_sym
168
- when :DateTime
169
- DateTime.parse(value)
170
- when :Date
171
- Date.parse(value)
172
- when :String
173
- value.to_s
174
- when :Integer
175
- value.to_i
176
- when :Float
177
- value.to_f
178
- when :Boolean
179
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
180
- true
181
- else
182
- false
183
- end
184
- when :Object
185
- # generic object (usually a Hash), return directly
186
- value
187
- when /\AArray<(?<inner_type>.+)>\z/
188
- inner_type = Regexp.last_match[:inner_type]
189
- value.map { |v| _deserialize(inner_type, v) }
190
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
191
- k_type = Regexp.last_match[:k_type]
192
- v_type = Regexp.last_match[:v_type]
193
- {}.tap do |hash|
194
- value.each do |k, v|
195
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
196
- end
197
- end
198
- else # model
199
- AuthressSdk.const_get(type).build_from_hash(value)
200
- end
201
- end
202
-
203
- # Returns the string representation of the object
204
- # @return [String] String presentation of the object
205
- def to_s
206
- to_hash.to_s
207
- end
208
-
209
- # to_body is an alias to to_hash (backward compatibility)
210
- # @return [Hash] Returns the object in the form of hash
211
- def to_body
212
- to_hash
213
- end
214
-
215
- # Returns the object in the form of hash
216
- # @return [Hash] Returns the object in the form of hash
217
- def to_hash
218
- hash = {}
219
- self.class.attribute_map.each_pair do |attr, param|
220
- value = self.send(attr)
221
- if value.nil?
222
- is_nullable = self.class.openapi_nullable.include?(attr)
223
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
224
- end
225
-
226
- hash[param] = _to_hash(value)
227
- end
228
- hash
229
- end
230
-
231
- # Outputs non-array value in the form of hash
232
- # For object, use to_hash. Otherwise, just return the value
233
- # @param [Object] value Any valid value
234
- # @return [Hash] Returns the value in the form of hash
235
- def _to_hash(value)
236
- if value.is_a?(Array)
237
- value.compact.map { |v| _to_hash(v) }
238
- elsif value.is_a?(Hash)
239
- {}.tap do |hash|
240
- value.each { |k, v| hash[k] = _to_hash(v) }
241
- end
242
- elsif value.respond_to? :to_hash
243
- value.to_hash
244
- else
245
- value
246
- end
247
- end end
248
- end
@@ -1,248 +0,0 @@
1
- =begin
2
-
3
- =end
4
-
5
- require 'date'
6
-
7
- module AuthressSdk
8
- # The role which contains a list of permissions.
9
- class Body7
10
- # Unique identifier for the role, can be specified on creation, and used by records to map to permissions.
11
- attr_accessor :role_id
12
-
13
- # A helpful name for this role
14
- attr_accessor :name
15
-
16
- # A description for when to the user as well as additional information.
17
- attr_accessor :description
18
-
19
- # A list of the permissions
20
- attr_accessor :permissions
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'role_id' => :'roleId',
26
- :'name' => :'name',
27
- :'description' => :'description',
28
- :'permissions' => :'permissions'
29
- }
30
- end
31
-
32
- # Attribute type mapping.
33
- def self.openapi_types
34
- {
35
- :'role_id' => :'Object',
36
- :'name' => :'Object',
37
- :'description' => :'Object',
38
- :'permissions' => :'Object'
39
- }
40
- end
41
-
42
- # List of attributes with nullable: true
43
- def self.openapi_nullable
44
- Set.new([
45
- ])
46
- end
47
-
48
- # Initializes the object
49
- # @param [Hash] attributes Model attributes in the form of hash
50
- def initialize(attributes = {})
51
- if (!attributes.is_a?(Hash))
52
- fail ArgumentError, "The input argument (attributes) must be a hash in `AuthressSdk::Body7` initialize method"
53
- end
54
-
55
- # check to see if the attribute exists and convert string to symbol for hash key
56
- attributes = attributes.each_with_object({}) { |(k, v), h|
57
- if (!self.class.attribute_map.key?(k.to_sym))
58
- fail ArgumentError, "`#{k}` is not a valid attribute in `AuthressSdk::Body7`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
- end
60
- h[k.to_sym] = v
61
- }
62
-
63
- if attributes.key?(:'role_id')
64
- self.role_id = attributes[:'role_id']
65
- end
66
-
67
- if attributes.key?(:'name')
68
- self.name = attributes[:'name']
69
- end
70
-
71
- if attributes.key?(:'description')
72
- self.description = attributes[:'description']
73
- end
74
-
75
- if attributes.key?(:'permissions')
76
- if (value = attributes[:'permissions']).is_a?(Array)
77
- self.permissions = value
78
- end
79
- end
80
- end
81
-
82
- # Show invalid properties with the reasons. Usually used together with valid?
83
- # @return Array for valid properties with the reasons
84
- def list_invalid_properties
85
- invalid_properties = Array.new
86
- if @role_id.nil?
87
- invalid_properties.push('invalid value for "role_id", role_id cannot be nil.')
88
- end
89
-
90
- if @name.nil?
91
- invalid_properties.push('invalid value for "name", name cannot be nil.')
92
- end
93
-
94
- if @permissions.nil?
95
- invalid_properties.push('invalid value for "permissions", permissions cannot be nil.')
96
- end
97
-
98
- invalid_properties
99
- end
100
-
101
- # Check to see if the all the properties in the model are valid
102
- # @return true if the model is valid
103
- def valid?
104
- return false if @role_id.nil?
105
- return false if @name.nil?
106
- return false if @permissions.nil?
107
- true
108
- end
109
-
110
- # Checks equality by comparing each attribute.
111
- # @param [Object] Object to be compared
112
- def ==(o)
113
- return true if self.equal?(o)
114
- self.class == o.class &&
115
- role_id == o.role_id &&
116
- name == o.name &&
117
- description == o.description &&
118
- permissions == o.permissions
119
- end
120
-
121
- # @see the `==` method
122
- # @param [Object] Object to be compared
123
- def eql?(o)
124
- self == o
125
- end
126
-
127
- # Calculates hash code according to all attributes.
128
- # @return [Integer] Hash code
129
- def hash
130
- [role_id, name, description, permissions].hash
131
- end
132
-
133
- # Builds the object from hash
134
- # @param [Hash] attributes Model attributes in the form of hash
135
- # @return [Object] Returns the model itself
136
- def self.build_from_hash(attributes)
137
- new.build_from_hash(attributes)
138
- end
139
-
140
- # Builds the object from hash
141
- # @param [Hash] attributes Model attributes in the form of hash
142
- # @return [Object] Returns the model itself
143
- def build_from_hash(attributes)
144
- return nil unless attributes.is_a?(Hash)
145
- self.class.openapi_types.each_pair do |key, type|
146
- if type =~ /\AArray<(.*)>/i
147
- # check to ensure the input is an array given that the attribute
148
- # is documented as an array but the input is not
149
- if attributes[self.class.attribute_map[key]].is_a?(Array)
150
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
151
- end
152
- elsif !attributes[self.class.attribute_map[key]].nil?
153
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
155
- self.send("#{key}=", nil)
156
- end
157
- end
158
-
159
- self
160
- end
161
-
162
- # Deserializes the data based on type
163
- # @param string type Data type
164
- # @param string value Value to be deserialized
165
- # @return [Object] Deserialized data
166
- def _deserialize(type, value)
167
- case type.to_sym
168
- when :DateTime
169
- DateTime.parse(value)
170
- when :Date
171
- Date.parse(value)
172
- when :String
173
- value.to_s
174
- when :Integer
175
- value.to_i
176
- when :Float
177
- value.to_f
178
- when :Boolean
179
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
180
- true
181
- else
182
- false
183
- end
184
- when :Object
185
- # generic object (usually a Hash), return directly
186
- value
187
- when /\AArray<(?<inner_type>.+)>\z/
188
- inner_type = Regexp.last_match[:inner_type]
189
- value.map { |v| _deserialize(inner_type, v) }
190
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
191
- k_type = Regexp.last_match[:k_type]
192
- v_type = Regexp.last_match[:v_type]
193
- {}.tap do |hash|
194
- value.each do |k, v|
195
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
196
- end
197
- end
198
- else # model
199
- AuthressSdk.const_get(type).build_from_hash(value)
200
- end
201
- end
202
-
203
- # Returns the string representation of the object
204
- # @return [String] String presentation of the object
205
- def to_s
206
- to_hash.to_s
207
- end
208
-
209
- # to_body is an alias to to_hash (backward compatibility)
210
- # @return [Hash] Returns the object in the form of hash
211
- def to_body
212
- to_hash
213
- end
214
-
215
- # Returns the object in the form of hash
216
- # @return [Hash] Returns the object in the form of hash
217
- def to_hash
218
- hash = {}
219
- self.class.attribute_map.each_pair do |attr, param|
220
- value = self.send(attr)
221
- if value.nil?
222
- is_nullable = self.class.openapi_nullable.include?(attr)
223
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
224
- end
225
-
226
- hash[param] = _to_hash(value)
227
- end
228
- hash
229
- end
230
-
231
- # Outputs non-array value in the form of hash
232
- # For object, use to_hash. Otherwise, just return the value
233
- # @param [Object] value Any valid value
234
- # @return [Hash] Returns the value in the form of hash
235
- def _to_hash(value)
236
- if value.is_a?(Array)
237
- value.compact.map { |v| _to_hash(v) }
238
- elsif value.is_a?(Hash)
239
- {}.tap do |hash|
240
- value.each { |k, v| hash[k] = _to_hash(v) }
241
- end
242
- elsif value.respond_to? :to_hash
243
- value.to_hash
244
- else
245
- value
246
- end
247
- end end
248
- end