Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
583 changes: 583 additions & 0 deletions output/csharp/src/Seam/Api/AccessGrants.cs

Large diffs are not rendered by default.

190 changes: 190 additions & 0 deletions output/csharp/src/Seam/Api/AccessMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,196 @@ public async Task DeleteAsync(string accessMethodId = default)
{
await DeleteAsync(new DeleteRequest(accessMethodId: accessMethodId));
}

[DataContract(Name = "getRequest_request")]
public class GetRequest
{
[JsonConstructorAttribute]
protected GetRequest() { }

public GetRequest(string accessMethodId = default)
{
AccessMethodId = accessMethodId;
}

[DataMember(Name = "access_method_id", IsRequired = true, EmitDefaultValue = false)]
public string AccessMethodId { get; set; }

public override string ToString()
{
JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null);

StringWriter stringWriter = new StringWriter(
new StringBuilder(256),
System.Globalization.CultureInfo.InvariantCulture
);
using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter))
{
jsonTextWriter.IndentChar = ' ';
jsonTextWriter.Indentation = 2;
jsonTextWriter.Formatting = Formatting.Indented;
jsonSerializer.Serialize(jsonTextWriter, this, null);
}

return stringWriter.ToString();
}
}

[DataContract(Name = "getResponse_response")]
public class GetResponse
{
[JsonConstructorAttribute]
protected GetResponse() { }

public GetResponse(AccessMethod accessMethod = default)
{
AccessMethod = accessMethod;
}

[DataMember(Name = "access_method", IsRequired = false, EmitDefaultValue = false)]
public AccessMethod AccessMethod { get; set; }

public override string ToString()
{
JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null);

StringWriter stringWriter = new StringWriter(
new StringBuilder(256),
System.Globalization.CultureInfo.InvariantCulture
);
using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter))
{
jsonTextWriter.IndentChar = ' ';
jsonTextWriter.Indentation = 2;
jsonTextWriter.Formatting = Formatting.Indented;
jsonSerializer.Serialize(jsonTextWriter, this, null);
}

return stringWriter.ToString();
}
}

public AccessMethod Get(GetRequest request)
{
var requestOptions = new RequestOptions();
requestOptions.Data = request;
return _seam.Post<GetResponse>("/access_methods/get", requestOptions).Data.AccessMethod;
}

public AccessMethod Get(string accessMethodId = default)
{
return Get(new GetRequest(accessMethodId: accessMethodId));
}

public async Task<AccessMethod> GetAsync(GetRequest request)
{
var requestOptions = new RequestOptions();
requestOptions.Data = request;
return (await _seam.PostAsync<GetResponse>("/access_methods/get", requestOptions))
.Data
.AccessMethod;
}

public async Task<AccessMethod> GetAsync(string accessMethodId = default)
{
return (await GetAsync(new GetRequest(accessMethodId: accessMethodId)));
}

[DataContract(Name = "listRequest_request")]
public class ListRequest
{
[JsonConstructorAttribute]
protected ListRequest() { }

public ListRequest(string accessGrantId = default)
{
AccessGrantId = accessGrantId;
}

[DataMember(Name = "access_grant_id", IsRequired = true, EmitDefaultValue = false)]
public string AccessGrantId { get; set; }

public override string ToString()
{
JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null);

StringWriter stringWriter = new StringWriter(
new StringBuilder(256),
System.Globalization.CultureInfo.InvariantCulture
);
using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter))
{
jsonTextWriter.IndentChar = ' ';
jsonTextWriter.Indentation = 2;
jsonTextWriter.Formatting = Formatting.Indented;
jsonSerializer.Serialize(jsonTextWriter, this, null);
}

return stringWriter.ToString();
}
}

[DataContract(Name = "listResponse_response")]
public class ListResponse
{
[JsonConstructorAttribute]
protected ListResponse() { }

public ListResponse(List<AccessMethod> accessMethods = default)
{
AccessMethods = accessMethods;
}

[DataMember(Name = "access_methods", IsRequired = false, EmitDefaultValue = false)]
public List<AccessMethod> AccessMethods { get; set; }

public override string ToString()
{
JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null);

StringWriter stringWriter = new StringWriter(
new StringBuilder(256),
System.Globalization.CultureInfo.InvariantCulture
);
using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter))
{
jsonTextWriter.IndentChar = ' ';
jsonTextWriter.Indentation = 2;
jsonTextWriter.Formatting = Formatting.Indented;
jsonSerializer.Serialize(jsonTextWriter, this, null);
}

return stringWriter.ToString();
}
}

public List<AccessMethod> List(ListRequest request)
{
var requestOptions = new RequestOptions();
requestOptions.Data = request;
return _seam
.Post<ListResponse>("/access_methods/list", requestOptions)
.Data.AccessMethods;
}

public List<AccessMethod> List(string accessGrantId = default)
{
return List(new ListRequest(accessGrantId: accessGrantId));
}

public async Task<List<AccessMethod>> ListAsync(ListRequest request)
{
var requestOptions = new RequestOptions();
requestOptions.Data = request;
return (await _seam.PostAsync<ListResponse>("/access_methods/list", requestOptions))
.Data
.AccessMethods;
}

public async Task<List<AccessMethod>> ListAsync(string accessGrantId = default)
{
return (await ListAsync(new ListRequest(accessGrantId: accessGrantId)));
}
}
}

Expand Down
27 changes: 27 additions & 0 deletions output/csharp/src/Seam/Api/ClientSessions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public CreateRequest(
string? customerKey = default,
string? expiresAt = default,
string? userIdentifierKey = default,
string? userIdentityId = default,
List<string>? userIdentityIds = default
)
{
Expand All @@ -40,6 +41,7 @@ public CreateRequest(
CustomerKey = customerKey;
ExpiresAt = expiresAt;
UserIdentifierKey = userIdentifierKey;
UserIdentityId = userIdentityId;
UserIdentityIds = userIdentityIds;
}

Expand All @@ -65,6 +67,9 @@ public CreateRequest(
[DataMember(Name = "user_identifier_key", IsRequired = false, EmitDefaultValue = false)]
public string? UserIdentifierKey { get; set; }

[DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)]
public string? UserIdentityId { get; set; }

[DataMember(Name = "user_identity_ids", IsRequired = false, EmitDefaultValue = false)]
public List<string>? UserIdentityIds { get; set; }

Expand Down Expand Up @@ -138,6 +143,7 @@ public ClientSession Create(
string? customerKey = default,
string? expiresAt = default,
string? userIdentifierKey = default,
string? userIdentityId = default,
List<string>? userIdentityIds = default
)
{
Expand All @@ -149,6 +155,7 @@ public ClientSession Create(
customerKey: customerKey,
expiresAt: expiresAt,
userIdentifierKey: userIdentifierKey,
userIdentityId: userIdentityId,
userIdentityIds: userIdentityIds
)
);
Expand All @@ -172,6 +179,7 @@ public async Task<ClientSession> CreateAsync(
string? customerKey = default,
string? expiresAt = default,
string? userIdentifierKey = default,
string? userIdentityId = default,
List<string>? userIdentityIds = default
)
{
Expand All @@ -184,6 +192,7 @@ await CreateAsync(
customerKey: customerKey,
expiresAt: expiresAt,
userIdentifierKey: userIdentifierKey,
userIdentityId: userIdentityId,
userIdentityIds: userIdentityIds
)
)
Expand Down Expand Up @@ -380,13 +389,15 @@ public GetOrCreateRequest(
List<string>? connectedAccountIds = default,
string? expiresAt = default,
string? userIdentifierKey = default,
string? userIdentityId = default,
List<string>? userIdentityIds = default
)
{
ConnectWebviewIds = connectWebviewIds;
ConnectedAccountIds = connectedAccountIds;
ExpiresAt = expiresAt;
UserIdentifierKey = userIdentifierKey;
UserIdentityId = userIdentityId;
UserIdentityIds = userIdentityIds;
}

Expand All @@ -406,6 +417,9 @@ public GetOrCreateRequest(
[DataMember(Name = "user_identifier_key", IsRequired = false, EmitDefaultValue = false)]
public string? UserIdentifierKey { get; set; }

[DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)]
public string? UserIdentityId { get; set; }

[DataMember(Name = "user_identity_ids", IsRequired = false, EmitDefaultValue = false)]
public List<string>? UserIdentityIds { get; set; }

Expand Down Expand Up @@ -477,6 +491,7 @@ public ClientSession GetOrCreate(
List<string>? connectedAccountIds = default,
string? expiresAt = default,
string? userIdentifierKey = default,
string? userIdentityId = default,
List<string>? userIdentityIds = default
)
{
Expand All @@ -486,6 +501,7 @@ public ClientSession GetOrCreate(
connectedAccountIds: connectedAccountIds,
expiresAt: expiresAt,
userIdentifierKey: userIdentifierKey,
userIdentityId: userIdentityId,
userIdentityIds: userIdentityIds
)
);
Expand All @@ -510,6 +526,7 @@ public async Task<ClientSession> GetOrCreateAsync(
List<string>? connectedAccountIds = default,
string? expiresAt = default,
string? userIdentifierKey = default,
string? userIdentityId = default,
List<string>? userIdentityIds = default
)
{
Expand All @@ -520,6 +537,7 @@ await GetOrCreateAsync(
connectedAccountIds: connectedAccountIds,
expiresAt: expiresAt,
userIdentifierKey: userIdentifierKey,
userIdentityId: userIdentityId,
userIdentityIds: userIdentityIds
)
)
Expand All @@ -537,13 +555,15 @@ public GrantAccessRequest(
List<string>? connectWebviewIds = default,
List<string>? connectedAccountIds = default,
string? userIdentifierKey = default,
string? userIdentityId = default,
List<string>? userIdentityIds = default
)
{
ClientSessionId = clientSessionId;
ConnectWebviewIds = connectWebviewIds;
ConnectedAccountIds = connectedAccountIds;
UserIdentifierKey = userIdentifierKey;
UserIdentityId = userIdentityId;
UserIdentityIds = userIdentityIds;
}

Expand All @@ -563,6 +583,9 @@ public GrantAccessRequest(
[DataMember(Name = "user_identifier_key", IsRequired = false, EmitDefaultValue = false)]
public string? UserIdentifierKey { get; set; }

[DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)]
public string? UserIdentityId { get; set; }

[DataMember(Name = "user_identity_ids", IsRequired = false, EmitDefaultValue = false)]
public List<string>? UserIdentityIds { get; set; }

Expand Down Expand Up @@ -598,6 +621,7 @@ public void GrantAccess(
List<string>? connectWebviewIds = default,
List<string>? connectedAccountIds = default,
string? userIdentifierKey = default,
string? userIdentityId = default,
List<string>? userIdentityIds = default
)
{
Expand All @@ -607,6 +631,7 @@ public void GrantAccess(
connectWebviewIds: connectWebviewIds,
connectedAccountIds: connectedAccountIds,
userIdentifierKey: userIdentifierKey,
userIdentityId: userIdentityId,
userIdentityIds: userIdentityIds
)
);
Expand All @@ -624,6 +649,7 @@ public async Task GrantAccessAsync(
List<string>? connectWebviewIds = default,
List<string>? connectedAccountIds = default,
string? userIdentifierKey = default,
string? userIdentityId = default,
List<string>? userIdentityIds = default
)
{
Expand All @@ -633,6 +659,7 @@ await GrantAccessAsync(
connectWebviewIds: connectWebviewIds,
connectedAccountIds: connectedAccountIds,
userIdentifierKey: userIdentifierKey,
userIdentityId: userIdentityId,
userIdentityIds: userIdentityIds
)
);
Expand Down
Loading
Loading