xbim_identity 2.0.0

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 (103) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +174 -0
  4. data/Rakefile +10 -0
  5. data/lib/xbim_identity/api/authentication_api.rb +118 -0
  6. data/lib/xbim_identity/api/client_applications_api.rb +315 -0
  7. data/lib/xbim_identity/api/invitations_api.rb +489 -0
  8. data/lib/xbim_identity/api/me_api.rb +148 -0
  9. data/lib/xbim_identity/api/members_api.rb +406 -0
  10. data/lib/xbim_identity/api/registration_api.rb +85 -0
  11. data/lib/xbim_identity/api/tenants_api.rb +709 -0
  12. data/lib/xbim_identity/api/users_api.rb +308 -0
  13. data/lib/xbim_identity/api_client.rb +390 -0
  14. data/lib/xbim_identity/api_error.rb +57 -0
  15. data/lib/xbim_identity/configuration.rb +278 -0
  16. data/lib/xbim_identity/models/application_type.rb +39 -0
  17. data/lib/xbim_identity/models/client_app.rb +351 -0
  18. data/lib/xbim_identity/models/client_app_endpoint.rb +239 -0
  19. data/lib/xbim_identity/models/draft_invitation.rb +379 -0
  20. data/lib/xbim_identity/models/invitation.rb +379 -0
  21. data/lib/xbim_identity/models/invitation_create.rb +253 -0
  22. data/lib/xbim_identity/models/invitation_edit.rb +239 -0
  23. data/lib/xbim_identity/models/invite_status.rb +41 -0
  24. data/lib/xbim_identity/models/master.rb +331 -0
  25. data/lib/xbim_identity/models/master_base.rb +243 -0
  26. data/lib/xbim_identity/models/master_subscription.rb +323 -0
  27. data/lib/xbim_identity/models/o_data_boolean.rb +230 -0
  28. data/lib/xbim_identity/models/o_data_client_app_endpoint_list.rb +252 -0
  29. data/lib/xbim_identity/models/o_data_client_app_list.rb +252 -0
  30. data/lib/xbim_identity/models/o_data_invitation_list.rb +252 -0
  31. data/lib/xbim_identity/models/o_data_string.rb +230 -0
  32. data/lib/xbim_identity/models/o_data_tenant_list.rb +252 -0
  33. data/lib/xbim_identity/models/o_data_tenant_user_list.rb +252 -0
  34. data/lib/xbim_identity/models/o_data_user_list.rb +252 -0
  35. data/lib/xbim_identity/models/problem_details.rb +259 -0
  36. data/lib/xbim_identity/models/region.rb +280 -0
  37. data/lib/xbim_identity/models/region_info.rb +256 -0
  38. data/lib/xbim_identity/models/subscription.rb +309 -0
  39. data/lib/xbim_identity/models/team_member_create.rb +229 -0
  40. data/lib/xbim_identity/models/team_member_edit.rb +219 -0
  41. data/lib/xbim_identity/models/tenancy_type.rb +38 -0
  42. data/lib/xbim_identity/models/tenant.rb +383 -0
  43. data/lib/xbim_identity/models/tenant_create.rb +267 -0
  44. data/lib/xbim_identity/models/tenant_edit.rb +229 -0
  45. data/lib/xbim_identity/models/tenant_role.rb +39 -0
  46. data/lib/xbim_identity/models/tenant_user.rb +299 -0
  47. data/lib/xbim_identity/models/token_err_response.rb +219 -0
  48. data/lib/xbim_identity/models/token_response.rb +259 -0
  49. data/lib/xbim_identity/models/user.rb +261 -0
  50. data/lib/xbim_identity/models/user_create.rb +247 -0
  51. data/lib/xbim_identity/models/user_tenant.rb +279 -0
  52. data/lib/xbim_identity/version.rb +15 -0
  53. data/lib/xbim_identity.rb +83 -0
  54. data/spec/api/authentication_api_spec.rb +52 -0
  55. data/spec/api/client_applications_api_spec.rb +101 -0
  56. data/spec/api/invitations_api_spec.rb +130 -0
  57. data/spec/api/me_api_spec.rb +61 -0
  58. data/spec/api/members_api_spec.rb +113 -0
  59. data/spec/api/registration_api_spec.rb +48 -0
  60. data/spec/api/tenants_api_spec.rb +176 -0
  61. data/spec/api/users_api_spec.rb +95 -0
  62. data/spec/api_client_spec.rb +226 -0
  63. data/spec/configuration_spec.rb +42 -0
  64. data/spec/models/application_type_spec.rb +28 -0
  65. data/spec/models/client_app_endpoint_spec.rb +46 -0
  66. data/spec/models/client_app_spec.rb +112 -0
  67. data/spec/models/draft_invitation_spec.rb +130 -0
  68. data/spec/models/invitation_create_spec.rb +52 -0
  69. data/spec/models/invitation_edit_spec.rb +46 -0
  70. data/spec/models/invitation_spec.rb +130 -0
  71. data/spec/models/invite_status_spec.rb +28 -0
  72. data/spec/models/master_base_spec.rb +46 -0
  73. data/spec/models/master_spec.rb +94 -0
  74. data/spec/models/master_subscription_spec.rb +94 -0
  75. data/spec/models/o_data_boolean_spec.rb +40 -0
  76. data/spec/models/o_data_client_app_endpoint_list_spec.rb +52 -0
  77. data/spec/models/o_data_client_app_list_spec.rb +52 -0
  78. data/spec/models/o_data_invitation_list_spec.rb +52 -0
  79. data/spec/models/o_data_string_spec.rb +40 -0
  80. data/spec/models/o_data_tenant_list_spec.rb +52 -0
  81. data/spec/models/o_data_tenant_user_list_spec.rb +52 -0
  82. data/spec/models/o_data_user_list_spec.rb +52 -0
  83. data/spec/models/problem_details_spec.rb +58 -0
  84. data/spec/models/region_info_spec.rb +46 -0
  85. data/spec/models/region_spec.rb +58 -0
  86. data/spec/models/subscription_spec.rb +88 -0
  87. data/spec/models/team_member_create_spec.rb +40 -0
  88. data/spec/models/team_member_edit_spec.rb +34 -0
  89. data/spec/models/tenancy_type_spec.rb +28 -0
  90. data/spec/models/tenant_create_spec.rb +58 -0
  91. data/spec/models/tenant_edit_spec.rb +40 -0
  92. data/spec/models/tenant_role_spec.rb +28 -0
  93. data/spec/models/tenant_spec.rb +130 -0
  94. data/spec/models/tenant_user_spec.rb +82 -0
  95. data/spec/models/token_err_response_spec.rb +34 -0
  96. data/spec/models/token_response_spec.rb +58 -0
  97. data/spec/models/user_create_spec.rb +46 -0
  98. data/spec/models/user_spec.rb +58 -0
  99. data/spec/models/user_tenant_spec.rb +70 -0
  100. data/spec/spec_helper.rb +111 -0
  101. data/xbim_identity-1.0.0.gem +0 -0
  102. data/xbim_identity.gemspec +38 -0
  103. metadata +184 -0
@@ -0,0 +1,230 @@
1
+ =begin
2
+ #Xbim Flex Identity API 2.0
3
+
4
+ #Communication centralised around construction data
5
+
6
+ The version of the OpenAPI document: 2.0
7
+ Contact: info@xbim.net
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module XbimIdentity
17
+ # Annotation class. Used to describe the value return types from OData controllers
18
+ class ODataBoolean
19
+ attr_accessor :odata_context
20
+
21
+ attr_accessor :value
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'odata_context' => :'@odata.context',
27
+ :'value' => :'value'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'odata_context' => :'String',
40
+ :'value' => :'Boolean'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ :'odata_context',
48
+ :'value'
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XbimIdentity::ODataBoolean` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XbimIdentity::ODataBoolean`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'odata_context')
68
+ self.odata_context = attributes[:'odata_context']
69
+ end
70
+
71
+ if attributes.key?(:'value')
72
+ self.value = attributes[:'value']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ odata_context == o.odata_context &&
95
+ value == o.value
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Integer] Hash code
106
+ def hash
107
+ [odata_context, value].hash
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 self.build_from_hash(attributes)
114
+ new.build_from_hash(attributes)
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ self.class.openapi_types.each_pair do |key, type|
123
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
124
+ self.send("#{key}=", nil)
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
129
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
130
+ end
131
+ elsif !attributes[self.class.attribute_map[key]].nil?
132
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
+ end
134
+ end
135
+
136
+ self
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def _deserialize(type, value)
144
+ case type.to_sym
145
+ when :Time
146
+ Time.parse(value)
147
+ when :Date
148
+ Date.parse(value)
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :Boolean
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ # models (e.g. Pet) or oneOf
177
+ klass = XbimIdentity.const_get(type)
178
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+
228
+ end
229
+
230
+ end
@@ -0,0 +1,252 @@
1
+ =begin
2
+ #Xbim Flex Identity API 2.0
3
+
4
+ #Communication centralised around construction data
5
+
6
+ The version of the OpenAPI document: 2.0
7
+ Contact: info@xbim.net
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module XbimIdentity
17
+ # List result
18
+ class ODataClientAppEndpointList
19
+ attr_accessor :odata_context
20
+
21
+ attr_accessor :value
22
+
23
+ attr_accessor :odata_next_link
24
+
25
+ attr_accessor :odata_count
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'odata_context' => :'@odata.context',
31
+ :'value' => :'value',
32
+ :'odata_next_link' => :'@odata.nextLink',
33
+ :'odata_count' => :'@odata.count'
34
+ }
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'odata_context' => :'String',
46
+ :'value' => :'Array<ClientAppEndpoint>',
47
+ :'odata_next_link' => :'String',
48
+ :'odata_count' => :'Integer'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ :'odata_context',
56
+ :'value',
57
+ :'odata_next_link',
58
+ :'odata_count'
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XbimIdentity::ODataClientAppEndpointList` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XbimIdentity::ODataClientAppEndpointList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'odata_context')
78
+ self.odata_context = attributes[:'odata_context']
79
+ end
80
+
81
+ if attributes.key?(:'value')
82
+ if (value = attributes[:'value']).is_a?(Array)
83
+ self.value = value
84
+ end
85
+ end
86
+
87
+ if attributes.key?(:'odata_next_link')
88
+ self.odata_next_link = attributes[:'odata_next_link']
89
+ end
90
+
91
+ if attributes.key?(:'odata_count')
92
+ self.odata_count = attributes[:'odata_count']
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ invalid_properties = Array.new
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ true
107
+ end
108
+
109
+ # Checks equality by comparing each attribute.
110
+ # @param [Object] Object to be compared
111
+ def ==(o)
112
+ return true if self.equal?(o)
113
+ self.class == o.class &&
114
+ odata_context == o.odata_context &&
115
+ value == o.value &&
116
+ odata_next_link == o.odata_next_link &&
117
+ odata_count == o.odata_count
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [odata_context, value, odata_next_link, odata_count].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ new.build_from_hash(attributes)
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def build_from_hash(attributes)
143
+ return nil unless attributes.is_a?(Hash)
144
+ self.class.openapi_types.each_pair do |key, type|
145
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
146
+ self.send("#{key}=", nil)
147
+ elsif type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
151
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
+ end
153
+ elsif !attributes[self.class.attribute_map[key]].nil?
154
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ end
156
+ end
157
+
158
+ self
159
+ end
160
+
161
+ # Deserializes the data based on type
162
+ # @param string type Data type
163
+ # @param string value Value to be deserialized
164
+ # @return [Object] Deserialized data
165
+ def _deserialize(type, value)
166
+ case type.to_sym
167
+ when :Time
168
+ Time.parse(value)
169
+ when :Date
170
+ Date.parse(value)
171
+ when :String
172
+ value.to_s
173
+ when :Integer
174
+ value.to_i
175
+ when :Float
176
+ value.to_f
177
+ when :Boolean
178
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
179
+ true
180
+ else
181
+ false
182
+ end
183
+ when :Object
184
+ # generic object (usually a Hash), return directly
185
+ value
186
+ when /\AArray<(?<inner_type>.+)>\z/
187
+ inner_type = Regexp.last_match[:inner_type]
188
+ value.map { |v| _deserialize(inner_type, v) }
189
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
190
+ k_type = Regexp.last_match[:k_type]
191
+ v_type = Regexp.last_match[:v_type]
192
+ {}.tap do |hash|
193
+ value.each do |k, v|
194
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
195
+ end
196
+ end
197
+ else # model
198
+ # models (e.g. Pet) or oneOf
199
+ klass = XbimIdentity.const_get(type)
200
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
201
+ end
202
+ end
203
+
204
+ # Returns the string representation of the object
205
+ # @return [String] String presentation of the object
206
+ def to_s
207
+ to_hash.to_s
208
+ end
209
+
210
+ # to_body is an alias to to_hash (backward compatibility)
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_body
213
+ to_hash
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ if value.nil?
223
+ is_nullable = self.class.openapi_nullable.include?(attr)
224
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
+ end
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ # Outputs non-array value in the form of hash
233
+ # For object, use to_hash. Otherwise, just return the value
234
+ # @param [Object] value Any valid value
235
+ # @return [Hash] Returns the value in the form of hash
236
+ def _to_hash(value)
237
+ if value.is_a?(Array)
238
+ value.compact.map { |v| _to_hash(v) }
239
+ elsif value.is_a?(Hash)
240
+ {}.tap do |hash|
241
+ value.each { |k, v| hash[k] = _to_hash(v) }
242
+ end
243
+ elsif value.respond_to? :to_hash
244
+ value.to_hash
245
+ else
246
+ value
247
+ end
248
+ end
249
+
250
+ end
251
+
252
+ end