Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workspace routes #6

Merged
merged 1 commit into from
Oct 2, 2023
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
63 changes: 63 additions & 0 deletions output/csharp/src/Seam/Api/AccessCodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,69 @@ await DeleteAsync(
);
}

[DataContract(Name = "generateCodeRequest_request")]
public class GenerateCodeRequest
{
[JsonConstructorAttribute]
protected GenerateCodeRequest() { }

public GenerateCodeRequest(string deviceId = default)
{
DeviceId = deviceId;
}

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

[DataContract(Name = "generateCodeResponse_response")]
public class GenerateCodeResponse
{
[JsonConstructorAttribute]
protected GenerateCodeResponse() { }

public GenerateCodeResponse(AccessCode generatedCode = default)
{
GeneratedCode = generatedCode;
}

[DataMember(Name = "generated_code", IsRequired = false, EmitDefaultValue = false)]
public AccessCode GeneratedCode { get; set; }
}

public AccessCode GenerateCode(GenerateCodeRequest request)
{
var requestOptions = new RequestOptions();
requestOptions.Data = request;
return _seam
.Post<GenerateCodeResponse>("/access_codes/generate_code", requestOptions)
.Data.GeneratedCode;
}

public AccessCode GenerateCode(string deviceId = default)
{
return GenerateCode(new GenerateCodeRequest(deviceId: deviceId));
}

public async Task<AccessCode> GenerateCodeAsync(GenerateCodeRequest request)
{
var requestOptions = new RequestOptions();
requestOptions.Data = request;
return (
await _seam.PostAsync<GenerateCodeResponse>(
"/access_codes/generate_code",
requestOptions
)
)
.Data
.GeneratedCode;
}

public async Task<AccessCode> GenerateCodeAsync(string deviceId = default)
{
return (await GenerateCodeAsync(new GenerateCodeRequest(deviceId: deviceId)));
}

[DataContract(Name = "getRequest_request")]
public class GetRequest
{
Expand Down
118 changes: 68 additions & 50 deletions output/csharp/src/Seam/Api/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,80 +157,89 @@ public enum EventTypeEnum
[EnumMember(Value = "device.battery_status_changed")]
DeviceBatteryStatusChanged = 9,

[EnumMember(Value = "device.third_party_integration_detected")]
DeviceThirdPartyIntegrationDetected = 10,

[EnumMember(Value = "device.salto.privacy_mode_activated")]
DeviceSaltoPrivacyModeActivated = 11,

[EnumMember(Value = "device.salto.privacy_mode_deactivated")]
DeviceSaltoPrivacyModeDeactivated = 12,

[EnumMember(Value = "access_code.created")]
AccessCodeCreated = 10,
AccessCodeCreated = 13,

[EnumMember(Value = "access_code.changed")]
AccessCodeChanged = 11,
AccessCodeChanged = 14,

[EnumMember(Value = "access_code.scheduled_on_device")]
AccessCodeScheduledOnDevice = 12,
AccessCodeScheduledOnDevice = 15,

[EnumMember(Value = "access_code.set_on_device")]
AccessCodeSetOnDevice = 13,
AccessCodeSetOnDevice = 16,

[EnumMember(Value = "access_code.deleted")]
AccessCodeDeleted = 14,
AccessCodeDeleted = 17,

[EnumMember(Value = "access_code.removed_from_device")]
AccessCodeRemovedFromDevice = 15,
AccessCodeRemovedFromDevice = 18,

[EnumMember(Value = "access_code.failed_to_set_on_device")]
AccessCodeFailedToSetOnDevice = 16,
AccessCodeFailedToSetOnDevice = 19,

[EnumMember(Value = "access_code.delay_in_setting_on_device")]
AccessCodeDelayInSettingOnDevice = 17,
AccessCodeDelayInSettingOnDevice = 20,

[EnumMember(Value = "access_code.failed_to_remove_from_device")]
AccessCodeFailedToRemoveFromDevice = 18,
AccessCodeFailedToRemoveFromDevice = 21,

[EnumMember(Value = "access_code.delay_in_removing_from_device")]
AccessCodeDelayInRemovingFromDevice = 19,
AccessCodeDelayInRemovingFromDevice = 22,

[EnumMember(Value = "access_code.modified_external_to_seam")]
AccessCodeModifiedExternalToSeam = 20,
AccessCodeModifiedExternalToSeam = 23,

[EnumMember(Value = "access_code.unmanaged.converted_to_managed")]
AccessCodeUnmanagedConvertedToManaged = 21,
AccessCodeUnmanagedConvertedToManaged = 24,

[EnumMember(Value = "access_code.unmanaged.failed_to_convert_to_managed")]
AccessCodeUnmanagedFailedToConvertToManaged = 22,
AccessCodeUnmanagedFailedToConvertToManaged = 25,

[EnumMember(Value = "access_code.unmanaged.created")]
AccessCodeUnmanagedCreated = 23,
AccessCodeUnmanagedCreated = 26,

[EnumMember(Value = "access_code.unmanaged.removed")]
AccessCodeUnmanagedRemoved = 24,
AccessCodeUnmanagedRemoved = 27,

[EnumMember(Value = "lock.locked")]
LockLocked = 25,
LockLocked = 28,

[EnumMember(Value = "lock.unlocked")]
LockUnlocked = 26,
LockUnlocked = 29,

[EnumMember(Value = "connected_account.connected")]
ConnectedAccountConnected = 27,
ConnectedAccountConnected = 30,

[EnumMember(Value = "connected_account.successful_login")]
ConnectedAccountSuccessfulLogin = 28,
ConnectedAccountSuccessfulLogin = 31,

[EnumMember(Value = "connected_account.created")]
ConnectedAccountCreated = 29,
ConnectedAccountCreated = 32,

[EnumMember(Value = "connected_account.deleted")]
ConnectedAccountDeleted = 30,
ConnectedAccountDeleted = 33,

[EnumMember(Value = "connected_account.disconnected")]
ConnectedAccountDisconnected = 31,
ConnectedAccountDisconnected = 34,

[EnumMember(Value = "connected_account.completed_first_sync")]
ConnectedAccountCompletedFirstSync = 32,
ConnectedAccountCompletedFirstSync = 35,

[EnumMember(Value = "noise_sensor.noise_threshold_triggered")]
NoiseSensorNoiseThresholdTriggered = 33,
NoiseSensorNoiseThresholdTriggered = 36,

[EnumMember(Value = "access_code.backup_access_code_pulled")]
AccessCodeBackupAccessCodePulled = 34
AccessCodeBackupAccessCodePulled = 37
}

[JsonConverter(typeof(StringEnumConverter))]
Expand Down Expand Up @@ -266,80 +275,89 @@ public enum EventTypesEnum
[EnumMember(Value = "device.battery_status_changed")]
DeviceBatteryStatusChanged = 9,

[EnumMember(Value = "device.third_party_integration_detected")]
DeviceThirdPartyIntegrationDetected = 10,

[EnumMember(Value = "device.salto.privacy_mode_activated")]
DeviceSaltoPrivacyModeActivated = 11,

[EnumMember(Value = "device.salto.privacy_mode_deactivated")]
DeviceSaltoPrivacyModeDeactivated = 12,

[EnumMember(Value = "access_code.created")]
AccessCodeCreated = 10,
AccessCodeCreated = 13,

[EnumMember(Value = "access_code.changed")]
AccessCodeChanged = 11,
AccessCodeChanged = 14,

[EnumMember(Value = "access_code.scheduled_on_device")]
AccessCodeScheduledOnDevice = 12,
AccessCodeScheduledOnDevice = 15,

[EnumMember(Value = "access_code.set_on_device")]
AccessCodeSetOnDevice = 13,
AccessCodeSetOnDevice = 16,

[EnumMember(Value = "access_code.deleted")]
AccessCodeDeleted = 14,
AccessCodeDeleted = 17,

[EnumMember(Value = "access_code.removed_from_device")]
AccessCodeRemovedFromDevice = 15,
AccessCodeRemovedFromDevice = 18,

[EnumMember(Value = "access_code.failed_to_set_on_device")]
AccessCodeFailedToSetOnDevice = 16,
AccessCodeFailedToSetOnDevice = 19,

[EnumMember(Value = "access_code.delay_in_setting_on_device")]
AccessCodeDelayInSettingOnDevice = 17,
AccessCodeDelayInSettingOnDevice = 20,

[EnumMember(Value = "access_code.failed_to_remove_from_device")]
AccessCodeFailedToRemoveFromDevice = 18,
AccessCodeFailedToRemoveFromDevice = 21,

[EnumMember(Value = "access_code.delay_in_removing_from_device")]
AccessCodeDelayInRemovingFromDevice = 19,
AccessCodeDelayInRemovingFromDevice = 22,

[EnumMember(Value = "access_code.modified_external_to_seam")]
AccessCodeModifiedExternalToSeam = 20,
AccessCodeModifiedExternalToSeam = 23,

[EnumMember(Value = "access_code.unmanaged.converted_to_managed")]
AccessCodeUnmanagedConvertedToManaged = 21,
AccessCodeUnmanagedConvertedToManaged = 24,

[EnumMember(Value = "access_code.unmanaged.failed_to_convert_to_managed")]
AccessCodeUnmanagedFailedToConvertToManaged = 22,
AccessCodeUnmanagedFailedToConvertToManaged = 25,

[EnumMember(Value = "access_code.unmanaged.created")]
AccessCodeUnmanagedCreated = 23,
AccessCodeUnmanagedCreated = 26,

[EnumMember(Value = "access_code.unmanaged.removed")]
AccessCodeUnmanagedRemoved = 24,
AccessCodeUnmanagedRemoved = 27,

[EnumMember(Value = "lock.locked")]
LockLocked = 25,
LockLocked = 28,

[EnumMember(Value = "lock.unlocked")]
LockUnlocked = 26,
LockUnlocked = 29,

[EnumMember(Value = "connected_account.connected")]
ConnectedAccountConnected = 27,
ConnectedAccountConnected = 30,

[EnumMember(Value = "connected_account.successful_login")]
ConnectedAccountSuccessfulLogin = 28,
ConnectedAccountSuccessfulLogin = 31,

[EnumMember(Value = "connected_account.created")]
ConnectedAccountCreated = 29,
ConnectedAccountCreated = 32,

[EnumMember(Value = "connected_account.deleted")]
ConnectedAccountDeleted = 30,
ConnectedAccountDeleted = 33,

[EnumMember(Value = "connected_account.disconnected")]
ConnectedAccountDisconnected = 31,
ConnectedAccountDisconnected = 34,

[EnumMember(Value = "connected_account.completed_first_sync")]
ConnectedAccountCompletedFirstSync = 32,
ConnectedAccountCompletedFirstSync = 35,

[EnumMember(Value = "noise_sensor.noise_threshold_triggered")]
NoiseSensorNoiseThresholdTriggered = 33,
NoiseSensorNoiseThresholdTriggered = 36,

[EnumMember(Value = "access_code.backup_access_code_pulled")]
AccessCodeBackupAccessCodePulled = 34
AccessCodeBackupAccessCodePulled = 37
}

[DataMember(Name = "since", IsRequired = false, EmitDefaultValue = false)]
Expand Down
48 changes: 48 additions & 0 deletions output/csharp/src/Seam/Api/Webhooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,54 @@ public async Task<Webhook> GetAsync(string webhookId = default)
{
return (await GetAsync(new GetRequest(webhookId: webhookId)));
}

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

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

public ListResponse(List<Webhook> webhooks = default)
{
Webhooks = webhooks;
}

[DataMember(Name = "webhooks", IsRequired = false, EmitDefaultValue = false)]
public List<Webhook> Webhooks { get; set; }
}

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

public List<Webhook> List()
{
return List(new ListRequest());
}

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

public async Task<List<Webhook>> ListAsync()
{
return (await ListAsync(new ListRequest()));
}
}
}

Expand Down
Loading