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
140 changes: 140 additions & 0 deletions output/csharp/src/Seam/Api/ClientSessionsV1InstantKeySeam.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
using System.Runtime.Serialization;
using System.Text;
using JsonSubTypes;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using Seam.Client;
using Seam.Model;

namespace Seam.Api
{
public class ClientSessionsV1InstantKeySeam
{
private ISeamClient _seam;

public ClientSessionsV1InstantKeySeam(ISeamClient seam)
{
_seam = seam;
}

[DataContract(Name = "exchangeShortCodeRequest_request")]
public class ExchangeShortCodeRequest
{
[JsonConstructorAttribute]
protected ExchangeShortCodeRequest() { }

public ExchangeShortCodeRequest(string shortCode = default)
{
ShortCode = shortCode;
}

[DataMember(Name = "short_code", IsRequired = true, EmitDefaultValue = false)]
public string ShortCode { 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 = "exchangeShortCodeResponse_response")]
public class ExchangeShortCodeResponse
{
[JsonConstructorAttribute]
protected ExchangeShortCodeResponse() { }

public ExchangeShortCodeResponse(ClientSession clientSession = default)
{
ClientSession = clientSession;
}

[DataMember(Name = "client_session", IsRequired = false, EmitDefaultValue = false)]
public ClientSession ClientSession { 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 ClientSession ExchangeShortCode(ExchangeShortCodeRequest request)
{
var requestOptions = new RequestOptions();
requestOptions.Data = request;
return _seam
.Post<ExchangeShortCodeResponse>(
"/seam/instant_key/v1/client_sessions/exchange_short_code",
requestOptions
)
.Data.ClientSession;
}

public ClientSession ExchangeShortCode(string shortCode = default)
{
return ExchangeShortCode(new ExchangeShortCodeRequest(shortCode: shortCode));
}

public async Task<ClientSession> ExchangeShortCodeAsync(ExchangeShortCodeRequest request)
{
var requestOptions = new RequestOptions();
requestOptions.Data = request;
return (
await _seam.PostAsync<ExchangeShortCodeResponse>(
"/seam/instant_key/v1/client_sessions/exchange_short_code",
requestOptions
)
)
.Data
.ClientSession;
}

public async Task<ClientSession> ExchangeShortCodeAsync(string shortCode = default)
{
return (
await ExchangeShortCodeAsync(new ExchangeShortCodeRequest(shortCode: shortCode))
);
}
}
}

namespace Seam.Client
{
public partial class SeamClient
{
public Api.ClientSessionsV1InstantKeySeam ClientSessionsV1InstantKeySeam => new(this);
}

public partial interface ISeamClient
{
public Api.ClientSessionsV1InstantKeySeam ClientSessionsV1InstantKeySeam { get; }
}
}
152 changes: 152 additions & 0 deletions output/csharp/src/Seam/Model/ActionAttempt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
[JsonSubtypes.KnownSubType(typeof(ActionAttemptDeleteAccessCode), "DELETE_ACCESS_CODE")]
[JsonSubtypes.KnownSubType(typeof(ActionAttemptCreateAccessCode), "CREATE_ACCESS_CODE")]
[JsonSubtypes.KnownSubType(typeof(ActionAttemptSyncAccessCodes), "SYNC_ACCESS_CODES")]
[JsonSubtypes.KnownSubType(
typeof(ActionAttemptSimulateManualLockViaKeypad),
"SIMULATE_MANUAL_LOCK_VIA_KEYPAD"
)]
[JsonSubtypes.KnownSubType(
typeof(ActionAttemptSimulateKeypadCodeEntry),
"SIMULATE_KEYPAD_CODE_ENTRY"
)]
[JsonSubtypes.KnownSubType(
typeof(ActionAttemptActivateClimatePreset),
"ACTIVATE_CLIMATE_PRESET"
Expand All @@ -42,7 +50,7 @@
}

[DataContract(Name = "seamModel_actionAttemptLockDoor_model")]
public class ActionAttemptLockDoor : ActionAttempt

Check failure on line 53 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v16 on Linux)

'ActionAttemptLockDoor' does not implement inherited abstract member 'ActionAttempt.Status.set'

Check failure on line 53 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v18 on Linux)

'ActionAttemptLockDoor' does not implement inherited abstract member 'ActionAttempt.Status.set'
{
[JsonConstructorAttribute]
protected ActionAttemptLockDoor() { }
Expand Down Expand Up @@ -85,13 +93,13 @@
public override string ActionType { get; } = "LOCK_DOOR";

[DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)]
public override Object Error { get; set; }

Check failure on line 96 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v16 on Linux)

'ActionAttemptLockDoor.Error': no suitable method found to override

Check failure on line 96 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v18 on Linux)

'ActionAttemptLockDoor.Error': no suitable method found to override

[DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)]
public override Object Result { get; set; }

Check failure on line 99 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v16 on Linux)

'ActionAttemptLockDoor.Result': no suitable method found to override

Check failure on line 99 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v18 on Linux)

'ActionAttemptLockDoor.Result': no suitable method found to override

[DataMember(Name = "status", IsRequired = true, EmitDefaultValue = false)]
public override ActionAttemptLockDoor.StatusEnum Status { get; set; }

Check failure on line 102 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v16 on Linux)

'ActionAttemptLockDoor.Status': type must be 'string' to match overridden member 'ActionAttempt.Status'

Check failure on line 102 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v18 on Linux)

'ActionAttemptLockDoor.Status': type must be 'string' to match overridden member 'ActionAttempt.Status'

public override string ToString()
{
Expand All @@ -114,7 +122,7 @@
}

[DataContract(Name = "seamModel_actionAttemptUnlockDoor_model")]
public class ActionAttemptUnlockDoor : ActionAttempt

Check failure on line 125 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v16 on Linux)

'ActionAttemptUnlockDoor' does not implement inherited abstract member 'ActionAttempt.Status.set'

Check failure on line 125 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v18 on Linux)

'ActionAttemptUnlockDoor' does not implement inherited abstract member 'ActionAttempt.Status.set'
{
[JsonConstructorAttribute]
protected ActionAttemptUnlockDoor() { }
Expand Down Expand Up @@ -157,13 +165,13 @@
public override string ActionType { get; } = "UNLOCK_DOOR";

[DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)]
public override Object Error { get; set; }

Check failure on line 168 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v16 on Linux)

'ActionAttemptUnlockDoor.Error': no suitable method found to override

Check failure on line 168 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v18 on Linux)

'ActionAttemptUnlockDoor.Error': no suitable method found to override

[DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)]
public override Object Result { get; set; }

Check failure on line 171 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v16 on Linux)

'ActionAttemptUnlockDoor.Result': no suitable method found to override

Check failure on line 171 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v18 on Linux)

'ActionAttemptUnlockDoor.Result': no suitable method found to override

[DataMember(Name = "status", IsRequired = true, EmitDefaultValue = false)]
public override ActionAttemptUnlockDoor.StatusEnum Status { get; set; }

Check failure on line 174 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v16 on Linux)

'ActionAttemptUnlockDoor.Status': type must be 'string' to match overridden member 'ActionAttempt.Status'

Check failure on line 174 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v18 on Linux)

'ActionAttemptUnlockDoor.Status': type must be 'string' to match overridden member 'ActionAttempt.Status'

public override string ToString()
{
Expand Down Expand Up @@ -229,10 +237,10 @@
public override string ActionType { get; } = "SCAN_CREDENTIAL";

[DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)]
public override Object Error { get; set; }

Check failure on line 240 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v16 on Linux)

'ActionAttemptScanCredential.Error': no suitable method found to override

Check failure on line 240 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v18 on Linux)

'ActionAttemptScanCredential.Error': no suitable method found to override

[DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)]
public override Object Result { get; set; }

Check failure on line 243 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v16 on Linux)

'ActionAttemptScanCredential.Result': no suitable method found to override

Check failure on line 243 in output/csharp/src/Seam/Model/ActionAttempt.cs

View workflow job for this annotation

GitHub Actions / Test (Node.js v18 on Linux)

'ActionAttemptScanCredential.Result': no suitable method found to override

[DataMember(Name = "status", IsRequired = true, EmitDefaultValue = false)]
public override ActionAttemptScanCredential.StatusEnum Status { get; set; }
Expand Down Expand Up @@ -617,6 +625,150 @@
}
}

[DataContract(Name = "seamModel_actionAttemptSimulateKeypadCodeEntry_model")]
public class ActionAttemptSimulateKeypadCodeEntry : ActionAttempt
{
[JsonConstructorAttribute]
protected ActionAttemptSimulateKeypadCodeEntry() { }

public ActionAttemptSimulateKeypadCodeEntry(
string actionAttemptId = default,
string actionType = default,
Object error = default,
Object result = default,
ActionAttemptSimulateKeypadCodeEntry.StatusEnum status = default
)
{
ActionAttemptId = actionAttemptId;
ActionType = actionType;
Error = error;
Result = result;
Status = status;
}

[JsonConverter(typeof(SafeStringEnumConverter))]
public enum StatusEnum
{
[EnumMember(Value = "unrecognized")]
Unrecognized = 0,

[EnumMember(Value = "pending")]
Pending = 1,

[EnumMember(Value = "success")]
Success = 2,

[EnumMember(Value = "error")]
Error = 3,
}

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

[DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)]
public override string ActionType { get; } = "SIMULATE_KEYPAD_CODE_ENTRY";

[DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)]
public override Object Error { get; set; }

[DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)]
public override Object Result { get; set; }

[DataMember(Name = "status", IsRequired = true, EmitDefaultValue = false)]
public override ActionAttemptSimulateKeypadCodeEntry.StatusEnum Status { 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 = "seamModel_actionAttemptSimulateManualLockViaKeypad_model")]
public class ActionAttemptSimulateManualLockViaKeypad : ActionAttempt
{
[JsonConstructorAttribute]
protected ActionAttemptSimulateManualLockViaKeypad() { }

public ActionAttemptSimulateManualLockViaKeypad(
string actionAttemptId = default,
string actionType = default,
Object error = default,
Object result = default,
ActionAttemptSimulateManualLockViaKeypad.StatusEnum status = default
)
{
ActionAttemptId = actionAttemptId;
ActionType = actionType;
Error = error;
Result = result;
Status = status;
}

[JsonConverter(typeof(SafeStringEnumConverter))]
public enum StatusEnum
{
[EnumMember(Value = "unrecognized")]
Unrecognized = 0,

[EnumMember(Value = "pending")]
Pending = 1,

[EnumMember(Value = "success")]
Success = 2,

[EnumMember(Value = "error")]
Error = 3,
}

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

[DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)]
public override string ActionType { get; } = "SIMULATE_MANUAL_LOCK_VIA_KEYPAD";

[DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)]
public override Object Error { get; set; }

[DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)]
public override Object Result { get; set; }

[DataMember(Name = "status", IsRequired = true, EmitDefaultValue = false)]
public override ActionAttemptSimulateManualLockViaKeypad.StatusEnum Status { 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 = "seamModel_actionAttemptSyncAccessCodes_model")]
public class ActionAttemptSyncAccessCodes : ActionAttempt
{
Expand Down
2 changes: 1 addition & 1 deletion output/csharp/src/Seam/Seam.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<PackageId>Seam</PackageId>

<PackageVersion>0.52.0</PackageVersion>
<PackageVersion>0.53.0</PackageVersion>

<Authors>Seam</Authors>

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
},
"devDependencies": {
"@seamapi/nextlove-sdk-generator": "^1.17.4",
"@seamapi/types": "^1.384.0",
"@seamapi/types": "^1.385.0",
"@types/node": "^18.19.11",
"ava": "^5.0.1",
"axios": "^1.5.0",
Expand Down