authentik-api 2026.8.0.rc6 → 2026.8.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.
- checksums.yaml +4 -4
- data/README_API.md +22 -5
- data/lib/authentik/api/api/agents_api.rb +410 -0
- data/lib/authentik/api/api/endpoints_api.rb +3 -0
- data/lib/authentik/api/api/requests_api.rb +72 -0
- data/lib/authentik/api/models/agent.rb +450 -0
- data/lib/authentik/api/models/agent_create_request.rb +203 -0
- data/lib/authentik/api/models/agent_created.rb +185 -0
- data/lib/authentik/api/models/agent_grant_request_create_request.rb +161 -0
- data/lib/authentik/api/models/agent_grant_request_created.rb +185 -0
- data/lib/authentik/api/models/agent_request.rb +303 -0
- data/lib/authentik/api/models/app_enum.rb +2 -2
- data/lib/authentik/api/models/capabilities_enum.rb +3 -1
- data/lib/authentik/api/models/endpoint_device.rb +1 -15
- data/lib/authentik/api/models/endpoint_device_details.rb +1 -15
- data/lib/authentik/api/models/grant_request.rb +14 -16
- data/lib/authentik/api/models/model_enum.rb +3 -1
- data/lib/authentik/api/models/paginated_agent_list.rb +214 -0
- data/lib/authentik/api/models/patched_agent_request.rb +289 -0
- data/lib/authentik/api/models/patched_source_stage_request.rb +16 -4
- data/lib/authentik/api/models/policy_behavior_enum.rb +35 -0
- data/lib/authentik/api/models/resume_on_match_failures_enum.rb +33 -0
- data/lib/authentik/api/models/source_stage.rb +16 -4
- data/lib/authentik/api/models/source_stage_request.rb +16 -4
- data/lib/authentik/api/version.rb +1 -1
- data/spec/api/agents_api_spec.rb +101 -0
- data/spec/api/endpoints_api_spec.rb +1 -0
- data/spec/api/requests_api_spec.rb +13 -0
- data/spec/models/agent_create_request_spec.rb +54 -0
- data/spec/models/agent_created_spec.rb +36 -0
- data/spec/models/agent_grant_request_create_request_spec.rb +30 -0
- data/spec/models/agent_grant_request_created_spec.rb +36 -0
- data/spec/models/agent_request_spec.rb +72 -0
- data/spec/models/agent_spec.rb +108 -0
- data/spec/models/grant_request_spec.rb +6 -0
- data/spec/models/paginated_agent_list_spec.rb +42 -0
- data/spec/models/patched_agent_request_spec.rb +72 -0
- data/spec/models/patched_source_stage_request_spec.rb +6 -0
- data/spec/models/policy_behavior_enum_spec.rb +24 -0
- data/spec/models/resume_on_match_failures_enum_spec.rb +24 -0
- data/spec/models/source_stage_request_spec.rb +6 -0
- data/spec/models/source_stage_spec.rb +6 -0
- metadata +34 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
This file is automatically generated by: https://openapi-generator.tech.
|
|
3
|
+
Any manual changes will be lost when the OpenAPI scheme changes.
|
|
4
|
+
|
|
5
|
+
=end
|
|
6
|
+
|
|
7
|
+
require 'date'
|
|
8
|
+
require 'time'
|
|
9
|
+
|
|
10
|
+
module Authentik::Api
|
|
11
|
+
# Response returned once when an agent is created, carrying the one-time API token.
|
|
12
|
+
class AgentCreated < ApiModelBase
|
|
13
|
+
attr_accessor :agent
|
|
14
|
+
|
|
15
|
+
attr_accessor :token
|
|
16
|
+
|
|
17
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
18
|
+
def self.attribute_map
|
|
19
|
+
{
|
|
20
|
+
:'agent' => :'agent',
|
|
21
|
+
:'token' => :'token'
|
|
22
|
+
}
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Returns attribute mapping this model knows about
|
|
26
|
+
def self.acceptable_attribute_map
|
|
27
|
+
attribute_map
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns all the JSON keys this model knows about
|
|
31
|
+
def self.acceptable_attributes
|
|
32
|
+
acceptable_attribute_map.values
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Attribute type mapping.
|
|
36
|
+
def self.openapi_types
|
|
37
|
+
{
|
|
38
|
+
:'agent' => :'Agent',
|
|
39
|
+
:'token' => :'String'
|
|
40
|
+
}
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# List of attributes with nullable: true
|
|
44
|
+
def self.openapi_nullable
|
|
45
|
+
Set.new([
|
|
46
|
+
])
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Initializes the object
|
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
51
|
+
def initialize(attributes = {})
|
|
52
|
+
if (!attributes.is_a?(Hash))
|
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::AgentCreated` initialize method"
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
57
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
59
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::AgentCreated`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
61
|
+
end
|
|
62
|
+
h[k.to_sym] = v
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if attributes.key?(:'agent')
|
|
66
|
+
self.agent = attributes[:'agent']
|
|
67
|
+
else
|
|
68
|
+
self.agent = nil
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
if attributes.key?(:'token')
|
|
72
|
+
self.token = attributes[:'token']
|
|
73
|
+
else
|
|
74
|
+
self.token = nil
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
79
|
+
# @return Array for valid properties with the reasons
|
|
80
|
+
def list_invalid_properties
|
|
81
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
82
|
+
invalid_properties = Array.new
|
|
83
|
+
if @agent.nil?
|
|
84
|
+
invalid_properties.push('invalid value for "agent", agent cannot be nil.')
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if @token.nil?
|
|
88
|
+
invalid_properties.push('invalid value for "token", token cannot be nil.')
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
invalid_properties
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Check to see if the all the properties in the model are valid
|
|
95
|
+
# @return true if the model is valid
|
|
96
|
+
def valid?
|
|
97
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
98
|
+
return false if @agent.nil?
|
|
99
|
+
return false if @token.nil?
|
|
100
|
+
true
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Custom attribute writer method with validation
|
|
104
|
+
# @param [Object] agent Value to be assigned
|
|
105
|
+
def agent=(agent)
|
|
106
|
+
if agent.nil?
|
|
107
|
+
fail ArgumentError, 'agent cannot be nil'
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
@agent = agent
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Custom attribute writer method with validation
|
|
114
|
+
# @param [Object] token Value to be assigned
|
|
115
|
+
def token=(token)
|
|
116
|
+
if token.nil?
|
|
117
|
+
fail ArgumentError, 'token cannot be nil'
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
@token = token
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Checks equality by comparing each attribute.
|
|
124
|
+
# @param [Object] Object to be compared
|
|
125
|
+
def ==(o)
|
|
126
|
+
return true if self.equal?(o)
|
|
127
|
+
self.class == o.class &&
|
|
128
|
+
agent == o.agent &&
|
|
129
|
+
token == o.token
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# @see the `==` method
|
|
133
|
+
# @param [Object] Object to be compared
|
|
134
|
+
def eql?(o)
|
|
135
|
+
self == o
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Calculates hash code according to all attributes.
|
|
139
|
+
# @return [Integer] Hash code
|
|
140
|
+
def hash
|
|
141
|
+
[agent, token].hash
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Builds the object from hash
|
|
145
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
146
|
+
# @return [Object] Returns the model itself
|
|
147
|
+
def self.build_from_hash(attributes)
|
|
148
|
+
return nil unless attributes.is_a?(Hash)
|
|
149
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
150
|
+
transformed_hash = {}
|
|
151
|
+
openapi_types.each_pair do |key, type|
|
|
152
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
153
|
+
transformed_hash["#{key}"] = nil
|
|
154
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
155
|
+
# check to ensure the input is an array given that the attribute
|
|
156
|
+
# is documented as an array but the input is not
|
|
157
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
158
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
159
|
+
end
|
|
160
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
161
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
new(transformed_hash)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Returns the object in the form of hash
|
|
168
|
+
# @return [Hash] Returns the object in the form of hash
|
|
169
|
+
def to_hash
|
|
170
|
+
hash = {}
|
|
171
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
172
|
+
value = self.send(attr)
|
|
173
|
+
if value.nil?
|
|
174
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
175
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
hash[param] = _to_hash(value)
|
|
179
|
+
end
|
|
180
|
+
hash
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
end
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
This file is automatically generated by: https://openapi-generator.tech.
|
|
3
|
+
Any manual changes will be lost when the OpenAPI scheme changes.
|
|
4
|
+
|
|
5
|
+
=end
|
|
6
|
+
|
|
7
|
+
require 'date'
|
|
8
|
+
require 'time'
|
|
9
|
+
|
|
10
|
+
module Authentik::Api
|
|
11
|
+
# Body for an agent requesting access for itself. Deliberately narrower than `GrantRequestCreateSerializer`: an agent may not pick its own expiry, which is derived from the granting rules and capped by the agent's own lifetime.
|
|
12
|
+
class AgentGrantRequestCreateRequest < ApiModelBase
|
|
13
|
+
attr_accessor :pbms
|
|
14
|
+
|
|
15
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
16
|
+
def self.attribute_map
|
|
17
|
+
{
|
|
18
|
+
:'pbms' => :'pbms'
|
|
19
|
+
}
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Returns attribute mapping this model knows about
|
|
23
|
+
def self.acceptable_attribute_map
|
|
24
|
+
attribute_map
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns all the JSON keys this model knows about
|
|
28
|
+
def self.acceptable_attributes
|
|
29
|
+
acceptable_attribute_map.values
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Attribute type mapping.
|
|
33
|
+
def self.openapi_types
|
|
34
|
+
{
|
|
35
|
+
:'pbms' => :'Array<String>'
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# List of attributes with nullable: true
|
|
40
|
+
def self.openapi_nullable
|
|
41
|
+
Set.new([
|
|
42
|
+
])
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Initializes the object
|
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
47
|
+
def initialize(attributes = {})
|
|
48
|
+
if (!attributes.is_a?(Hash))
|
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::AgentGrantRequestCreateRequest` initialize method"
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
53
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::AgentGrantRequestCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
57
|
+
end
|
|
58
|
+
h[k.to_sym] = v
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if attributes.key?(:'pbms')
|
|
62
|
+
if (value = attributes[:'pbms']).is_a?(Array)
|
|
63
|
+
self.pbms = value
|
|
64
|
+
end
|
|
65
|
+
else
|
|
66
|
+
self.pbms = nil
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
71
|
+
# @return Array for valid properties with the reasons
|
|
72
|
+
def list_invalid_properties
|
|
73
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
74
|
+
invalid_properties = Array.new
|
|
75
|
+
if @pbms.nil?
|
|
76
|
+
invalid_properties.push('invalid value for "pbms", pbms cannot be nil.')
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
invalid_properties
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Check to see if the all the properties in the model are valid
|
|
83
|
+
# @return true if the model is valid
|
|
84
|
+
def valid?
|
|
85
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
86
|
+
return false if @pbms.nil?
|
|
87
|
+
true
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Custom attribute writer method with validation
|
|
91
|
+
# @param [Object] pbms Value to be assigned
|
|
92
|
+
def pbms=(pbms)
|
|
93
|
+
if pbms.nil?
|
|
94
|
+
fail ArgumentError, 'pbms cannot be nil'
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
@pbms = pbms
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Checks equality by comparing each attribute.
|
|
101
|
+
# @param [Object] Object to be compared
|
|
102
|
+
def ==(o)
|
|
103
|
+
return true if self.equal?(o)
|
|
104
|
+
self.class == o.class &&
|
|
105
|
+
pbms == o.pbms
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# @see the `==` method
|
|
109
|
+
# @param [Object] Object to be compared
|
|
110
|
+
def eql?(o)
|
|
111
|
+
self == o
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Calculates hash code according to all attributes.
|
|
115
|
+
# @return [Integer] Hash code
|
|
116
|
+
def hash
|
|
117
|
+
[pbms].hash
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Builds the object from hash
|
|
121
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
122
|
+
# @return [Object] Returns the model itself
|
|
123
|
+
def self.build_from_hash(attributes)
|
|
124
|
+
return nil unless attributes.is_a?(Hash)
|
|
125
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
126
|
+
transformed_hash = {}
|
|
127
|
+
openapi_types.each_pair do |key, type|
|
|
128
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
129
|
+
transformed_hash["#{key}"] = nil
|
|
130
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
131
|
+
# check to ensure the input is an array given that the attribute
|
|
132
|
+
# is documented as an array but the input is not
|
|
133
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
134
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
135
|
+
end
|
|
136
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
137
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
new(transformed_hash)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Returns the object in the form of hash
|
|
144
|
+
# @return [Hash] Returns the object in the form of hash
|
|
145
|
+
def to_hash
|
|
146
|
+
hash = {}
|
|
147
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
148
|
+
value = self.send(attr)
|
|
149
|
+
if value.nil?
|
|
150
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
151
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
hash[param] = _to_hash(value)
|
|
155
|
+
end
|
|
156
|
+
hash
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
end
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
This file is automatically generated by: https://openapi-generator.tech.
|
|
3
|
+
Any manual changes will be lost when the OpenAPI scheme changes.
|
|
4
|
+
|
|
5
|
+
=end
|
|
6
|
+
|
|
7
|
+
require 'date'
|
|
8
|
+
require 'time'
|
|
9
|
+
|
|
10
|
+
module Authentik::Api
|
|
11
|
+
# Response to an agent's access request: the request it created, plus the URL to hand to the human it acts for. An agent has no browser, so it cannot run the approval itself -- `fulfill_url` is what its owner opens to approve or deny.
|
|
12
|
+
class AgentGrantRequestCreated < ApiModelBase
|
|
13
|
+
attr_accessor :grant_request
|
|
14
|
+
|
|
15
|
+
attr_accessor :fulfill_url
|
|
16
|
+
|
|
17
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
18
|
+
def self.attribute_map
|
|
19
|
+
{
|
|
20
|
+
:'grant_request' => :'grant_request',
|
|
21
|
+
:'fulfill_url' => :'fulfill_url'
|
|
22
|
+
}
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Returns attribute mapping this model knows about
|
|
26
|
+
def self.acceptable_attribute_map
|
|
27
|
+
attribute_map
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns all the JSON keys this model knows about
|
|
31
|
+
def self.acceptable_attributes
|
|
32
|
+
acceptable_attribute_map.values
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Attribute type mapping.
|
|
36
|
+
def self.openapi_types
|
|
37
|
+
{
|
|
38
|
+
:'grant_request' => :'GrantRequest',
|
|
39
|
+
:'fulfill_url' => :'String'
|
|
40
|
+
}
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# List of attributes with nullable: true
|
|
44
|
+
def self.openapi_nullable
|
|
45
|
+
Set.new([
|
|
46
|
+
])
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Initializes the object
|
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
51
|
+
def initialize(attributes = {})
|
|
52
|
+
if (!attributes.is_a?(Hash))
|
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::AgentGrantRequestCreated` initialize method"
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
57
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
59
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::AgentGrantRequestCreated`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
61
|
+
end
|
|
62
|
+
h[k.to_sym] = v
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if attributes.key?(:'grant_request')
|
|
66
|
+
self.grant_request = attributes[:'grant_request']
|
|
67
|
+
else
|
|
68
|
+
self.grant_request = nil
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
if attributes.key?(:'fulfill_url')
|
|
72
|
+
self.fulfill_url = attributes[:'fulfill_url']
|
|
73
|
+
else
|
|
74
|
+
self.fulfill_url = nil
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
79
|
+
# @return Array for valid properties with the reasons
|
|
80
|
+
def list_invalid_properties
|
|
81
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
82
|
+
invalid_properties = Array.new
|
|
83
|
+
if @grant_request.nil?
|
|
84
|
+
invalid_properties.push('invalid value for "grant_request", grant_request cannot be nil.')
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if @fulfill_url.nil?
|
|
88
|
+
invalid_properties.push('invalid value for "fulfill_url", fulfill_url cannot be nil.')
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
invalid_properties
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Check to see if the all the properties in the model are valid
|
|
95
|
+
# @return true if the model is valid
|
|
96
|
+
def valid?
|
|
97
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
98
|
+
return false if @grant_request.nil?
|
|
99
|
+
return false if @fulfill_url.nil?
|
|
100
|
+
true
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Custom attribute writer method with validation
|
|
104
|
+
# @param [Object] grant_request Value to be assigned
|
|
105
|
+
def grant_request=(grant_request)
|
|
106
|
+
if grant_request.nil?
|
|
107
|
+
fail ArgumentError, 'grant_request cannot be nil'
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
@grant_request = grant_request
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Custom attribute writer method with validation
|
|
114
|
+
# @param [Object] fulfill_url Value to be assigned
|
|
115
|
+
def fulfill_url=(fulfill_url)
|
|
116
|
+
if fulfill_url.nil?
|
|
117
|
+
fail ArgumentError, 'fulfill_url cannot be nil'
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
@fulfill_url = fulfill_url
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Checks equality by comparing each attribute.
|
|
124
|
+
# @param [Object] Object to be compared
|
|
125
|
+
def ==(o)
|
|
126
|
+
return true if self.equal?(o)
|
|
127
|
+
self.class == o.class &&
|
|
128
|
+
grant_request == o.grant_request &&
|
|
129
|
+
fulfill_url == o.fulfill_url
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# @see the `==` method
|
|
133
|
+
# @param [Object] Object to be compared
|
|
134
|
+
def eql?(o)
|
|
135
|
+
self == o
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Calculates hash code according to all attributes.
|
|
139
|
+
# @return [Integer] Hash code
|
|
140
|
+
def hash
|
|
141
|
+
[grant_request, fulfill_url].hash
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Builds the object from hash
|
|
145
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
146
|
+
# @return [Object] Returns the model itself
|
|
147
|
+
def self.build_from_hash(attributes)
|
|
148
|
+
return nil unless attributes.is_a?(Hash)
|
|
149
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
150
|
+
transformed_hash = {}
|
|
151
|
+
openapi_types.each_pair do |key, type|
|
|
152
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
153
|
+
transformed_hash["#{key}"] = nil
|
|
154
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
155
|
+
# check to ensure the input is an array given that the attribute
|
|
156
|
+
# is documented as an array but the input is not
|
|
157
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
158
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
159
|
+
end
|
|
160
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
161
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
new(transformed_hash)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Returns the object in the form of hash
|
|
168
|
+
# @return [Hash] Returns the object in the form of hash
|
|
169
|
+
def to_hash
|
|
170
|
+
hash = {}
|
|
171
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
172
|
+
value = self.send(attr)
|
|
173
|
+
if value.nil?
|
|
174
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
175
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
hash[param] = _to_hash(value)
|
|
179
|
+
end
|
|
180
|
+
hash
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
end
|