authlete 1.0.24 → 1.1.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 (160) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/Makefile +40 -0
  4. data/Rakefile +5 -0
  5. data/authlete.gemspec +2 -2
  6. data/lib/authlete.rb +28 -9
  7. data/lib/authlete/api.rb +146 -321
  8. data/lib/authlete/authentication-server.rb +2 -2
  9. data/lib/authlete/exception.rb +14 -15
  10. data/lib/authlete/model/base.rb +30 -0
  11. data/lib/authlete/model/client-extension.rb +17 -119
  12. data/lib/authlete/model/client.rb +196 -345
  13. data/lib/authlete/model/hashable.rb +13 -33
  14. data/lib/authlete/model/named-uri.rb +13 -74
  15. data/lib/authlete/model/pair.rb +13 -74
  16. data/lib/authlete/model/param-initializer.rb +45 -0
  17. data/lib/authlete/model/property.rb +15 -85
  18. data/lib/authlete/model/request/authentication-callback-request.rb +63 -55
  19. data/lib/authlete/model/request/authorization-fail-request.rb +14 -75
  20. data/lib/authlete/model/request/authorization-issue-request.rb +38 -119
  21. data/lib/authlete/model/request/authorization-request.rb +8 -73
  22. data/lib/authlete/model/request/backchannel-authentication-complete-request.rb +97 -0
  23. data/lib/authlete/model/request/backchannel-authentication-fail-request.rb +55 -0
  24. data/lib/authlete/model/request/backchannel-authentication-issue-request.rb +37 -0
  25. data/lib/authlete/model/request/backchannel-authentication-request.rb +63 -0
  26. data/lib/authlete/model/request/base.rb +26 -0
  27. data/lib/authlete/model/request/client-authorization-delete-request.rb +7 -93
  28. data/lib/authlete/model/request/client-authorization-get-list-request.rb +17 -89
  29. data/lib/authlete/model/request/client-authorization-update-request.rb +11 -86
  30. data/lib/authlete/model/request/client-registration-request.rb +49 -0
  31. data/lib/authlete/model/request/client-secret-update-request.rb +7 -89
  32. data/lib/authlete/model/request/developer-authentication-callback-request.rb +40 -43
  33. data/lib/authlete/model/request/device-authorization-request.rb +63 -0
  34. data/lib/authlete/model/request/device-complete-request.rb +99 -0
  35. data/lib/authlete/model/request/device-verification-request.rb +40 -0
  36. data/lib/authlete/model/request/granted-scopes-request.rb +8 -74
  37. data/lib/authlete/model/request/introspection-request.rb +24 -83
  38. data/lib/authlete/model/request/pushed-auth-req-request.rb +64 -0
  39. data/lib/authlete/model/request/revocation-request.rb +14 -88
  40. data/lib/authlete/model/request/standard-introspection-request.rb +8 -73
  41. data/lib/authlete/model/request/token-create-request.rb +52 -183
  42. data/lib/authlete/model/request/token-fail-request.rb +12 -74
  43. data/lib/authlete/model/request/token-issue-request.rb +22 -80
  44. data/lib/authlete/model/request/token-request.rb +44 -81
  45. data/lib/authlete/model/request/token-update-request.rb +35 -121
  46. data/lib/authlete/model/request/user-info-issue-request.rb +14 -80
  47. data/lib/authlete/model/request/user-info-request.rb +25 -70
  48. data/lib/authlete/model/response/access-token.rb +96 -0
  49. data/lib/authlete/model/response/authentication-callback-response.rb +24 -19
  50. data/lib/authlete/model/response/authorization-fail-response.rb +13 -15
  51. data/lib/authlete/model/response/authorization-issue-response.rb +29 -32
  52. data/lib/authlete/model/response/authorization-response.rb +97 -123
  53. data/lib/authlete/model/response/authorized-client-list-response.rb +37 -0
  54. data/lib/authlete/model/response/backchannel-authentication-complete-response.rb +143 -0
  55. data/lib/authlete/model/response/backchannel-authentication-fail-response.rb +47 -0
  56. data/lib/authlete/model/response/backchannel-authentication-issue-response.rb +63 -0
  57. data/lib/authlete/model/response/backchannel-authentication-response.rb +160 -0
  58. data/lib/authlete/model/response/client-list-response.rb +58 -0
  59. data/lib/authlete/model/response/client-registration-response.rb +50 -0
  60. data/lib/authlete/model/response/client-secret-refresh-response.rb +12 -12
  61. data/lib/authlete/model/response/client-secret-update-response.rb +12 -12
  62. data/lib/authlete/model/response/developer-authentication-callback-response.rb +24 -19
  63. data/lib/authlete/model/response/device-authorization-response.rb +134 -0
  64. data/lib/authlete/model/response/device-complete-response.rb +39 -0
  65. data/lib/authlete/model/response/device-verification-response.rb +96 -0
  66. data/lib/authlete/model/response/granted-scopes-get-response.rb +27 -19
  67. data/lib/authlete/model/response/introspection-response.rb +64 -58
  68. data/lib/authlete/model/response/pushed-auth-req-response.rb +59 -0
  69. data/lib/authlete/model/response/revocation-response.rb +12 -15
  70. data/lib/authlete/model/response/service-list-response.rb +54 -0
  71. data/lib/authlete/model/response/standard-introspection-response.rb +13 -15
  72. data/lib/authlete/model/response/token-create-response.rb +50 -55
  73. data/lib/authlete/model/response/token-fail-response.rb +14 -17
  74. data/lib/authlete/model/response/token-issue-response.rb +49 -62
  75. data/lib/authlete/model/response/token-list-response.rb +64 -0
  76. data/lib/authlete/model/response/token-response.rb +59 -79
  77. data/lib/authlete/model/response/token-update-response.rb +28 -23
  78. data/lib/authlete/model/response/user-info-issue-response.rb +16 -16
  79. data/lib/authlete/model/response/user-info-response.rb +48 -42
  80. data/lib/authlete/model/result.rb +14 -13
  81. data/lib/authlete/model/scope.rb +29 -119
  82. data/lib/authlete/model/service-owner.rb +32 -116
  83. data/lib/authlete/model/service.rb +464 -685
  84. data/lib/authlete/model/sns-credentials.rb +18 -91
  85. data/lib/authlete/model/tagged-value.rb +14 -69
  86. data/lib/authlete/utility.rb +3 -32
  87. data/lib/authlete/version.rb +3 -3
  88. data/test/authlete/model/request/test_authentication-callback-request.rb +100 -0
  89. data/test/authlete/model/request/test_authorization-fail-request.rb +67 -0
  90. data/test/authlete/model/request/test_authorization-issue-request.rb +94 -0
  91. data/test/authlete/model/request/test_authorization-request.rb +57 -0
  92. data/test/authlete/model/request/test_backchannel-authentication-complete-request.rb +102 -0
  93. data/test/authlete/model/request/test_backchannel-authentication-fail-request.rb +71 -0
  94. data/test/authlete/model/request/test_backchannel-authentication-issue-request.rb +57 -0
  95. data/test/authlete/model/request/test_backchannel-authentication-request.rb +75 -0
  96. data/test/authlete/model/request/test_client-authorization-delete-request.rb +57 -0
  97. data/test/authlete/model/request/test_client-authorization-get-list-request.rb +71 -0
  98. data/test/authlete/model/request/test_client-authorization-update-request.rb +63 -0
  99. data/test/authlete/model/request/test_client-registration-request.rb +68 -0
  100. data/test/authlete/model/request/test_device-authorization-request.rb +75 -0
  101. data/test/authlete/model/request/test_device-complete-request.rb +102 -0
  102. data/test/authlete/model/request/test_device-verification-request.rb +57 -0
  103. data/test/authlete/model/request/test_granted-scopes-request.rb +57 -0
  104. data/test/authlete/model/request/test_introspection-request.rb +79 -0
  105. data/test/authlete/model/request/test_pushed-auth-req-request.rb +75 -0
  106. data/test/authlete/model/request/test_revocation-request.rb +67 -0
  107. data/test/authlete/model/request/test_standard-introspection-request.rb +57 -0
  108. data/test/authlete/model/request/test_token-create-request.rb +110 -0
  109. data/test/authlete/model/request/test_token-fail-request.rb +63 -0
  110. data/test/authlete/model/request/test_token-issue-request.rb +70 -0
  111. data/test/authlete/model/request/test_token-request.rb +94 -0
  112. data/test/authlete/model/request/test_token-update-request.rb +82 -0
  113. data/test/authlete/model/request/test_user-info-issue-request.rb +67 -0
  114. data/test/authlete/model/request/test_user-info-request.rb +75 -0
  115. data/test/authlete/model/response/test_access-token.rb +101 -0
  116. data/test/authlete/model/response/test_authorization-fail-response.rb +68 -0
  117. data/test/authlete/model/response/test_authorization-issue-response.rb +92 -0
  118. data/test/authlete/model/response/test_authorization-response.rb +145 -0
  119. data/test/authlete/model/response/test_authorized-client-list-response.rb +83 -0
  120. data/test/authlete/model/response/test_backchannel-authentication-complete-response.rb +132 -0
  121. data/test/authlete/model/response/test_backchannel-authentication-fail-response.rb +68 -0
  122. data/test/authlete/model/response/test_backchannel-authentication-issue-response.rb +80 -0
  123. data/test/authlete/model/response/test_backchannel-authentication-response.rb +156 -0
  124. data/test/authlete/model/response/test_client-list-response.rb +79 -0
  125. data/test/authlete/model/response/test_client-secret-refresh-response.rb +68 -0
  126. data/test/authlete/model/response/test_client-secret-update-response.rb +68 -0
  127. data/test/authlete/model/response/test_device-authorization-response.rb +140 -0
  128. data/test/authlete/model/response/test_device-complete-response.rb +64 -0
  129. data/test/authlete/model/response/test_device-verification-response.rb +112 -0
  130. data/test/authlete/model/response/test_granted-scopes-get-response.rb +84 -0
  131. data/test/authlete/model/response/test_introspection-response.rb +127 -0
  132. data/test/authlete/model/response/test_pushed-auth-req-response.rb +76 -0
  133. data/test/authlete/model/response/test_revocation-response.rb +68 -0
  134. data/test/authlete/model/response/test_service-list-response.rb +72 -0
  135. data/test/authlete/model/response/test_standard-introspection-response.rb +68 -0
  136. data/test/authlete/model/response/test_token-create-response.rb +107 -0
  137. data/test/authlete/model/response/test_token-fail-response.rb +68 -0
  138. data/test/authlete/model/response/test_token-issue-response.rb +127 -0
  139. data/test/authlete/model/response/test_token-list-response.rb +84 -0
  140. data/test/authlete/model/response/test_token-response.rb +147 -0
  141. data/test/authlete/model/response/test_token-update-response.rb +87 -0
  142. data/test/authlete/model/response/test_user-info-issue-response.rb +68 -0
  143. data/test/authlete/model/response/test_user-info-response.rb +107 -0
  144. data/test/authlete/model/test_client-extension.rb +95 -0
  145. data/test/authlete/model/test_client.rb +461 -0
  146. data/test/authlete/model/test_named-uri.rb +85 -0
  147. data/test/authlete/model/test_pair.rb +85 -0
  148. data/test/authlete/model/test_property.rb +90 -0
  149. data/test/authlete/model/test_result.rb +68 -0
  150. data/test/authlete/model/test_scope.rb +106 -0
  151. data/test/authlete/model/test_service-owner.rb +80 -0
  152. data/test/authlete/model/test_service.rb +614 -0
  153. data/test/authlete/model/test_sns-credentials.rb +88 -0
  154. data/test/authlete/model/test_tagged-value.rb +83 -0
  155. data/test/authlete/test_exception.rb +70 -0
  156. metadata +169 -9
  157. data/lib/authlete/model/client-list.rb +0 -129
  158. data/lib/authlete/model/response/client-authorization-get-list-response.rb +0 -60
  159. data/lib/authlete/model/response/service-creatable-response.rb +0 -51
  160. data/lib/authlete/model/service-list.rb +0 -128
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2018 Authlete, Inc.
3
+ # Copyright (C) 2014-2020 Authlete, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -17,29 +17,30 @@
17
17
 
18
18
  module Authlete
19
19
  module Model
20
- # == Authlete::Model::Result
21
- #
22
- # The base class of responses from Authlete Web APIs.
23
- class Result
20
+ class Result < Authlete::Model::Base
24
21
  include Authlete::Utility
25
- # The code assigned to the result of the API call.
26
- # (String)
22
+
27
23
  attr_accessor :resultCode
28
24
  alias_method :result_code, :resultCode
29
25
  alias_method :result_code=, :resultCode=
30
26
 
31
- # The message about the result of the API call.
32
- # (String)
33
27
  attr_accessor :resultMessage
34
28
  alias_method :result_message, :resultMessage
35
29
  alias_method :result_message=, :resultMessage=
36
30
 
37
31
  private
38
32
 
39
- def initialize(hash = {})
40
- @resultCode = extract_value(hash, :resultCode)
41
- @resultMessage = extract_value(hash, :resultMessage)
33
+ def defaults
34
+ {
35
+ resultCode: nil,
36
+ resultMessage: nil
37
+ }
38
+ end
39
+
40
+ def set_params(hash)
41
+ @resultCode = hash[:resultCode]
42
+ @resultMessage = hash[:resultMessage]
42
43
  end
43
44
  end
44
45
  end
45
- end
46
+ end
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2018 Authlete, Inc.
3
+ # Copyright (C) 2014-2020 Authlete, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -15,144 +15,54 @@
15
15
  # limitations under the License.
16
16
 
17
17
 
18
- require 'set'
19
-
20
-
21
18
  module Authlete
22
19
  module Model
23
- class Scope < Authlete::Model::Hashable
20
+ class Scope < Authlete::Model::Base
21
+ include Authlete::Model::Hashable
24
22
  include Authlete::Utility
25
- # The attributes of this scopes. (Pair array)
26
- attr_accessor :attributes
27
-
28
- # The description about this scope. (String)
29
- attr_accessor :description
30
23
 
31
- # The descriptions about this scope with language tags.
32
- # (TaggedValue array)
33
- attr_accessor :descriptions
34
-
35
- # The name of this scope. (String)
36
24
  attr_accessor :name
37
25
 
38
- # The flag to indicate whether this scope is included in the
39
- # default scope set. (Boolean)
40
26
  attr_accessor :defaultEntry
41
27
  alias_method :default_entry, :defaultEntry
42
28
  alias_method :default_entry=, :defaultEntry=
43
29
 
44
- private
45
-
46
- # Boolean attributes.
47
- BOOLEAN_ATTRIBUTES = ::Set.new([ :defaultEntry ])
48
-
49
- # String attributes.
50
- STRING_ATTRIBUTES = ::Set.new([ :description, :name ])
51
-
52
- # Tagged value array attributes.
53
- TAGGED_VALUE_ARRAY_ATTRIBUTES = ::Set.new([ :descriptions ])
54
-
55
- # Mapping from snake cases to camel cases.
56
- SNAKE_TO_CAMEL = { :default_entry => :defaultEntry }
57
-
58
- # The constructor
59
- def initialize(hash = nil)
60
- # Set default values to boolean attributes.
61
- BOOLEAN_ATTRIBUTES.each do |attr|
62
- send("#{attr}=", false)
63
- end
64
-
65
- # Set default values to string attributes.
66
- STRING_ATTRIBUTES.each do |attr|
67
- send("#{attr}=", nil)
68
- end
69
-
70
- # Set default values to tagged value array attributes.
71
- TAGGED_VALUE_ARRAY_ATTRIBUTES.each do |attr|
72
- send("#{attr}=", nil)
73
- end
74
-
75
- # Set attribute values using the given hash.
76
- authlete_model_update(hash)
77
- end
78
-
79
- def authlete_model_convert_key(key)
80
- key = key.to_sym
81
-
82
- # Convert snakecase to camelcase, if necessary.
83
- if SNAKE_TO_CAMEL.has_key?(key)
84
- key = SNAKE_TO_CAMEL[key]
85
- end
86
-
87
- key
88
- end
89
-
90
- def authlete_model_simple_attribute?(key)
91
- BOOLEAN_ATTRIBUTES.include?(key) or
92
- STRING_ATTRIBUTES.include?(key)
93
- end
94
-
95
- def authlete_model_update(hash)
96
- return if hash.nil?
97
-
98
- hash.each do |key, value|
99
- key = authlete_model_convert_key(key)
100
-
101
- if authlete_model_simple_attribute?(key)
102
- send("#{key}=", value)
103
- elsif TAGGED_VALUE_ARRAY_ATTRIBUTES.include?(key)
104
- # Get an array consisting of "TaggedValue" objects.
105
- parsed = get_parsed_array(value) do |element|
106
- Authlete::Model::TaggedValue.parse(element)
107
- end
108
-
109
- send("#{key}=", parsed)
110
- elsif key == :attributes
111
- @attributes = get_parsed_array(value) do |element|
112
- Authlete::Model::Pair.parse(element)
113
- end
114
- end
115
- end
30
+ attr_accessor :description
116
31
 
117
- self
118
- end
32
+ attr_accessor :descriptions
119
33
 
120
- public
34
+ attr_accessor :attributes
121
35
 
122
- # Construct an instance from the given hash.
123
- #
124
- # If the given argument is nil or is not a Hash, nil is returned.
125
- # Otherwise, Scope.new(hash) is returned.
126
- def self.parse(hash)
127
- if hash.nil? or (hash.kind_of?(Hash) == false)
128
- return nil
129
- end
36
+ private
130
37
 
131
- Authlete::Model::Scope.new(hash)
38
+ def defaults
39
+ {
40
+ name: nil,
41
+ defaultEntry: false,
42
+ description: nil,
43
+ descriptions: nil,
44
+ attributes: nil
45
+ }
132
46
  end
133
47
 
134
- # Set attribute values using the given hash.
135
- def update(hash)
136
- authlete_model_update(hash)
48
+ def set_params(hash)
49
+ @name = hash[:name]
50
+ @defaultEntry = hash[:defaultEntry]
51
+ @description = hash[:description]
52
+ @descriptions = get_parsed_array(hash[:descriptions]) { |e| Authlete::Model::TaggedValue.parse(e) }
53
+ @attributes = get_parsed_array(hash[:attributes]) { |e| Authlete::Model::Pair.parse(e) }
137
54
  end
138
55
 
139
- # Convert this object into a hash.
140
- def to_hash
141
- hash = {}
56
+ def to_hash_value(key, var)
57
+ raw_val = instance_variable_get(var)
142
58
 
143
- instance_variables.each do |var|
144
- key = var.to_s.delete("@").to_sym
145
- val = instance_variable_get(var)
146
-
147
- if authlete_model_simple_attribute?(key) or val.nil?
148
- hash[key] = val
149
- elsif key == :attributes or key == :descriptions
150
- hash[key] = val.map { |element| element.to_hash }
151
- end
59
+ case key
60
+ when :descriptions, :attributes
61
+ raw_val&.map { |e| e.to_hash }
62
+ else
63
+ raw_val
152
64
  end
153
-
154
- hash
155
65
  end
156
66
  end
157
67
  end
158
- end
68
+ end
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2018 Authlete, Inc.
3
+ # Copyright (C) 2014-2020 Authlete, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -15,139 +15,55 @@
15
15
  # limitations under the License.
16
16
 
17
17
 
18
- require 'set'
19
-
20
-
21
18
  module Authlete
22
19
  module Model
23
- class ServiceOwner < Authlete::Model::Hashable
24
- # The API key of the service owner. (Long)
25
- attr_accessor :apiKey
26
- alias_method :api_key, :apiKey
27
- alias_method :api_key=, :apiKey=
20
+ class ServiceOwner < Authlete::Model::Base
21
+ include Authlete::Model::Hashable
22
+ include Authlete::Utility
28
23
 
29
- # The API secret of the service owner. (String)
30
- attr_accessor :apiSecret
31
- alias_method :api_secret, :apiSecret
32
- alias_method :api_secret=, :apiSecret=
24
+ attr_accessor :number
25
+
26
+ attr_accessor :name
33
27
 
34
- # The email address of the service owner. (String)
35
28
  attr_accessor :email
36
29
 
37
- # The login ID of the service owner. (String)
38
30
  attr_accessor :loginId
39
31
  alias_method :login_id, :loginId
40
32
  alias_method :login_id=, :loginId=
41
33
 
42
- # The service owner name. (String)
43
- attr_accessor :name
34
+ attr_accessor :apiKey
35
+ alias_method :api_key, :apiKey
36
+ alias_method :api_key=, :apiKey=
44
37
 
45
- # The service owner number. (Integer)
46
- attr_accessor :number
38
+ attr_accessor :apiSecret
39
+ alias_method :api_secret, :apiSecret
40
+ alias_method :api_secret=, :apiSecret=
47
41
 
48
- # The plan. (String)
49
42
  attr_accessor :plan
50
43
 
51
44
  private
52
45
 
53
- # Integer attributes.
54
- INTEGER_ATTRIBUTES = ::Set.new([
55
- :apiKey, :number
56
- ])
57
-
58
-
59
- # String attributes.
60
- STRING_ATTRIBUTES = ::Set.new([
61
- :apiSecret, :email, :loginId, :name, :plan
62
- ])
63
-
64
- # Mapping from snake cases to camel cases.
65
- SNAKE_TO_CAMEL = {
66
- :api_key => :apiKey,
67
- :api_secret => :apiSecret,
68
- :login_id => :loginId
69
- }
70
-
71
- # The constructor
72
- def initialize(hash = nil)
73
- # Set default values to integer attributes.
74
- INTEGER_ATTRIBUTES.each do |attr|
75
- send("#{attr}=", 0)
76
- end
77
-
78
- # Set default values to string attributes.
79
- STRING_ATTRIBUTES.each do |attr|
80
- send("#{attr}=", nil)
81
- end
82
-
83
- # Set attribute values using the given hash.
84
- authlete_model_update(hash)
85
- end
86
-
87
- def authlete_model_convert_key(key)
88
- key = key.to_sym
89
-
90
- # Convert snakecase to camelcase, if necessary.
91
- if SNAKE_TO_CAMEL.has_key?(key)
92
- key = SNAKE_TO_CAMEL[key]
93
- end
94
-
95
- return key
96
- end
97
-
98
- def authlete_model_simple_attribute?(key)
99
- INTEGER_ATTRIBUTES.include?(key) or
100
- STRING_ATTRIBUTES.include?(key)
101
- end
102
-
103
- def authlete_model_update(hash)
104
- return if hash.nil?
105
-
106
- hash.each do |key, value|
107
- key = authlete_model_convert_key(key)
108
-
109
- if authlete_model_simple_attribute?(key)
110
- send("#{key}=", value)
111
- end
112
- end
113
-
114
- self
115
- end
116
-
117
- public
118
-
119
- # Construct an instance from the given hash.
120
- #
121
- # If the given argument is nil or is not a Hash, nil is returned.
122
- # Otherwise, ServiceOwner.new(hash) is returned.
123
- def self.parse(hash)
124
- if hash.nil? or (hash.kind_of?(Hash) == false)
125
- return nil
126
- end
127
-
128
- ServiceOwner.new(hash)
46
+ def defaults
47
+ {
48
+ number: 0,
49
+ name: nil,
50
+ email: nil,
51
+ loginId: nil,
52
+ apiKey: nil,
53
+ apiSecret: nil,
54
+ plan: nil
55
+ }
129
56
  end
130
57
 
131
- # Set attribute values using the given hash.
132
- def update(hash)
133
- authlete_model_update(hash)
134
- end
135
-
136
- # Convert this object into a hash.
137
- def to_hash
138
- hash = {}
139
-
140
- instance_variables.each do |var|
141
- key = var.to_s.delete("@").to_sym
142
- val = instance_variable_get(var)
143
-
144
- if authlete_model_simple_attribute?(key) or val.nil?
145
- hash[key] = val
146
- end
147
- end
148
-
149
- hash
58
+ def set_params(hash)
59
+ @number = hash[:number]
60
+ @name = hash[:name]
61
+ @email = hash[:email]
62
+ @loginId = hash[:loginId]
63
+ @apiKey = hash[:apiKey]
64
+ @apiSecret = hash[:apiSecret]
65
+ @plan = hash[:plan]
150
66
  end
151
67
  end
152
68
  end
153
- end
69
+ end
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2019 Authlete, Inc.
3
+ # Copyright (C) 2014-2020 Authlete, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -15,867 +15,646 @@
15
15
  # limitations under the License.
16
16
 
17
17
 
18
- require 'set'
19
-
20
-
21
18
  module Authlete
22
19
  module Model
23
- class Service < Authlete::Model::Hashable
20
+ class Service < Authlete::Model::Base
21
+ include Authlete::Model::Hashable
24
22
  include Authlete::Utility
25
- # The duration of access tokens in seconds. (Integer)
26
- attr_accessor :accessTokenDuration
27
- alias_method :access_token_duration, :accessTokenDuration
28
- alias_method :access_token_duration=, :accessTokenDuration=
29
-
30
- # The signature algorithm for access tokens. (String)
31
- attr_accessor :accessTokenSignAlg
32
- alias_method :access_token_sign_alg, :accessTokenSignAlg
33
- alias_method :access_token_sign_alg=, :accessTokenSignAlg=
34
23
 
35
- # The key ID to identify a JWK used for signing access tokens. (String)
36
- attr_accessor :accessTokenSignatureKeyId
37
- alias_method :access_token_signature_key_id, :accessTokenSignatureKeyId
38
- alias_method :access_token_signature_key_id=, :accessTokenSignatureKeyId=
24
+ attr_accessor :number
39
25
 
40
- # The access token type. (String)
41
- attr_accessor :accessTokenType
42
- alias_method :access_token_type, :accessTokenType
43
- alias_method :access_token_type=, :accessTokenType=
26
+ attr_accessor :serviceOwnerNumber
27
+ alias_method :service_owner_number, :serviceOwnerNumber
28
+ alias_method :service_owner_number=, :serviceOwnerNumber=
44
29
 
45
- # The allowable clock skew between the server and clients in seconds.
46
- # The clock skew is taken into consideration when time-related claims
47
- # in a JWT (e.g. +exp+, +iat+, +nbf+) are verified. (Integer)
48
- attr_accessor :allowableClockSkew
49
- alias_method :allowable_clock_skew, :allowableClockSkew
50
- alias_method :allowable_clock_skew=, :allowableClockSkew=
30
+ attr_accessor :serviceName
31
+ alias_method :service_name, :serviceName
32
+ alias_method :service_name=, :serviceName=
51
33
 
52
- # The API key. (Integer)
53
34
  attr_accessor :apiKey
54
35
  alias_method :api_key, :apiKey
55
36
  alias_method :api_key=, :apiKey=
56
37
 
57
- # The API secret. (String)
58
38
  attr_accessor :apiSecret
59
39
  alias_method :api_secret, :apiSecret
60
40
  alias_method :api_secret=, :apiSecret=
61
41
 
62
- # The API key to access the authentication callback endpoint. (String)
63
- attr_accessor :authenticationCallbackApiKey
64
- alias_method :authentication_callback_api_key, :authenticationCallbackApiKey
65
- alias_method :authentication_callback_api_key=, :authenticationCallbackApiKey=
66
-
67
- # The API secret to access the authentication callback endpoint. (String)
68
- attr_accessor :authenticationCallbackApiSecret
69
- alias_method :authentication_callback_api_secret, :authenticationCallbackApiSecret
70
- alias_method :authentication_callback_api_secret=, :authenticationCallbackApiSecret=
71
-
72
- # The URI of the authentication callback endpoint. (String)
73
- attr_accessor :authenticationCallbackEndpoint
74
- alias_method :authentication_callback_endpoint, :authenticationCallbackEndpoint
75
- alias_method :authentication_callback_endpoint=, :authenticationCallbackEndpoint=
42
+ attr_accessor :issuer
76
43
 
77
- # The URI of the authorization endpoint. (String)
78
44
  attr_accessor :authorizationEndpoint
79
45
  alias_method :authorization_endpoint, :authorizationEndpoint
80
46
  alias_method :authorization_endpoint=, :authorizationEndpoint=
81
47
 
82
- # The duration of access tokens in seconds; the value of +expires_in+
83
- # in access token responses. (Integer)
84
- attr_accessor :authorizationResponseDuration
85
- alias_method :authorization_response_duration, :authorizationResponseDuration
86
- alias_method :authorization_response_duration=, :authorizationResponseDuration=
48
+ attr_accessor :tokenEndpoint
49
+ alias_method :token_endpoint, :tokenEndpoint
50
+ alias_method :token_endpoint=, :tokenEndpoint=
87
51
 
88
- # The key ID to identify a JWK used for signing authorization responses
89
- # using an asymmetric key. (String)
90
- attr_accessor :authorizationSignatureKeyId
91
- alias_method :authorization_signature_key_id, :authorizationSignatureKeyId
92
- alias_method :authorization_signature_key_id=, :authorizationSignatureKeyId=
52
+ attr_accessor :revocationEndpoint
53
+ alias_method :revocation_endpoint, :revocationEndpoint
54
+ alias_method :revocation_endpoint=, :revocationEndpoint=
93
55
 
94
- # The URI of the backchannel authentication endpoint. (String)
95
- attr_accessor :backchannelAuthenticationEndpoint
96
- alias_method :backchannel_authentication_endpoint, :backchannelAuthenticationEndpoint
97
- alias_method :backchannel_authentication_endpoint=, :backchannelAuthenticationEndpoint=
56
+ attr_accessor :supportedRevocationAuthMethods
57
+ alias_method :supported_revocation_auth_methods, :supportedRevocationAuthMethods
58
+ alias_method :supported_revocation_auth_methods=, :supportedRevocationAuthMethods=
98
59
 
99
- # The duration of backchannel authentication request IDs in seconds.
100
- # (Integer)
101
- attr_accessor :backchannelAuthReqIdDuration
102
- alias_method :backchannel_auth_req_id_duration, :backchannelAuthReqIdDuration
103
- alias_method :backchannel_auth_req_id_duration=, :backchannelAuthReqIdDuration=
60
+ attr_accessor :userInfoEndpoint
61
+ alias_method :user_info_endpoint, :userInfoEndpoint
62
+ alias_method :user_info_endpoint=, :userInfoEndpoint=
104
63
 
105
- # The flag indicating whether the +binding_message+ request parameter
106
- # is always required whenever a backchannel authentication request is
107
- # judged as a request for Financial-grade API. (Boolean)
108
- attr_accessor :backchannelBindingMessageRequiredInFapi
109
- alias_method :backchannel_binding_message_required_in_fapi, :backchannelBindingMessageRequiredInFapi
110
- alias_method :backchannel_binding_message_required_in_fapi=, :backchannelBindingMessageRequiredInFapi=
64
+ attr_accessor :jwksUri
65
+ alias_method :jwks_uri, :jwksUri
66
+ alias_method :jwks_uri=, :jwksUri=
111
67
 
112
- # The minimum interval between polling requests in seconds. (Integer)
113
- attr_accessor :backchannelPollingInterval
114
- alias_method :backchannel_polling_interval, :backchannelPollingInterval
115
- alias_method :backchannel_polling_interval=, :backchannelPollingInterval=
68
+ attr_accessor :jwks
116
69
 
117
- # The flag which indicates whether the +user_code+ request parameter
118
- # is supported at the backchannel authentication endpoint. (Boolean)
119
- attr_accessor :backchannelUserCodeParameterSupported
120
- alias_method :backchannel_user_code_parameter_supported, :backchannelUserCodeParameterSupported
121
- alias_method :backchannel_user_code_parameter_supported=, :backchannelUserCodeParameterSupported=
70
+ attr_accessor :registrationEndpoint
71
+ alias_method :registration_endpoint, :registrationEndpoint
72
+ alias_method :registration_endpoint=, :registrationEndpoint=
122
73
 
123
- # The flag which indicates whether the 'Client ID Alias' feature
124
- # is enabled or not. (Boolean)
125
- attr_accessor :clientIdAliasEnabled
126
- alias_method :client_id_alias_enabled, :clientIdAliasEnabled
127
- alias_method :client_id_alias_enabled=, :clientIdAliasEnabled=
74
+ attr_accessor :registrationManagementEndpoint
75
+ alias_method :registration_management_endpoint, :registrationManagementEndpoint
76
+ alias_method :registration_management_endpoint=, :registrationManagementEndpoint=
128
77
 
129
- # The number of client applications that one developer can create.
130
- # 0 means no limit. (Integer)
131
- attr_accessor :clientsPerDeveloper
132
- alias_method :clients_per_developer, :clientsPerDeveloper
133
- alias_method :clients_per_developer=, :clientsPerDeveloper=
78
+ attr_accessor :supportedScopes
79
+ alias_method :supported_scopes, :supportedScopes
80
+ alias_method :supported_scopes=, :supportedScopes=
81
+
82
+ attr_accessor :supportedResponseTypes
83
+ alias_method :supported_response_types, :supportedResponseTypes
84
+ alias_method :supported_response_types=, :supportedResponseTypes=
85
+
86
+ attr_accessor :supportedGrantTypes
87
+ alias_method :supported_grant_types, :supportedGrantTypes
88
+ alias_method :supported_grant_types=, :supportedGrantTypes=
89
+
90
+ attr_accessor :supportedAcrs
91
+ alias_method :supported_acrs, :supportedAcrs
92
+ alias_method :supported_acrs=, :supportedAcrs=
93
+
94
+ attr_accessor :supportedTokenAuthMethods
95
+ alias_method :supported_token_auth_methods, :supportedTokenAuthMethods
96
+ alias_method :supported_token_auth_methods=, :supportedTokenAuthMethods=
97
+
98
+ attr_accessor :supportedDisplays
99
+ alias_method :supported_displays, :supportedDisplays
100
+ alias_method :supported_displays=, :supportedDisplays=
101
+
102
+ attr_accessor :supportedClaimTypes
103
+ alias_method :supported_claim_types, :supportedClaimTypes
104
+ alias_method :supported_claim_types=, :supportedClaimTypes=
105
+
106
+ attr_accessor :supportedClaims
107
+ alias_method :supported_claims, :supportedClaims
108
+ alias_method :supported_claims=, :supportedClaims=
109
+
110
+ attr_accessor :serviceDocumentation
111
+ alias_method :service_documentation, :serviceDocumentation
112
+ alias_method :service_documentation=, :serviceDocumentation=
113
+
114
+ attr_accessor :supportedClaimLocales
115
+ alias_method :supported_claim_locales, :supportedClaimLocales
116
+ alias_method :supported_claim_locales=, :supportedClaimLocales=
117
+
118
+ attr_accessor :supportedUiLocales
119
+ alias_method :supported_ui_locales, :supportedUiLocales
120
+ alias_method :supported_ui_locales=, :supportedUiLocales=
121
+
122
+ attr_accessor :policyUri
123
+ alias_method :policy_uri, :policyUri
124
+ alias_method :policy_uri=, :policyUri=
125
+
126
+ attr_accessor :tosUri
127
+ alias_method :tos_uri, :tosUri
128
+ alias_method :tos_uri=, :tosUri=
129
+
130
+ attr_accessor :authenticationCallbackEndpoint
131
+ alias_method :authentication_callback_endpoint, :authenticationCallbackEndpoint
132
+ alias_method :authentication_callback_endpoint=, :authenticationCallbackEndpoint=
133
+
134
+ attr_accessor :authenticationCallbackApiKey
135
+ alias_method :authentication_callback_api_key, :authenticationCallbackApiKey
136
+ alias_method :authentication_callback_api_key=, :authenticationCallbackApiKey=
137
+
138
+ attr_accessor :authenticationCallbackApiSecret
139
+ alias_method :authentication_callback_api_secret, :authenticationCallbackApiSecret
140
+ alias_method :authentication_callback_api_secret=, :authenticationCallbackApiSecret=
141
+
142
+ attr_accessor :supportedSnses
143
+ alias_method :supported_snses, :supportedSnses
144
+ alias_method :supported_snses=, :supportedSnses=
145
+
146
+ attr_accessor :snsCredentials
147
+ alias_method :sns_credentials, :snsCredentials
148
+ alias_method :sns_credentials=, :snsCredentials=
134
149
 
135
- # The timestamp at which the service was created. (Integer)
136
150
  attr_accessor :createdAt
137
151
  alias_method :created_at, :createdAt
138
152
  alias_method :created_at=, :createdAt=
139
153
 
140
- # The description of this service. (String)
141
- attr_accessor :description
154
+ attr_accessor :modifiedAt
155
+ alias_method :modified_at, :modifiedAt
156
+ alias_method :modified_at=, :modifiedAt=
157
+
158
+ attr_accessor :developerAuthenticationCallbackEndpoint
159
+ alias_method :developer_authentication_callback_endpoint, :developerAuthenticationCallbackEndpoint
160
+ alias_method :developer_authentication_callback_endpoint=, :developerAuthenticationCallbackEndpoint=
142
161
 
143
- # The API key to access the developer authentication callback endpoint. (String)
144
162
  attr_accessor :developerAuthenticationCallbackApiKey
145
163
  alias_method :developer_authentication_callback_api_key, :developerAuthenticationCallbackApiKey
146
164
  alias_method :developer_authentication_callback_api_key=, :developerAuthenticationCallbackApiKey=
147
165
 
148
- # The API secret to access the developer authentication callback endpoint. (String)
149
166
  attr_accessor :developerAuthenticationCallbackApiSecret
150
167
  alias_method :developer_authentication_callback_api_secret, :developerAuthenticationCallbackApiSecret
151
168
  alias_method :developer_authentication_callback_api_secret=, :developerAuthenticationCallbackApiSecret=
152
169
 
153
- # The URI of the developer authentication callback endpoint. (String)
154
- attr_accessor :developerAuthenticationCallbackEndpoint
155
- alias_method :developer_authentication_callback_endpoint, :developerAuthenticationCallbackEndpoint
156
- alias_method :developer_authentication_callback_endpoint=, :developerAuthenticationCallbackEndpoint=
170
+ attr_accessor :supportedDeveloperSnses
171
+ alias_method :supported_developer_snses, :supportedDeveloperSnses
172
+ alias_method :supported_developer_snses=, :supportedDeveloperSnses=
157
173
 
158
- # The list of SNS credentials for developer login. (SnsCredentials array)
159
174
  attr_accessor :developerSnsCredentials
160
175
  alias_method :developer_sns_credentials, :developerSnsCredentials
161
176
  alias_method :developer_sns_credentials=, :developerSnsCredentials=
162
177
 
163
- # The URI of the device authorization endpoint. (String)
164
- attr_accessor :deviceAuthorizationEndpoint
165
- alias_method :device_authorization_endpoint, :deviceAuthorizationEndpoint
166
- alias_method :device_authorization_endpoint=, :deviceAuthorizationEndpoint=
167
-
168
- # The duration of device verification codes (device_code) and
169
- # end-user verification codes (user_code) in seconds. (Integer)
170
- attr_accessor :deviceFlowCodeDuration
171
- alias_method :device_flow_code_duration, :deviceFlowCodeDuration
172
- alias_method :device_flow_code_duration=, :deviceFlowCodeDuration=
173
-
174
- # The minimum interval between polling requests in Device Flow in seconds. (Integer)
175
- attr_accessor :deviceFlowPollingInterval
176
- alias_method :device_flow_polling_interval, :deviceFlowPollingInterval
177
- alias_method :device_flow_polling_interval=, :deviceFlowPollingInterval=
178
-
179
- # The verification URI for Device Flow. (String)
180
- attr_accessor :deviceVerificationUri
181
- alias_method :device_verification_uri, :deviceVerificationUri
182
- alias_method :device_verification_uri=, :deviceVerificationUri=
183
-
184
- # The verification URI for Device Flow with a placeholder for a user code. (String)
185
- attr_accessor :deviceVerificationUriComplete
186
- alias_method :device_verification_uri_complete, :deviceVerificationUriComplete
187
- alias_method :device_verification_uri_complete=, :deviceVerificationUriComplete=
178
+ attr_accessor :clientsPerDeveloper
179
+ alias_method :clients_per_developer, :clientsPerDeveloper
180
+ alias_method :clients_per_developer=, :clientsPerDeveloper=
188
181
 
189
- # The flag to indicate whether the direct authorization endpoint
190
- # is enabled or not. The path of the endpoint is
191
- # <code>/api/auth/authorization/direct/{serviceApiKey}</code>.
192
- # (Boolean)
193
182
  attr_accessor :directAuthorizationEndpointEnabled
194
183
  alias_method :direct_authorization_endpoint_enabled, :directAuthorizationEndpointEnabled
195
184
  alias_method :direct_authorization_endpoint_enabled=, :directAuthorizationEndpointEnabled=
196
185
 
197
- # The flag to indicate whether the direct introspection endpoint
198
- # is enabled or not. The path of the endpoint is
199
- # <code>/api/auth/introspection/direct/{serviceApiKey}</code>.
200
- # (Boolean)
201
- attr_accessor :directIntrospectionEndpointEnabled
202
- alias_method :direct_introspection_endpoint_enabled, :directIntrospectionEndpointEnabled
203
- alias_method :direct_introspection_endpoint_enabled=, :directIntrospectionEndpointEnabled=
204
-
205
- # The flag to indicate whether the direct jwks endpoint
206
- # is enabled or not. The path of the endpoint is
207
- # <code>/api/service/jwks/get/direct/{serviceApiKey}</code>.
208
- # (Boolean)
209
- attr_accessor :directJwksEndpointEnabled
210
- alias_method :direct_jwks_endpoint_enabled, :directJwksEndpointEnabled
211
- alias_method :direct_jwks_endpoint_enabled=, :directJwksEndpointEnabled=
186
+ attr_accessor :directTokenEndpointEnabled
187
+ alias_method :direct_token_endpoint_enabled, :directTokenEndpointEnabled
188
+ alias_method :direct_token_endpoint_enabled=, :directTokenEndpointEnabled=
212
189
 
213
- # The flag to indicate whether the direct revocation endpoint
214
- # is enabled or not. The path of the endpoint is
215
- # <code>/api/auth/revocation/direct/{serviceApiKey}</code>.
216
- # (Boolean)
217
190
  attr_accessor :directRevocationEndpointEnabled
218
191
  alias_method :direct_revocation_endpoint_enabled, :directRevocationEndpointEnabled
219
192
  alias_method :direct_revocation_endpoint_enabled=, :directRevocationEndpointEnabled=
220
193
 
221
- # The flag to indicate whether the direct token endpoint
222
- # is enabled or not. The path of the endpoint is
223
- # <code>/api/auth/token/direct/{serviceApiKey}</code>.
224
- # (Boolean)
225
- attr_accessor :directTokenEndpointEnabled
226
- alias_method :direct_token_endpoint_enabled, :directTokenEndpointEnabled
227
- alias_method :direct_token_endpoint_enabled=, :directTokenEndpointEnabled=
228
-
229
- # The flag to indicate whether the direct user info endpoint
230
- # is enabled or not. The path of the endpoint is
231
- # <code>/api/auth/userinfo/direct/{serviceApiKey}</code>.
232
- # (Boolean)
233
194
  attr_accessor :directUserInfoEndpointEnabled
234
195
  alias_method :direct_user_info_endpoint_enabled, :directUserInfoEndpointEnabled
235
196
  alias_method :direct_user_info_endpoint_enabled=, :directUserInfoEndpointEnabled=
236
197
 
237
- # The flag to indicate whether the <code>error_description</code>
238
- # response parameter is omitted. (Boolean)
198
+ attr_accessor :directJwksEndpointEnabled
199
+ alias_method :direct_jwks_endpoint_enabled, :directJwksEndpointEnabled
200
+ alias_method :direct_jwks_endpoint_enabled=, :directJwksEndpointEnabled=
201
+
202
+ attr_accessor :directIntrospectionEndpointEnabled
203
+ alias_method :direct_introspection_endpoint_enabled, :directIntrospectionEndpointEnabled
204
+ alias_method :direct_introspection_endpoint_enabled=, :directIntrospectionEndpointEnabled=
205
+
206
+ attr_accessor :singleAccessTokenPerSubject
207
+ alias_method :single_access_token_per_subject, :singleAccessTokenPerSubject
208
+ alias_method :single_access_token_per_subject=, :singleAccessTokenPerSubject=
209
+
210
+ attr_accessor :pkceRequired
211
+ alias_method :pkce_required, :pkceRequired
212
+ alias_method :pkce_required=, :pkceRequired=
213
+
214
+ attr_accessor :pkceS256Required
215
+ alias_method :pkce_s256_required, :pkceS256Required
216
+ alias_method :pkce_s256_required=, :pkceS256Required=
217
+
218
+ attr_accessor :refreshTokenKept
219
+ alias_method :refresh_token_kept, :refreshTokenKept
220
+ alias_method :refresh_token_kept=, :refreshTokenKept=
221
+
222
+ attr_accessor :refreshTokenDurationKept
223
+ alias_method :refresh_token_duration_kept, :refreshTokenDurationKept
224
+ alias_method :refresh_token_duration_kept=, :refreshTokenDurationKept=
225
+
239
226
  attr_accessor :errorDescriptionOmitted
240
227
  alias_method :error_description_omitted, :errorDescriptionOmitted
241
228
  alias_method :error_description_omitted=, :errorDescriptionOmitted=
242
229
 
243
- # The flag to indicate whether the <code>error_uri</code>
244
- # response parameter is omitted. (Boolean)
245
230
  attr_accessor :errorUriOmitted
246
231
  alias_method :error_uri_omitted, :errorUriOmitted
247
232
  alias_method :error_uri_omitted=, :errorUriOmitted=
248
233
 
249
- # The duration of ID tokens in seconds. (Integer)
250
- attr_accessor :idTokenDuration
251
- alias_method :id_token_duration, :idTokenDuration
252
- alias_method :id_token_duration=, :idTokenDuration=
234
+ attr_accessor :clientIdAliasEnabled
235
+ alias_method :client_id_alias_enabled, :clientIdAliasEnabled
236
+ alias_method :client_id_alias_enabled=, :clientIdAliasEnabled=
253
237
 
254
- # The key ID to identify a JWK used for ID token signature using an
255
- # asymmetric key. (String)
256
- attr_accessor :idTokenSignatureKeyId
257
- alias_method :id_token_signature_key_id, :idTokenSignatureKeyId
258
- alias_method :id_token_signature_key_id=, :idTokenSignatureKeyId=
238
+ attr_accessor :supportedServiceProfiles
239
+ alias_method :supported_service_profiles, :supportedServiceProfiles
240
+ alias_method :supported_service_profiles=, :supportedServiceProfiles=
241
+
242
+ attr_accessor :tlsClientCertificateBoundAccessTokens
243
+ alias_method :tls_client_certificate_bound_access_tokens, :tlsClientCertificateBoundAccessTokens
244
+ alias_method :tls_client_certificate_bound_access_tokens=, :tlsClientCertificateBoundAccessTokens=
259
245
 
260
- # The URI of the introspection endpoint. (String)
261
246
  attr_accessor :introspectionEndpoint
262
247
  alias_method :introspection_endpoint, :introspectionEndpoint
263
248
  alias_method :introspection_endpoint=, :introspectionEndpoint=
264
249
 
265
- # The issuer identifier of this OpenID Provider. (String)
266
- attr_accessor :issuer
267
-
268
- # The JSON Web Key Set of this service. (String)
269
- attr_accessor :jwks
270
-
271
- # The URI of the service's JSON Web Key Set. (String)
272
- attr_accessor :jwksUri
273
- alias_method :jwks_uri, :jwksUri
274
- alias_method :jwks_uri=, :jwksUri=
275
-
276
- # The metadata of the service. (Pair Array)
277
- attr_accessor :metadata
278
-
279
- # The timestamp at which the service was modified. (Integer)
280
- attr_accessor :modifiedAt
281
- alias_method :modified_at, :modifiedAt
282
- alias_method :modified_at=, :modifiedAt=
250
+ attr_accessor :supportedIntrospectionAuthMethods
251
+ alias_method :supported_introspection_auth_methods, :supportedIntrospectionAuthMethods
252
+ alias_method :supported_introspection_auth_methods=, :supportedIntrospectionAuthMethods=
283
253
 
284
- # The flag that indicates whether the service will validate the PKI certificate chain
285
- # for MTLS based authentication. (Boolean)
286
254
  attr_accessor :mutualTlsValidatePkiCertChain
287
255
  alias_method :mutual_tls_validate_pki_cert_chain, :mutualTlsValidatePkiCertChain
288
256
  alias_method :mutual_tls_validate_pki_cert_chain=, :mutualTlsValidatePkiCertChain=
289
257
 
290
- # The service number. (Integer)
291
- attr_accessor :number
292
-
293
- # The flag to indicate whether the use of Proof Key for Code
294
- # Exchange (PKCE) is always required for authorization requests
295
- # Authorization Code Flow.
296
- # (Boolean)
297
- attr_accessor :pkceRequired
298
- alias_method :pkce_required, :pkceRequired
299
- alias_method :pkce_required=, :pkceRequired=
300
-
301
- # The flag indicating whether S256 is required as the code challenge
302
- # method whenever PKCE is used. (Boolean)
303
- attr_accessor :pkceS256Required
304
- alias_method :pkce_s256_required, :pkceS256Required
305
- alias_method :pkce_s256_required=, :pkceS256Required=
306
-
307
- # The URI of the service's policy page. (String)
308
- attr_accessor :policyUri
309
- alias_method :policy_uri, :policyUri
310
- alias_method :policy_uri=, :policyUri=
258
+ attr_accessor :trustedRootCertificates
259
+ alias_method :trusted_root_certificates, :trustedRootCertificates
260
+ alias_method :trusted_root_certificates=, :trustedRootCertificates=
311
261
 
312
- # The duration of refresh tokens in seconds. (Integer)
313
- attr_accessor :refreshTokenDuration
314
- alias_method :refresh_token_duration, :refreshTokenDuration
315
- alias_method :refresh_token_duration=, :refreshTokenDuration=
262
+ attr_accessor :dynamicRegistrationSupported
263
+ alias_method :dynamic_registration_supported, :dynamicRegistrationSupported
264
+ alias_method :dynamic_registration_supported=, :dynamicRegistrationSupported=
316
265
 
317
- # The flag to indicate whether a refresh token remains unchanged
318
- # or gets renewed after its use.
319
- # (Boolean)
320
- attr_accessor :refreshTokenKept
321
- alias_method :refresh_token_kept, :refreshTokenKept
322
- alias_method :refresh_token_kept=, :refreshTokenKept=
266
+ attr_accessor :endSessionEndpoint
267
+ alias_method :end_session_endpoint, :endSessionEndpoint
268
+ alias_method :end_session_endpoint=, :endSessionEndpoint=
323
269
 
324
- # The URI of the registration endpoint. (String)
325
- attr_accessor :registrationEndpoint
326
- alias_method :registration_endpoint, :registrationEndpoint
327
- alias_method :registration_endpoint=, :registrationEndpoint=
270
+ attr_accessor :description
328
271
 
329
- # The URI of the token revocation endpoint. (String)
330
- attr_accessor :revocationEndpoint
331
- alias_method :revocation_endpoint, :revocationEndpoint
332
- alias_method :revocation_endpoint=, :revocationEndpoint=
272
+ attr_accessor :accessTokenType
273
+ alias_method :access_token_type, :accessTokenType
274
+ alias_method :access_token_type=, :accessTokenType=
333
275
 
334
- # The URI of the service's documentation. (String)
335
- attr_accessor :serviceDocumentation
336
- alias_method :service_documentation, :serviceDocumentation
337
- alias_method :service_documentation=, :serviceDocumentation=
276
+ attr_accessor :accessTokenSignAlg
277
+ alias_method :access_token_sign_alg, :accessTokenSignAlg
278
+ alias_method :access_token_sign_alg=, :accessTokenSignAlg=
338
279
 
339
- # The service name. (String)
340
- attr_accessor :serviceName
341
- alias_method :service_name, :serviceName
342
- alias_method :service_name=, :serviceName=
280
+ attr_accessor :accessTokenDuration
281
+ alias_method :access_token_duration, :accessTokenDuration
282
+ alias_method :access_token_duration=, :accessTokenDuration=
343
283
 
344
- # The service owner number. (Integer)
345
- attr_accessor :serviceOwnerNumber
346
- alias_method :service_owner_number, :serviceOwnerNumber
347
- alias_method :service_owner_number=, :serviceOwnerNumber=
284
+ attr_accessor :refreshTokenDuration
285
+ alias_method :refresh_token_duration, :refreshTokenDuration
286
+ alias_method :refresh_token_duration=, :refreshTokenDuration=
348
287
 
349
- # The flag to indicate whether the number of access tokens
350
- # per subject (and per client) is at most one or can be more. (Boolean)
351
- attr_accessor :singleAccessTokenPerSubject
352
- alias_method :single_access_token_per_subject, :singleAccessTokenPerSubject
353
- alias_method :single_access_token_per_subject=, :singleAccessTokenPerSubject=
288
+ attr_accessor :idTokenDuration
289
+ alias_method :id_token_duration, :idTokenDuration
290
+ alias_method :id_token_duration=, :idTokenDuration=
354
291
 
355
- # The list of SNS credentials. (SnsCredentials array)
356
- attr_accessor :snsCredentials
357
- alias_method :sns_credentials, :snsCredentials
358
- alias_method :sns_credentials=, :snsCredentials=
292
+ attr_accessor :authorizationResponseDuration
293
+ alias_method :authorization_response_duration, :authorizationResponseDuration
294
+ alias_method :authorization_response_duration=, :authorizationResponseDuration=
359
295
 
360
- # The list of supported ACRs. (String array)
361
- attr_accessor :supportedAcrs
362
- alias_method :supported_acrs, :supportedAcrs
363
- alias_method :supported_acrs=, :supportedAcrs=
296
+ attr_accessor :pushedAuthReqDuration
297
+ alias_method :pushed_auth_req_duration, :pushedAuthReqDuration
298
+ alias_method :pushed_auth_req_duration=, :pushedAuthReqDuration=
364
299
 
365
- # The list of supported claim locales. (String array)
366
- attr_accessor :supportedClaimLocales
367
- alias_method :supported_claim_locales, :supportedClaimLocales
368
- alias_method :supported_claim_locales=, :supportedClaimLocales=
300
+ attr_accessor :metadata
369
301
 
370
- # The list of supported claims. (String array)
371
- attr_accessor :supportedClaims
372
- alias_method :supported_claims, :supportedClaims
373
- alias_method :supported_claims=, :supportedClaims=
302
+ attr_accessor :accessTokenSignatureKeyId
303
+ alias_method :access_token_signature_key_id, :accessTokenSignatureKeyId
304
+ alias_method :access_token_signature_key_id=, :accessTokenSignatureKeyId=
374
305
 
375
- # The list of supported claim types. (String array)
376
- #
377
- # Valid values are "NORMAL", "AGGREGATED" and "DISTRIBUTED".
378
- attr_accessor :supportedClaimTypes
379
- alias_method :supported_claim_types, :supportedClaimTypes
380
- alias_method :supported_claim_types=, :supportedClaimTypes=
306
+ attr_accessor :authorizationSignatureKeyId
307
+ alias_method :authorization_signature_key_id, :authorizationSignatureKeyId
308
+ alias_method :authorization_signature_key_id=, :authorizationSignatureKeyId=
381
309
 
382
- # The list of supported SNSes for developer login. (Sns array)
383
- attr_accessor :supportedDeveloperSnses
384
- alias_method :supported_developer_snses, :supportedDeveloperSnses
385
- alias_method :supported_developer_snses=, :supportedDeveloperSnses=
310
+ attr_accessor :idTokenSignatureKeyId
311
+ alias_method :id_token_signature_key_id, :idTokenSignatureKeyId
312
+ alias_method :id_token_signature_key_id=, :idTokenSignatureKeyId=
386
313
 
387
- # The list of supported values of +display+ parameter. (String array)
388
- #
389
- # Valid values are "PAGE", "POPUP", "TOUCH" and "WAP".
390
- attr_accessor :supportedDisplays
391
- alias_method :supported_displays, :supportedDisplays
392
- alias_method :supported_displays=, :supportedDisplays=
314
+ attr_accessor :userInfoSignatureKeyId
315
+ alias_method :user_info_signature_key_id, :userInfoSignatureKeyId
316
+ alias_method :user_info_signature_key_id=, :userInfoSignatureKeyId=
393
317
 
394
- # The list of supported grant types. (String array)
395
- #
396
- # Valid values are "AUTHORIZATION_CODE", "IMPLICIT", "PASSWORD",
397
- # "CLIENT_CREDENTIALS" and "REFRESH_TOKEN".
398
- attr_accessor :supportedGrantTypes
399
- alias_method :supported_grant_types, :supportedGrantTypes
400
- alias_method :supported_grant_types=, :supportedGrantTypes=
318
+ attr_accessor :supportedBackchannelTokenDeliveryModes
319
+ alias_method :supported_backchannel_token_delivery_modes, :supportedBackchannelTokenDeliveryModes
320
+ alias_method :supported_backchannel_token_delivery_modes=, :supportedBackchannelTokenDeliveryModes=
401
321
 
402
- # The list of supported response types. (String array)
403
- #
404
- # Valid values are "NONE", "CODE", "TOKEN", "ID_TOKEN",
405
- # "CODE_TOKEN", "CODE_ID_TOKEN", "ID_TOKEN_TOKEN" and
406
- # "CODE_ID_TOKEN_TOKEN".
407
- attr_accessor :supportedResponseTypes
408
- alias_method :supported_response_types, :supportedResponseTypes
409
- alias_method :supported_response_types=, :supportedResponseTypes=
322
+ attr_accessor :backchannelAuthenticationEndpoint
323
+ alias_method :backchannel_authentication_endpoint, :backchannelAuthenticationEndpoint
324
+ alias_method :backchannel_authentication_endpoint=, :backchannelAuthenticationEndpoint=
410
325
 
411
- # The list of supported scopes. (Scope array)
412
- attr_accessor :supportedScopes
413
- alias_method :supported_scopes, :supportedScopes
414
- alias_method :supported_scopes=, :supportedScopes=
326
+ attr_accessor :backchannelUserCodeParameterSupported
327
+ alias_method :backchannel_user_code_parameter_supported, :backchannelUserCodeParameterSupported
328
+ alias_method :backchannel_user_code_parameter_supported=, :backchannelUserCodeParameterSupported=
415
329
 
416
- # The list of supported service profiles. (String array)
417
- attr_accessor :supportedServiceProfiles
418
- alias_method :supported_service_profiles, :supportedServiceProfiles
419
- alias_method :supported_service_profiles=, :supportedServiceProfiles=
330
+ attr_accessor :backchannelAuthReqIdDuration
331
+ alias_method :backchannel_auth_req_id_duration, :backchannelAuthReqIdDuration
332
+ alias_method :backchannel_auth_req_id_duration=, :backchannelAuthReqIdDuration=
420
333
 
421
- # The list of supported SNSes. (Sns array)
422
- attr_accessor :supportedSnses
423
- alias_method :supported_snses, :supportedSnses
424
- alias_method :supported_snses=, :supportedSnses=
334
+ attr_accessor :backchannelPollingInterval
335
+ alias_method :backchannel_polling_interval, :backchannelPollingInterval
336
+ alias_method :backchannel_polling_interval=, :backchannelPollingInterval=
425
337
 
426
- # The list of supported client authentication methods at the token endpoint. (String array)
427
- #
428
- # Valid values are "NONE", "CLIENT_SECRET_BASIC", "CLIENT_SECRET_POST",
429
- # "CLIENT_SECRET_JWT" and "PRIVATE_KEY_JWT".
430
- attr_accessor :supportedTokenAuthMethods
431
- alias_method :supported_token_auth_methods, :supportedTokenAuthMethods
432
- alias_method :supported_token_auth_methods=, :supportedTokenAuthMethods=
338
+ attr_accessor :backchannelBindingMessageRequiredInFapi
339
+ alias_method :backchannel_binding_message_required_in_fapi, :backchannelBindingMessageRequiredInFapi
340
+ alias_method :backchannel_binding_message_required_in_fapi=, :backchannelBindingMessageRequiredInFapi=
433
341
 
434
- # The list of supported backchannel token delivery modes. (String array)
435
- # Valid values are "POLL", "PING" and "PUSH".
436
- attr_accessor :supportedBackchannelTokenDeliveryModes
437
- alias_method :supported_backchannel_token_delivery_modes, :supportedBackchannelTokenDeliveryModes
438
- alias_method :supported_backchannel_token_delivery_modes=, :supportedBackchannelTokenDeliveryModes=
342
+ attr_accessor :allowableClockSkew
343
+ alias_method :allowable_clock_skew, :allowableClockSkew
344
+ alias_method :allowable_clock_skew=, :allowableClockSkew=
439
345
 
440
- # The list of supported UI locales. (String array)
441
- attr_accessor :supportedUiLocales
442
- alias_method :supported_ui_locales, :supportedUiLocales
443
- alias_method :supported_ui_locales=, :supportedUiLocales=
346
+ attr_accessor :deviceAuthorizationEndpoint
347
+ alias_method :device_authorization_endpoint, :deviceAuthorizationEndpoint
348
+ alias_method :device_authorization_endpoint=, :deviceAuthorizationEndpoint=
444
349
 
445
- # The flag that indicates whether the service offers TLS client certificate
446
- # bound access tokens (Boolean)
447
- attr_accessor :tlsClientCertificateBoundAccessTokens
448
- alias_method :tls_client_certificate_bound_access_tokens, :tlsClientCertificateBoundAccessTokens
449
- alias_method :tls_client_certificate_bound_access_tokens=, :tlsClientCertificateBoundAccessTokens=
350
+ attr_accessor :deviceVerificationUri
351
+ alias_method :device_verification_uri, :deviceVerificationUri
352
+ alias_method :device_verification_uri=, :deviceVerificationUri=
450
353
 
451
- # The URI of the token endpoint. (String)
452
- attr_accessor :tokenEndpoint
453
- alias_method :token_endpoint, :tokenEndpoint
454
- alias_method :token_endpoint=, :tokenEndpoint=
354
+ attr_accessor :deviceVerificationUriComplete
355
+ alias_method :device_verification_uri_complete, :deviceVerificationUriComplete
356
+ alias_method :device_verification_uri_complete=, :deviceVerificationUriComplete=
455
357
 
456
- # The URI of the service's "Terms Of Service" page. (String)
457
- attr_accessor :tosUri
458
- alias_method :tos_uri, :tosUri
459
- alias_method :tos_uri=, :tosUri=
358
+ attr_accessor :deviceFlowCodeDuration
359
+ alias_method :device_flow_code_duration, :deviceFlowCodeDuration
360
+ alias_method :device_flow_code_duration=, :deviceFlowCodeDuration=
460
361
 
461
- # The list of trusted root certificates, used when the service validates client
462
- # certificate paths. (String array)
463
- attr_accessor :trustedRootCertificates
464
- alias_method :trusted_root_certificates, :trustedRootCertificates
465
- alias_method :trusted_root_certificates=, :trustedRootCertificates=
362
+ attr_accessor :deviceFlowPollingInterval
363
+ alias_method :device_flow_polling_interval, :deviceFlowPollingInterval
364
+ alias_method :device_flow_polling_interval=, :deviceFlowPollingInterval=
466
365
 
467
- # The character set for user codes. (String)
468
366
  attr_accessor :userCodeCharset
469
367
  alias_method :user_code_charset, :userCodeCharset
470
368
  alias_method :user_code_charset=, :userCodeCharset=
471
369
 
472
- # The length of user codes. (Integer)
473
370
  attr_accessor :userCodeLength
474
371
  alias_method :user_code_length, :userCodeLength
475
372
  alias_method :user_code_length=, :userCodeLength=
476
373
 
477
- # The URI of user info endpoint. (String)
478
- attr_accessor :userInfoEndpoint
479
- alias_method :user_info_endpoint, :userInfoEndpoint
480
- alias_method :user_info_endpoint=, :userInfoEndpoint=
481
-
482
- # The key ID to identify a JWK used for user info signature using an
483
- # asymmetric key. (String)
484
- attr_accessor :userInfoSignatureKeyId
485
- alias_method :user_info_signature_key_id, :userInfoSignatureKeyId
486
- alias_method :user_info_signature_key_id=, :userInfoSignatureKeyId=
487
-
488
- # Flag of whether this service supports dynamic client registration.
489
- # (Boolean)
490
- attr_accessor :dynamicRegistrationSupported
491
- alias_method :dynamic_registration_supported, :dynamicRegistrationSupported
492
- alias_method :dynamic_registration_supported=, :dynamicRegistrationSupported=
493
-
494
- # The base URI of the service's "Dynamic Client Registration Management"
495
- # endpoint. Client management URIs will be based on this by adding the
496
- # client ID as a path component. (String)
497
- attr_accessor :registrationManagementEndpoint
498
- alias_method :registration_management_endpoint, :registrationManagementEndpoint
499
- alias_method :registration_management_endpoint=, :registrationManagementEndpoint=
500
-
501
- # The URI of request object endpoint. (String)
502
- attr_accessor :requestObjectEndpoint
503
- alias_method :request_object_endpoint, :requestObjectEndpoint
504
- alias_method :request_object_endpoint=, :requestObjectEndpoint=
505
-
506
- # MTLS endpoint aliases. (NamedUri array)
507
- attr_accessor :mtlsEndpointAliases
508
- alias_method :mtls_endpoint_aliases, :mtlsEndpointAliases
509
- alias_method :mtls_endpoint_aliases=, :mtlsEndpointAliases=
510
-
511
- # The URI of pushed authorization request endpoint. (String)
512
374
  attr_accessor :pushedAuthReqEndpoint
513
375
  alias_method :pushed_auth_req_endpoint, :pushedAuthReqEndpoint
514
376
  alias_method :pushed_auth_req_endpoint=, :pushedAuthReqEndpoint=
515
377
 
516
- # Duration of pushed authorization requests. (Integer)
517
- attr_accessor :pushedAuthReqDuration
518
- alias_method :pushed_auth_req_duration, :pushedAuthReqDuration
519
- alias_method :pushed_auth_req_duration=, :pushedAuthReqDuration=
378
+ attr_accessor :mtlsEndpointAliases
379
+ alias_method :mtls_endpoint_aliases, :mtlsEndpointAliases
380
+ alias_method :mtls_endpoint_aliases=, :mtlsEndpointAliases=
520
381
 
521
- # Supported data types for +authorization_details+. (String array)
522
382
  attr_accessor :supportedAuthorizationDataTypes
523
383
  alias_method :supported_authorization_data_types, :supportedAuthorizationDataTypes
524
384
  alias_method :supported_authorization_data_types=, :supportedAuthorizationDataTypes=
525
385
 
526
- # Trust frameworks supported by this service. (String array)
527
- # This corresponds to the +trust_frameworks_supported+ in OpenID Connect
528
- # for Identity Assurance 1.0.
529
386
  attr_accessor :supportedTrustFrameworks
530
387
  alias_method :supported_trust_frameworks, :supportedTrustFrameworks
531
388
  alias_method :supported_trust_frameworks=, :supportedTrustFrameworks=
532
389
 
533
- # Evidence supported by this service. (String array)
534
- # This corresponds to the +evidence_supported+ in OpenID Connect for
535
- # Identity Assurance 1.0.
536
390
  attr_accessor :supportedEvidence
537
391
  alias_method :supported_evidence, :supportedEvidence
538
392
  alias_method :supported_evidence=, :supportedEvidence=
539
393
 
540
- # Identity documents supported by this service. (String array)
541
- # This corresponds to the +id_documents_supported+ in OpenID Connect
542
- # for Identity Assurance 1.0.
543
394
  attr_accessor :supportedIdentityDocuments
544
395
  alias_method :supported_identity_documents, :supportedIdentityDocuments
545
396
  alias_method :supported_identity_documents=, :supportedIdentityDocuments=
546
397
 
547
- # Verification methods supported by this service. (String array)
548
- # This corresponds to the +id_documents_verification_methods_supported+ in
549
- # OpenID Connect for Identity Assurance 1.0.
550
398
  attr_accessor :supportedVerificationMethods
551
399
  alias_method :supported_verification_methods, :supportedVerificationMethods
552
400
  alias_method :supported_verification_methods=, :supportedVerificationMethods=
553
401
 
554
- # Verified claims supported by this service. (String array)
555
- # This corresponds to the +claims_in_verified_claims_supported+ in
556
- # OpenID Connect for Identity Assurance 1.0.
557
402
  attr_accessor :supportedVerifiedClaims
558
403
  alias_method :supported_verified_claims, :supportedVerifiedClaims
559
404
  alias_method :supported_verified_claims=, :supportedVerifiedClaims=
560
405
 
561
- # Flag of whether this service allows token requests without client ID
562
- # from public clients or not. (Boolean)
563
406
  attr_accessor :missingClientIdAllowed
564
407
  alias_method :missing_client_id_allowed, :missingClientIdAllowed
565
408
  alias_method :missing_client_id_allowed=, :missingClientIdAllowed=
566
409
 
567
- # Flag of whether the remaining duration of the used refresh token is
568
- # taken over to the newly issued refresh token. (Boolean)
569
- attr_accessor :refreshTokenDurationKept
570
- alias_method :refresh_token_duration_kept, :refreshTokenDurationKept
571
- alias_method :refresh_token_duration_kept=, :refreshTokenDurationKept=
572
-
573
- # Flag of whether this service requires that clients use the pushed
574
- # authorization request endpoint. (Boolean)
575
410
  attr_accessor :parRequired
576
411
  alias_method :par_required, :parRequired
577
412
  alias_method :par_required=, :parRequired=
578
413
 
579
- # Flag of whether this service always requires request objects. (Boolean)
580
414
  attr_accessor :requestObjectRequired
581
415
  alias_method :request_object_required, :requestObjectRequired
582
416
  alias_method :request_object_required=, :requestObjectRequired=
583
417
 
584
- # Flag of whether this service processes request objects based on the
585
- # rules defined in OpenID Connect Core 1.0 (if +true+) or JAR (JWT Secured
586
- # Authorization Request) (if +false+). (Boolean)
587
418
  attr_accessor :traditionalRequestObjectProcessingApplied
588
419
  alias_method :traditional_request_object_processing_applied, :traditionalRequestObjectProcessingApplied
589
420
  alias_method :traditional_request_object_processing_applied=, :traditionalRequestObjectProcessingApplied=
590
421
 
591
- # Flag of whether claims specified by shortcut scopes (e.g. profile)
592
- # are included in the issued ID token only when no access token is issued.
593
- # (Boolean)
594
422
  attr_accessor :claimShortcutRestrictive
595
423
  alias_method :claim_shortcut_restrictive, :claimShortcutRestrictive
596
424
  alias_method :claim_shortcut_restrictive=, :claimShortcutRestrictive=
597
425
 
598
- # Flag of whether requests that request no scope are rejected or not.
599
- # (Boolean)
600
426
  attr_accessor :scopeRequired
601
427
  alias_method :scope_required, :scopeRequired
602
428
  alias_method :scope_required=, :scopeRequired=
603
429
 
604
430
  private
605
431
 
606
- # Integer attributes.
607
- INTEGER_ATTRIBUTES = ::Set.new([
608
- :accessTokenDuration, :allowableClockSkew, :apiKey, :authorizationResponseDuration,
609
- :backchannelAuthReqIdDuration, :backchannelPollingInterval, :clientsPerDeveloper,
610
- :createdAt, :deviceFlowCodeDuration, :deviceFlowPollingInterval,
611
- :idTokenDuration, :modifiedAt, :number, :refreshTokenDuration,
612
- :serviceOwnerNumber, :userCodeLength, :pushedAuthReqDuration
613
- ])
614
-
615
- # Boolean attributes.
616
- BOOLEAN_ATTRIBUTES = ::Set.new([
617
- :backchannelBindingMessageRequiredInFapi, :backchannelUserCodeParameterSupported,
618
- :claimShortcutRestrictive, :clientIdAliasEnabled,
619
- :directAuthorizationEndpointEnabled, :directIntrospectionEndpointEnabled,
620
- :directJwksEndpointEnabled, :directRevocationEndpointEnabled, :directTokenEndpointEnabled,
621
- :directUserInfoEndpointEnabled, :errorDescriptionOmitted, :errorUriOmitted,
622
- :mutualTlsValidatePkiCertChain, :pkceRequired, :pkceS256Required, :refreshTokenKept,
623
- :singleAccessTokenPerSubject, :tlsClientCertificateBoundAccessTokens,
624
- :dynamicRegistrationSupported, :missingClientIdAllowed, :refreshTokenDurationKept,
625
- :parRequired, :requestObjectRequired, :scopeRequired, :traditionalRequestObjectProcessingApplied
626
- ])
627
-
628
- # String attributes.
629
- STRING_ATTRIBUTES = ::Set.new([
630
- :accessTokenSignAlg, :accessTokenSignatureKeyId, :accessTokenType,
631
- :apiSecret, :authenticationCallbackApiKey, :authenticationCallbackApiSecret,
632
- :authenticationCallbackEndpoint, :authorizationEndpoint, :authorizationSignatureKeyId,
633
- :backchannelAuthenticationEndpoint, :description, :developerAuthenticationCallbackApiKey,
634
- :developerAuthenticationCallbackApiSecret, :developerAuthenticationCallbackEndpoint,
635
- :deviceAuthorizationEndpoint, :deviceVerificationUri, :deviceVerificationUriComplete,
636
- :idTokenSignatureKeyId, :introspectionEndpoint, :issuer, :jwks, :jwksUri,
637
- :policyUri, :registrationEndpoint, :registrationManagementEndpoint,
638
- :requestObjectEndpoint, :revocationEndpoint, :serviceDocumentation, :serviceName,
639
- :tokenEndpoint, :tosUri, :userCodeCharset, :userInfoEndpoint, :userInfoSignatureKeyId,
640
- :pushedAuthReqEndpoint
641
- ])
642
-
643
- # String array attributes.
644
- STRING_ARRAY_ATTRIBUTES = ::Set.new([
645
- :supportedAcrs, :supportedBackchannelTokenDeliveryModes, :supportedClaimLocales,
646
- :supportedClaims, :supportedClaimTypes, :supportedDeveloperSnses,
647
- :supportedDisplays, :supportedGrantTypes, :supportedResponseTypes,
648
- :supportedServiceProfiles, :supportedSnses, :supportedTokenAuthMethods,
649
- :supportedUiLocales, :trustedRootCertificates, :supportedAuthorizationDataTypes,
650
- :supportedTrustFrameworks, :supportedEvidence, :supportedIdentityDocuments,
651
- :supportedVerificationMethods, :supportedVerifiedClaims
652
- ])
653
-
654
- # SNS credentials array attributes.
655
- SNS_CREDENTIALS_ARRAY_ATTRIBUTES = ::Set.new([
656
- :developerSnsCredentials, :snsCredentials
657
- ])
658
-
659
- # Mapping from snake cases to camel cases.
660
- SNAKE_TO_CAMEL = {
661
- :access_token_duration => :accessTokenDuration,
662
- :access_token_sign_alg => :accessTokenSignAlg,
663
- :access_token_signature_key_id => :accessTokenSignatureKeyId,
664
- :access_token_type => :accessTokenType,
665
- :allowable_clock_skew => :allowableClockSkew,
666
- :api_key => :apiKey,
667
- :api_secret => :apiSecret,
668
- :authentication_callback_api_key => :authenticationCallbackApiKey,
669
- :authentication_callback_api_secret => :authenticationCallbackApiSecret,
670
- :authentication_callback_endpoint => :authenticationCallbackEndpoint,
671
- :authorization_endpoint => :authorizationEndpoint,
672
- :authorization_response_duration => :authorizationResponseDuration,
673
- :authorization_signature_key_id => :authorizationSignatureKeyId,
674
- :backchannel_authentication_endpoint => :backchannelAuthenticationEndpoint,
675
- :backchannel_binding_message_required_in_fapi => :backchannelBindingMessageRequiredInFapi,
676
- :backchannel_auth_req_id_duration => :backchannelAuthReqIdDuration,
677
- :backchannel_polling_interval => :backchannelPollingInterval,
678
- :backchannel_user_code_parameter_supported => :backchannelUserCodeParameterSupported,
679
- :developer_authentication_callback_api_key => :developerAuthenticationCallbackApiKey,
680
- :developer_authentication_callback_api_secret => :developerAuthenticationCallbackApiSecret,
681
- :developer_authentication_callback_endpoint => :developerAuthenticationCallbackEndpoint,
682
- :developer_sns_credentials => :developerSnsCredentials,
683
- :device_authorization_endpoint => :deviceAuthorizationEndpoint,
684
- :device_flow_code_duration => :deviceFlowCodeDuration,
685
- :device_flow_polling_interval => :deviceFlowPollingInterval,
686
- :device_verification_uri => :deviceVerificationUri,
687
- :device_verification_uri_complete => :deviceVerificationUriComplete,
688
- :client_id_alias_enabled => :clientIdAliasEnabled,
689
- :clients_per_developer => :clientsPerDeveloper,
690
- :created_at => :createdAt,
691
- :direct_authorization_endpoint_enabled => :directAuthorizationEndpointEnabled,
692
- :direct_introspection_endpoint_enabled => :directIntrospectionEndpointEnabled,
693
- :direct_jwks_endpoint_enabled => :directJwksEndpointEnabled,
694
- :direct_revocation_endpoint_enabled => :directRevocationEndpointEnabled,
695
- :direct_token_endpoint_enabled => :directTokenEndpointEnabled,
696
- :direct_user_info_endpoint_enabled => :directUserInfoEndpointEnabled,
697
- :dynamic_registration_supported => :dynamicRegistrationSupported,
698
- :error_description_omitted => :errorDescriptionOmitted,
699
- :error_uri_omitted => :errorUriOmitted,
700
- :id_token_duration => :idTokenDuration,
701
- :id_token_signature_key_id => :idTokenSignatureKeyId,
702
- :introspection_endpoint => :introspectionEndpoint,
703
- :jwks_uri => :jwksUri,
704
- :modified_at => :modifiedAt,
705
- :mutual_tls_validate_pki_cert_chain => :mutualTlsValidatePkiCertChain,
706
- :pkce_required => :pkceRequired,
707
- :pkce_s256_required => :pkceS256Required,
708
- :policy_uri => :policyUri,
709
- :refresh_token_duration => :refreshTokenDuration,
710
- :refresh_token_kept => :refreshTokenKept,
711
- :registration_endpoint => :registrationEndpoint,
712
- :registration_management_endpoint => :registrationManagementEndpoint,
713
- :revocation_endpoint => :revocationEndpoint,
714
- :request_object_endpoint => :requestObjectEndpoint,
715
- :service_documentation => :serviceDocumentation,
716
- :service_name => :serviceName,
717
- :service_owner_number => :serviceOwnerNumber,
718
- :single_access_token_per_subject => :singleAccessTokenPerSubject,
719
- :sns_credentials => :snsCredentials,
720
- :supported_acrs => :supportedAcrs,
721
- :supported_backchannel_token_delivery_modes => :supportedBackchannelTokenDeliveryModes,
722
- :supported_claim_locales => :supportedClaimLocales,
723
- :supported_claims => :supportedClaims,
724
- :supported_claim_types => :supportedClaimTypes,
725
- :supported_developer_snses => :supportedDeveloperSnses,
726
- :supported_displays => :supportedDisplays,
727
- :supported_grant_types => :supportedGrantTypes,
728
- :supported_response_types => :supportedResponseTypes,
729
- :supported_scopes => :supportedScopes,
730
- :supported_service_profiles => :supportedServiceProfiles,
731
- :supported_snses => :supportedSnses,
732
- :supported_token_auth_methods => :supportedTokenAuthMethods,
733
- :supported_ui_locales => :supportedUiLocales,
734
- :tls_client_certificate_bound_access_tokens => :tlsClientCertificateBoundAccessTokens,
735
- :token_endpoint => :tokenEndpoint,
736
- :tos_uri => :tosUri,
737
- :trusted_root_certificates => :trustedRootCertificates,
738
- :user_code_charset => :userCodeCharset,
739
- :user_code_length => :userCodeLength,
740
- :user_info_endpoint => :userInfoEndpoint,
741
- :user_info_signature_key_id => :userInfoSignatureKeyId,
742
- :mtls_endpoint_aliases => :mtlsEndpointAliases,
743
- :pushed_auth_req_endpoint => :pushedAuthReqEndpoint,
744
- :pushed_auth_req_duration => :pushedAuthReqDuration,
745
- :supported_authorization_data_types => :supportedAuthorizationDataTypes,
746
- :supported_trust_frameworks => :supportedTrustFrameworks,
747
- :supported_evidence => :supportedEvidence,
748
- :supported_identity_documents => :supportedIdentityDocuments,
749
- :supported_verification_methods => :supportedVerificationMethods,
750
- :supported_verified_claims => :supportedVerifiedClaims,
751
- :missing_client_id_allowed => :missingClientIdAllowed,
752
- :refresh_token_duration_kept => :refreshTokenDurationKept,
753
- :par_required => :parRequired,
754
- :request_object_required => :requestObjectRequired,
755
- :traditional_request_object_processing_applied => :traditionalRequestObjectProcessingApplied,
756
- :claim_shortcut_restrictive => :claimShortcutRestrictive,
757
- :scope_required => :scopeRequired
758
- }
759
-
760
- # The constructor
761
- def initialize(hash = nil)
762
- # Set default values to integer attributes.
763
- INTEGER_ATTRIBUTES.each do |attr|
764
- send("#{attr}=", 0)
765
- end
766
-
767
- # Set default values to boolean attributes.
768
- BOOLEAN_ATTRIBUTES.each do |attr|
769
- send("#{attr}=", false)
770
- end
771
-
772
- # Set default values to string attributes.
773
- STRING_ATTRIBUTES.each do |attr|
774
- send("#{attr}=", nil)
775
- end
776
-
777
- # Set default values to string array attributes.
778
- STRING_ARRAY_ATTRIBUTES.each do |attr|
779
- send("#{attr}=", nil)
780
- end
781
-
782
- # Set default values to sns credentials array attributes.
783
- SNS_CREDENTIALS_ARRAY_ATTRIBUTES.each do |attr|
784
- send("#{attr}=", nil)
785
- end
786
-
787
- # Set default values to special objects.
788
- @metadata = nil
789
- @supportedScopes = nil
790
- @mtlsEndpointAliases = nil
791
-
792
- # Set attribute values using the given hash.
793
- authlete_model_update(hash)
794
- end
795
-
796
- def authlete_model_convert_key(key)
797
- key = key.to_sym
798
-
799
- # Convert snakecase to camelcase, if necessary.
800
- if SNAKE_TO_CAMEL.has_key?(key)
801
- key = SNAKE_TO_CAMEL[key]
802
- end
803
-
804
- key
432
+ def defaults
433
+ {
434
+ number: 0,
435
+ serviceOwnerNumber: 0,
436
+ serviceName: nil,
437
+ apiKey: 0,
438
+ apiSecret: nil,
439
+ issuer: nil,
440
+ authorizationEndpoint: nil,
441
+ tokenEndpoint: nil,
442
+ revocationEndpoint: nil,
443
+ supportedRevocationAuthMethods: nil,
444
+ userInfoEndpoint: nil,
445
+ jwksUri: nil,
446
+ jwks: nil,
447
+ registrationEndpoint: nil,
448
+ registrationManagementEndpoint: nil,
449
+ supportedScopes: nil,
450
+ supportedResponseTypes: nil,
451
+ supportedGrantTypes: nil,
452
+ supportedAcrs: nil,
453
+ supportedTokenAuthMethods: nil,
454
+ supportedDisplays: nil,
455
+ supportedClaimTypes: nil,
456
+ supportedClaims: nil,
457
+ serviceDocumentation: nil,
458
+ supportedClaimLocales: nil,
459
+ supportedUiLocales: nil,
460
+ policyUri: nil,
461
+ tosUri: nil,
462
+ authenticationCallbackEndpoint: nil,
463
+ authenticationCallbackApiKey: nil,
464
+ authenticationCallbackApiSecret: nil,
465
+ supportedSnses: nil,
466
+ snsCredentials: nil,
467
+ createdAt: 0,
468
+ modifiedAt: 0,
469
+ developerAuthenticationCallbackEndpoint: nil,
470
+ developerAuthenticationCallbackApiKey: nil,
471
+ developerAuthenticationCallbackApiSecret: nil,
472
+ supportedDeveloperSnses: nil,
473
+ developerSnsCredentials: nil,
474
+ clientsPerDeveloper: 0,
475
+ directAuthorizationEndpointEnabled: false,
476
+ directTokenEndpointEnabled: false,
477
+ directRevocationEndpointEnabled: false,
478
+ directUserInfoEndpointEnabled: false,
479
+ directJwksEndpointEnabled: false,
480
+ directIntrospectionEndpointEnabled: false,
481
+ singleAccessTokenPerSubject: false,
482
+ pkceRequired: false,
483
+ pkceS256Required: false,
484
+ refreshTokenKept: false,
485
+ refreshTokenDurationKept: false,
486
+ errorDescriptionOmitted: false,
487
+ errorUriOmitted: false,
488
+ clientIdAliasEnabled: false,
489
+ supportedServiceProfiles: nil,
490
+ tlsClientCertificateBoundAccessTokens: false,
491
+ introspectionEndpoint: nil,
492
+ supportedIntrospectionAuthMethods: nil,
493
+ mutualTlsValidatePkiCertChain: false,
494
+ trustedRootCertificates: nil,
495
+ dynamicRegistrationSupported: false,
496
+ endSessionEndpoint: nil,
497
+ description: nil,
498
+ accessTokenType: nil,
499
+ accessTokenSignAlg: nil,
500
+ accessTokenDuration: 0,
501
+ refreshTokenDuration: 0,
502
+ idTokenDuration: 0,
503
+ authorizationResponseDuration: 0,
504
+ pushedAuthReqDuration: 0,
505
+ metadata: nil,
506
+ accessTokenSignatureKeyId: nil,
507
+ authorizationSignatureKeyId: nil,
508
+ idTokenSignatureKeyId: nil,
509
+ userInfoSignatureKeyId: nil,
510
+ supportedBackchannelTokenDeliveryModes: nil,
511
+ backchannelAuthenticationEndpoint: nil,
512
+ backchannelUserCodeParameterSupported: false,
513
+ backchannelAuthReqIdDuration: 0,
514
+ backchannelPollingInterval: 0,
515
+ backchannelBindingMessageRequiredInFapi: false,
516
+ allowableClockSkew: 0,
517
+ deviceAuthorizationEndpoint: nil,
518
+ deviceVerificationUri: nil,
519
+ deviceVerificationUriComplete: nil,
520
+ deviceFlowCodeDuration: 0,
521
+ deviceFlowPollingInterval: 0,
522
+ userCodeCharset: nil,
523
+ userCodeLength: 0,
524
+ pushedAuthReqEndpoint: nil,
525
+ mtlsEndpointAliases: nil,
526
+ supportedAuthorizationDataTypes: nil,
527
+ supportedTrustFrameworks: nil,
528
+ supportedEvidence: nil,
529
+ supportedIdentityDocuments: nil,
530
+ supportedVerificationMethods: nil,
531
+ supportedVerifiedClaims: nil,
532
+ missingClientIdAllowed: false,
533
+ parRequired: false,
534
+ requestObjectRequired: false,
535
+ traditionalRequestObjectProcessingApplied: false,
536
+ claimShortcutRestrictive: false,
537
+ scopeRequired: false
538
+ }
805
539
  end
806
540
 
807
- def authlete_model_simple_attribute?(key)
808
- INTEGER_ATTRIBUTES.include?(key) or
809
- BOOLEAN_ATTRIBUTES.include?(key) or
810
- STRING_ATTRIBUTES.include?(key) or
811
- STRING_ARRAY_ATTRIBUTES.include?(key)
812
- end
813
-
814
- def authlete_model_update(hash)
815
- return if hash.nil?
816
-
817
- hash.each do |key, value|
818
- key = authlete_model_convert_key(key)
819
-
820
- if authlete_model_simple_attribute?(key)
821
- send("#{key}=", value)
822
- elsif SNS_CREDENTIALS_ARRAY_ATTRIBUTES.include?(key)
823
- # Get an array consisting of "SnsCredentials" objects.
824
- parsed = get_parsed_array(value) do |element|
825
- Authlete::Model::SnsCredentials.parse(element)
826
- end
827
-
828
- send("#{key}=", parsed)
829
- elsif key == :metadata
830
- @metadata = get_parsed_array(value) do |element|
831
- Authlete::Model::Pair.parse(element)
832
- end
833
- elsif key == :supportedScopes
834
- @supportedScopes = get_parsed_array(value) do |element|
835
- Authlete::Model::Scope.parse(element)
836
- end
837
- elsif key == :mtlsEndpointAliases
838
- @mtlsEndpointAliases = get_parsed_array(value) do |element|
839
- Authlete::Model::NamedUri.parse(element)
840
- end
841
- end
842
- end
843
-
844
- self
541
+ def set_params(hash)
542
+ @number = hash[:number]
543
+ @serviceOwnerNumber = hash[:serviceOwnerNumber]
544
+ @serviceName = hash[:serviceName]
545
+ @apiKey = hash[:apiKey]
546
+ @apiSecret = hash[:apiSecret]
547
+ @issuer = hash[:issuer]
548
+ @authorizationEndpoint = hash[:authorizationEndpoint]
549
+ @tokenEndpoint = hash[:tokenEndpoint]
550
+ @revocationEndpoint = hash[:revocationEndpoint]
551
+ @supportedRevocationAuthMethods = hash[:supportedRevocationAuthMethods]
552
+ @userInfoEndpoint = hash[:userInfoEndpoint]
553
+ @jwksUri = hash[:jwksUri]
554
+ @jwks = hash[:jwks]
555
+ @registrationEndpoint = hash[:registrationEndpoint]
556
+ @registrationManagementEndpoint = hash[:registrationManagementEndpoint]
557
+ @supportedScopes = get_parsed_array(hash[:supportedScopes]) { |e| Authlete::Model::Scope.parse(e) }
558
+ @supportedResponseTypes = hash[:supportedResponseTypes]
559
+ @supportedGrantTypes = hash[:supportedGrantTypes]
560
+ @supportedAcrs = hash[:supportedAcrs]
561
+ @supportedTokenAuthMethods = hash[:supportedTokenAuthMethods]
562
+ @supportedDisplays = hash[:supportedDisplays]
563
+ @supportedClaimTypes = hash[:supportedClaimTypes]
564
+ @supportedClaims = hash[:supportedClaims]
565
+ @serviceDocumentation = hash[:serviceDocumentation]
566
+ @supportedClaimLocales = hash[:supportedClaimLocales]
567
+ @supportedUiLocales = hash[:supportedUiLocales]
568
+ @policyUri = hash[:policyUri]
569
+ @tosUri = hash[:tosUri]
570
+ @authenticationCallbackEndpoint = hash[:authenticationCallbackEndpoint]
571
+ @authenticationCallbackApiKey = hash[:authenticationCallbackApiKey]
572
+ @authenticationCallbackApiSecret = hash[:authenticationCallbackApiSecret]
573
+ @supportedSnses = hash[:supportedSnses]
574
+ @snsCredentials = get_parsed_array(hash[:snsCredentials]) { |e| Authlete::Model::SnsCredentials.parse(e) }
575
+ @createdAt = hash[:createdAt]
576
+ @modifiedAt = hash[:modifiedAt]
577
+ @developerAuthenticationCallbackEndpoint = hash[:developerAuthenticationCallbackEndpoint]
578
+ @developerAuthenticationCallbackApiKey = hash[:developerAuthenticationCallbackApiKey]
579
+ @developerAuthenticationCallbackApiSecret = hash[:developerAuthenticationCallbackApiSecret]
580
+ @supportedDeveloperSnses = hash[:supportedDeveloperSnses]
581
+ @developerSnsCredentials = get_parsed_array(hash[:developerSnsCredentials]) { |e| Authlete::Model::SnsCredentials.parse(e) }
582
+ @clientsPerDeveloper = hash[:clientsPerDeveloper]
583
+ @directAuthorizationEndpointEnabled = hash[:directAuthorizationEndpointEnabled]
584
+ @directTokenEndpointEnabled = hash[:directTokenEndpointEnabled]
585
+ @directRevocationEndpointEnabled = hash[:directRevocationEndpointEnabled]
586
+ @directUserInfoEndpointEnabled = hash[:directUserInfoEndpointEnabled]
587
+ @directJwksEndpointEnabled = hash[:directJwksEndpointEnabled]
588
+ @directIntrospectionEndpointEnabled = hash[:directIntrospectionEndpointEnabled]
589
+ @singleAccessTokenPerSubject = hash[:singleAccessTokenPerSubject]
590
+ @pkceRequired = hash[:pkceRequired]
591
+ @pkceS256Required = hash[:pkceS256Required]
592
+ @refreshTokenKept = hash[:refreshTokenKept]
593
+ @refreshTokenDurationKept = hash[:refreshTokenDurationKept]
594
+ @errorDescriptionOmitted = hash[:errorDescriptionOmitted]
595
+ @errorUriOmitted = hash[:errorUriOmitted]
596
+ @clientIdAliasEnabled = hash[:clientIdAliasEnabled]
597
+ @supportedServiceProfiles = hash[:supportedServiceProfiles]
598
+ @tlsClientCertificateBoundAccessTokens = hash[:tlsClientCertificateBoundAccessTokens]
599
+ @introspectionEndpoint = hash[:introspectionEndpoint]
600
+ @supportedIntrospectionAuthMethods = hash[:supportedIntrospectionAuthMethods]
601
+ @mutualTlsValidatePkiCertChain = hash[:mutualTlsValidatePkiCertChain]
602
+ @trustedRootCertificates = hash[:trustedRootCertificates]
603
+ @dynamicRegistrationSupported = hash[:dynamicRegistrationSupported]
604
+ @endSessionEndpoint = hash[:endSessionEndpoint]
605
+ @description = hash[:description]
606
+ @accessTokenType = hash[:accessTokenType]
607
+ @accessTokenSignAlg = hash[:accessTokenSignAlg]
608
+ @accessTokenDuration = hash[:accessTokenDuration]
609
+ @refreshTokenDuration = hash[:refreshTokenDuration]
610
+ @idTokenDuration = hash[:idTokenDuration]
611
+ @authorizationResponseDuration = hash[:authorizationResponseDuration]
612
+ @pushedAuthReqDuration = hash[:pushedAuthReqDuration]
613
+ @metadata = get_parsed_array(hash[:metadata]) { |e| Authlete::Model::Pair.parse(e) }
614
+ @accessTokenSignatureKeyId = hash[:accessTokenSignatureKeyId]
615
+ @authorizationSignatureKeyId = hash[:authorizationSignatureKeyId]
616
+ @idTokenSignatureKeyId = hash[:idTokenSignatureKeyId]
617
+ @userInfoSignatureKeyId = hash[:userInfoSignatureKeyId]
618
+ @supportedBackchannelTokenDeliveryModes = hash[:supportedBackchannelTokenDeliveryModes]
619
+ @backchannelAuthenticationEndpoint = hash[:backchannelAuthenticationEndpoint]
620
+ @backchannelUserCodeParameterSupported = hash[:backchannelUserCodeParameterSupported]
621
+ @backchannelAuthReqIdDuration = hash[:backchannelAuthReqIdDuration]
622
+ @backchannelPollingInterval = hash[:backchannelPollingInterval]
623
+ @backchannelBindingMessageRequiredInFapi = hash[:backchannelBindingMessageRequiredInFapi]
624
+ @allowableClockSkew = hash[:allowableClockSkew]
625
+ @deviceAuthorizationEndpoint = hash[:deviceAuthorizationEndpoint]
626
+ @deviceVerificationUri = hash[:deviceVerificationUri]
627
+ @deviceVerificationUriComplete = hash[:deviceVerificationUriComplete]
628
+ @deviceFlowCodeDuration = hash[:deviceFlowCodeDuration]
629
+ @deviceFlowPollingInterval = hash[:deviceFlowPollingInterval]
630
+ @userCodeCharset = hash[:userCodeCharset]
631
+ @userCodeLength = hash[:userCodeLength]
632
+ @pushedAuthReqEndpoint = hash[:pushedAuthReqEndpoint]
633
+ @mtlsEndpointAliases = get_parsed_array(hash[:mtlsEndpointAliases]) { |e| Authlete::Model::NamedUri.parse(e) }
634
+ @supportedAuthorizationDataTypes = hash[:supportedAuthorizationDataTypes]
635
+ @supportedTrustFrameworks = hash[:supportedTrustFrameworks]
636
+ @supportedEvidence = hash[:supportedEvidence]
637
+ @supportedIdentityDocuments = hash[:supportedIdentityDocuments]
638
+ @supportedVerificationMethods = hash[:supportedVerificationMethods]
639
+ @supportedVerifiedClaims = hash[:supportedVerifiedClaims]
640
+ @missingClientIdAllowed = hash[:missingClientIdAllowed]
641
+ @parRequired = hash[:parRequired]
642
+ @requestObjectRequired = hash[:requestObjectRequired]
643
+ @traditionalRequestObjectProcessingApplied = hash[:traditionalRequestObjectProcessingApplied]
644
+ @claimShortcutRestrictive = hash[:claimShortcutRestrictive]
645
+ @scopeRequired = hash[:scopeRequired]
845
646
  end
846
647
 
847
- public
648
+ def to_hash_value(key, var)
649
+ raw_val = instance_variable_get(var)
848
650
 
849
- # Construct an instance from the given hash.
850
- #
851
- # If the given argument is nil or is not a Hash, nil is returned.
852
- # Otherwise, Service.new(hash) is returned.
853
- def self.parse(hash)
854
- if hash.nil? or (hash.kind_of?(Hash) == false)
855
- return nil
651
+ case key
652
+ when :snsCredentials, :developerSnsCredentials, :supportedScopes, :metadata, :mtlsEndpointAliases
653
+ raw_val&.map { |e| e.to_hash }
654
+ else
655
+ raw_val
856
656
  end
857
-
858
- Service.new(hash)
859
- end
860
-
861
- # Convert this object into a hash.
862
- def to_hash
863
- hash = {}
864
-
865
- instance_variables.each do |var|
866
- key = var.to_s.delete("@").to_sym
867
- val = instance_variable_get(var)
868
-
869
- if authlete_model_simple_attribute?(key) or val.nil?
870
- hash[key] = val
871
- elsif key == :developerSnsCredentials or key == :snsCredentials or
872
- key == :supportedScopes or key == :metadata or key == :mtlsEndpointAliases
873
- hash[key] = val.map { |element| element.to_hash }
874
- end
875
- end
876
-
877
- hash
878
657
  end
879
658
  end
880
659
  end
881
- end
660
+ end