Skip to content

Commit e7733ee

Browse files
authored
Remove deprecated dashboard-access route from lib-openapi.json (#1875)
We removed it from the cloud spec, need to remove it here to clear the way for future spec updates. Surprisingly annoying to keep the deprecated methods around in some languages. Ruby was easiest: Literally just copying the diff for the deleted method to an `api_extra` file, regen, done. Python and JavaScript were the most annoying, because I couldn't think of a nice way of keeping the query struct around.
2 parents 8579e6e + 16e35a6 commit e7733ee

File tree

31 files changed

+315
-326
lines changed

31 files changed

+315
-326
lines changed

csharp/Svix/Authentication.cs

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,6 @@ public class AuthenticationExpireAllOptions : SvixOptionsBase
2929
}
3030
}
3131

32-
public class AuthenticationDashboardAccessOptions : SvixOptionsBase
33-
{
34-
public string? IdempotencyKey { get; set; }
35-
36-
public new Dictionary<string, string> HeaderParams()
37-
{
38-
return SerializeParams(
39-
new Dictionary<string, object?> { { "idempotency-key", IdempotencyKey } }
40-
);
41-
}
42-
}
43-
4432
public class AuthenticationLogoutOptions : SvixOptionsBase
4533
{
4634
public string? IdempotencyKey { get; set; }
@@ -187,12 +175,7 @@ public bool ExpireAll(
187175
}
188176
}
189177

190-
/// <summary>
191-
/// DEPRECATED: Please use `app-portal-access` instead.
192-
///
193-
/// Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
194-
/// </summary>
195-
[Obsolete]
178+
[Obsolete("Please use `AppPortalAccessAsync` instead")]
196179
public async Task<DashboardAccessOut> DashboardAccessAsync(
197180
string appId,
198181
AuthenticationDashboardAccessOptions? options = null,
@@ -219,12 +202,7 @@ public async Task<DashboardAccessOut> DashboardAccessAsync(
219202
}
220203
}
221204

222-
/// <summary>
223-
/// DEPRECATED: Please use `app-portal-access` instead.
224-
///
225-
/// Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
226-
/// </summary>
227-
[Obsolete]
205+
[Obsolete("Please use `AppPortalAccess` instead")]
228206
public DashboardAccessOut DashboardAccess(
229207
string appId,
230208
AuthenticationDashboardAccessOptions? options = null

csharp/Svix/Deprecated.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#nullable enable
2+
3+
namespace Svix
4+
{
5+
[Obsolete]
6+
public class AuthenticationDashboardAccessOptions : SvixOptionsBase
7+
{
8+
public string? IdempotencyKey { get; set; }
9+
10+
public new Dictionary<string, string> HeaderParams()
11+
{
12+
return SerializeParams(
13+
new Dictionary<string, object?> { { "idempotency-key", IdempotencyKey } }
14+
);
15+
}
16+
}
17+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
[Obsolete("Please use `AppPortalAccessAsync` instead")]
2+
public async Task<DashboardAccessOut> DashboardAccessAsync(
3+
string appId,
4+
AuthenticationDashboardAccessOptions? options = null,
5+
CancellationToken cancellationToken = default
6+
)
7+
{
8+
try
9+
{
10+
var response = await _client.SvixHttpClient.SendRequestAsync<DashboardAccessOut>(
11+
method: HttpMethod.Post,
12+
path: "/api/v1/auth/dashboard-access/{app_id}",
13+
pathParams: new Dictionary<string, string> { { "app_id", appId } },
14+
queryParams: options?.QueryParams(),
15+
headerParams: options?.HeaderParams(),
16+
cancellationToken: cancellationToken
17+
);
18+
return response.Data;
19+
}
20+
catch (ApiException e)
21+
{
22+
_client.Logger?.LogError(e, $"{nameof(DashboardAccessAsync)} failed");
23+
24+
throw;
25+
}
26+
}
27+
28+
[Obsolete("Please use `AppPortalAccess` instead")]
29+
public DashboardAccessOut DashboardAccess(
30+
string appId,
31+
AuthenticationDashboardAccessOptions? options = null
32+
)
33+
{
34+
try
35+
{
36+
var response = _client.SvixHttpClient.SendRequest<DashboardAccessOut>(
37+
method: HttpMethod.Post,
38+
path: "/api/v1/auth/dashboard-access/{app_id}",
39+
pathParams: new Dictionary<string, string> { { "app_id", appId } },
40+
queryParams: options?.QueryParams(),
41+
headerParams: options?.HeaderParams()
42+
);
43+
return response.Data;
44+
}
45+
catch (ApiException e)
46+
{
47+
_client.Logger?.LogError(e, $"{nameof(DashboardAccess)} failed");
48+
49+
throw;
50+
}
51+
}

go/authentication.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ type AuthenticationExpireAllOptions struct {
2525
IdempotencyKey *string
2626
}
2727

28-
type AuthenticationDashboardAccessOptions struct {
29-
IdempotencyKey *string
30-
}
31-
3228
type AuthenticationLogoutOptions struct {
3329
IdempotencyKey *string
3430
}
@@ -94,9 +90,7 @@ func (authentication *Authentication) ExpireAll(
9490
return err
9591
}
9692

97-
// DEPRECATED: Please use `app-portal-access` instead.
98-
//
99-
// Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
93+
// Deprecated: Please use `AppPortalAccess` instead.
10094
func (authentication *Authentication) DashboardAccess(
10195
ctx context.Context,
10296
appId string,

go/deprecated.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package svix
2+
3+
type AuthenticationDashboardAccessOptions struct {
4+
IdempotencyKey *string
5+
}

java/lib/src/main/java/com/svix/api/Authentication.java

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import com.svix.models.AppPortalAccessIn;
77
import com.svix.models.AppPortalAccessOut;
88
import com.svix.models.ApplicationTokenExpireIn;
9-
import com.svix.models.DashboardAccessOut;
109

1110
import okhttp3.Headers;
1211
import okhttp3.HttpUrl;
@@ -84,28 +83,19 @@ public void expireAll(
8483
}
8584

8685
/**
87-
* DEPRECATED: Please use `app-portal-access` instead.
88-
*
89-
* <p>Use this function to get magic links (and authentication codes) for connecting your users
90-
* to the Consumer Application Portal.
91-
*
92-
* @deprecated
86+
* @deprecated Please use appPortalAccess instead.
9387
*/
9488
@Deprecated
95-
public DashboardAccessOut dashboardAccess(final String appId) throws IOException, ApiException {
89+
public com.svix.models.DashboardAccessOut dashboardAccess(final String appId)
90+
throws IOException, ApiException {
9691
return this.dashboardAccess(appId, new AuthenticationDashboardAccessOptions());
9792
}
9893

9994
/**
100-
* DEPRECATED: Please use `app-portal-access` instead.
101-
*
102-
* <p>Use this function to get magic links (and authentication codes) for connecting your users
103-
* to the Consumer Application Portal.
104-
*
105-
* @deprecated
95+
* @deprecated Please use appPortalAccess instead.
10696
*/
10797
@Deprecated
108-
public DashboardAccessOut dashboardAccess(
98+
public com.svix.models.DashboardAccessOut dashboardAccess(
10999
final String appId, final AuthenticationDashboardAccessOptions options)
110100
throws IOException, ApiException {
111101
HttpUrl.Builder url =
@@ -117,7 +107,11 @@ public DashboardAccessOut dashboardAccess(
117107
headers.put("idempotency-key", options.idempotencyKey);
118108
}
119109
return this.client.executeRequest(
120-
"POST", url.build(), Headers.of(headers), null, DashboardAccessOut.class);
110+
"POST",
111+
url.build(),
112+
Headers.of(headers),
113+
null,
114+
com.svix.models.DashboardAccessOut.class);
121115
}
122116

123117
/**
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/** @deprecated Please use appPortalAccess instead. */
2+
@Deprecated
3+
public com.svix.models.DashboardAccessOut dashboardAccess(final String appId)
4+
throws IOException, ApiException {
5+
return this.dashboardAccess(appId, new AuthenticationDashboardAccessOptions());
6+
}
7+
8+
/** @deprecated Please use appPortalAccess instead. */
9+
@Deprecated
10+
public com.svix.models.DashboardAccessOut dashboardAccess(
11+
final String appId, final AuthenticationDashboardAccessOptions options)
12+
throws IOException, ApiException {
13+
HttpUrl.Builder url =
14+
this.client
15+
.newUrlBuilder()
16+
.encodedPath(String.format("/api/v1/auth/dashboard-access/%s", appId));
17+
Map<String, String> headers = new HashMap<>();
18+
if (options.idempotencyKey != null) {
19+
headers.put("idempotency-key", options.idempotencyKey);
20+
}
21+
return this.client.executeRequest(
22+
"POST", url.build(), Headers.of(headers), null, com.svix.models.DashboardAccessOut.class);
23+
}

javascript/src/api/authentication.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ export interface AuthenticationExpireAllOptions {
2525
idempotencyKey?: string;
2626
}
2727

28-
export interface AuthenticationDashboardAccessOptions {
28+
export interface AuthenticationLogoutOptions {
2929
idempotencyKey?: string;
3030
}
3131

32-
export interface AuthenticationLogoutOptions {
32+
/** @deprecated */
33+
export interface AuthenticationDashboardAccessOptions {
3334
idempotencyKey?: string;
3435
}
3536

@@ -74,13 +75,7 @@ export class Authentication {
7475
return request.sendNoResponseBody(this.requestCtx);
7576
}
7677

77-
/**
78-
* DEPRECATED: Please use `app-portal-access` instead.
79-
*
80-
* Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
81-
*
82-
* @deprecated
83-
*/
78+
/** @deprecated Please use `appPortalAccess` instead. */
8479
public dashboardAccess(
8580
appId: string,
8681
options?: AuthenticationDashboardAccessOptions

javascript/src/api_internal/authentication.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ export interface AuthenticationStreamPortalAccessOptions {
3333
idempotencyKey?: string;
3434
}
3535

36+
/** @deprecated */
37+
export interface AuthenticationDashboardAccessOptions {
38+
idempotencyKey?: string;
39+
}
40+
3641
export class Authentication {
3742
public constructor(private readonly requestCtx: SvixRequestContext) {}
3843

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/** @deprecated Please use `appPortalAccess` instead. */
2+
public dashboardAccess(
3+
appId: string,
4+
options?: AuthenticationDashboardAccessOptions
5+
): Promise<DashboardAccessOut> {
6+
const request = new SvixRequest(
7+
HttpMethod.POST,
8+
"/api/v1/auth/dashboard-access/{app_id}"
9+
);
10+
11+
request.setPathParam("app_id", appId);
12+
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
13+
14+
return request.send(this.requestCtx, DashboardAccessOutSerializer._fromJsonObject);
15+
}

0 commit comments

Comments
 (0)