xbim_identity 2.0.1 → 2.0.2

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 (102) hide show
  1. checksums.yaml +4 -4
  2. metadata +7 -107
  3. data/Gemfile +0 -9
  4. data/README.md +0 -175
  5. data/Rakefile +0 -10
  6. data/lib/xbim_identity/api/authentication_api.rb +0 -118
  7. data/lib/xbim_identity/api/client_applications_api.rb +0 -315
  8. data/lib/xbim_identity/api/invitations_api.rb +0 -489
  9. data/lib/xbim_identity/api/me_api.rb +0 -148
  10. data/lib/xbim_identity/api/members_api.rb +0 -406
  11. data/lib/xbim_identity/api/registration_api.rb +0 -85
  12. data/lib/xbim_identity/api/tenants_api.rb +0 -709
  13. data/lib/xbim_identity/api/users_api.rb +0 -382
  14. data/lib/xbim_identity/api_client.rb +0 -390
  15. data/lib/xbim_identity/api_error.rb +0 -57
  16. data/lib/xbim_identity/configuration.rb +0 -278
  17. data/lib/xbim_identity/models/application_type.rb +0 -39
  18. data/lib/xbim_identity/models/client_app.rb +0 -351
  19. data/lib/xbim_identity/models/client_app_endpoint.rb +0 -239
  20. data/lib/xbim_identity/models/draft_invitation.rb +0 -379
  21. data/lib/xbim_identity/models/invitation.rb +0 -379
  22. data/lib/xbim_identity/models/invitation_create.rb +0 -253
  23. data/lib/xbim_identity/models/invitation_edit.rb +0 -239
  24. data/lib/xbim_identity/models/invite_status.rb +0 -41
  25. data/lib/xbim_identity/models/master.rb +0 -331
  26. data/lib/xbim_identity/models/master_base.rb +0 -243
  27. data/lib/xbim_identity/models/master_subscription.rb +0 -323
  28. data/lib/xbim_identity/models/o_data_boolean.rb +0 -230
  29. data/lib/xbim_identity/models/o_data_client_app_endpoint_list.rb +0 -252
  30. data/lib/xbim_identity/models/o_data_client_app_list.rb +0 -252
  31. data/lib/xbim_identity/models/o_data_invitation_list.rb +0 -252
  32. data/lib/xbim_identity/models/o_data_string.rb +0 -230
  33. data/lib/xbim_identity/models/o_data_tenant_list.rb +0 -252
  34. data/lib/xbim_identity/models/o_data_tenant_user_list.rb +0 -252
  35. data/lib/xbim_identity/models/o_data_user_list.rb +0 -252
  36. data/lib/xbim_identity/models/problem_details.rb +0 -259
  37. data/lib/xbim_identity/models/region.rb +0 -280
  38. data/lib/xbim_identity/models/region_info.rb +0 -256
  39. data/lib/xbim_identity/models/subscription.rb +0 -309
  40. data/lib/xbim_identity/models/team_member_create.rb +0 -229
  41. data/lib/xbim_identity/models/team_member_edit.rb +0 -219
  42. data/lib/xbim_identity/models/tenancy_type.rb +0 -38
  43. data/lib/xbim_identity/models/tenant.rb +0 -383
  44. data/lib/xbim_identity/models/tenant_create.rb +0 -267
  45. data/lib/xbim_identity/models/tenant_edit.rb +0 -229
  46. data/lib/xbim_identity/models/tenant_role.rb +0 -39
  47. data/lib/xbim_identity/models/tenant_user.rb +0 -299
  48. data/lib/xbim_identity/models/token_err_response.rb +0 -219
  49. data/lib/xbim_identity/models/token_response.rb +0 -259
  50. data/lib/xbim_identity/models/user.rb +0 -261
  51. data/lib/xbim_identity/models/user_create.rb +0 -247
  52. data/lib/xbim_identity/models/user_tenant.rb +0 -279
  53. data/lib/xbim_identity/version.rb +0 -15
  54. data/lib/xbim_identity.rb +0 -83
  55. data/spec/api/authentication_api_spec.rb +0 -52
  56. data/spec/api/client_applications_api_spec.rb +0 -101
  57. data/spec/api/invitations_api_spec.rb +0 -130
  58. data/spec/api/me_api_spec.rb +0 -61
  59. data/spec/api/members_api_spec.rb +0 -113
  60. data/spec/api/registration_api_spec.rb +0 -48
  61. data/spec/api/tenants_api_spec.rb +0 -176
  62. data/spec/api/users_api_spec.rb +0 -109
  63. data/spec/api_client_spec.rb +0 -226
  64. data/spec/configuration_spec.rb +0 -42
  65. data/spec/models/application_type_spec.rb +0 -28
  66. data/spec/models/client_app_endpoint_spec.rb +0 -46
  67. data/spec/models/client_app_spec.rb +0 -112
  68. data/spec/models/draft_invitation_spec.rb +0 -130
  69. data/spec/models/invitation_create_spec.rb +0 -52
  70. data/spec/models/invitation_edit_spec.rb +0 -46
  71. data/spec/models/invitation_spec.rb +0 -130
  72. data/spec/models/invite_status_spec.rb +0 -28
  73. data/spec/models/master_base_spec.rb +0 -46
  74. data/spec/models/master_spec.rb +0 -94
  75. data/spec/models/master_subscription_spec.rb +0 -94
  76. data/spec/models/o_data_boolean_spec.rb +0 -40
  77. data/spec/models/o_data_client_app_endpoint_list_spec.rb +0 -52
  78. data/spec/models/o_data_client_app_list_spec.rb +0 -52
  79. data/spec/models/o_data_invitation_list_spec.rb +0 -52
  80. data/spec/models/o_data_string_spec.rb +0 -40
  81. data/spec/models/o_data_tenant_list_spec.rb +0 -52
  82. data/spec/models/o_data_tenant_user_list_spec.rb +0 -52
  83. data/spec/models/o_data_user_list_spec.rb +0 -52
  84. data/spec/models/problem_details_spec.rb +0 -58
  85. data/spec/models/region_info_spec.rb +0 -46
  86. data/spec/models/region_spec.rb +0 -58
  87. data/spec/models/subscription_spec.rb +0 -88
  88. data/spec/models/team_member_create_spec.rb +0 -40
  89. data/spec/models/team_member_edit_spec.rb +0 -34
  90. data/spec/models/tenancy_type_spec.rb +0 -28
  91. data/spec/models/tenant_create_spec.rb +0 -58
  92. data/spec/models/tenant_edit_spec.rb +0 -40
  93. data/spec/models/tenant_role_spec.rb +0 -28
  94. data/spec/models/tenant_spec.rb +0 -130
  95. data/spec/models/tenant_user_spec.rb +0 -82
  96. data/spec/models/token_err_response_spec.rb +0 -34
  97. data/spec/models/token_response_spec.rb +0 -58
  98. data/spec/models/user_create_spec.rb +0 -46
  99. data/spec/models/user_spec.rb +0 -58
  100. data/spec/models/user_tenant_spec.rb +0 -70
  101. data/spec/spec_helper.rb +0 -111
  102. data/xbim_identity.gemspec +0 -38
@@ -1,278 +0,0 @@
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
- module XbimIdentity
14
- class Configuration
15
- # Defines url scheme
16
- attr_accessor :scheme
17
-
18
- # Defines url host
19
- attr_accessor :host
20
-
21
- # Defines url base path
22
- attr_accessor :base_path
23
-
24
- # Define server configuration index
25
- attr_accessor :server_index
26
-
27
- # Define server operation configuration index
28
- attr_accessor :server_operation_index
29
-
30
- # Default server variables
31
- attr_accessor :server_variables
32
-
33
- # Default server operation variables
34
- attr_accessor :server_operation_variables
35
-
36
- # Defines API keys used with API Key authentications.
37
- #
38
- # @return [Hash] key: parameter name, value: parameter value (API key)
39
- #
40
- # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
41
- # config.api_key['api_key'] = 'xxx'
42
- attr_accessor :api_key
43
-
44
- # Defines API key prefixes used with API Key authentications.
45
- #
46
- # @return [Hash] key: parameter name, value: API key prefix
47
- #
48
- # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
49
- # config.api_key_prefix['api_key'] = 'Token'
50
- attr_accessor :api_key_prefix
51
-
52
- # Defines the username used with HTTP basic authentication.
53
- #
54
- # @return [String]
55
- attr_accessor :username
56
-
57
- # Defines the password used with HTTP basic authentication.
58
- #
59
- # @return [String]
60
- attr_accessor :password
61
-
62
- # Defines the access token (Bearer) used with OAuth2.
63
- attr_accessor :access_token
64
-
65
- # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
66
- # details will be logged with `logger.debug` (see the `logger` attribute).
67
- # Default to false.
68
- #
69
- # @return [true, false]
70
- attr_accessor :debugging
71
-
72
- # Defines the logger used for debugging.
73
- # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
74
- #
75
- # @return [#debug]
76
- attr_accessor :logger
77
-
78
- # Defines the temporary folder to store downloaded files
79
- # (for API endpoints that have file response).
80
- # Default to use `Tempfile`.
81
- #
82
- # @return [String]
83
- attr_accessor :temp_folder_path
84
-
85
- # The time limit for HTTP request in seconds.
86
- # Default to 0 (never times out).
87
- attr_accessor :timeout
88
-
89
- # Set this to false to skip client side validation in the operation.
90
- # Default to true.
91
- # @return [true, false]
92
- attr_accessor :client_side_validation
93
-
94
- ### TLS/SSL setting
95
- # Set this to false to skip verifying SSL certificate when calling API from https server.
96
- # Default to true.
97
- #
98
- # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
99
- #
100
- # @return [true, false]
101
- attr_accessor :verify_ssl
102
-
103
- ### TLS/SSL setting
104
- # Set this to false to skip verifying SSL host name
105
- # Default to true.
106
- #
107
- # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
108
- #
109
- # @return [true, false]
110
- attr_accessor :verify_ssl_host
111
-
112
- ### TLS/SSL setting
113
- # Set this to customize the certificate file to verify the peer.
114
- #
115
- # @return [String] the path to the certificate file
116
- #
117
- # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
118
- # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
119
- attr_accessor :ssl_ca_cert
120
-
121
- ### TLS/SSL setting
122
- # Client certificate file (for client certificate)
123
- attr_accessor :cert_file
124
-
125
- ### TLS/SSL setting
126
- # Client private key file (for client certificate)
127
- attr_accessor :key_file
128
-
129
- # Set this to customize parameters encoding of array parameter with multi collectionFormat.
130
- # Default to nil.
131
- #
132
- # @see The params_encoding option of Ethon. Related source code:
133
- # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
134
- attr_accessor :params_encoding
135
-
136
- attr_accessor :inject_format
137
-
138
- attr_accessor :force_ending_format
139
-
140
- def initialize
141
- @scheme = 'https'
142
- @host = 'apis.xbim-dev.net'
143
- @base_path = ''
144
- @server_index = 0
145
- @server_operation_index = {}
146
- @server_variables = {}
147
- @server_operation_variables = {}
148
- @api_key = {}
149
- @api_key_prefix = {}
150
- @client_side_validation = true
151
- @verify_ssl = true
152
- @verify_ssl_host = true
153
- @params_encoding = nil
154
- @cert_file = nil
155
- @key_file = nil
156
- @timeout = 0
157
- @debugging = false
158
- @inject_format = false
159
- @force_ending_format = false
160
- @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
161
-
162
- yield(self) if block_given?
163
- end
164
-
165
- # The default Configuration object.
166
- def self.default
167
- @@default ||= Configuration.new
168
- end
169
-
170
- def configure
171
- yield(self) if block_given?
172
- end
173
-
174
- def scheme=(scheme)
175
- # remove :// from scheme
176
- @scheme = scheme.sub(/:\/\//, '')
177
- end
178
-
179
- def host=(host)
180
- # remove http(s):// and anything after a slash
181
- @host = host.sub(/https?:\/\//, '').split('/').first
182
- end
183
-
184
- def base_path=(base_path)
185
- # Add leading and trailing slashes to base_path
186
- @base_path = "/#{base_path}".gsub(/\/+/, '/')
187
- @base_path = '' if @base_path == '/'
188
- end
189
-
190
- # Returns base URL for specified operation based on server settings
191
- def base_url(operation = nil)
192
- index = server_operation_index.fetch(operation, server_index)
193
- return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
194
-
195
- server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
196
- end
197
-
198
- # Gets API key (with prefix if set).
199
- # @param [String] param_name the parameter name of API key auth
200
- def api_key_with_prefix(param_name, param_alias = nil)
201
- key = @api_key[param_name]
202
- key = @api_key.fetch(param_alias, key) unless param_alias.nil?
203
- if @api_key_prefix[param_name]
204
- "#{@api_key_prefix[param_name]} #{key}"
205
- else
206
- key
207
- end
208
- end
209
-
210
- # Gets Basic Auth token string
211
- def basic_auth_token
212
- 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
213
- end
214
-
215
- # Returns Auth Settings hash for api client.
216
- def auth_settings
217
- {
218
- 'oauth2' =>
219
- {
220
- type: 'oauth2',
221
- in: 'header',
222
- key: 'Authorization',
223
- value: "Bearer #{access_token}"
224
- },
225
- }
226
- end
227
-
228
- # Returns an array of Server setting
229
- def server_settings
230
- [
231
- {
232
- url: "https://apis.xbim-dev.net",
233
- description: "No description provided",
234
- }
235
- ]
236
- end
237
-
238
- def operation_server_settings
239
- {
240
- }
241
- end
242
-
243
- # Returns URL based on server settings
244
- #
245
- # @param index array index of the server settings
246
- # @param variables hash of variable and the corresponding value
247
- def server_url(index, variables = {}, servers = nil)
248
- servers = server_settings if servers == nil
249
-
250
- # check array index out of bound
251
- if (index < 0 || index >= servers.size)
252
- fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
253
- end
254
-
255
- server = servers[index]
256
- url = server[:url]
257
-
258
- return url unless server.key? :variables
259
-
260
- # go through variable and assign a value
261
- server[:variables].each do |name, variable|
262
- if variables.key?(name)
263
- if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
264
- url.gsub! "{" + name.to_s + "}", variables[name]
265
- else
266
- fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
267
- end
268
- else
269
- # use default value
270
- url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
271
- end
272
- end
273
-
274
- url
275
- end
276
-
277
- end
278
- end
@@ -1,39 +0,0 @@
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
- class ApplicationType
18
- JAVASCRIPT_APP = "JavascriptApp".freeze
19
- WEB_APP_SERVER_SIDE = "WebAppServerSide".freeze
20
- MOBILE_NATIVE_APP = "MobileNativeApp".freeze
21
- AUTOMATION_APP = "AutomationApp".freeze
22
-
23
- # Builds the enum from string
24
- # @param [String] The enum value in the form of the string
25
- # @return [String] The enum value
26
- def self.build_from_hash(value)
27
- new.build_from_hash(value)
28
- end
29
-
30
- # Builds the enum from string
31
- # @param [String] The enum value in the form of the string
32
- # @return [String] The enum value
33
- def build_from_hash(value)
34
- constantValues = ApplicationType.constants.select { |c| ApplicationType::const_get(c) == value }
35
- raise "Invalid ENUM value #{value} for class #ApplicationType" if constantValues.empty?
36
- value
37
- end
38
- end
39
- end
@@ -1,351 +0,0 @@
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
- class ClientApp
18
- attr_accessor :client_id
19
-
20
- attr_accessor :application_name
21
-
22
- attr_accessor :application_description
23
-
24
- attr_accessor :application_base_url
25
-
26
- attr_accessor :application_icon_url
27
-
28
- attr_accessor :application_type
29
-
30
- attr_accessor :is_system_application
31
-
32
- attr_accessor :is_public
33
-
34
- attr_accessor :is_enabled
35
-
36
- attr_accessor :owner
37
-
38
- attr_accessor :endpoints
39
-
40
- attr_accessor :master
41
-
42
- attr_accessor :date_created
43
-
44
- attr_accessor :date_modified
45
-
46
- # Attribute mapping from ruby-style variable name to JSON key.
47
- def self.attribute_map
48
- {
49
- :'client_id' => :'clientId',
50
- :'application_name' => :'applicationName',
51
- :'application_description' => :'applicationDescription',
52
- :'application_base_url' => :'applicationBaseUrl',
53
- :'application_icon_url' => :'applicationIconUrl',
54
- :'application_type' => :'applicationType',
55
- :'is_system_application' => :'isSystemApplication',
56
- :'is_public' => :'isPublic',
57
- :'is_enabled' => :'isEnabled',
58
- :'owner' => :'owner',
59
- :'endpoints' => :'endpoints',
60
- :'master' => :'master',
61
- :'date_created' => :'dateCreated',
62
- :'date_modified' => :'dateModified'
63
- }
64
- end
65
-
66
- # Returns all the JSON keys this model knows about
67
- def self.acceptable_attributes
68
- attribute_map.values
69
- end
70
-
71
- # Attribute type mapping.
72
- def self.openapi_types
73
- {
74
- :'client_id' => :'String',
75
- :'application_name' => :'String',
76
- :'application_description' => :'String',
77
- :'application_base_url' => :'String',
78
- :'application_icon_url' => :'String',
79
- :'application_type' => :'ApplicationType',
80
- :'is_system_application' => :'Boolean',
81
- :'is_public' => :'Boolean',
82
- :'is_enabled' => :'Boolean',
83
- :'owner' => :'User',
84
- :'endpoints' => :'Array<ClientAppEndpoint>',
85
- :'master' => :'Master',
86
- :'date_created' => :'Time',
87
- :'date_modified' => :'Time'
88
- }
89
- end
90
-
91
- # List of attributes with nullable: true
92
- def self.openapi_nullable
93
- Set.new([
94
- :'client_id',
95
- :'application_name',
96
- :'application_description',
97
- :'application_base_url',
98
- :'application_icon_url',
99
- :'application_type',
100
- :'is_system_application',
101
- :'is_public',
102
- :'is_enabled',
103
- :'owner',
104
- :'endpoints',
105
- :'master',
106
- :'date_created',
107
- :'date_modified'
108
- ])
109
- end
110
-
111
- # Initializes the object
112
- # @param [Hash] attributes Model attributes in the form of hash
113
- def initialize(attributes = {})
114
- if (!attributes.is_a?(Hash))
115
- fail ArgumentError, "The input argument (attributes) must be a hash in `XbimIdentity::ClientApp` initialize method"
116
- end
117
-
118
- # check to see if the attribute exists and convert string to symbol for hash key
119
- attributes = attributes.each_with_object({}) { |(k, v), h|
120
- if (!self.class.attribute_map.key?(k.to_sym))
121
- fail ArgumentError, "`#{k}` is not a valid attribute in `XbimIdentity::ClientApp`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
122
- end
123
- h[k.to_sym] = v
124
- }
125
-
126
- if attributes.key?(:'client_id')
127
- self.client_id = attributes[:'client_id']
128
- end
129
-
130
- if attributes.key?(:'application_name')
131
- self.application_name = attributes[:'application_name']
132
- end
133
-
134
- if attributes.key?(:'application_description')
135
- self.application_description = attributes[:'application_description']
136
- end
137
-
138
- if attributes.key?(:'application_base_url')
139
- self.application_base_url = attributes[:'application_base_url']
140
- end
141
-
142
- if attributes.key?(:'application_icon_url')
143
- self.application_icon_url = attributes[:'application_icon_url']
144
- end
145
-
146
- if attributes.key?(:'application_type')
147
- self.application_type = attributes[:'application_type']
148
- end
149
-
150
- if attributes.key?(:'is_system_application')
151
- self.is_system_application = attributes[:'is_system_application']
152
- end
153
-
154
- if attributes.key?(:'is_public')
155
- self.is_public = attributes[:'is_public']
156
- end
157
-
158
- if attributes.key?(:'is_enabled')
159
- self.is_enabled = attributes[:'is_enabled']
160
- end
161
-
162
- if attributes.key?(:'owner')
163
- self.owner = attributes[:'owner']
164
- end
165
-
166
- if attributes.key?(:'endpoints')
167
- if (value = attributes[:'endpoints']).is_a?(Array)
168
- self.endpoints = value
169
- end
170
- end
171
-
172
- if attributes.key?(:'master')
173
- self.master = attributes[:'master']
174
- end
175
-
176
- if attributes.key?(:'date_created')
177
- self.date_created = attributes[:'date_created']
178
- end
179
-
180
- if attributes.key?(:'date_modified')
181
- self.date_modified = attributes[:'date_modified']
182
- end
183
- end
184
-
185
- # Show invalid properties with the reasons. Usually used together with valid?
186
- # @return Array for valid properties with the reasons
187
- def list_invalid_properties
188
- invalid_properties = Array.new
189
- invalid_properties
190
- end
191
-
192
- # Check to see if the all the properties in the model are valid
193
- # @return true if the model is valid
194
- def valid?
195
- true
196
- end
197
-
198
- # Checks equality by comparing each attribute.
199
- # @param [Object] Object to be compared
200
- def ==(o)
201
- return true if self.equal?(o)
202
- self.class == o.class &&
203
- client_id == o.client_id &&
204
- application_name == o.application_name &&
205
- application_description == o.application_description &&
206
- application_base_url == o.application_base_url &&
207
- application_icon_url == o.application_icon_url &&
208
- application_type == o.application_type &&
209
- is_system_application == o.is_system_application &&
210
- is_public == o.is_public &&
211
- is_enabled == o.is_enabled &&
212
- owner == o.owner &&
213
- endpoints == o.endpoints &&
214
- master == o.master &&
215
- date_created == o.date_created &&
216
- date_modified == o.date_modified
217
- end
218
-
219
- # @see the `==` method
220
- # @param [Object] Object to be compared
221
- def eql?(o)
222
- self == o
223
- end
224
-
225
- # Calculates hash code according to all attributes.
226
- # @return [Integer] Hash code
227
- def hash
228
- [client_id, application_name, application_description, application_base_url, application_icon_url, application_type, is_system_application, is_public, is_enabled, owner, endpoints, master, date_created, date_modified].hash
229
- end
230
-
231
- # Builds the object from hash
232
- # @param [Hash] attributes Model attributes in the form of hash
233
- # @return [Object] Returns the model itself
234
- def self.build_from_hash(attributes)
235
- new.build_from_hash(attributes)
236
- end
237
-
238
- # Builds the object from hash
239
- # @param [Hash] attributes Model attributes in the form of hash
240
- # @return [Object] Returns the model itself
241
- def build_from_hash(attributes)
242
- return nil unless attributes.is_a?(Hash)
243
- self.class.openapi_types.each_pair do |key, type|
244
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
245
- self.send("#{key}=", nil)
246
- elsif type =~ /\AArray<(.*)>/i
247
- # check to ensure the input is an array given that the attribute
248
- # is documented as an array but the input is not
249
- if attributes[self.class.attribute_map[key]].is_a?(Array)
250
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
251
- end
252
- elsif !attributes[self.class.attribute_map[key]].nil?
253
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
254
- end
255
- end
256
-
257
- self
258
- end
259
-
260
- # Deserializes the data based on type
261
- # @param string type Data type
262
- # @param string value Value to be deserialized
263
- # @return [Object] Deserialized data
264
- def _deserialize(type, value)
265
- case type.to_sym
266
- when :Time
267
- Time.parse(value)
268
- when :Date
269
- Date.parse(value)
270
- when :String
271
- value.to_s
272
- when :Integer
273
- value.to_i
274
- when :Float
275
- value.to_f
276
- when :Boolean
277
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
278
- true
279
- else
280
- false
281
- end
282
- when :Object
283
- # generic object (usually a Hash), return directly
284
- value
285
- when /\AArray<(?<inner_type>.+)>\z/
286
- inner_type = Regexp.last_match[:inner_type]
287
- value.map { |v| _deserialize(inner_type, v) }
288
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
289
- k_type = Regexp.last_match[:k_type]
290
- v_type = Regexp.last_match[:v_type]
291
- {}.tap do |hash|
292
- value.each do |k, v|
293
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
294
- end
295
- end
296
- else # model
297
- # models (e.g. Pet) or oneOf
298
- klass = XbimIdentity.const_get(type)
299
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
300
- end
301
- end
302
-
303
- # Returns the string representation of the object
304
- # @return [String] String presentation of the object
305
- def to_s
306
- to_hash.to_s
307
- end
308
-
309
- # to_body is an alias to to_hash (backward compatibility)
310
- # @return [Hash] Returns the object in the form of hash
311
- def to_body
312
- to_hash
313
- end
314
-
315
- # Returns the object in the form of hash
316
- # @return [Hash] Returns the object in the form of hash
317
- def to_hash
318
- hash = {}
319
- self.class.attribute_map.each_pair do |attr, param|
320
- value = self.send(attr)
321
- if value.nil?
322
- is_nullable = self.class.openapi_nullable.include?(attr)
323
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
324
- end
325
-
326
- hash[param] = _to_hash(value)
327
- end
328
- hash
329
- end
330
-
331
- # Outputs non-array value in the form of hash
332
- # For object, use to_hash. Otherwise, just return the value
333
- # @param [Object] value Any valid value
334
- # @return [Hash] Returns the value in the form of hash
335
- def _to_hash(value)
336
- if value.is_a?(Array)
337
- value.compact.map { |v| _to_hash(v) }
338
- elsif value.is_a?(Hash)
339
- {}.tap do |hash|
340
- value.each { |k, v| hash[k] = _to_hash(v) }
341
- end
342
- elsif value.respond_to? :to_hash
343
- value.to_hash
344
- else
345
- value
346
- end
347
- end
348
-
349
- end
350
-
351
- end