Skip to content

Commit 314b0a7

Browse files
algolia-botsbelloneFluf22
committed
feat(specs): Ingestion API: new code property in oauth authentication (generated)
algolia/api-clients-automation#5897 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Sylvain Bellone <sylvain.bellone@algolia.com> Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
1 parent fa56cdd commit 314b0a7

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

lib/algolia/models/ingestion/auth_o_auth.rb

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ class AuthOAuth
1818
# Client secret. This field is `null` in the API response.
1919
attr_accessor :client_secret
2020

21+
# Authorization code. Used during an `authorization_code` grant type flow, to request an access_token when creating/updating the authentication. This field is not returned in the API response.
22+
attr_accessor :code
23+
2124
# OAuth scope.
2225
attr_accessor :scope
2326

@@ -27,6 +30,7 @@ def self.attribute_map
2730
:url => :url,
2831
:client_id => :client_id,
2932
:client_secret => :client_secret,
33+
:code => :code,
3034
:scope => :scope
3135
}
3236
end
@@ -36,7 +40,8 @@ def self.discriminator_attributes
3640
[
3741
:url,
3842
:client_id,
39-
:client_secret
43+
:client_secret,
44+
:code
4045
]
4146
end
4247

@@ -46,6 +51,7 @@ def self.types_mapping
4651
:url => :"String",
4752
:client_id => :"String",
4853
:client_secret => :"String",
54+
:code => :"String",
4955
:scope => :"String"
5056
}
5157
end
@@ -88,14 +94,14 @@ def initialize(attributes = {})
8894

8995
if attributes.key?(:client_id)
9096
self.client_id = attributes[:client_id]
91-
else
92-
self.client_id = nil
9397
end
9498

9599
if attributes.key?(:client_secret)
96100
self.client_secret = attributes[:client_secret]
97-
else
98-
self.client_secret = nil
101+
end
102+
103+
if attributes.key?(:code)
104+
self.code = attributes[:code]
99105
end
100106

101107
if attributes.key?(:scope)
@@ -111,6 +117,7 @@ def ==(other)
111117
url == other.url &&
112118
client_id == other.client_id &&
113119
client_secret == other.client_secret &&
120+
code == other.code &&
114121
scope == other.scope
115122
end
116123

@@ -123,7 +130,7 @@ def eql?(other)
123130
# Calculates hash code according to all attributes.
124131
# @return [Integer] Hash code
125132
def hash
126-
[url, client_id, client_secret, scope].hash
133+
[url, client_id, client_secret, code, scope].hash
127134
end
128135

129136
# Builds the object from hash

lib/algolia/models/ingestion/auth_o_auth_partial.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ class AuthOAuthPartial
1818
# Client secret. This field is `null` in the API response.
1919
attr_accessor :client_secret
2020

21+
# Authorization code. Used during an `authorization_code` grant type flow, to request an access_token when creating/updating the authentication. This field is not returned in the API response.
22+
attr_accessor :code
23+
2124
# OAuth scope.
2225
attr_accessor :scope
2326

@@ -27,6 +30,7 @@ def self.attribute_map
2730
:url => :url,
2831
:client_id => :client_id,
2932
:client_secret => :client_secret,
33+
:code => :code,
3034
:scope => :scope
3135
}
3236
end
@@ -44,6 +48,7 @@ def self.types_mapping
4448
:url => :"String",
4549
:client_id => :"String",
4650
:client_secret => :"String",
51+
:code => :"String",
4752
:scope => :"String"
4853
}
4954
end
@@ -90,6 +95,10 @@ def initialize(attributes = {})
9095
self.client_secret = attributes[:client_secret]
9196
end
9297

98+
if attributes.key?(:code)
99+
self.code = attributes[:code]
100+
end
101+
93102
if attributes.key?(:scope)
94103
self.scope = attributes[:scope]
95104
end
@@ -103,6 +112,7 @@ def ==(other)
103112
url == other.url &&
104113
client_id == other.client_id &&
105114
client_secret == other.client_secret &&
115+
code == other.code &&
106116
scope == other.scope
107117
end
108118

@@ -115,7 +125,7 @@ def eql?(other)
115125
# Calculates hash code according to all attributes.
116126
# @return [Integer] Hash code
117127
def hash
118-
[url, client_id, client_secret, scope].hash
128+
[url, client_id, client_secret, code, scope].hash
119129
end
120130

121131
# Builds the object from hash

0 commit comments

Comments
 (0)