diff --git a/generate-routes.ts b/generate-routes.ts index 0dd12d35..730382de 100644 --- a/generate-routes.ts +++ b/generate-routes.ts @@ -78,6 +78,7 @@ interface Endpoint { resource: string | null method: Method requestFormat: 'params' | 'body' + isRequestParamOptional: boolean } type Method = 'GET' | 'POST' @@ -147,6 +148,9 @@ const createEndpoint = ( method, resource: deriveResource(endpointPath, method), requestFormat: ['GET', 'DELETE'].includes(method) ? 'params' : 'body', + // UPSTREAM: This could be derived from the OpenAPI spec, however some endpoints require at least one param, + // and in the spec this currently looks as if params are optional. + isRequestParamOptional: true, } } @@ -298,11 +302,10 @@ const renderClassMethod = ({ namespace, resource, path, + isRequestParamOptional, }: Endpoint): string => ` async ${camelCase(name)}( - ${requestFormat}${ - requestFormat === 'params' ? '?' : '' - }: ${renderRequestType({ + ${requestFormat}${isRequestParamOptional ? '?' : ''}: ${renderRequestType({ name, namespace, })}, diff --git a/src/lib/seam/connect/routes/access-codes-unmanaged.ts b/src/lib/seam/connect/routes/access-codes-unmanaged.ts index d0f26eaf..6f8c94bd 100644 --- a/src/lib/seam/connect/routes/access-codes-unmanaged.ts +++ b/src/lib/seam/connect/routes/access-codes-unmanaged.ts @@ -83,7 +83,7 @@ export class SeamHttpAccessCodesUnmanaged { } async convertToManaged( - body: AccessCodesUnmanagedConvertToManagedBody, + body?: AccessCodesUnmanagedConvertToManagedBody, ): Promise { await this.client.request({ url: '/access_codes/unmanaged/convert_to_managed', @@ -92,7 +92,7 @@ export class SeamHttpAccessCodesUnmanaged { }) } - async delete(body: AccessCodesUnmanagedDeleteBody): Promise { + async delete(body?: AccessCodesUnmanagedDeleteBody): Promise { await this.client.request({ url: '/access_codes/unmanaged/delete', method: 'post', @@ -101,7 +101,7 @@ export class SeamHttpAccessCodesUnmanaged { } async get( - body: AccessCodesUnmanagedGetParams, + body?: AccessCodesUnmanagedGetParams, ): Promise { const { data } = await this.client.request( { @@ -114,7 +114,7 @@ export class SeamHttpAccessCodesUnmanaged { } async list( - body: AccessCodesUnmanagedListParams, + body?: AccessCodesUnmanagedListParams, ): Promise { const { data } = await this.client.request({ @@ -125,7 +125,7 @@ export class SeamHttpAccessCodesUnmanaged { return data.access_codes } - async update(body: AccessCodesUnmanagedUpdateBody): Promise { + async update(body?: AccessCodesUnmanagedUpdateBody): Promise { await this.client.request({ url: '/access_codes/unmanaged/update', method: 'post', diff --git a/src/lib/seam/connect/routes/access-codes.ts b/src/lib/seam/connect/routes/access-codes.ts index 53bffa9f..b24e712d 100644 --- a/src/lib/seam/connect/routes/access-codes.ts +++ b/src/lib/seam/connect/routes/access-codes.ts @@ -88,7 +88,7 @@ export class SeamHttpAccessCodes { } async create( - body: AccessCodesCreateBody, + body?: AccessCodesCreateBody, ): Promise { const { data } = await this.client.request({ url: '/access_codes/create', @@ -99,7 +99,7 @@ export class SeamHttpAccessCodes { } async createMultiple( - body: AccessCodesCreateMultipleBody, + body?: AccessCodesCreateMultipleBody, ): Promise { const { data } = await this.client.request({ @@ -110,7 +110,7 @@ export class SeamHttpAccessCodes { return data.access_codes } - async delete(body: AccessCodesDeleteBody): Promise { + async delete(body?: AccessCodesDeleteBody): Promise { await this.client.request({ url: '/access_codes/delete', method: 'post', @@ -119,7 +119,7 @@ export class SeamHttpAccessCodes { } async generateCode( - body: AccessCodesGenerateCodeBody, + body?: AccessCodesGenerateCodeBody, ): Promise { const { data } = await this.client.request( { @@ -132,7 +132,7 @@ export class SeamHttpAccessCodes { } async get( - body: AccessCodesGetParams, + body?: AccessCodesGetParams, ): Promise { const { data } = await this.client.request({ url: '/access_codes/get', @@ -143,7 +143,7 @@ export class SeamHttpAccessCodes { } async list( - body: AccessCodesListParams, + body?: AccessCodesListParams, ): Promise { const { data } = await this.client.request({ url: '/access_codes/list', @@ -154,7 +154,7 @@ export class SeamHttpAccessCodes { } async pullBackupAccessCode( - body: AccessCodesPullBackupAccessCodeBody, + body?: AccessCodesPullBackupAccessCodeBody, ): Promise { const { data } = await this.client.request({ @@ -165,7 +165,7 @@ export class SeamHttpAccessCodes { return data.backup_access_code } - async update(body: AccessCodesUpdateBody): Promise { + async update(body?: AccessCodesUpdateBody): Promise { await this.client.request({ url: '/access_codes/update', method: 'post', diff --git a/src/lib/seam/connect/routes/acs-access-groups.ts b/src/lib/seam/connect/routes/acs-access-groups.ts index 3cca37d8..ac61f438 100644 --- a/src/lib/seam/connect/routes/acs-access-groups.ts +++ b/src/lib/seam/connect/routes/acs-access-groups.ts @@ -82,7 +82,7 @@ export class SeamHttpAcsAccessGroups { return SeamHttpAcsAccessGroups.fromClientSessionToken(token, options) } - async addUser(body: AcsAccessGroupsAddUserBody): Promise { + async addUser(body?: AcsAccessGroupsAddUserBody): Promise { await this.client.request({ url: '/acs/access_groups/add_user', method: 'post', @@ -91,7 +91,7 @@ export class SeamHttpAcsAccessGroups { } async create( - body: AcsAccessGroupsCreateBody, + body?: AcsAccessGroupsCreateBody, ): Promise { const { data } = await this.client.request({ url: '/acs/access_groups/create', @@ -101,7 +101,7 @@ export class SeamHttpAcsAccessGroups { return data.acs_access_group } - async delete(body: AcsAccessGroupsDeleteBody): Promise { + async delete(body?: AcsAccessGroupsDeleteBody): Promise { await this.client.request({ url: '/acs/access_groups/delete', method: 'post', @@ -110,7 +110,7 @@ export class SeamHttpAcsAccessGroups { } async get( - body: AcsAccessGroupsGetParams, + body?: AcsAccessGroupsGetParams, ): Promise { const { data } = await this.client.request({ url: '/acs/access_groups/get', @@ -121,7 +121,7 @@ export class SeamHttpAcsAccessGroups { } async list( - body: AcsAccessGroupsListParams, + body?: AcsAccessGroupsListParams, ): Promise { const { data } = await this.client.request({ url: '/acs/access_groups/list', @@ -132,7 +132,7 @@ export class SeamHttpAcsAccessGroups { } async listUsers( - body: AcsAccessGroupsListUsersParams, + body?: AcsAccessGroupsListUsersParams, ): Promise { const { data } = await this.client.request({ @@ -143,7 +143,7 @@ export class SeamHttpAcsAccessGroups { return data.acs_users } - async removeUser(body: AcsAccessGroupsRemoveUserBody): Promise { + async removeUser(body?: AcsAccessGroupsRemoveUserBody): Promise { await this.client.request({ url: '/acs/access_groups/remove_user', method: 'post', @@ -151,7 +151,7 @@ export class SeamHttpAcsAccessGroups { }) } - async update(body: AcsAccessGroupsUpdateBody): Promise { + async update(body?: AcsAccessGroupsUpdateBody): Promise { await this.client.request({ url: '/acs/access_groups/update', method: 'post', diff --git a/src/lib/seam/connect/routes/acs-credentials.ts b/src/lib/seam/connect/routes/acs-credentials.ts index 988d85bd..75260dd2 100644 --- a/src/lib/seam/connect/routes/acs-credentials.ts +++ b/src/lib/seam/connect/routes/acs-credentials.ts @@ -83,7 +83,7 @@ export class SeamHttpAcsCredentials { } async create( - body: AcsCredentialsCreateBody, + body?: AcsCredentialsCreateBody, ): Promise { const { data } = await this.client.request({ url: '/acs/credentials/create', @@ -93,7 +93,7 @@ export class SeamHttpAcsCredentials { return data.acs_credential } - async delete(body: AcsCredentialsDeleteBody): Promise { + async delete(body?: AcsCredentialsDeleteBody): Promise { await this.client.request({ url: '/acs/credentials/delete', method: 'post', @@ -102,7 +102,7 @@ export class SeamHttpAcsCredentials { } async get( - body: AcsCredentialsGetParams, + body?: AcsCredentialsGetParams, ): Promise { const { data } = await this.client.request({ url: '/acs/credentials/get', @@ -113,7 +113,7 @@ export class SeamHttpAcsCredentials { } async list( - body: AcsCredentialsListParams, + body?: AcsCredentialsListParams, ): Promise { const { data } = await this.client.request({ url: '/acs/credentials/list', diff --git a/src/lib/seam/connect/routes/acs-systems.ts b/src/lib/seam/connect/routes/acs-systems.ts index a23b6653..4c4d3957 100644 --- a/src/lib/seam/connect/routes/acs-systems.ts +++ b/src/lib/seam/connect/routes/acs-systems.ts @@ -83,7 +83,7 @@ export class SeamHttpAcsSystems { } async get( - body: AcsSystemsGetParams, + body?: AcsSystemsGetParams, ): Promise { const { data } = await this.client.request({ url: '/acs/systems/get', @@ -94,7 +94,7 @@ export class SeamHttpAcsSystems { } async list( - body: AcsSystemsListParams, + body?: AcsSystemsListParams, ): Promise { const { data } = await this.client.request({ url: '/acs/systems/list', diff --git a/src/lib/seam/connect/routes/acs-users.ts b/src/lib/seam/connect/routes/acs-users.ts index b51ad852..9c457210 100644 --- a/src/lib/seam/connect/routes/acs-users.ts +++ b/src/lib/seam/connect/routes/acs-users.ts @@ -82,7 +82,7 @@ export class SeamHttpAcsUsers { return SeamHttpAcsUsers.fromClientSessionToken(token, options) } - async addToAccessGroup(body: AcsUsersAddToAccessGroupBody): Promise { + async addToAccessGroup(body?: AcsUsersAddToAccessGroupBody): Promise { await this.client.request({ url: '/acs/users/add_to_access_group', method: 'post', @@ -91,7 +91,7 @@ export class SeamHttpAcsUsers { } async create( - body: AcsUsersCreateBody, + body?: AcsUsersCreateBody, ): Promise { const { data } = await this.client.request({ url: '/acs/users/create', @@ -101,7 +101,7 @@ export class SeamHttpAcsUsers { return data.acs_user } - async delete(body: AcsUsersDeleteBody): Promise { + async delete(body?: AcsUsersDeleteBody): Promise { await this.client.request({ url: '/acs/users/delete', method: 'post', @@ -109,7 +109,9 @@ export class SeamHttpAcsUsers { }) } - async get(body: AcsUsersGetParams): Promise { + async get( + body?: AcsUsersGetParams, + ): Promise { const { data } = await this.client.request({ url: '/acs/users/get', method: 'post', @@ -119,7 +121,7 @@ export class SeamHttpAcsUsers { } async list( - body: AcsUsersListParams, + body?: AcsUsersListParams, ): Promise { const { data } = await this.client.request({ url: '/acs/users/list', @@ -130,7 +132,7 @@ export class SeamHttpAcsUsers { } async removeFromAccessGroup( - body: AcsUsersRemoveFromAccessGroupBody, + body?: AcsUsersRemoveFromAccessGroupBody, ): Promise { await this.client.request({ url: '/acs/users/remove_from_access_group', @@ -139,7 +141,7 @@ export class SeamHttpAcsUsers { }) } - async suspend(body: AcsUsersSuspendBody): Promise { + async suspend(body?: AcsUsersSuspendBody): Promise { await this.client.request({ url: '/acs/users/suspend', method: 'post', @@ -147,7 +149,7 @@ export class SeamHttpAcsUsers { }) } - async unsuspend(body: AcsUsersUnsuspendBody): Promise { + async unsuspend(body?: AcsUsersUnsuspendBody): Promise { await this.client.request({ url: '/acs/users/unsuspend', method: 'post', @@ -155,7 +157,7 @@ export class SeamHttpAcsUsers { }) } - async update(body: AcsUsersUpdateBody): Promise { + async update(body?: AcsUsersUpdateBody): Promise { await this.client.request({ url: '/acs/users/update', method: 'post', diff --git a/src/lib/seam/connect/routes/action-attempts.ts b/src/lib/seam/connect/routes/action-attempts.ts index 42e1cea4..809c9617 100644 --- a/src/lib/seam/connect/routes/action-attempts.ts +++ b/src/lib/seam/connect/routes/action-attempts.ts @@ -83,7 +83,7 @@ export class SeamHttpActionAttempts { } async get( - body: ActionAttemptsGetParams, + body?: ActionAttemptsGetParams, ): Promise { const { data } = await this.client.request({ url: '/action_attempts/get', @@ -94,7 +94,7 @@ export class SeamHttpActionAttempts { } async list( - body: ActionAttemptsListParams, + body?: ActionAttemptsListParams, ): Promise { const { data } = await this.client.request({ url: '/action_attempts/list', diff --git a/src/lib/seam/connect/routes/client-sessions.ts b/src/lib/seam/connect/routes/client-sessions.ts index b4a00bdc..8eb7afb2 100644 --- a/src/lib/seam/connect/routes/client-sessions.ts +++ b/src/lib/seam/connect/routes/client-sessions.ts @@ -81,7 +81,7 @@ export class SeamHttpClientSessions { } async create( - body: ClientSessionsCreateBody, + body?: ClientSessionsCreateBody, ): Promise { const { data } = await this.client.request({ url: '/client_sessions/create', @@ -91,7 +91,7 @@ export class SeamHttpClientSessions { return data.client_session } - async delete(body: ClientSessionsDeleteBody): Promise { + async delete(body?: ClientSessionsDeleteBody): Promise { await this.client.request({ url: '/client_sessions/delete', method: 'post', @@ -100,7 +100,7 @@ export class SeamHttpClientSessions { } async get( - body: ClientSessionsGetParams, + body?: ClientSessionsGetParams, ): Promise { const { data } = await this.client.request({ url: '/client_sessions/get', @@ -111,7 +111,7 @@ export class SeamHttpClientSessions { } async getOrCreate( - body: ClientSessionsGetOrCreateBody, + body?: ClientSessionsGetOrCreateBody, ): Promise { const { data } = await this.client.request({ @@ -123,7 +123,7 @@ export class SeamHttpClientSessions { } async grantAccess( - body: ClientSessionsGrantAccessBody, + body?: ClientSessionsGrantAccessBody, ): Promise { const { data } = await this.client.request({ @@ -135,7 +135,7 @@ export class SeamHttpClientSessions { } async list( - body: ClientSessionsListParams, + body?: ClientSessionsListParams, ): Promise { const { data } = await this.client.request({ url: '/client_sessions/list', diff --git a/src/lib/seam/connect/routes/connect-webviews.ts b/src/lib/seam/connect/routes/connect-webviews.ts index 50f21440..486ca77d 100644 --- a/src/lib/seam/connect/routes/connect-webviews.ts +++ b/src/lib/seam/connect/routes/connect-webviews.ts @@ -87,7 +87,7 @@ export class SeamHttpConnectWebviews { } async create( - body: ConnectWebviewsCreateBody, + body?: ConnectWebviewsCreateBody, ): Promise { const { data } = await this.client.request({ url: '/connect_webviews/create', @@ -97,7 +97,7 @@ export class SeamHttpConnectWebviews { return data.connect_webview } - async delete(body: ConnectWebviewsDeleteBody): Promise { + async delete(body?: ConnectWebviewsDeleteBody): Promise { await this.client.request({ url: '/connect_webviews/delete', method: 'post', @@ -106,7 +106,7 @@ export class SeamHttpConnectWebviews { } async get( - body: ConnectWebviewsGetParams, + body?: ConnectWebviewsGetParams, ): Promise { const { data } = await this.client.request({ url: '/connect_webviews/get', @@ -117,7 +117,7 @@ export class SeamHttpConnectWebviews { } async list( - body: ConnectWebviewsListParams, + body?: ConnectWebviewsListParams, ): Promise { const { data } = await this.client.request({ url: '/connect_webviews/list', diff --git a/src/lib/seam/connect/routes/connected-accounts.ts b/src/lib/seam/connect/routes/connected-accounts.ts index e301ddce..8a756d81 100644 --- a/src/lib/seam/connect/routes/connected-accounts.ts +++ b/src/lib/seam/connect/routes/connected-accounts.ts @@ -86,7 +86,7 @@ export class SeamHttpConnectedAccounts { return SeamHttpConnectedAccounts.fromClientSessionToken(token, options) } - async delete(body: ConnectedAccountsDeleteBody): Promise { + async delete(body?: ConnectedAccountsDeleteBody): Promise { await this.client.request({ url: '/connected_accounts/delete', method: 'post', @@ -95,7 +95,7 @@ export class SeamHttpConnectedAccounts { } async get( - body: ConnectedAccountsGetParams, + body?: ConnectedAccountsGetParams, ): Promise { const { data } = await this.client.request({ url: '/connected_accounts/get', diff --git a/src/lib/seam/connect/routes/devices-unmanaged.ts b/src/lib/seam/connect/routes/devices-unmanaged.ts index 92dbe8f6..91466f58 100644 --- a/src/lib/seam/connect/routes/devices-unmanaged.ts +++ b/src/lib/seam/connect/routes/devices-unmanaged.ts @@ -83,7 +83,7 @@ export class SeamHttpDevicesUnmanaged { } async get( - body: DevicesUnmanagedGetParams, + body?: DevicesUnmanagedGetParams, ): Promise { const { data } = await this.client.request({ url: '/devices/unmanaged/get', @@ -94,7 +94,7 @@ export class SeamHttpDevicesUnmanaged { } async list( - body: DevicesUnmanagedListParams, + body?: DevicesUnmanagedListParams, ): Promise { const { data } = await this.client.request({ url: '/devices/unmanaged/list', @@ -104,7 +104,7 @@ export class SeamHttpDevicesUnmanaged { return data.devices } - async update(body: DevicesUnmanagedUpdateBody): Promise { + async update(body?: DevicesUnmanagedUpdateBody): Promise { await this.client.request({ url: '/devices/unmanaged/update', method: 'post', diff --git a/src/lib/seam/connect/routes/devices.ts b/src/lib/seam/connect/routes/devices.ts index 09f384e5..de4e3ad2 100644 --- a/src/lib/seam/connect/routes/devices.ts +++ b/src/lib/seam/connect/routes/devices.ts @@ -87,7 +87,7 @@ export class SeamHttpDevices { return SeamHttpDevicesUnmanaged.fromClient(this.client) } - async delete(body: DevicesDeleteBody): Promise { + async delete(body?: DevicesDeleteBody): Promise { await this.client.request({ url: '/devices/delete', method: 'post', @@ -95,7 +95,7 @@ export class SeamHttpDevices { }) } - async get(body: DevicesGetParams): Promise { + async get(body?: DevicesGetParams): Promise { const { data } = await this.client.request({ url: '/devices/get', method: 'post', @@ -104,7 +104,9 @@ export class SeamHttpDevices { return data.device } - async list(body: DevicesListParams): Promise { + async list( + body?: DevicesListParams, + ): Promise { const { data } = await this.client.request({ url: '/devices/list', method: 'post', @@ -114,7 +116,7 @@ export class SeamHttpDevices { } async listDeviceProviders( - body: DevicesListDeviceProvidersParams, + body?: DevicesListDeviceProvidersParams, ): Promise { const { data } = await this.client.request({ @@ -125,7 +127,7 @@ export class SeamHttpDevices { return data.device_providers } - async update(body: DevicesUpdateBody): Promise { + async update(body?: DevicesUpdateBody): Promise { await this.client.request({ url: '/devices/update', method: 'post', diff --git a/src/lib/seam/connect/routes/events.ts b/src/lib/seam/connect/routes/events.ts index e30957db..489e6897 100644 --- a/src/lib/seam/connect/routes/events.ts +++ b/src/lib/seam/connect/routes/events.ts @@ -82,7 +82,7 @@ export class SeamHttpEvents { return SeamHttpEvents.fromClientSessionToken(token, options) } - async get(body: EventsGetParams): Promise { + async get(body?: EventsGetParams): Promise { const { data } = await this.client.request({ url: '/events/get', method: 'post', @@ -91,7 +91,7 @@ export class SeamHttpEvents { return data.event } - async list(body: EventsListParams): Promise { + async list(body?: EventsListParams): Promise { const { data } = await this.client.request({ url: '/events/list', method: 'post', diff --git a/src/lib/seam/connect/routes/locks.ts b/src/lib/seam/connect/routes/locks.ts index 0c3f061e..ca481534 100644 --- a/src/lib/seam/connect/routes/locks.ts +++ b/src/lib/seam/connect/routes/locks.ts @@ -82,7 +82,7 @@ export class SeamHttpLocks { return SeamHttpLocks.fromClientSessionToken(token, options) } - async get(body: LocksGetParams): Promise { + async get(body?: LocksGetParams): Promise { const { data } = await this.client.request({ url: '/locks/get', method: 'post', @@ -91,7 +91,7 @@ export class SeamHttpLocks { return data.device } - async list(body: LocksListParams): Promise { + async list(body?: LocksListParams): Promise { const { data } = await this.client.request({ url: '/locks/list', method: 'post', @@ -101,7 +101,7 @@ export class SeamHttpLocks { } async lockDoor( - body: LocksLockDoorBody, + body?: LocksLockDoorBody, ): Promise { const { data } = await this.client.request({ url: '/locks/lock_door', @@ -112,7 +112,7 @@ export class SeamHttpLocks { } async unlockDoor( - body: LocksUnlockDoorBody, + body?: LocksUnlockDoorBody, ): Promise { const { data } = await this.client.request({ url: '/locks/unlock_door', diff --git a/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts b/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts index 6efb61a2..24f3e5b9 100644 --- a/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +++ b/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts @@ -85,7 +85,7 @@ export class SeamHttpNoiseSensorsNoiseThresholds { ) } - async create(body: NoiseSensorsNoiseThresholdsCreateBody): Promise { + async create(body?: NoiseSensorsNoiseThresholdsCreateBody): Promise { await this.client.request({ url: '/noise_sensors/noise_thresholds/create', method: 'post', @@ -93,7 +93,7 @@ export class SeamHttpNoiseSensorsNoiseThresholds { }) } - async delete(body: NoiseSensorsNoiseThresholdsDeleteBody): Promise { + async delete(body?: NoiseSensorsNoiseThresholdsDeleteBody): Promise { await this.client.request({ url: '/noise_sensors/noise_thresholds/delete', method: 'post', @@ -102,7 +102,7 @@ export class SeamHttpNoiseSensorsNoiseThresholds { } async get( - body: NoiseSensorsNoiseThresholdsGetParams, + body?: NoiseSensorsNoiseThresholdsGetParams, ): Promise { const { data } = await this.client.request({ @@ -114,7 +114,7 @@ export class SeamHttpNoiseSensorsNoiseThresholds { } async list( - body: NoiseSensorsNoiseThresholdsListParams, + body?: NoiseSensorsNoiseThresholdsListParams, ): Promise { const { data } = await this.client.request({ @@ -125,7 +125,7 @@ export class SeamHttpNoiseSensorsNoiseThresholds { return data.noise_thresholds } - async update(body: NoiseSensorsNoiseThresholdsUpdateBody): Promise { + async update(body?: NoiseSensorsNoiseThresholdsUpdateBody): Promise { await this.client.request({ url: '/noise_sensors/noise_thresholds/update', method: 'post', diff --git a/src/lib/seam/connect/routes/thermostats-climate-setting-schedules.ts b/src/lib/seam/connect/routes/thermostats-climate-setting-schedules.ts index f600279c..46785067 100644 --- a/src/lib/seam/connect/routes/thermostats-climate-setting-schedules.ts +++ b/src/lib/seam/connect/routes/thermostats-climate-setting-schedules.ts @@ -86,7 +86,7 @@ export class SeamHttpThermostatsClimateSettingSchedules { } async create( - body: ThermostatsClimateSettingSchedulesCreateBody, + body?: ThermostatsClimateSettingSchedulesCreateBody, ): Promise< ThermostatsClimateSettingSchedulesCreateResponse['climate_setting_schedule'] > { @@ -102,7 +102,7 @@ export class SeamHttpThermostatsClimateSettingSchedules { } async delete( - body: ThermostatsClimateSettingSchedulesDeleteBody, + body?: ThermostatsClimateSettingSchedulesDeleteBody, ): Promise { await this.client.request( { @@ -114,7 +114,7 @@ export class SeamHttpThermostatsClimateSettingSchedules { } async get( - body: ThermostatsClimateSettingSchedulesGetParams, + body?: ThermostatsClimateSettingSchedulesGetParams, ): Promise< ThermostatsClimateSettingSchedulesGetResponse['climate_setting_schedule'] > { @@ -128,7 +128,7 @@ export class SeamHttpThermostatsClimateSettingSchedules { } async list( - body: ThermostatsClimateSettingSchedulesListParams, + body?: ThermostatsClimateSettingSchedulesListParams, ): Promise< ThermostatsClimateSettingSchedulesListResponse['climate_setting_schedules'] > { @@ -144,7 +144,7 @@ export class SeamHttpThermostatsClimateSettingSchedules { } async update( - body: ThermostatsClimateSettingSchedulesUpdateBody, + body?: ThermostatsClimateSettingSchedulesUpdateBody, ): Promise { await this.client.request( { diff --git a/src/lib/seam/connect/routes/thermostats.ts b/src/lib/seam/connect/routes/thermostats.ts index 7ef5b244..dd5c78fd 100644 --- a/src/lib/seam/connect/routes/thermostats.ts +++ b/src/lib/seam/connect/routes/thermostats.ts @@ -87,7 +87,7 @@ export class SeamHttpThermostats { return SeamHttpThermostatsClimateSettingSchedules.fromClient(this.client) } - async cool(body: ThermostatsCoolBody): Promise { + async cool(body?: ThermostatsCoolBody): Promise { await this.client.request({ url: '/thermostats/cool', method: 'post', @@ -96,7 +96,7 @@ export class SeamHttpThermostats { } async get( - body: ThermostatsGetParams, + body?: ThermostatsGetParams, ): Promise { const { data } = await this.client.request({ url: '/thermostats/get', @@ -106,7 +106,7 @@ export class SeamHttpThermostats { return data.thermostat } - async heat(body: ThermostatsHeatBody): Promise { + async heat(body?: ThermostatsHeatBody): Promise { await this.client.request({ url: '/thermostats/heat', method: 'post', @@ -114,7 +114,7 @@ export class SeamHttpThermostats { }) } - async heatCool(body: ThermostatsHeatCoolBody): Promise { + async heatCool(body?: ThermostatsHeatCoolBody): Promise { await this.client.request({ url: '/thermostats/heat_cool', method: 'post', @@ -123,7 +123,7 @@ export class SeamHttpThermostats { } async list( - body: ThermostatsListParams, + body?: ThermostatsListParams, ): Promise { const { data } = await this.client.request({ url: '/thermostats/list', @@ -133,7 +133,7 @@ export class SeamHttpThermostats { return data.thermostats } - async off(body: ThermostatsOffBody): Promise { + async off(body?: ThermostatsOffBody): Promise { await this.client.request({ url: '/thermostats/off', method: 'post', @@ -141,7 +141,7 @@ export class SeamHttpThermostats { }) } - async setFanMode(body: ThermostatsSetFanModeBody): Promise { + async setFanMode(body?: ThermostatsSetFanModeBody): Promise { await this.client.request({ url: '/thermostats/set_fan_mode', method: 'post', @@ -149,7 +149,7 @@ export class SeamHttpThermostats { }) } - async update(body: ThermostatsUpdateBody): Promise { + async update(body?: ThermostatsUpdateBody): Promise { await this.client.request({ url: '/thermostats/update', method: 'post', diff --git a/src/lib/seam/connect/routes/webhooks.ts b/src/lib/seam/connect/routes/webhooks.ts index 7780ef68..5cddbf53 100644 --- a/src/lib/seam/connect/routes/webhooks.ts +++ b/src/lib/seam/connect/routes/webhooks.ts @@ -87,7 +87,7 @@ export class SeamHttpWebhooks { } async create( - body: WebhooksCreateBody, + body?: WebhooksCreateBody, ): Promise { const { data } = await this.client.request({ url: '/webhooks/create', @@ -97,7 +97,7 @@ export class SeamHttpWebhooks { return data.webhook } - async delete(body: WebhooksDeleteBody): Promise { + async delete(body?: WebhooksDeleteBody): Promise { await this.client.request({ url: '/webhooks/delete', method: 'post', @@ -105,7 +105,7 @@ export class SeamHttpWebhooks { }) } - async get(body: WebhooksGetParams): Promise { + async get(body?: WebhooksGetParams): Promise { const { data } = await this.client.request({ url: '/webhooks/get', method: 'post', diff --git a/src/lib/seam/connect/routes/workspaces.ts b/src/lib/seam/connect/routes/workspaces.ts index f69cd4da..e886745c 100644 --- a/src/lib/seam/connect/routes/workspaces.ts +++ b/src/lib/seam/connect/routes/workspaces.ts @@ -108,7 +108,7 @@ export class SeamHttpWorkspaces { return data.workspaces } - async resetSandbox(body: WorkspacesResetSandboxBody): Promise { + async resetSandbox(body?: WorkspacesResetSandboxBody): Promise { await this.client.request({ url: '/workspaces/reset_sandbox', method: 'post',