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